PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.5
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.5
4.9.5 4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 All 203 releases
← All changes | includes/Admin/NoticePointers.php +5 -27 4.5.2 → 4.9.5 View file →
@@ -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 }
@@ -87,9 +69,9 @@
87 69 url: ajaxurl,
88 70 type: 'POST',
89 71 data: {
90 72 action: 'betterdocs_dismiss_black_friday_pointer',
91 - nonce: '<?php echo wp_create_nonce( 'betterdocs_dismiss_pointer' ); ?>',
73 + nonce: '<?php echo esc_js( wp_create_nonce( 'betterdocs_dismiss_pointer' ) ); ?>',
92 74 introduction_key: '<?php echo esc_attr( self::DISMISS_ACTION_KEY ); ?>'
93 75 }
94 76 });
95 77 }
@@ -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',