Plugin Directory

Changeset 3403286


Ignore:
Timestamp:
11/26/2025 11:10:42 AM (3 months ago)
Author:
digitallychee
Message:

Release 1.0.4 - add settings screen previewing Pro features and clarify upgrade path.

Location:
dashboard-detox-hide-marketing-review-popups
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • dashboard-detox-hide-marketing-review-popups/tags/1.0.4/changelog.txt

    r3403167 r3403286  
    11== Changelog for Dashboard Detox – Hide Marketing & Review Popups ==
     2
     3= 1.0.4 - 2025-11-26 =
     4* Added a simple settings screen in the free version to explain available Pro features.
     5* Clarified the upgrade path to Dashboard Detox Pro directly from the plugin settings.
     6* No changes to core notice-hiding behaviour.
    27
    38= 1.0.3 - 2025-11-22 =
  • dashboard-detox-hide-marketing-review-popups/tags/1.0.4/dashboard-detox-hide-marketing-review-popups.php

    r3403167 r3403286  
    33 * Plugin Name: Dashboard Detox – Hide Marketing & Review Popups
    44 * Description: Light, no-nonsense plugin that hides most marketing and review nags in the WordPress admin area.
    5  * Version: 1.0.3
     5 * Version: 1.0.4
    66 * Requires at least: 6.0
    77 * Requries PHP: 7.4
     
    3535class DL_Dashboard_Detox {
    3636
     37    const PRO_URL = 'https://checkout.freemius.com/plugin/21788/plan/36360/';
     38
     39
    3740    public function __construct() {
    3841        if ( is_admin() ) {
     
    4245        // Enqueue both our CSS and JS properly
    4346        add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );
     47
     48
     49        // Free version: show Pro settings UI, but disabled
     50        add_action( 'admin_menu', array( $this, 'add_settings_page' ) );
    4451        }
    4552    }
     
    6572        false,
    6673        array(),
    67         '1.0.2'
     74        '1.0.4'
    6875    );
    6976
     
    107114        false,
    108115        array(),
    109         '1.0.2',
     116        '1.0.4',
    110117        true
    111118    );
     
    113120    wp_enqueue_script( 'dl-dashboard-detox-inline' );
    114121
    115     $js = '(function() {
    116 
    117         function runDashboardDetox() {
    118 
    119             // Built-in patterns that often indicate marketing or review nags
    120             var basePatterns = [
    121                 /rate\\s+(this\\s+)?plugin/i,
    122                 /leave\\s+(us\\s+)?a\\s+review/i,
    123                 /review\\s+our\\s+plugin/i,
    124                 /★★★★★/i,
    125                 /5\\s*stars?/i,
    126                 /upgrade\\s+to\\s+pro/i,
    127                 /go\\s+pro/i,
    128                 /limited\\s+time\\s+offer/i,
    129                 /discount/i,
    130                 /sale/i,
    131                 /black\\s+friday/i,
    132                 /cyber\\s+monday/i,
    133                 /special\\s+offer/i,
    134                 /coupon/i,
    135                 /subscribe\\s+to\\s+our\\s+newsletter/i
    136             ];
    137 
    138             var selectors = [
    139                 ".notice",
    140                 ".notice-info",
    141                 ".notice-warning",
    142                 ".notice-success",
    143                 ".notice-error",
    144                 ".is-dismissible",
    145                 ".updated",
    146                 ".update-nag",
    147                 "div[class*=\'notice\']",
    148                 "div[class*=\'promo\']",
    149                 "div[class*=\'banner\']",
    150                 "div[class*=\'review\']",
    151                 "div[class*=\'rating\']",
    152                 "div[class*=\'popup\']",
    153                 "div[class*=\'overlay\']"
    154             ];
    155 
    156             function applyDetox(root) {
    157                 var nodes = (root || document).querySelectorAll(selectors.join(","));
    158                 if (!nodes.length) {
    159                     return;
     122
     123        $js = '(function() {
     124
     125            function runDashboardDetox() {
     126
     127                // Built-in patterns that often indicate marketing or review nags
     128                var basePatterns = [
     129                    /rate\\s+(this\\s+)?plugin/i,
     130                    /leave\\s+(us\\s+)?a\\s+review/i,
     131                    /review\\s+our\\s+plugin/i,
     132                    /★★★★★/i,
     133                    /5\\s*stars?/i,
     134                    /upgrade\\s+to\\s+pro/i,
     135                    /go\\s+pro/i,
     136                    /limited\\s+time\\s+offer/i,
     137                    /discount/i,
     138                    /sale/i,
     139                    /black\\s+friday/i,
     140                    /cyber\\s+monday/i,
     141                    /special\\s+offer/i,
     142                    /coupon/i,
     143                    /subscribe\\s+to\\s+our\\s+newsletter/i
     144                ];
     145
     146                var selectors = [
     147                    ".notice",
     148                    ".notice-info",
     149                    ".notice-warning",
     150                    ".notice-success",
     151                    ".notice-error",
     152                    ".is-dismissible",
     153                    ".updated",
     154                    ".update-nag",
     155                    "div[class*=\'notice\']",
     156                    "div[class*=\'promo\']",
     157                    "div[class*=\'banner\']",
     158                    "div[class*=\'review\']",
     159                    "div[class*=\'rating\']",
     160                    "div[class*=\'popup\']",
     161                    "div[class*=\'overlay\']"
     162                ];
     163
     164                function applyDetox(root) {
     165                    var nodes = (root || document).querySelectorAll(selectors.join(","));
     166                    if (!nodes.length) {
     167                        return;
     168                    }
     169
     170                    nodes.forEach(function(el) {
     171                        var text = (el.innerText || "").trim();
     172                        if (!text) return;
     173
     174                        var lowerText = text.toLowerCase();
     175
     176                        // Avoid hiding update/security notices unless clearly promotional
     177                        if (el.closest("#update-nag") || el.id === "update-nag" || el.classList.contains("update-nag")) {
     178                            // Still allow pattern matching, just don\'t hide *only* by type.
     179                        }
     180
     181                        var isMarketing = basePatterns.some(function(re) {
     182                            return re.test(text);
     183                        });
     184
     185                        if (isMarketing) {
     186                            el.classList.add("dl-dashboard-detox-hidden");
     187                            el.style.outline = "";
     188                            el.style.opacity = "";
     189                            el.style.backgroundColor = "";
     190                            el.style.display = "none";
     191
     192                            if (el.parentNode) {
     193                                el.parentNode.removeChild(el);
     194                            }
     195                        } else {
     196                            el.classList.remove("dl-dashboard-detox-hidden");
     197                            el.style.outline = "";
     198                            el.style.opacity = "1";
     199                            el.style.backgroundColor = "";
     200                            el.style.display = "";
     201                        }
     202                    });
    160203                }
    161204
    162                 nodes.forEach(function(el) {
    163                     var text = (el.innerText || "").trim();
    164                     if (!text) return;
    165 
    166                     var lowerText = text.toLowerCase();
    167 
    168                     // Avoid hiding update/security notices unless clearly promotional
    169                     if (el.closest("#update-nag") || el.id === "update-nag" || el.classList.contains("update-nag")) {
    170                         // Still allow pattern matching, just don\'t hide *only* by type.
    171                     }
    172 
    173                     var isMarketing = basePatterns.some(function(re) {
    174                         return re.test(text);
    175                     });
    176 
    177                     if (isMarketing) {
    178                         el.classList.add("dl-dashboard-detox-hidden");
    179                         el.style.outline = "";
    180                         el.style.opacity = "";
    181                         el.style.backgroundColor = "";
    182                         el.style.display = "none";
    183 
    184                         if (el.parentNode) {
    185                             el.parentNode.removeChild(el);
    186                         }
    187                     } else {
    188                         el.classList.remove("dl-dashboard-detox-hidden");
    189                         el.style.outline = "";
    190                         el.style.opacity = "1";
    191                         el.style.backgroundColor = "";
    192                         el.style.display = "";
    193                     }
    194                 });
     205                // Initial run
     206                applyDetox();
     207
     208                // Clean up pre-hide CSS
     209                var body = document.body;
     210                if (body && body.classList.contains("dl-dashboard-detox-prehide")) {
     211                    body.classList.remove("dl-dashboard-detox-prehide");
     212                }
     213                var preStyle = document.getElementById("dl-dashboard-detox-prehide-style");
     214                if (preStyle && preStyle.parentNode) {
     215                    preStyle.parentNode.removeChild(preStyle);
     216                }
     217
    195218            }
    196219
    197             // Initial run
    198             applyDetox();
    199 
    200             // Clean up pre-hide CSS
    201             var body = document.body;
    202             if (body && body.classList.contains("dl-dashboard-detox-prehide")) {
    203                 body.classList.remove("dl-dashboard-detox-prehide");
     220            if (document.readyState === "loading") {
     221                document.addEventListener("DOMContentLoaded", runDashboardDetox);
     222            } else {
     223                runDashboardDetox();
    204224            }
    205             var preStyle = document.getElementById("dl-dashboard-detox-prehide-style");
    206             if (preStyle && preStyle.parentNode) {
    207                 preStyle.parentNode.removeChild(preStyle);
    208             }
    209 
     225
     226        })();';
     227
     228    wp_add_inline_script( 'dl-dashboard-detox-inline', $js );
     229}
     230
     231    /**
     232     * Add the (free) settings page that previews Pro features.
     233     */
     234    public function add_settings_page() {
     235        add_options_page(
     236            __( 'Dashboard Detox', 'dashboard-detox-hide-marketing-review-popups' ),
     237            __( 'Dashboard Detox', 'dashboard-detox-hide-marketing-review-popups' ),
     238            'manage_options',
     239            'dashboard-detox-settings',
     240            array( $this, 'render_settings_page' )
     241        );
     242    }
     243
     244    /**
     245     * Render the settings page for the free version,
     246     * showing Pro features as disabled with upgrade links.
     247     */
     248    public function render_settings_page() {
     249        if ( ! current_user_can( 'manage_options' ) ) {
     250            return;
    210251        }
    211252
    212         if (document.readyState === "loading") {
    213             document.addEventListener("DOMContentLoaded", runDashboardDetox);
    214         } else {
    215             runDashboardDetox();
    216         }
    217 
    218     })();';
    219 
    220     wp_add_inline_script( 'dl-dashboard-detox-inline', $js );
    221 }
    222 
    223 
    224 
    225 }
     253        $pro_url = self::PRO_URL;
     254        ?>
     255        <div class="wrap">
     256            <h1><?php esc_html_e( 'Dashboard Detox Settings', 'dashboard-detox-hide-marketing-review-popups' ); ?></h1>
     257
     258            <div class="notice notice-info">
     259                <p>
     260                    <strong><?php esc_html_e( 'Want more control?', 'dashboard-detox-hide-marketing-review-popups' ); ?></strong>
     261                    <?php esc_html_e( 'Dashboard Detox Pro lets you fine-tune exactly which notices are blocked or allowed, and includes a debug mode.', 'dashboard-detox-hide-marketing-review-popups' ); ?>
     262                    <a href="<?php echo esc_url( $pro_url ); ?>" target="_blank" rel="noopener noreferrer">
     263                        <?php esc_html_e( 'Upgrade to Pro →', 'dashboard-detox-hide-marketing-review-popups' ); ?>
     264                    </a>
     265                </p>
     266            </div>
     267
     268            <p>
     269                <?php esc_html_e( 'The options below are available in Dashboard Detox Pro. They are shown here for reference and are disabled in the free version.', 'dashboard-detox-hide-marketing-review-popups' ); ?>
     270            </p>
     271
     272            <table class="form-table" role="presentation">
     273                <tr>
     274                    <th scope="row">
     275                        <label><?php esc_html_e( 'Extra blocked keywords', 'dashboard-detox-hide-marketing-review-popups' ); ?></label>
     276                    </th>
     277                    <td>
     278                        <textarea
     279                            rows="6"
     280                            class="large-text"
     281                            disabled="disabled"
     282                        ></textarea>
     283                        <p class="description">
     284                            <?php esc_html_e( 'In Pro you can add your own words or phrases (e.g. “upgrade”, “Black Friday”, “newsletter”) to always block matching notices.', 'dashboard-detox-hide-marketing-review-popups' ); ?>
     285                        </p>
     286                    </td>
     287                </tr>
     288
     289                <tr>
     290                    <th scope="row">
     291                        <label><?php esc_html_e( 'Whitelist keywords', 'dashboard-detox-hide-marketing-review-popups' ); ?></label>
     292                    </th>
     293                    <td>
     294                        <textarea
     295                            rows="4"
     296                            class="large-text"
     297                            disabled="disabled"
     298                        ></textarea>
     299                        <p class="description">
     300                            <?php esc_html_e( 'In Pro you can whitelist important notices by keyword so they are never hidden, even if they match other rules.', 'dashboard-detox-hide-marketing-review-popups' ); ?>
     301                        </p>
     302                    </td>
     303                </tr>
     304
     305                <tr>
     306                    <th scope="row"><?php esc_html_e( 'Debug mode', 'dashboard-detox-hide-marketing-review-popups' ); ?></th>
     307                    <td>
     308                        <label>
     309                            <input type="checkbox" disabled="disabled" />
     310                            <?php esc_html_e( 'Highlight matching notices instead of hiding them (Pro only).', 'dashboard-detox-hide-marketing-review-popups' ); ?>
     311                        </label>
     312                        <p class="description">
     313                            <?php esc_html_e( 'Use this in Pro to see which notices would be hidden, without actually hiding them.', 'dashboard-detox-hide-marketing-review-popups' ); ?>
     314                        </p>
     315                    </td>
     316                </tr>
     317            </table>
     318
     319            <p>
     320                <a class="button button-primary" href="<?php echo esc_url( $pro_url ); ?>" target="_blank" rel="noopener noreferrer">
     321                    <?php esc_html_e( 'Upgrade to Dashboard Detox Pro', 'dashboard-detox-hide-marketing-review-popups' ); ?>
     322                </a>
     323            </p>
     324        </div>
     325        <?php
     326    }
     327
     328
     329}
     330
     331/**
     332 * Add Settings + Upgrade links to the plugin row on the Plugins screen.
     333 */
     334function dl_dashboard_detox_action_links( $links ) {
     335    $settings_url = admin_url( 'options-general.php?page=dashboard-detox-settings' );
     336    $pro_url      = 'https://checkout.freemius.com/plugin/21788/plan/36360/';
     337
     338    $settings_link = '<a href="' . esc_url( $settings_url ) . '">' .
     339        esc_html__( 'Settings', 'dashboard-detox-hide-marketing-review-popups' ) .
     340        '</a>';
     341
     342    $pro_link = '<a href="' . esc_url( $pro_url ) . '" target="_blank" rel="noopener noreferrer">' .
     343        esc_html__( 'Upgrade to Pro', 'dashboard-detox-hide-marketing-review-popups' ) .
     344        '</a>';
     345
     346    // Put Settings first, then the existing links, then Upgrade to Pro at the end.
     347    array_unshift( $links, $settings_link );
     348    $links[] = $pro_link;
     349
     350    return $links;
     351}
     352add_filter(
     353    'plugin_action_links_' . plugin_basename( __FILE__ ),
     354    'dl_dashboard_detox_action_links'
     355);
    226356
    227357new DL_Dashboard_Detox();
  • dashboard-detox-hide-marketing-review-popups/tags/1.0.4/readme.txt

    r3403167 r3403286  
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 1.0.3
     7Stable tag: 1.0.4
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    4040No setup required. Just activate and detox your dashboard.
    4141
     42### Need more control? Dashboard Detox Pro
     43
     44The free version gives you a clean, quiet dashboard with zero configuration. 
     45If you’d like more fine-grained control, [Dashboard Detox Pro](https://checkout.freemius.com/plugin/21788/plan/36360/) adds a few extra tools:
     46
     47* Add custom “blocked keywords” to hide specific promos or campaigns.
     48* Whitelist important notices by keyword so they are never hidden.
     49* Turn on Debug Mode to highlight notices that would be hidden, instead of actually hiding them.
     50* Ideal for agencies and developers managing lots of client sites.
     51
     52== Free vs Pro ==
     53
     54**Free version**
     55
     56* Automatically hides most common marketing, upsell, and review nags in the WordPress admin.
     57* Lightweight, safe defaults — just activate and enjoy a calmer dashboard.
     58* No configuration required.
     59
     60**Dashboard Detox Pro**
     61
     62* Includes everything in the free version, plus:
     63* Custom “blocked keywords” to target specific marketing phrases (e.g. "Black Friday", "lifetime deal").
     64* Whitelist keywords to always show important notices.
     65* Debug Mode to see what would be hidden without actually hiding it.
     66* Priority for future enhancements.
     67
     68👉 [Get Dashboard Detox Pro](https://checkout.freemius.com/plugin/21788/plan/36360/)
     69
    4270== Installation ==
    4371
     
    6593
    6694= Is there a Pro version? =
    67 Yes — Dashboard Detox Pro adds custom keyword rules, whitelists, debug mode and more.
     95Yes. Dashboard Detox Pro adds advanced controls for power users and agencies, including custom blocked/whitelist keyword rules and a debug mode. 
     96You can purchase a Pro subscription here: https://checkout.freemius.com/plugin/21788/plan/36360/
    6897
    6998== Screenshots ==
     
    73102
    74103== Changelog ==
     104
     105= 1.0.4 - 2025-11-26 =
     106* Added a simple settings screen in the free version to explain available Pro features.
     107* Clarified the upgrade path to Dashboard Detox Pro directly from the plugin settings.
     108* No changes to core notice-hiding behaviour.
    75109
    76110= 1.0.3 =
     
    98132== Upgrade Notice ==
    99133
    100 = 1.0.3 =
    101 This update improves compliance with WordPress asset loading requirements. Behaviour remains the same, but CSS and JS are now loaded via the correct WordPress APIs.
     134= 1.0.4 =
     135This release adds a small settings page in the free version that previews Pro-only options and provides an optional upgrade link. There are no changes to how notices are detected or hidden.
  • dashboard-detox-hide-marketing-review-popups/trunk/changelog.txt

    r3403167 r3403286  
    11== Changelog for Dashboard Detox – Hide Marketing & Review Popups ==
     2
     3= 1.0.4 - 2025-11-26 =
     4* Added a simple settings screen in the free version to explain available Pro features.
     5* Clarified the upgrade path to Dashboard Detox Pro directly from the plugin settings.
     6* No changes to core notice-hiding behaviour.
    27
    38= 1.0.3 - 2025-11-22 =
  • dashboard-detox-hide-marketing-review-popups/trunk/dashboard-detox-hide-marketing-review-popups.php

    r3403167 r3403286  
    33 * Plugin Name: Dashboard Detox – Hide Marketing & Review Popups
    44 * Description: Light, no-nonsense plugin that hides most marketing and review nags in the WordPress admin area.
    5  * Version: 1.0.3
     5 * Version: 1.0.4
    66 * Requires at least: 6.0
    77 * Requries PHP: 7.4
     
    3535class DL_Dashboard_Detox {
    3636
     37    const PRO_URL = 'https://checkout.freemius.com/plugin/21788/plan/36360/';
     38
     39
    3740    public function __construct() {
    3841        if ( is_admin() ) {
     
    4245        // Enqueue both our CSS and JS properly
    4346        add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );
     47
     48
     49        // Free version: show Pro settings UI, but disabled
     50        add_action( 'admin_menu', array( $this, 'add_settings_page' ) );
    4451        }
    4552    }
     
    6572        false,
    6673        array(),
    67         '1.0.2'
     74        '1.0.4'
    6875    );
    6976
     
    107114        false,
    108115        array(),
    109         '1.0.2',
     116        '1.0.4',
    110117        true
    111118    );
     
    113120    wp_enqueue_script( 'dl-dashboard-detox-inline' );
    114121
    115     $js = '(function() {
    116 
    117         function runDashboardDetox() {
    118 
    119             // Built-in patterns that often indicate marketing or review nags
    120             var basePatterns = [
    121                 /rate\\s+(this\\s+)?plugin/i,
    122                 /leave\\s+(us\\s+)?a\\s+review/i,
    123                 /review\\s+our\\s+plugin/i,
    124                 /★★★★★/i,
    125                 /5\\s*stars?/i,
    126                 /upgrade\\s+to\\s+pro/i,
    127                 /go\\s+pro/i,
    128                 /limited\\s+time\\s+offer/i,
    129                 /discount/i,
    130                 /sale/i,
    131                 /black\\s+friday/i,
    132                 /cyber\\s+monday/i,
    133                 /special\\s+offer/i,
    134                 /coupon/i,
    135                 /subscribe\\s+to\\s+our\\s+newsletter/i
    136             ];
    137 
    138             var selectors = [
    139                 ".notice",
    140                 ".notice-info",
    141                 ".notice-warning",
    142                 ".notice-success",
    143                 ".notice-error",
    144                 ".is-dismissible",
    145                 ".updated",
    146                 ".update-nag",
    147                 "div[class*=\'notice\']",
    148                 "div[class*=\'promo\']",
    149                 "div[class*=\'banner\']",
    150                 "div[class*=\'review\']",
    151                 "div[class*=\'rating\']",
    152                 "div[class*=\'popup\']",
    153                 "div[class*=\'overlay\']"
    154             ];
    155 
    156             function applyDetox(root) {
    157                 var nodes = (root || document).querySelectorAll(selectors.join(","));
    158                 if (!nodes.length) {
    159                     return;
     122
     123        $js = '(function() {
     124
     125            function runDashboardDetox() {
     126
     127                // Built-in patterns that often indicate marketing or review nags
     128                var basePatterns = [
     129                    /rate\\s+(this\\s+)?plugin/i,
     130                    /leave\\s+(us\\s+)?a\\s+review/i,
     131                    /review\\s+our\\s+plugin/i,
     132                    /★★★★★/i,
     133                    /5\\s*stars?/i,
     134                    /upgrade\\s+to\\s+pro/i,
     135                    /go\\s+pro/i,
     136                    /limited\\s+time\\s+offer/i,
     137                    /discount/i,
     138                    /sale/i,
     139                    /black\\s+friday/i,
     140                    /cyber\\s+monday/i,
     141                    /special\\s+offer/i,
     142                    /coupon/i,
     143                    /subscribe\\s+to\\s+our\\s+newsletter/i
     144                ];
     145
     146                var selectors = [
     147                    ".notice",
     148                    ".notice-info",
     149                    ".notice-warning",
     150                    ".notice-success",
     151                    ".notice-error",
     152                    ".is-dismissible",
     153                    ".updated",
     154                    ".update-nag",
     155                    "div[class*=\'notice\']",
     156                    "div[class*=\'promo\']",
     157                    "div[class*=\'banner\']",
     158                    "div[class*=\'review\']",
     159                    "div[class*=\'rating\']",
     160                    "div[class*=\'popup\']",
     161                    "div[class*=\'overlay\']"
     162                ];
     163
     164                function applyDetox(root) {
     165                    var nodes = (root || document).querySelectorAll(selectors.join(","));
     166                    if (!nodes.length) {
     167                        return;
     168                    }
     169
     170                    nodes.forEach(function(el) {
     171                        var text = (el.innerText || "").trim();
     172                        if (!text) return;
     173
     174                        var lowerText = text.toLowerCase();
     175
     176                        // Avoid hiding update/security notices unless clearly promotional
     177                        if (el.closest("#update-nag") || el.id === "update-nag" || el.classList.contains("update-nag")) {
     178                            // Still allow pattern matching, just don\'t hide *only* by type.
     179                        }
     180
     181                        var isMarketing = basePatterns.some(function(re) {
     182                            return re.test(text);
     183                        });
     184
     185                        if (isMarketing) {
     186                            el.classList.add("dl-dashboard-detox-hidden");
     187                            el.style.outline = "";
     188                            el.style.opacity = "";
     189                            el.style.backgroundColor = "";
     190                            el.style.display = "none";
     191
     192                            if (el.parentNode) {
     193                                el.parentNode.removeChild(el);
     194                            }
     195                        } else {
     196                            el.classList.remove("dl-dashboard-detox-hidden");
     197                            el.style.outline = "";
     198                            el.style.opacity = "1";
     199                            el.style.backgroundColor = "";
     200                            el.style.display = "";
     201                        }
     202                    });
    160203                }
    161204
    162                 nodes.forEach(function(el) {
    163                     var text = (el.innerText || "").trim();
    164                     if (!text) return;
    165 
    166                     var lowerText = text.toLowerCase();
    167 
    168                     // Avoid hiding update/security notices unless clearly promotional
    169                     if (el.closest("#update-nag") || el.id === "update-nag" || el.classList.contains("update-nag")) {
    170                         // Still allow pattern matching, just don\'t hide *only* by type.
    171                     }
    172 
    173                     var isMarketing = basePatterns.some(function(re) {
    174                         return re.test(text);
    175                     });
    176 
    177                     if (isMarketing) {
    178                         el.classList.add("dl-dashboard-detox-hidden");
    179                         el.style.outline = "";
    180                         el.style.opacity = "";
    181                         el.style.backgroundColor = "";
    182                         el.style.display = "none";
    183 
    184                         if (el.parentNode) {
    185                             el.parentNode.removeChild(el);
    186                         }
    187                     } else {
    188                         el.classList.remove("dl-dashboard-detox-hidden");
    189                         el.style.outline = "";
    190                         el.style.opacity = "1";
    191                         el.style.backgroundColor = "";
    192                         el.style.display = "";
    193                     }
    194                 });
     205                // Initial run
     206                applyDetox();
     207
     208                // Clean up pre-hide CSS
     209                var body = document.body;
     210                if (body && body.classList.contains("dl-dashboard-detox-prehide")) {
     211                    body.classList.remove("dl-dashboard-detox-prehide");
     212                }
     213                var preStyle = document.getElementById("dl-dashboard-detox-prehide-style");
     214                if (preStyle && preStyle.parentNode) {
     215                    preStyle.parentNode.removeChild(preStyle);
     216                }
     217
    195218            }
    196219
    197             // Initial run
    198             applyDetox();
    199 
    200             // Clean up pre-hide CSS
    201             var body = document.body;
    202             if (body && body.classList.contains("dl-dashboard-detox-prehide")) {
    203                 body.classList.remove("dl-dashboard-detox-prehide");
     220            if (document.readyState === "loading") {
     221                document.addEventListener("DOMContentLoaded", runDashboardDetox);
     222            } else {
     223                runDashboardDetox();
    204224            }
    205             var preStyle = document.getElementById("dl-dashboard-detox-prehide-style");
    206             if (preStyle && preStyle.parentNode) {
    207                 preStyle.parentNode.removeChild(preStyle);
    208             }
    209 
     225
     226        })();';
     227
     228    wp_add_inline_script( 'dl-dashboard-detox-inline', $js );
     229}
     230
     231    /**
     232     * Add the (free) settings page that previews Pro features.
     233     */
     234    public function add_settings_page() {
     235        add_options_page(
     236            __( 'Dashboard Detox', 'dashboard-detox-hide-marketing-review-popups' ),
     237            __( 'Dashboard Detox', 'dashboard-detox-hide-marketing-review-popups' ),
     238            'manage_options',
     239            'dashboard-detox-settings',
     240            array( $this, 'render_settings_page' )
     241        );
     242    }
     243
     244    /**
     245     * Render the settings page for the free version,
     246     * showing Pro features as disabled with upgrade links.
     247     */
     248    public function render_settings_page() {
     249        if ( ! current_user_can( 'manage_options' ) ) {
     250            return;
    210251        }
    211252
    212         if (document.readyState === "loading") {
    213             document.addEventListener("DOMContentLoaded", runDashboardDetox);
    214         } else {
    215             runDashboardDetox();
    216         }
    217 
    218     })();';
    219 
    220     wp_add_inline_script( 'dl-dashboard-detox-inline', $js );
    221 }
    222 
    223 
    224 
    225 }
     253        $pro_url = self::PRO_URL;
     254        ?>
     255        <div class="wrap">
     256            <h1><?php esc_html_e( 'Dashboard Detox Settings', 'dashboard-detox-hide-marketing-review-popups' ); ?></h1>
     257
     258            <div class="notice notice-info">
     259                <p>
     260                    <strong><?php esc_html_e( 'Want more control?', 'dashboard-detox-hide-marketing-review-popups' ); ?></strong>
     261                    <?php esc_html_e( 'Dashboard Detox Pro lets you fine-tune exactly which notices are blocked or allowed, and includes a debug mode.', 'dashboard-detox-hide-marketing-review-popups' ); ?>
     262                    <a href="<?php echo esc_url( $pro_url ); ?>" target="_blank" rel="noopener noreferrer">
     263                        <?php esc_html_e( 'Upgrade to Pro →', 'dashboard-detox-hide-marketing-review-popups' ); ?>
     264                    </a>
     265                </p>
     266            </div>
     267
     268            <p>
     269                <?php esc_html_e( 'The options below are available in Dashboard Detox Pro. They are shown here for reference and are disabled in the free version.', 'dashboard-detox-hide-marketing-review-popups' ); ?>
     270            </p>
     271
     272            <table class="form-table" role="presentation">
     273                <tr>
     274                    <th scope="row">
     275                        <label><?php esc_html_e( 'Extra blocked keywords', 'dashboard-detox-hide-marketing-review-popups' ); ?></label>
     276                    </th>
     277                    <td>
     278                        <textarea
     279                            rows="6"
     280                            class="large-text"
     281                            disabled="disabled"
     282                        ></textarea>
     283                        <p class="description">
     284                            <?php esc_html_e( 'In Pro you can add your own words or phrases (e.g. “upgrade”, “Black Friday”, “newsletter”) to always block matching notices.', 'dashboard-detox-hide-marketing-review-popups' ); ?>
     285                        </p>
     286                    </td>
     287                </tr>
     288
     289                <tr>
     290                    <th scope="row">
     291                        <label><?php esc_html_e( 'Whitelist keywords', 'dashboard-detox-hide-marketing-review-popups' ); ?></label>
     292                    </th>
     293                    <td>
     294                        <textarea
     295                            rows="4"
     296                            class="large-text"
     297                            disabled="disabled"
     298                        ></textarea>
     299                        <p class="description">
     300                            <?php esc_html_e( 'In Pro you can whitelist important notices by keyword so they are never hidden, even if they match other rules.', 'dashboard-detox-hide-marketing-review-popups' ); ?>
     301                        </p>
     302                    </td>
     303                </tr>
     304
     305                <tr>
     306                    <th scope="row"><?php esc_html_e( 'Debug mode', 'dashboard-detox-hide-marketing-review-popups' ); ?></th>
     307                    <td>
     308                        <label>
     309                            <input type="checkbox" disabled="disabled" />
     310                            <?php esc_html_e( 'Highlight matching notices instead of hiding them (Pro only).', 'dashboard-detox-hide-marketing-review-popups' ); ?>
     311                        </label>
     312                        <p class="description">
     313                            <?php esc_html_e( 'Use this in Pro to see which notices would be hidden, without actually hiding them.', 'dashboard-detox-hide-marketing-review-popups' ); ?>
     314                        </p>
     315                    </td>
     316                </tr>
     317            </table>
     318
     319            <p>
     320                <a class="button button-primary" href="<?php echo esc_url( $pro_url ); ?>" target="_blank" rel="noopener noreferrer">
     321                    <?php esc_html_e( 'Upgrade to Dashboard Detox Pro', 'dashboard-detox-hide-marketing-review-popups' ); ?>
     322                </a>
     323            </p>
     324        </div>
     325        <?php
     326    }
     327
     328
     329}
     330
     331/**
     332 * Add Settings + Upgrade links to the plugin row on the Plugins screen.
     333 */
     334function dl_dashboard_detox_action_links( $links ) {
     335    $settings_url = admin_url( 'options-general.php?page=dashboard-detox-settings' );
     336    $pro_url      = 'https://checkout.freemius.com/plugin/21788/plan/36360/';
     337
     338    $settings_link = '<a href="' . esc_url( $settings_url ) . '">' .
     339        esc_html__( 'Settings', 'dashboard-detox-hide-marketing-review-popups' ) .
     340        '</a>';
     341
     342    $pro_link = '<a href="' . esc_url( $pro_url ) . '" target="_blank" rel="noopener noreferrer">' .
     343        esc_html__( 'Upgrade to Pro', 'dashboard-detox-hide-marketing-review-popups' ) .
     344        '</a>';
     345
     346    // Put Settings first, then the existing links, then Upgrade to Pro at the end.
     347    array_unshift( $links, $settings_link );
     348    $links[] = $pro_link;
     349
     350    return $links;
     351}
     352add_filter(
     353    'plugin_action_links_' . plugin_basename( __FILE__ ),
     354    'dl_dashboard_detox_action_links'
     355);
    226356
    227357new DL_Dashboard_Detox();
  • dashboard-detox-hide-marketing-review-popups/trunk/readme.txt

    r3403167 r3403286  
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 1.0.3
     7Stable tag: 1.0.4
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    4040No setup required. Just activate and detox your dashboard.
    4141
     42### Need more control? Dashboard Detox Pro
     43
     44The free version gives you a clean, quiet dashboard with zero configuration. 
     45If you’d like more fine-grained control, [Dashboard Detox Pro](https://checkout.freemius.com/plugin/21788/plan/36360/) adds a few extra tools:
     46
     47* Add custom “blocked keywords” to hide specific promos or campaigns.
     48* Whitelist important notices by keyword so they are never hidden.
     49* Turn on Debug Mode to highlight notices that would be hidden, instead of actually hiding them.
     50* Ideal for agencies and developers managing lots of client sites.
     51
     52== Free vs Pro ==
     53
     54**Free version**
     55
     56* Automatically hides most common marketing, upsell, and review nags in the WordPress admin.
     57* Lightweight, safe defaults — just activate and enjoy a calmer dashboard.
     58* No configuration required.
     59
     60**Dashboard Detox Pro**
     61
     62* Includes everything in the free version, plus:
     63* Custom “blocked keywords” to target specific marketing phrases (e.g. "Black Friday", "lifetime deal").
     64* Whitelist keywords to always show important notices.
     65* Debug Mode to see what would be hidden without actually hiding it.
     66* Priority for future enhancements.
     67
     68👉 [Get Dashboard Detox Pro](https://checkout.freemius.com/plugin/21788/plan/36360/)
     69
    4270== Installation ==
    4371
     
    6593
    6694= Is there a Pro version? =
    67 Yes — Dashboard Detox Pro adds custom keyword rules, whitelists, debug mode and more.
     95Yes. Dashboard Detox Pro adds advanced controls for power users and agencies, including custom blocked/whitelist keyword rules and a debug mode. 
     96You can purchase a Pro subscription here: https://checkout.freemius.com/plugin/21788/plan/36360/
    6897
    6998== Screenshots ==
     
    73102
    74103== Changelog ==
     104
     105= 1.0.4 - 2025-11-26 =
     106* Added a simple settings screen in the free version to explain available Pro features.
     107* Clarified the upgrade path to Dashboard Detox Pro directly from the plugin settings.
     108* No changes to core notice-hiding behaviour.
    75109
    76110= 1.0.3 =
     
    98132== Upgrade Notice ==
    99133
    100 = 1.0.3 =
    101 This update improves compliance with WordPress asset loading requirements. Behaviour remains the same, but CSS and JS are now loaded via the correct WordPress APIs.
     134= 1.0.4 =
     135This release adds a small settings page in the free version that previews Pro-only options and provides an optional upgrade link. There are no changes to how notices are detected or hidden.
Note: See TracChangeset for help on using the changeset viewer.