-
Notifications
You must be signed in to change notification settings - Fork 108
[CWA-744] feat: Update promotions for Elementor One & add promotions to additional plugins #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
Open
rami-elementor
wants to merge
15
commits into
core-beta
Choose a base branch
from
promotions
base: core-beta
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+588
−133
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7b1b750
Update promotions for Elementor One
rami-elementor bd06a91
Update
rami-elementor 3c20066
Add promotions to additional plugins
rami-elementor 57f0f86
Add missing dismiss capability
rami-elementor 3674e8c
Move promotion buttons to a separate method
rami-elementor c1701e9
move to folders
rami-elementor 2bde5dd
Conditional manage/migrate cta buttons
rami-elementor 3b1e157
Update
rami-elementor 8305f28
Add promotions to additional plugins
rami-elementor bce4130
Add promotions to additional plugins
rami-elementor 41fff23
Add promotions to additional plugins
rami-elementor b18ce5e
Update
rami-elementor 19de886
Update
rami-elementor 2fa50c4
Update
rami-elementor dd11c05
Accessibility best practice
rami-elementor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| <?php | ||
| namespace Code_Snippets\Promotions; | ||
|
|
||
| class Elementor extends Promotion_Base { | ||
|
|
||
| public function get_plugin_name(): string { | ||
| return esc_html__( 'Elementor Custom Code', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_plugin_slug(): string { | ||
| return 'elementor'; | ||
| } | ||
|
|
||
| public function get_plugin_admin_screens(): array { | ||
| return [ | ||
| // Elementor Core | ||
| 'elementor_custom_code', | ||
| 'elementor_page_elementor_custom_code', | ||
| // Elementor Pro | ||
| 'edit-elementor_snippet', | ||
| 'elementor_snippet', | ||
| // New Elementor One | ||
| 'elementor_page_e-custom-code', | ||
| ]; | ||
| } | ||
|
|
||
| public function get_promotion_heading(): string { | ||
| return esc_html__( 'Upgrade to the Industry Standard for Code Management', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_promotion_message(): string { | ||
| return esc_html__( 'Move your custom logic into a dedicated dashboard built for professionals. Experience a cleaner workflow with advanced security and global organization.', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_promotion_buttons(): array { | ||
| return $this->get_default_buttons(); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <?php | ||
| namespace Code_Snippets\Promotions; | ||
|
|
||
| class Header_Footer_Code extends Promotion_Base { | ||
|
|
||
| public function get_plugin_name(): string { | ||
| return esc_html__( 'Head & Footer Code', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_plugin_slug(): string { | ||
| return 'head-footer-code'; | ||
| } | ||
|
|
||
| public function get_plugin_admin_screens(): array { | ||
| return [ | ||
| 'tools_page_head-footer-code' | ||
| ]; | ||
| } | ||
|
|
||
| public function get_promotion_heading(): string { | ||
| return esc_html__( 'Stop worrying about breaking your site', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_promotion_message(): string { | ||
| return esc_html__( 'Why risk manual edits? Migrate to Code Snippets Pro to get enterprise-grade Safe Mode that automatically catches errors before they go live.', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_promotion_buttons(): array { | ||
rami-elementor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return $this->get_default_buttons(); | ||
| } | ||
| } | ||
42 changes: 42 additions & 0 deletions
42
src/php/promotions/admin-notices/header-footer-code-manager.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| <?php | ||
| namespace Code_Snippets\Promotions; | ||
|
|
||
| use Code_Snippets\Header_Footer_Code_Manager_Importer; | ||
|
|
||
| class Header_Footer_Code_Manager extends Promotion_Base { | ||
|
|
||
| public function get_plugin_name(): string { | ||
| return esc_html__( 'Header Footer Code Manager', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_plugin_slug(): string { | ||
| return 'header-footer-code-manager'; | ||
| } | ||
|
|
||
| public function get_plugin_admin_screens(): array { | ||
| return [ | ||
| 'toplevel_page_hfcm-list', | ||
| 'hfcm_page_hfcm-tools', | ||
| 'hfcm_page_hfcm-create', | ||
| 'admin_page_hfcm-update', | ||
| ]; | ||
| } | ||
|
|
||
| public function get_promotion_heading(): string { | ||
| return esc_html__( 'Clean up your plugin list today', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_promotion_message(): string { | ||
| return esc_html__( 'Move your functionality to Code Snippets Pro and reduce your dependency on third-party plugins. A leaner dashboard is a more secure dashboard.', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_promotion_buttons(): array { | ||
| return $this->get_default_buttons( $this->has_snippets() ); | ||
| } | ||
|
|
||
| protected function has_snippets(): bool { | ||
| $importer = new Header_Footer_Code_Manager_Importer(); | ||
| $data = $importer->get_data(); | ||
| return ! empty( $data ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| <?php | ||
| namespace Code_Snippets\Promotions; | ||
|
|
||
| class Insert_HTML_Snippet extends Promotion_Base { | ||
|
|
||
| public function get_plugin_name(): string { | ||
| return esc_html__( 'Insert HTML Snippet', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_plugin_slug(): string { | ||
| return 'insert-html-snippet'; | ||
| } | ||
|
|
||
| public function get_plugin_admin_screens(): array { | ||
| return [ | ||
| 'toplevel_page_insert-html-snippet-manage', | ||
| 'insert-html-snippet_page_insert-html-snippet-settings', | ||
| 'insert-html-snippet_page_insert-html-snippet-about', | ||
| 'insert-html-snippet_page_insert-html-snippet-suggest-features', | ||
| ]; | ||
| } | ||
|
|
||
| public function get_promotion_heading(): string { | ||
| return esc_html__( 'Clean up your plugin list today', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_promotion_message(): string { | ||
| return esc_html__( 'Move your functionality to Code Snippets Pro and reduce your dependency on third-party plugins. A leaner dashboard is a more secure dashboard.', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_promotion_buttons(): array { | ||
| return $this->get_default_buttons(); | ||
| } | ||
| } |
45 changes: 45 additions & 0 deletions
45
src/php/promotions/admin-notices/insert-php-code-snippet.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| <?php | ||
| namespace Code_Snippets\Promotions; | ||
|
|
||
| use Code_Snippets\Insert_PHP_Code_Snippet_Importer; | ||
|
|
||
| class Insert_PHP_Code_Snippet extends Promotion_Base { | ||
|
|
||
| public function get_plugin_name(): string { | ||
| return esc_html__( 'Insert PHP Code Snippet', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_plugin_slug(): string { | ||
| return 'insert-php-code-snippet'; | ||
| } | ||
|
|
||
| public function get_plugin_admin_screens(): array { | ||
| return [ | ||
| 'toplevel_page_insert-php-code-snippet-manage', | ||
| 'insert-php-code-snippet_page_insert-php-code-snippet-settings', | ||
| 'insert-php-code-snippet_page_insert-php-code-snippet-about', | ||
| 'insert-php-code-snippet_page_insert-php-code-snippet-suggest-features', | ||
| ]; | ||
| } | ||
|
|
||
| public function get_promotion_heading(): string { | ||
| return esc_html__( 'Looking for a better way to manage your custom code?', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_promotion_message(): string { | ||
| return sprintf( | ||
| esc_html__( 'Code Snippets provides a powerful and user-friendly alternative to "%s", with cloud sync, advanced features, and an intuitive interface.', 'code-snippets' ), | ||
| $this->get_plugin_name() | ||
| ); | ||
| } | ||
|
|
||
| public function get_promotion_buttons(): array { | ||
| return $this->get_default_buttons( $this->has_snippets() ); | ||
| } | ||
|
|
||
| protected function has_snippets(): bool { | ||
| $importer = new Insert_PHP_Code_Snippet_Importer(); | ||
| $data = $importer->get_data(); | ||
| return ! empty( $data ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| <?php | ||
| namespace Code_Snippets\Promotions; | ||
|
|
||
| class Insert_PHP extends Promotion_Base { | ||
|
|
||
| public function get_plugin_name(): string { | ||
| return esc_html__( 'Woody Code Snippets', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_plugin_slug(): string { | ||
| return 'insert-php'; | ||
| } | ||
|
|
||
| public function get_plugin_admin_screens(): array { | ||
| return [ | ||
| 'wbcr-snippets', | ||
| 'edit-wbcr-snippets', | ||
| 'edit-wbcr-snippet-tags', | ||
| 'wbcr-snippets_page_winp-new-item', | ||
| 'wbcr-snippets_page_winp-settings', | ||
| 'wbcr-snippets_page_snippet-library', | ||
| 'wbcr-snippets_page_ti-about-insert_php', | ||
| ]; | ||
| } | ||
|
|
||
| public function get_promotion_heading(): string { | ||
| return esc_html__( 'Clean up your plugin list today', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_promotion_message(): string { | ||
| return esc_html__( 'Move your functionality to Code Snippets Pro and reduce your dependency on third-party plugins. A leaner dashboard is a more secure dashboard.', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_promotion_buttons(): array { | ||
| return $this->get_default_buttons(); | ||
| } | ||
rami-elementor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
34 changes: 34 additions & 0 deletions
34
src/php/promotions/admin-notices/wp-headers-and-footers.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| <?php | ||
| namespace Code_Snippets\Promotions; | ||
|
|
||
| class WP_Headers_And_Footers extends Promotion_Base { | ||
|
|
||
| public function get_plugin_name(): string { | ||
| return esc_html__( 'Insert Headers and Footers', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_plugin_slug(): string { | ||
| return 'wp-headers-and-footers'; | ||
| } | ||
|
|
||
| public function get_plugin_admin_screens(): array { | ||
| return [ | ||
| 'settings_page_wp-headers-and-footers' | ||
| ]; | ||
| } | ||
|
|
||
| public function get_promotion_heading(): string { | ||
| return esc_html__( 'Looking for a better way to manage your custom code?', 'code-snippets' ); | ||
| } | ||
|
|
||
| public function get_promotion_message(): string { | ||
| return sprintf( | ||
| esc_html__( 'Code Snippets provides a powerful and user-friendly alternative to "%s", with cloud sync, advanced features, and an intuitive interface.', 'code-snippets' ), | ||
| $this->get_plugin_name() | ||
| ); | ||
| } | ||
|
|
||
| public function get_promotion_buttons(): array { | ||
| return $this->get_default_buttons(); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.