-
Notifications
You must be signed in to change notification settings - Fork 108
feat: Update promotions for Elementor One #329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: core-beta
Are you sure you want to change the base?
Conversation
|
Amazing work @rami-elementor ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file seems a little redundant – we can just initialise Promotions\Elementor from Plugin.
| <?php | ||
| namespace Code_Snippets; | ||
|
|
||
| if ( ! defined( 'ABSPATH' ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to include these checks in class files.
| <?php | ||
| namespace Code_Snippets\Promotions; | ||
|
|
||
| if ( ! defined( 'ABSPATH' ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
| * @return void | ||
| */ | ||
| public function promotion_in_custom_code_screen() { | ||
| if ( ! $this->is_custom_code_screen() ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also check if the 'hide upsell' setting is turned on before printing promos.
| <div class="notice notice-info is-dismissible code-snippets-promotion"> | ||
| <div class="code-snippets-promotion-icon"> | ||
| <img | ||
| src="<?php echo esc_url( plugins_url( 'assets/icon.svg', CODE_SNIPPETS_FILE ) ); ?>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use PLUGIN_FILE.
| <?php esc_html_e( 'Code Snippets Pro provides a powerful and user-friendly alternative to Elementor Custom Code, with cloud sync, advanced features, and an intuitive interface.', 'code-snippets' ); ?> | ||
| </p> | ||
| <p> | ||
| <a href="<?php echo esc_url( admin_url( 'admin.php?page=snippets' ) ); ?>" class="button button-primary"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use Plugin::get_menu_url
|
|
||
| if ( $this->is_code_snippets_pro() ) { | ||
| $link_text = esc_html__( 'Manage CSS snippets', 'code-snippets' ); | ||
| $url = admin_url( 'admin.php?page=snippets&type=css' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above – please use API function for building URLs.
| * @return bool | ||
| */ | ||
| private function is_code_snippets_pro(): bool { | ||
| return defined( 'CODE_SNIPPETS_PRO' ) && CODE_SNIPPETS_PRO; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unreliable – please use Licensing::is_licensed to check the plugin variant.
Elementor released a new design in WordPress admin, with updated slugs. Promotions for CS should be displayed in the new Custom Code screens.
Promotion in empty archive:

Promotion in archive with custom code:

Promotion in new custom code:
