| @@ -6,13 +6,12 @@ | ||
| 6 | 6 | exit; |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | class NoticePointers { |
| 10 | - const PROMOTION_URL = 'https://betterdocs.co/bfcm-wp-admin-pointer '; | |
| 10 | + const PROMOTION_URL = 'https://betterdocs.co/bfcm-wp-admin-pointer'; | |
| 11 | 11 | const BETTERDOCS_POINTER_ID = 'toplevel_page_betterdocs-dashboard'; |
| 12 | 12 | const DISMISS_ACTION_KEY = 'betterdocs_black_friday_pointer_2025'; |
| 13 | 13 | const USER_META_KEY = 'betterdocs_introduction_meta'; |
| 14 | - const PRIORITY = 4; // Priority for this pointer (lower number = higher priority) | |
| 15 | 14 | |
| 16 | 15 | public function __construct() { |
| 17 | 16 | add_action( 'admin_print_footer_scripts', [ $this, 'enqueue_notice' ] ); |
| 18 | 17 | } |
| @@ -17,9 +16,9 @@ | ||
| 17 | 16 | add_action( 'admin_print_footer_scripts', [ $this, 'enqueue_notice' ] ); |
| 18 | 17 | } |
| 19 | 18 | |
| 20 | 19 | public function enqueue_notice() { |
| 21 | - // Only show on specific pages: dashboard and BetterDocs screens | |
| 20 | + // Only show on BetterDocs screens | |
| 22 | 21 | $screen = get_current_screen(); |
| 23 | 22 | |
| 24 | 23 | if ( ! $screen ) { |
| 25 | 24 | return; |
| @@ -29,25 +28,8 @@ | ||
| 29 | 28 | if ( ! $this->is_allowed_page( $screen ) ) { |
| 30 | 29 | return; |
| 31 | 30 | } |
| 32 | 31 | |
| 33 | - // For common pages (dashboard, plugins), check priority FIRST | |
| 34 | - $is_common_page = in_array( $screen->id, [ 'dashboard', 'plugins' ], true ); | |
| 35 | - if ( $is_common_page ) { | |
| 36 | - $current_priority = get_option( '_wpdeveloper_plugin_pointer_priority', 999 ); | |
| 37 | - | |
| 38 | - // If priority is greater than 4, update it to 4 | |
| 39 | - if ( $current_priority > 4 ) { | |
| 40 | - update_option( '_wpdeveloper_plugin_pointer_priority', 4 ); | |
| 41 | - $current_priority = 4; | |
| 42 | - } | |
| 43 | - | |
| 44 | - // If priority is not 4, don't display on common pages | |
| 45 | - if ( $current_priority != 4 ) { | |
| 46 | - return; | |
| 47 | - } | |
| 48 | - } | |
| 49 | - | |
| 50 | 32 | // Check basic conditions |
| 51 | 33 | if ( ! self::is_user_allowed() || self::is_dismissed() || ! self::is_campaign_time() || self::has_pro() ) { |
| 52 | 34 | return; |
| 53 | 35 | } |
| @@ -111,14 +93,10 @@ | ||
| 111 | 93 | * @param WP_Screen $screen Current screen object |
| 112 | 94 | * @return bool |
| 113 | 95 | */ |
| 114 | 96 | private function is_allowed_page( $screen ): bool { |
| 115 | - // Dashboard | |
| 116 | - if ( $screen->id === 'dashboard' || $screen->id === 'plugins' ) { | |
| 117 | - return true; | |
| 118 | - } | |
| 119 | - | |
| 120 | - // BetterDocs admin pages | |
| 97 | + // BetterDocs admin pages only — never the WP Dashboard or Plugins screen | |
| 98 | + // (WP.org guideline 11). | |
| 121 | 99 | $betterdocs_screens = [ |
| 122 | 100 | 'toplevel_page_betterdocs-dashboard', |
| 123 | 101 | 'betterdocs_page_betterdocs-admin', |
| 124 | 102 | 'betterdocs_page_betterdocs-settings', |