Changeset 3736541
- Timestamp:
- 10/09/2026 11:46:18 AM (10 days ago)
- Location:
- disable-right-click-rb
- Files:
-
- 27 added
- 4 edited
-
tags/2.0.2 (added)
-
tags/2.0.2/assets (added)
-
tags/2.0.2/assets/images (added)
-
tags/2.0.2/assets/images/index.html (added)
-
tags/2.0.2/assets/images/logo_rg.gif (added)
-
tags/2.0.2/assets/images/upzilla_black_logo.svg (added)
-
tags/2.0.2/assets/index.html (added)
-
tags/2.0.2/assets/js (added)
-
tags/2.0.2/assets/js/rb-admin-settings.js (added)
-
tags/2.0.2/class_rb_disable_right_click.php (added)
-
tags/2.0.2/class_rb_disable_right_click_key.php (added)
-
tags/2.0.2/disable-right-click-rb.php (added)
-
tags/2.0.2/information.php (added)
-
tags/2.0.2/options.php (added)
-
tags/2.0.2/readme.txt (added)
-
tags/2.0.2/screenshot-1.jpg (added)
-
tags/2.0.2/screenshot-2.jpg (added)
-
tags/2.0.2/screenshot-3.jpg (added)
-
tags/2.0.2/screenshot-4.jpg (added)
-
tags/2.0.2/screenshot-5.jpg (added)
-
tags/2.0.2/screenshot-6.jpg (added)
-
trunk/assets/js/rb-admin-settings.js (modified) (8 diffs)
-
trunk/class_rb_disable_right_click.php (modified) (4 diffs)
-
trunk/disable-right-click-rb.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (5 diffs)
-
trunk/screenshot-1.jpg (added)
-
trunk/screenshot-2.jpg (added)
-
trunk/screenshot-3.jpg (added)
-
trunk/screenshot-4.jpg (added)
-
trunk/screenshot-5.jpg (added)
-
trunk/screenshot-6.jpg (added)
Legend:
- Unmodified
- Added
- Removed
-
disable-right-click-rb/trunk/assets/js/rb-admin-settings.js
r3735578 r3736541 75 75 + '.status.ok{color:#146c2e;}' 76 76 + '.status.err{color:#b3261e;}' 77 + '.status.dirty{color:#8a5a00;}' 77 78 + '.field{display:flex;flex-direction:column;gap:4px;margin-bottom:12px;}' 78 79 + '.field label{font-size:12px;color:#49454f;font-weight:500;}' … … 522 523 peSaveBtn.disabled = false; 523 524 if ( res && res.success ) { 524 peStatus.classList.add( 'ok' ); 525 peStatus.textContent = s.saved; 525 markSaved( 'pro' ); 526 526 } else { 527 527 peStatus.classList.add( 'err' ); … … 546 546 } 547 547 advancedPanel.appendChild( proExtrasWrap ); 548 549 // ---- Unsaved changes and the "saved" status ---- 550 // Three separate saves: the base options (Protection + Advanced), the PRO 551 // fine-grained options and the watermark. Each remembers unsaved edits. 552 var dirty = {}; 553 function statusesOf( section ) { 554 return ( { base: [ protectionStatus, advStatus ], pro: [ peStatus ], wm: [ wmStatus ] } )[ section ] || []; 555 } 556 function sectionOf( node ) { 557 if ( watermarkPanel.contains( node ) ) { return 'wm'; } 558 if ( proExtrasWrap.contains( node ) ) { return 'pro'; } 559 return card.contains( node ) ? 'base' : null; 560 } 561 function markDirty( section ) { 562 dirty[ section ] = true; 563 statusesOf( section ).forEach( function ( el ) { 564 clearTimeout( el.fadeTimer ); 565 el.className = 'status dirty'; 566 el.textContent = s.unsaved; 567 } ); 568 } 569 // "Settings saved." fades after a few seconds; errors stay until the next save 570 function markSaved( section ) { 571 delete dirty[ section ]; 572 statusesOf( section ).forEach( function ( el ) { 573 clearTimeout( el.fadeTimer ); 574 el.className = 'status ok'; 575 el.textContent = s.saved; 576 el.fadeTimer = setTimeout( function () { 577 el.className = 'status'; 578 el.textContent = ''; 579 }, 3000 ); 580 } ); 581 } 548 582 549 583 // ---- Shared save (both tabs write the full options row) ---- … … 571 605 btn.disabled = false; 572 606 if ( res && res.success ) { 573 statusEl.classList.add( 'ok' ); 574 statusEl.textContent = s.saved; 607 markSaved( 'base' ); 575 608 } else { 576 609 statusEl.classList.add( 'err' ); … … 679 712 wmLogoPreview.style.display = 'block'; 680 713 wmLogoBtn.textContent = s.watermarkChangeLogo; 714 markDirty( 'wm' ); 681 715 } ); 682 716 frame.open(); … … 731 765 wmSaveBtn.disabled = false; 732 766 if ( res && res.success ) { 733 wmStatus.classList.add( 'ok' ); 734 wmStatus.textContent = s.saved; 767 markSaved( 'wm' ); 735 768 } else { 736 769 wmStatus.classList.add( 'err' ); … … 782 815 var FAQ_ITEMS = [ 783 816 { q: 'Will this actually stop someone copying my content?', a: 'No client-side technique can fully prevent it — anyone can still view page source, use a reader-mode browser extension, or take a screenshot. This deters casual copying, not a determined person.' }, 784 { q: 'W hy is "Copy, cut, paste" blocking my contact form?', a: 'That option blocks Ctrl/⌘+C/X/V/A everywhere on the page, including inside input fields. Turn it off on pages with forms, or exempt the roles that need to fill them in.' },817 { q: 'Will "Copy, cut, paste" break my contact form?', a: 'No. The shortcuts are blocked on the page content only: inside input fields, text areas and editable areas visitors can still type, select, copy and paste as usual.' }, 785 818 { q: 'Can I protect only my blog posts but leave pages alone?', a: 'Yes — switch "Where" to "Only on selected content types" and tick just Posts.' }, 786 819 { q: 'Does the "Advanced" tab really block F12 / DevTools?', a: 'Not reliably — browsers reserve those shortcuts and some can\'t be intercepted at all. Treat it as a mild deterrent and a visible message, not a security measure.' }, … … 876 909 } ); 877 910 911 // any edit in a section marks it unsaved; leaving the page then asks first 912 [ 'input', 'change' ].forEach( function ( type ) { 913 layout.addEventListener( type, function ( e ) { 914 var section = sectionOf( e.target ); 915 if ( section ) { markDirty( section ); } 916 } ); 917 } ); 918 window.addEventListener( 'beforeunload', function ( e ) { 919 if ( Object.keys( dirty ).length ) { 920 e.preventDefault(); 921 e.returnValue = ''; 922 } 923 } ); 924 878 925 showHelp( 'opt_context_menu' ); 879 926 -
disable-right-click-rb/trunk/class_rb_disable_right_click.php
r3735578 r3736541 218 218 . 'function allowed(e){if(!f.allowSelectors||!f.allowSelectors.length||!e||!e.target||!e.target.closest)return false;' 219 219 . 'for(var i=0;i<f.allowSelectors.length;i++){try{if(e.target.closest(f.allowSelectors[i]))return true;}catch(_){}}return false;}' 220 // form fields stay usable: typing, selecting, pasting a password, the field's own menu 221 . 'function field(e){var t=e&&e.target;return !!(t&&(t.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName)));}' 220 222 . 'function block(e){if(allowed(e))return true;if(e&&e.preventDefault)e.preventDefault();notify();return false;}' 221 223 . 'function notify(){if(!f.showMessage)return;if(window.__rbDrcMsgAt&&(Date.now()-window.__rbDrcMsgAt)<1500)return;window.__rbDrcMsgAt=Date.now();var m=document.createElement("div");' … … 225 227 . 'document.body.appendChild(m);requestAnimationFrame(function(){m.style.opacity="1";});' 226 228 . 'setTimeout(function(){m.style.opacity="0";setTimeout(function(){m.remove();},200);},1800);}' 227 . 'if(f.contextMenu){document.addEventListener("contextmenu",block);}' 228 . 'if(f.selection){document.addEventListener("selectstart",block);' 229 . 'var st=document.createElement("style");st.textContent="html{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}";document.head.appendChild(st);}' 229 . 'if(f.contextMenu){document.addEventListener("contextmenu",function(e){if(!field(e))block(e);});}' 230 . 'if(f.selection){document.addEventListener("selectstart",function(e){if(!field(e))block(e);});' 231 . 'var st=document.createElement("style");st.textContent="html{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}' 232 . 'input,textarea,[contenteditable],[contenteditable] *{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;}";document.head.appendChild(st);}' 230 233 . 'if(f.drag){document.addEventListener("dragstart",block);}' 231 234 . 'document.addEventListener("keydown",function(e){' 232 235 . 'var k=(e.key||"").toLowerCase();var ctrl=e.ctrlKey||e.metaKey;' 233 . 'if(f.copy&&ctrl&&(k==="c"||k==="x"||k==="v"||k==="a") ){block(e);return;}'236 . 'if(f.copy&&ctrl&&(k==="c"||k==="x"||k==="v"||k==="a")&&!field(e)){block(e);return;}' 234 237 . 'if(f.viewSource){' 235 238 . 'if(k==="f12"){block(e);return;}' … … 434 437 'save' => __( 'Save changes', 'disable-right-click-rb' ), 435 438 'saved' => __( 'Settings saved.', 'disable-right-click-rb' ), 439 'unsaved' => __( 'Unsaved changes', 'disable-right-click-rb' ), 436 440 'error' => __( 'Could not save settings. Please try again.', 'disable-right-click-rb' ), 437 441 'tabProtection' => __( 'Protection', 'disable-right-click-rb' ), … … 508 512 'opt_context_menu' => __( 'Stops the right-click menu, so visitors can\'t use "Save image as", "Copy", or "Inspect" from it. Doesn\'t stop keyboard shortcuts on its own.', 'disable-right-click-rb' ), 509 513 'opt_selection' => __( 'Prevents selecting/highlighting text with the mouse. Determined visitors can still view page source or use browser reader tools — no client-side technique fully prevents copying.', 'disable-right-click-rb' ), 510 'opt_copy' => __( 'Blocks the Ctrl/⌘+C, X, V and A keyboard shortcuts anywhere on the page, including inside text fields — so avoid turning this on for pages with forms or comment boxes.', 'disable-right-click-rb' ),514 'opt_copy' => __( 'Blocks the Ctrl/⌘+C, X, V and A keyboard shortcuts on the page. Form fields are left alone, so visitors can still paste into contact forms, comment boxes and login fields.', 'disable-right-click-rb' ), 511 515 'opt_drag' => __( 'Stops images being dragged onto the desktop or into another window. Doesn\'t affect right-click "Save image as" — combine with the context-menu option for that.', 'disable-right-click-rb' ), 512 516 'scope_selected' => __( 'Protection only applies on single pages of the content types you tick below. Archives, search results and the homepage stay unprotected.', 'disable-right-click-rb' ), -
disable-right-click-rb/trunk/disable-right-click-rb.php
r3735578 r3736541 4 4 Plugin URI: https://rbplugins.com/wordpress-plugins/disable-right-click-rb/ 5 5 Description: 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. 16 Version: 2.0.2 7 7 Author: rbPlugins 8 8 Author URI: https://profiles.wordpress.org/rbplugins/ … … 16 16 } 17 17 18 define( 'RB_DISABLE_RIGHT_CLICK_VERSION', '2.0. 1' );18 define( 'RB_DISABLE_RIGHT_CLICK_VERSION', '2.0.2' ); 19 19 define( 'RB_DISABLE_RIGHT_CLICK_PATH', plugin_dir_path( __FILE__ ) ); 20 20 define( 'RB_DISABLE_RIGHT_CLICK_URL', plugin_dir_url( __FILE__ ) ); -
disable-right-click-rb/trunk/readme.txt
r3735578 r3736541 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 2.0. 17 Stable tag: 2.0.2 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 18 18 19 19 📖 [Plugin Overview](https://rbplugins.com/wordpress-plugins/disable-right-click-rb/) | 📚 [Documentation](https://rbplugins.com/docs/disable-right-click-rb/) | 💎 [Pricing & PRO](https://rbplugins.com/wordpress-plugins/disable-right-click-rb/#pricing) 20 21 https://youtu.be/O1_dsh8faEU 20 22 21 23 🔒 **Why protect your content?** … … 95 97 = Is the "Block copy/cut/paste" option safe to use on pages with forms? = 96 98 97 That option blocks Ctrl/⌘+C, X, V and A anywhere on the page, including inside input fields — so avoid enabling it on pages with contact forms or comment boxes, or exempt the roles that need to fill them in.99 Yes. Since version 2.0.2 the copy, cut, paste and select-all shortcuts are blocked on the page content only: inside input fields, text areas and editable areas visitors can still type, select, copy and paste — so contact forms, comment boxes, checkout and login fields keep working. Right-click and text selection protection leave form fields alone in the same way. 98 100 99 101 = Does this plugin slow down my site? = … … 111 113 == Screenshots == 112 114 113 1. Protection tab — choose what to block, where, and who's exempt 114 2. Advanced tab — view-source blocking and DevTools detection 115 3. PRO — watermark tab (locked without the add-on, full controls with it) 116 4. PRO promo card on the settings screen 115 1. Protection tab — choose what to block (right click, text selection, copy shortcuts, image dragging), where protection applies, and which roles are exempt. 116 2. What visitors see — a short notice of your own when they try to right-click or drag a photo. 117 3. Advanced tab — view-source shortcut blocking and a DevTools indicator, with the PRO controls previewed in place. 118 4. PRO — image watermarking: your text or logo as a CSS overlay or embedded into the image file, with exclusions. 119 5. PRO — watermarked photos on the site, while exempt roles keep seeing the originals. 120 6. PRO — fine-grained control: precision scope, Opposite Mode, element allowlist and DevTools reaction. 117 121 118 122 == Changelog == 123 124 = 2.0.2 = 125 * Fixed: form fields stay usable — visitors can type, select, copy and paste in input fields, text areas and editable areas (contact forms, comments, checkout, login) while the page content stays protected 126 * Settings screen: edits are marked "Unsaved changes", "Settings saved." fades after a few seconds, and leaving the page with unsaved changes asks first 119 127 120 128 = 2.0.1 = … … 171 179 == Upgrade Notice == 172 180 173 = 2.0. 1=174 Settings screen polish: PRO options are previewed in place, fixed links to the plugin page and pricing.181 = 2.0.2 = 182 Copy and paste protection no longer blocks form fields: contact forms, comments and login fields keep working.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)