diff --git a/src/php/Integration/Promotions/Notices/Header_Footer_Code_Manager.php b/src/php/Integration/Promotions/Notices/Header_Footer_Code_Manager.php index b0faea9a..301c5006 100644 --- a/src/php/Integration/Promotions/Notices/Header_Footer_Code_Manager.php +++ b/src/php/Integration/Promotions/Notices/Header_Footer_Code_Manager.php @@ -2,8 +2,6 @@ namespace Code_Snippets\Integration\Promotions\Notices; -use Code_Snippets\REST_API\Import\Plugins\Header_Footer_Code_Manager_Plugin_Importer; - /** * Promotion class for Header Footer Code Manager. * @@ -49,17 +47,15 @@ public function get_plugin_admin_screens(): array { * @return string The promotion message. */ public function get_promotion_message(): string { - return __( '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' ); + return __( 'Move your functionality to Code Snippets and reduce your dependency on third-party plugins.', 'code-snippets' ); } /** - * Check if the Header Footer Code Manager plugin has any snippets. + * Check if the user should see the migration button. * - * @return bool True if there are snippets, false otherwise. + * @return bool Whether the user should see the migration button. */ - protected function has_snippets(): bool { - $importer = new Header_Footer_Code_Manager_Plugin_Importer(); - $data = $importer->get_data(); - return ! empty( $data ); + public function show_migration_button(): bool { + return true; } } diff --git a/src/php/Integration/Promotions/Notices/Insert_HTML_Snippet.php b/src/php/Integration/Promotions/Notices/Insert_HTML_Snippet.php index 29572e23..01c33549 100644 --- a/src/php/Integration/Promotions/Notices/Insert_HTML_Snippet.php +++ b/src/php/Integration/Promotions/Notices/Insert_HTML_Snippet.php @@ -47,6 +47,6 @@ public function get_plugin_admin_screens(): array { * @return string The promotion message. */ public function get_promotion_message(): string { - return __( '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' ); + return __( 'Move your functionality to Code Snippets and reduce your dependency on third-party plugins.', 'code-snippets' ); } } diff --git a/src/php/Integration/Promotions/Notices/Insert_PHP.php b/src/php/Integration/Promotions/Notices/Insert_PHP.php index 2ce12342..0ed7eff1 100644 --- a/src/php/Integration/Promotions/Notices/Insert_PHP.php +++ b/src/php/Integration/Promotions/Notices/Insert_PHP.php @@ -50,6 +50,6 @@ public function get_plugin_admin_screens(): array { * @return string The promotion message. */ public function get_promotion_message(): string { - return __( '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' ); + return __( 'Move your functionality to Code Snippets and reduce your dependency on third-party plugins.', 'code-snippets' ); } } diff --git a/src/php/Integration/Promotions/Notices/Insert_PHP_Code_Snippet.php b/src/php/Integration/Promotions/Notices/Insert_PHP_Code_Snippet.php index 29a79134..196342a4 100644 --- a/src/php/Integration/Promotions/Notices/Insert_PHP_Code_Snippet.php +++ b/src/php/Integration/Promotions/Notices/Insert_PHP_Code_Snippet.php @@ -2,8 +2,6 @@ namespace Code_Snippets\Integration\Promotions\Notices; -use Code_Snippets\REST_API\Import\Plugins\Insert_PHP_Code_Snippet_Plugin_Importer; - /** * Promotion class for Insert PHP Code Snippet plugin. * @@ -53,13 +51,11 @@ public function get_promotion_heading(): string { } /** - * Check if the user has any snippets in the Insert PHP Code Snippet plugin. + * Check if the user should see the migration button. * - * @return bool True if the user has snippets, false otherwise. + * @return bool Whether the user should see the migration button. */ - protected function has_snippets(): bool { - $importer = new Insert_PHP_Code_Snippet_Plugin_Importer(); - $data = $importer->get_data(); - return ! empty( $data ); + public function show_migration_button(): bool { + return true; } } diff --git a/src/php/Integration/Promotions/Notices/Promotion_Base.php b/src/php/Integration/Promotions/Notices/Promotion_Base.php index de70812e..1cb63f04 100644 --- a/src/php/Integration/Promotions/Notices/Promotion_Base.php +++ b/src/php/Integration/Promotions/Notices/Promotion_Base.php @@ -212,21 +212,21 @@ public function dismiss_promotion_ajax_handler() { } /** - * Check if the user has any snippets in the promoted plugin. + * Check if the user should see the migration button. * - * @return bool True if the user has snippets, false otherwise. + * @return bool Whether the user should see the migration button. */ - protected function has_snippets(): bool { + public function show_migration_button(): bool { return false; } /** * Render buttons for the promotion notice. * - * @uses has_snippets() to determine which buttons to show. + * @uses show_migration_button() to determine which buttons to show. */ protected function print_promotion_buttons() { - if ( $this->has_snippets() ) { + if ( $this->show_migration_button() ) { printf( '%s', esc_url( add_query_arg( 'tab', 'plugins', code_snippets()->get_menu_url( 'import' ) ) ),