Plugin Directory

Changeset 3735578


Ignore:
Timestamp:
10/08/2026 09:36:13 PM (11 days ago)
Author:
rbplugins
Message:

2.0.1 - Improve options and fix links, login protection, and UI issues

Location:
disable-right-click-rb
Files:
15 added
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • disable-right-click-rb/trunk/assets/js/rb-admin-settings.js

    r3735431 r3735578  
    66 * settings card on the left (tabs: Protection, Advanced, Watermark), Help
    77 * card on the right (Hints / FAQ / About) that updates via [data-help-key]
    8  * delegation. Watermark is a PRO tab: locked-upsell card when the PRO
    9  * add-on isn't installed (data.pro is false), real fields — saved via the
    10  * add-on's own AJAX action — when it is. Dependency-free, saved via
     8 * delegation. Watermark and "PRO: fine-grained control" are PRO sections:
     9 * without the add-on (data.pro is false) their fields are shown switched
     10 * off and marked PRO, with a link to the pricing; with it they are live and
     11 * saved via the add-on's own AJAX actions. Dependency-free, saved via
    1112 * fetch() to admin-ajax.php.
    1213 */
    … …  
    105106                + '.about-link.primary{background:#6750a4;color:#fff;}'
    106107                + '.about-link.primary:hover{background:#5a4592;}'
    107                 + '.warn-card{background:#fff4e5;border:1px solid #f0c04e;border-radius:10px;padding:14px 16px;margin-bottom:18px;}'
    108                 + '.warn-card strong{display:block;font-size:13px;color:#6b4e00;margin-bottom:4px;}'
    109                 + '.warn-card p{font-size:13px;color:#7a5c00;margin:0;line-height:1.5;}'
     108                + '.warn-card{display:flex;align-items:center;gap:10px;background:#fff4e5;border:1px solid #f0c04e;'
     109                + 'border-radius:10px;padding:9px 14px;margin-bottom:16px;}'
     110                + '.warn-card .warn-icon{font-size:20px;line-height:1;color:#b07a00;flex-shrink:0;}'
     111                + '.warn-card p{font-size:13px;color:#7a5c00;margin:0;line-height:1.4;}'
    110112                + '.pro-badge{background:linear-gradient(135deg,#8b5cf6,#6750a4);color:#fff;font-size:10px;'
    111113                + 'font-weight:700;padding:2px 7px;border-radius:10px;letter-spacing:.02em;}'
    112                 + '.locked-card{background:#12141c;color:#e7e4ef;border-radius:12px;padding:22px 24px;}'
    113                 + '.locked-card h3{margin:0 0 8px;font-size:15px;font-weight:600;color:#fff;}'
    114                 + '.locked-card p{margin:0 0 16px;font-size:13px;line-height:1.6;color:#cfcbe0;}'
    115                 + '.locked-cta{display:inline-block;background:#f5c542;color:#12141c;border-radius:8px;padding:10px 18px;'
    116                 + 'font-size:13px;font-weight:600;text-decoration:none;}'
    117                 + '.locked-cta:hover{background:#ffd75e;}'
     114                + '.pro-note{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:#f4eff9;border-radius:10px;'
     115                + 'padding:9px 14px;margin-bottom:16px;font-size:13px;line-height:1.4;color:#4a3b6e;}'
     116                + '.pro-note a{margin-left:auto;font-weight:600;color:#6750a4;text-decoration:none;white-space:nowrap;}'
     117                + '.pro-note a:hover{text-decoration:underline;}'
     118                + '.is-locked .option,.is-locked .field{opacity:.55;cursor:not-allowed;}'
     119                + '.is-locked .option:hover{background:none;}'
     120                + '.is-locked input,.is-locked textarea,.is-locked select,.is-locked button{cursor:not-allowed;}'
     121                + '.is-locked button.save:disabled{background:#c9c2d9;}'
     122                + '.legend-badge{margin-left:8px;vertical-align:1px;text-transform:none;}'
    118123                + 'select{border:1px solid #cac4d0;border-radius:8px;padding:7px 10px;font-size:13px;font-family:inherit;}'
    119124                + '.wm-row{display:flex;gap:12px;flex-wrap:wrap;}'
    … …  
    146151                } );
    147152                return node;
     153        }
     154
     155        /** One slim line above a PRO section a free user sees: what it is, and where to get it. */
     156        function proNote( text ) {
     157                return el( 'div', { class: 'pro-note' }, [
     158                        el( 'span', { text: text } ),
     159                        el( 'a', { href: data.watermarkBuyUrl, target: '_blank', rel: 'noopener', text: s.proUnlockLink } ),
     160                ] );
     161        }
     162
     163        /**
     164         * Free users: the PRO fields stay visible but switched off — every
     165         * control disabled, each group marked PRO. Hints still show on hover.
     166         */
     167        function lockSection( node ) {
     168                node.classList.add( 'is-locked' );
     169                [].forEach.call( node.querySelectorAll( 'input, textarea, select, button' ), function ( c ) {
     170                        c.disabled = true;
     171                } );
     172                [].forEach.call( node.querySelectorAll( 'legend' ), function ( lg ) {
     173                        lg.appendChild( el( 'span', { class: 'pro-badge legend-badge', text: s.proBadge } ) );
     174                } );
    148175        }
    149176
    … …  
    358385        // ======================================================================
    359386        var advWarn = el( 'div', { class: 'warn-card' }, [
    360                 el( 'strong', { text: '⚠' } ),
     387                el( 'span', { class: 'warn-icon', 'aria-hidden': 'true', text: '⚠' } ),
    361388                el( 'p', { text: s.advIntro } ),
    362389        ] );
    … …  
    401428        }
    402429        proExtrasWrap.appendChild( proExtrasHeading );
    403 
    404430        if ( ! data.pro ) {
    405                 proExtrasWrap.appendChild( el( 'div', { class: 'locked-card' }, [
    406                         el( 'h3', { text: s.proExtrasLockedTitle } ),
    407                         el( 'p', { text: s.proExtrasLockedBody } ),
    408                         el( 'a', { class: 'locked-cta', href: data.watermarkBuyUrl, target: '_blank', rel: 'noopener', text: s.watermarkBuyCta } ),
    409                 ] ) );
    410         } else {
     431                proExtrasWrap.appendChild( proNote( s.proPreviewExtras ) );
     432        }
     433
     434        // Built for everyone: free users see the same fields, switched off and
     435        // marked PRO, so they know what the add-on gives them.
     436        {
    411437                var pe = data.proExtras || {};
    412438                var peState = {
    … …  
    513539                proExtrasWrap.appendChild( allowFieldset );
    514540                proExtrasWrap.appendChild( devtoolsFieldset );
    515                 proExtrasWrap.appendChild( el( 'div', { class: 'actions' }, [ peSaveBtn, peStatus ] ) );
     541                if ( data.pro ) {
     542                        proExtrasWrap.appendChild( el( 'div', { class: 'actions' }, [ peSaveBtn, peStatus ] ) );
     543                } else {
     544                        lockSection( proExtrasWrap );
     545                }
    516546        }
    517547        advancedPanel.appendChild( proExtrasWrap );
    … …  
    561591        // ======================================================================
    562592        if ( ! data.pro ) {
    563                 watermarkPanel.appendChild( el( 'div', { class: 'locked-card' }, [
    564                         el( 'h3', { text: s.watermarkLockedTitle } ),
    565                         el( 'p', { text: s.watermarkLockedBody } ),
    566                         el( 'a', { class: 'locked-cta', href: data.watermarkBuyUrl, target: '_blank', rel: 'noopener', text: s.watermarkBuyCta } ),
    567                 ] ) );
    568         } else {
     593                watermarkPanel.appendChild( proNote( s.proPreviewWatermark ) );
     594        }
     595        {
    569596                var wm = data.watermark || {};
    570597                var wmState = {
    … …  
    723750                watermarkPanel.appendChild( wmLogoBlock );
    724751                watermarkPanel.appendChild( wmExcludeFieldset );
    725                 watermarkPanel.appendChild( el( 'div', { class: 'actions' }, [ wmSaveBtn, wmStatus ] ) );
     752                if ( data.pro ) {
     753                        watermarkPanel.appendChild( el( 'div', { class: 'actions' }, [ wmSaveBtn, wmStatus ] ) );
     754                } else {
     755                        lockSection( watermarkPanel );
     756                }
    726757        }
    727758
  • disable-right-click-rb/trunk/class_rb_disable_right_click.php

    r3735431 r3735578  
    378378                        'roles'        => $this->get_available_roles(),
    379379                        'pro'          => (bool) RB_DISABLE_RIGHT_CLICK_PRO,
    380                         'watermarkBuyUrl' => 'https://rbplugins.com/wordpress-plugins/disable-right-click-rb/pro/',
     380                        'watermarkBuyUrl' => 'https://rbplugins.com/wordpress-plugins/disable-right-click-rb/#pricing',
    381381                        /**
    382382                         * Free plugin only ever ships this inert default shape so the
    … …  
    450450                        'showMessageLabel'   => __( 'Show a short message when a blocked action is attempted', 'disable-right-click-rb' ),
    451451                        'messageTextLabel'   => __( 'Message text', 'disable-right-click-rb' ),
    452                         'advIntro'           => __( 'These go further than basic copy protection. Read the Hints on the right before turning them on.', 'disable-right-click-rb' ),
     452                        'advIntro'           => __( 'Stronger measures — check the Hints on the right before turning them on.', 'disable-right-click-rb' ),
    453453                        'optViewSource'      => __( 'Block view-source shortcuts (Ctrl/⌘+U, F12, Ctrl+Shift+I/J/C)', 'disable-right-click-rb' ),
    454454                        'optDevtools'        => __( 'Show the message if DevTools appears to be open (best-effort, may false-positive)', 'disable-right-click-rb' ),
    455455                        'tabWatermark'       => __( 'Watermark', 'disable-right-click-rb' ),
    456456                        'proBadge'           => __( 'PRO', 'disable-right-click-rb' ),
    457                         'watermarkLockedTitle' => __( 'Watermarking is a PRO feature', 'disable-right-click-rb' ),
    458                         'watermarkLockedBody'  => __( 'Stamp your logo or site name onto every image automatically — a quick CSS overlay, or real server-side embedding into the image file itself, with exclusions by filename or image size.', 'disable-right-click-rb' ),
    459                         'watermarkBuyCta'      => __( 'Get Disable Right Click RB PRO', 'disable-right-click-rb' ),
     457                        'proPreviewWatermark'  => __( 'Watermark every image with your logo or site name.', 'disable-right-click-rb' ),
     458                        'proPreviewExtras'     => __( 'Protect more pages and decide what stays usable.', 'disable-right-click-rb' ),
     459                        'proUnlockLink'        => __( 'Unlock PRO →', 'disable-right-click-rb' ),
    460460                        'watermarkEnableLabel' => __( 'Watermark images on this site', 'disable-right-click-rb' ),
    461461                        'watermarkModeLegend'  => __( 'Mode', 'disable-right-click-rb' ),
    … …  
    475475                        'watermarkChangeLogo'  => __( 'Change logo…', 'disable-right-click-rb' ),
    476476                        'proExtrasTitle'       => __( 'PRO: fine-grained control', 'disable-right-click-rb' ),
    477                         'proExtrasLockedTitle' => __( 'Fine-grained control is a PRO feature', 'disable-right-click-rb' ),
    478                         'proExtrasLockedBody'  => __( 'Extend protection to search results, 404, login and archive pages, protect only a specific list of URLs, allow right-click on chosen elements like links, and make DevTools detection actually do something.', 'disable-right-click-rb' ),
    479477                        'precisionScopeLegend' => __( 'Precision scope — also protect', 'disable-right-click-rb' ),
    480478                        'ctxSearch'            => __( 'Search results', 'disable-right-click-rb' ),
  • disable-right-click-rb/trunk/disable-right-click-rb.php

    r3735431 r3735578  
    22/*
    33Plugin Name: Disable Right Click RB
    4 Plugin URI: https://www.rbplugins.com/disable-right-click-rb
     4Plugin URI: https://rbplugins.com/wordpress-plugins/disable-right-click-rb/
    55Description: Protects your content from being copied — right click, text selection, copy/paste, image dragging and view-source shortcuts, with per-content-type scope and role exceptions.
    6 Version: 2.0.0
     6Version: 2.0.1
    77Author: rbPlugins
    88Author URI: https://profiles.wordpress.org/rbplugins/
    … …  
    1616}
    1717
    18 define( 'RB_DISABLE_RIGHT_CLICK_VERSION', '2.0.0' );
     18define( 'RB_DISABLE_RIGHT_CLICK_VERSION', '2.0.1' );
    1919define( 'RB_DISABLE_RIGHT_CLICK_PATH', plugin_dir_path( __FILE__ ) );
    2020define( 'RB_DISABLE_RIGHT_CLICK_URL', plugin_dir_url( __FILE__ ) );
  • disable-right-click-rb/trunk/information.php

    r3735431 r3735578  
    2222                color: #f3f2f7;
    2323                border-radius: 12px;
    24                 padding: 22px 28px;
     24                padding: 26px 32px;
    2525                margin: 16px 25px 16px 0;
    2626                flex-wrap: wrap;
    … …  
    3333                font-weight: 700;
    3434                white-space: nowrap;
     35                margin-bottom: 10px;
    3536        }
    3637        .rbdrc-promo-brand .rbdrc-dot {
    … …  
    4647        }
    4748        .rbdrc-promo-main h3 {
    48                 margin: 0 0 6px;
     49                margin: 0 0 16px;
    4950                font-size: 15px;
     51                line-height: 1.4;
    5052                font-weight: 600;
    5153                color: #fff;
  • disable-right-click-rb/trunk/readme.txt

    r3735431 r3735578  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 2.0.0
     7Stable tag: 2.0.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    118118== Changelog ==
    119119
     120= 2.0.1 =
     121* Settings screen: PRO options are now shown to free users, switched off and marked PRO, instead of an upsell card — see what the add-on gives you
     122* Settings screen: a compact one-line notice on the Advanced tab, and more room in the banner above the settings
     123* Fixed: PRO links now open the pricing section of the plugin's page
     124* Fixed: the Plugin URI pointed to an old address
     125* Fixed: with the PRO add-on, the "Login page" scope and login URLs in Opposite Mode now protect the login screen
     126* Fixed: no more "translation loading too early" notice in the debug log on WordPress 6.7+
     127* Fixed: the numbered steps in Hints were numbered twice
     128
    120129= 2.0.0 =
    121130* Complete rewrite: new settings screen (Protection / Advanced / Watermark tabs), built as a Shadow DOM app — faster, no WordPress admin theme conflicts
    … …  
    162171== Upgrade Notice ==
    163172
    164 = 2.0.0 =
    165 Major rewrite with a new settings screen and granular controls, plus an optional PRO add-on. Your existing on/off setting is migrated automatically — review the new Protection tab after updating to make sure the settings match what you expect.
     173= 2.0.1 =
     174Settings screen polish: PRO options are previewed in place, fixed links to the plugin page and pricing.
Note: See TracChangeset for help on using the changeset viewer.