@@ -24,10 +24,9 @@ class Admin {
2424 const IMPORTED_TEMPLATES_COUNT_OPT = 'tiob_premade_imported ' ;
2525 const FEEDBACK_DISMISSED_OPT = 'tiob_feedback_dismiss ' ;
2626
27- const TC_REMOVED_KEY = 'tiob_tc_removed ' ;
28- const TC_NEW_NOTICE_DISMISSED = 'tiob_new_tc_notice_dismissed ' ;
29- const ONBOARDING_PROMO_NOTICE_DISMISSED = 'tiob_onboarding_promo_notice_dismissed ' ;
30- const VISITED_LIBRARY_OPT = 'tiob_library_visited ' ;
27+ const TC_REMOVED_KEY = 'tiob_tc_removed ' ;
28+ const TC_NEW_NOTICE_DISMISSED = 'tiob_new_tc_notice_dismissed ' ;
29+ const VISITED_LIBRARY_OPT = 'tiob_library_visited ' ;
3130
3231 /**
3332 * Admin page slug
@@ -89,7 +88,6 @@ public function init() {
8988 add_action ( 'wp_ajax_tpc_get_logs ' , array ( $ this , 'external_get_logs ' ) );
9089
9190 add_action ( 'wp_ajax_dismiss_new_tc_notice ' , array ( $ this , 'dismiss_new_tc_notice ' ) );
92- add_action ( 'wp_ajax_dismiss_onboarding_promo_notice ' , array ( $ this , 'dismiss_onboarding_promo_notice ' ) );
9391
9492 $ this ->register_feedback_settings ();
9593
@@ -163,52 +161,6 @@ public function dismiss_new_tc_notice() {
163161 $ this ->ensure_ajax_response ( $ response );
164162 }
165163
166- /**
167- * Dismiss onboarding promo notice.
168- *
169- * @return void
170- */
171- public function dismiss_onboarding_promo_notice () {
172- $ response = array (
173- 'success ' => false ,
174- 'code ' => 'ti__ob_not_allowed ' ,
175- 'message ' => 'Not allowed! ' ,
176- );
177-
178- if ( ! isset ( $ _REQUEST ['nonce ' ] ) ) {
179- $ this ->ensure_ajax_response ( $ response );
180- return ;
181- }
182-
183- $ nonce = sanitize_text_field ( wp_unslash ( $ _REQUEST ['nonce ' ] ) );
184-
185- if ( ! wp_verify_nonce ( $ nonce , 'dismiss_onboarding_promo_notice ' ) ) {
186- $ this ->ensure_ajax_response ( $ response );
187- return ;
188- }
189-
190- if ( ! current_user_can ( 'install_plugins ' ) ) {
191- $ this ->ensure_ajax_response ( $ response );
192- return ;
193- }
194-
195- $ response ['success ' ] = true ;
196- unset( $ response ['code ' ] );
197- unset( $ response ['message ' ] );
198-
199- update_option ( self ::ONBOARDING_PROMO_NOTICE_DISMISSED , 'yes ' );
200- $ this ->ensure_ajax_response ( $ response );
201- }
202-
203- /**
204- * Decide if the onboarding promo notice should be shown.
205- *
206- * @return bool
207- */
208- private function should_show_onboarding_promo_notice () {
209- return get_option ( self ::ONBOARDING_PROMO_NOTICE_DISMISSED , 'no ' ) !== 'yes ' ;
210- }
211-
212164 /**
213165 * Decide if the business/agency variant of the onboarding promo text should be shown.
214166 *
@@ -937,11 +889,6 @@ private function get_localization() {
937889 'ajaxURL ' => esc_url ( admin_url ( 'admin-ajax.php ' ) ),
938890 'nonce ' => wp_create_nonce ( 'dismiss_new_tc_notice ' ),
939891 ),
940- 'onboardingPromoNotice ' => array (
941- 'show ' => $ this ->should_show_onboarding_promo_notice (),
942- 'ajaxURL ' => esc_url ( admin_url ( 'admin-ajax.php ' ) ),
943- 'nonce ' => wp_create_nonce ( 'dismiss_onboarding_promo_notice ' ),
944- ),
945892 'onboardingPluginCompatibility ' => array (
946893 'hyve-lite ' => is_php_version_compatible ( '8.1 ' ),
947894 ),
0 commit comments