Plugin Directory

Changeset 3028595


Ignore:
Timestamp:
01/30/2024 08:09:36 AM (23 months ago)
Author:
viitorcloudvc
Message:

Update plugin files and test with the latest WordPress version

Location:
wp-code-protection/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-code-protection/trunk/README.txt

    r2894205 r3028595  
    44Tags: Security, Threat, Rightclick disable, Disable CTRL A, C, X, U, S, and P, content protection
    55Requires at least: 3.8
    6 Tested up to: 6.2
     6Tested up to: 6.4.2
    77Stable tag: trunk
    88
  • wp-code-protection/trunk/index.php

    r2025636 r3028595  
    11<?php
    22// Silence is golden.
    3 ?>
  • wp-code-protection/trunk/source-code-protection.php

    r2598028 r3028595  
    11<?php
    2 /*  Plugin Name: Source Code Protection
    3     Plugin URI: https://viitorcloud.com/blog/
    4     Description: It prevents common techniques in protecting your code from being stolen.
    5     Version: 1.0.0
    6     Author:Viitorcloud
    7     Author URI:https://viitorcloud.com/
    8     */   
    92/**
    10  * Basic plugin definitions
    11  *
     3 * Plugin Name: Source Code Protection
     4 * Plugin URI: https://viitorcloud.com/blog/
     5 * Description: It prevents common techniques in protecting your code from being stolen.
     6 * Version: 2.0.0
     7 * Author: Viitorcloud
     8 * Author URI: https://viitorcloud.com/
     9 *
     10 * Basic plugin definitions
     11 *
    1212 * @package Source Code Protection
    1313 * @since 1.0.0
    1414 */
    1515
    16 // Exit if accessed directly
    17 if ( !defined( 'ABSPATH' ) ) exit;
     16// Exit if accessed directly.
     17if ( ! defined( 'ABSPATH' ) ) {
     18    exit;
     19}
    1820
    19 global $wpdb; 
     21global $wpdb;
    2022/**
    2123 * Activation hook
    22  * 
     24 *
    2325 * Register plugin activation hook.
    24  * 
     26 *
    2527 * @package Source Code Protection
    2628 * @since 1.0.0
     
    3234 *
    3335 * Register plugin deactivation hook.
    34  * 
     36 *
    3537 * @package Source Code Protection
    3638 * @since 1.0.0
     
    3941
    4042/**
    41  * Plugin Setup Activation hook call back 
     43 * Plugin Setup Activation hook call back
    4244 *
    43  * Initial setup of the plugin setting default options 
     45 * Initial setup of the plugin setting default options
    4446 * and database tables creations.
    45  * 
     47 *
    4648 * @package Source Code Protection
    4749 * @since 1.0.0
    4850 */
    4951function source_code_protection_install() {
    50    
     52
    5153    global $wpdb;
    52        
    5354}
    5455
     
    6364 */
    6465function source_code_protection_uninstall() {
    65    
     66
    6667    global $wpdb;
    67            
    6868}
    6969
     
    7676 * @since 1.0.0
    7777 */
    78 add_filter( 'body_class','source_code_protection_body_classes', 999 );
    79 add_action('wp_head', 'source_code_protection_wp_head');
     78add_filter( 'body_class', 'source_code_protection_body_classes', 999 );
     79add_action( 'wp_head', 'source_code_protection_wp_head' );
    8080
    81 /* add class to body tag */
    82 function source_code_protection_body_classes( $classes )
    83 {
    84     $classes[] = 'oncontextmenu';
     81/**
     82 * Add class to body tag.
     83 *
     84 * @param array $classes The current body classes.
     85 * @return array The modified body classes.
     86 */
     87function source_code_protection_body_classes( $classes ) {
     88    $classes[] = 'oncontextmenu';
    8589
    86     return $classes;
     90    return $classes;
    8791}
    8892/**
     
    9498 * @since 1.0.0
    9599 */
    96 function source_code_protection_wp_head(){ ?>
     100function source_code_protection_wp_head() {
     101    ?>
    97102<script type='text/javascript'> $ = jQuery;
    98103$(document).ready(function(){
    99   $(document).contextmenu(function() {
    100       return false;
    101   });
     104    $(document).contextmenu(function() {
     105        return false;
     106    });
    102107});
    103108
    104109$('img').bind('oncontextmenu', function(e) {
    105     return false;
    106 }); 
     110    return false;
     111});
    107112document.onkeydown = function(e) {
    108     if(e.keyCode == 123) {
    109         return false;
    110     }
    111     if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)){
    112         return false;
    113     }
    114     if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)){
    115         return false;
    116     }
    117     if(e.ctrlKey && e.shiftKey && e.keyCode == 'K'.charCodeAt(0)){
    118         return false;
    119     }
    120     if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)){
    121         return false;
    122     }
    123     if(e.ctrlKey && e.keyCode == 'S'.charCodeAt(0)){
    124         return false;
    125     }
    126     if(e.ctrlKey && e.keyCode == 'C'.charCodeAt(0)){
    127         return false;
    128     }
    129     if(e.ctrlKey && e.keyCode == 'V'.charCodeAt(0)){   
    130         return false;
    131     }
    132     if(e.ctrlKey && e.keyCode == 'A'.charCodeAt(0)){
    133         return false;
    134     }
    135     if(e.ctrlKey && e.keyCode == 'P'.charCodeAt(0)){
    136         return false;
    137     }
     113    if(e.keyCode == 123) {
     114        return false;
     115    }
     116    if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)){
     117        return false;
     118    }
     119    if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)){
     120        return false;
     121    }
     122    if(e.ctrlKey && e.shiftKey && e.keyCode == 'K'.charCodeAt(0)){
     123        return false;
     124    }
     125    if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)){
     126        return false;
     127    }
     128    if(e.ctrlKey && e.keyCode == 'S'.charCodeAt(0)){
     129        return false;
     130    }
     131    if(e.ctrlKey && e.keyCode == 'C'.charCodeAt(0)){
     132        return false;
     133    }
     134    if(e.ctrlKey && e.keyCode == 'V'.charCodeAt(0)){
     135        return false;
     136    }
     137    if(e.ctrlKey && e.keyCode == 'A'.charCodeAt(0)){
     138        return false;
     139    }
     140    if(e.ctrlKey && e.keyCode == 'P'.charCodeAt(0)){
     141        return false;
     142    }
    138143}
    139144</script>
Note: See TracChangeset for help on using the changeset viewer.