Plugin Directory

Changeset 3342511


Ignore:
Timestamp:
08/10/2025 07:53:29 PM (8 months ago)
Author:
devozon
Message:

Prepare trunk for v2.6.0

Location:
fense-block-vpn-proxy
Files:
91 added
13 edited

Legend:

Unmodified
Added
Removed
  • fense-block-vpn-proxy/trunk/admin/class-fense-bpvt-admin.php

    r3335460 r3342511  
    243243        $this->Fense_FUN->add_option( __( 'Enable cache', 'fense-block-vpn-proxy' ), 'enable_cache', 'select', 'checkbox', $data, 'tab_1', esc_html__( 'You can enable cache to lower the usage of Fense api requests', 'fense-block-vpn-proxy' ) );
    244244       
     245        $this->Fense_FUN->add_option( __( 'Enable Safe Mode', 'fense-block-vpn-proxy' ), 'cache_safe_mode', 'input', 'checkbox', null, 'tab_1', __( 'Enable this option only if you are using a WordPress caching plugin or a server-side caching system (e.g., Redis, Varnish, etc.) that caches website content.', 'fense-block-vpn-proxy' ) . '<br><br>' . __( 'When Safe Mode is active, the plugin operates after the content has loaded, ensuring full compatibility with any caching system.', 'fense-block-vpn-proxy' ) . '<br><br>' . __( 'Note: Safe Mode supports only one protection mode — Hide Content and Display a Message.', 'fense-block-vpn-proxy' ) );
     246       
    245247        add_settings_section(
    246248        // ID used to identify this section and with which to register options
     
    370372        );
    371373       
    372         $this->Fense_FUN->add_option( __( 'Enable IP Whitelisting', 'fense-block-vpn-proxy' ), 'ip_whitelisting_enable', 'input', 'checkbox','','tab_6' );
     374        $this->Fense_FUN->add_option( __( 'Enable IP Whitelisting', 'fense-block-vpn-proxy' ), 'ip_whitelisting_enable', 'input', 'checkbox', '', 'tab_6' );
    373375       
    374376        $this->Fense_FUN->add_option( __( 'IP Whitelisting', 'fense-block-vpn-proxy' ), 'ip_whitelisting', 'multi_input', 'checkbox', '', 'tab_6' );
     
    376378        $this->Fense_FUN->add_option( __( 'IP Whitelisting Range', 'fense-block-vpn-proxy' ), 'ip_whitelisting_range', 'ip_ranges', 'checkbox', '', 'tab_6' );
    377379       
    378         $this->Fense_FUN->add_option( __( 'Enable IP Blacklisting', 'fense-block-vpn-proxy' ), 'ip_blacklisting_enable', 'input', 'checkbox' ,'','tab_6' );
    379        
    380         $this->Fense_FUN->add_option( __( 'IP Blacklisting', 'fense-block-vpn-proxy' ), 'ip_blacklisting', 'multi_input', 'checkbox', '', 'tab_6');
    381        
    382         $this->Fense_FUN->add_option( __( 'IP Blacklisting Range', 'fense-block-vpn-proxy' ), 'ip_blacklisting_range', 'ip_ranges', 'checkbox', '', 'tab_6');
     380        $this->Fense_FUN->add_option( __( 'Enable IP Blacklisting', 'fense-block-vpn-proxy' ), 'ip_blacklisting_enable', 'input', 'checkbox', '', 'tab_6' );
     381       
     382        $this->Fense_FUN->add_option( __( 'IP Blacklisting', 'fense-block-vpn-proxy' ), 'ip_blacklisting', 'multi_input', 'checkbox', '', 'tab_6' );
     383       
     384        $this->Fense_FUN->add_option( __( 'IP Blacklisting Range', 'fense-block-vpn-proxy' ), 'ip_blacklisting_range', 'ip_ranges', 'checkbox', '', 'tab_6' );
    383385    }
    384386   
  • fense-block-vpn-proxy/trunk/fense-bpvt.php

    r3335460 r3342511  
    3535 * Plugin URI:        https://fense.in/
    3636 * Description:       With Fense You can easily Protect Your ads and Website From Bad Traffic that Leads To Destroy Your Rank and Force Ad Network To Close Your Account.
    37  * Version:           2.5.0
     37 * Version:           2.6.0
    3838 * Author:            Devozon
    3939 * Author URI:        https://devozon.com/
     
    4949}
    5050
    51 const FENSE_BPVT_VERSION = '2.5.0';
     51const FENSE_BPVT_VERSION = '2.6.0';
    5252const FENSE_BPVT_API_LINK = 'https://api.fense.in/';
    5353const FENSE_BPVT_MAIN_LINK = 'https://fense.in/';
     54const FENSE_BPVT_PLUGIN_KEY = 'FENSE_BPVT_';
    5455
    5556//? Activate plugin
     
    5859//? Deactivate plugin
    5960require_once plugin_dir_path( __FILE__ ) . 'includes/system/fense-bpvt-deactivate-plugin.php';
    60 
    6161
    6262//? Core
     
    7777//? plugin run Class
    7878require_once plugin_dir_path( __FILE__ ) . 'includes/core/class-fense-bpvt-run.php';
     79require_once plugin_dir_path( __FILE__ ) . 'includes/core/class-fense-bpvt-run-save-mode.php';
    7980
    8081//? plugin Stats Class
     
    9697require_once plugin_dir_path( __FILE__ ) . 'includes/system/fense-bpvt-api-call.php';
    9798
     99require_once plugin_dir_path( __FILE__ ) . 'includes/system/fense-bpvt-cache-safe-mode.php';
     100
    98101register_activation_hook( __FILE__, 'FENSE_BPVT_activate' );
    99102
  • fense-block-vpn-proxy/trunk/includes/class-fense-bpvt-admin-inputs.php

    r3334974 r3342511  
    393393            $lpout = '<label class="switch"><input type="' . esc_attr( $args['subtype'] ) . '" id="' . esc_attr( $args['id'] ) . '" "' . esc_attr( $args['required'] ) . '" name="' . esc_attr( $args['name'] ) . '" size="40" value="1" ' . $checked . ' /><span class="slider round"></span></label>';
    394394           
     395            $lpout .= (!empty($args['comment'])) ? '<div class="mt-2">' . $args['comment'] . '</div>' : '';
     396           
    395397            echo self::tg_esc_html( $lpout );
    396398           
  • fense-block-vpn-proxy/trunk/includes/class-fense-bpvt-deactivator.php

    r3026592 r3342511  
    4040 */
    4141
    42 if (!defined('ABSPATH')) exit; // Exit if accessed directly
     42if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    4343
    4444
    4545class FENSE_BPVT_Deactivator
    4646{
    47 
    48     /**
    49     * Short Description. (use period)
    50     *
    51     * Long Description.
    52     *
    53     * @since    1.0.0
    54     */
    55     public static function deactivate()
    56     {
    57 
    58     }
    59 
     47   
     48    /**
     49    * Short Description. (use period)
     50    *
     51    * Long Description.
     52    *
     53    * @since    1.0.0
     54    */
     55    public static function deactivate()
     56    {
     57   
     58    }
     59   
    6060}
  • fense-block-vpn-proxy/trunk/includes/class-fense-bpvt.php

    r3334974 r3342511  
    4747 */
    4848
    49 if (!defined('ABSPATH')) exit; // Exit if accessed directly
     49if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    5050
    5151class FENSE_BPVT
    5252{
    53 
    54     /**
    55      * The loader that's responsible for maintaining and registering all hooks that power
    56      * the plugin.
    57      *
    58      * @since    1.0.0
    59      * @access   protected
    60      * @var      FENSE_BPVT_Loader $loader Maintains and registers all hooks for the plugin.
    61      */
    62     protected $loader;
    63 
    64     /**
    65      * The unique identifier of this plugin.
    66      *
    67      * @since    1.0.0
    68      * @access   protected
    69      * @var      string $plugin_name The string used to uniquely identify this plugin.
    70      */
    71     protected $plugin_name;
    72 
    73     /**
    74      * The current version of the plugin.
    75      *
    76      * @since    1.0.0
    77      * @access   protected
    78      * @var      string $version The current version of the plugin.
    79      */
    80     protected $version;
    81 
    82     /**
    83      * Define the core functionality of the plugin.
    84      *
    85      * Set the plugin name and the plugin version that can be used throughout the plugin.
    86      * Load the dependencies, define the locale, and set the hooks for the admin area and
    87      * the public-facing side of the site.
    88      *
    89      * @since    1.0.0
    90      */
    91     public function __construct()
    92     {
    93         if (defined('FENSE_BPVT_VERSION')) {
    94             $this->version = FENSE_BPVT_VERSION;
    95         } else {
    96             $this->version = '1.0.0';
    97         }
    98         $this->plugin_name = 'fense-bpvt';
    99 
    100         $this->load_dependencies();
    101         $this->set_locale();
    102         $this->define_admin_hooks();
    103         $this->define_public_hooks();
    104 
    105     }
    106 
    107     /**
    108      * Load the required dependencies for this plugin.
    109      *
    110      * Include the following files that make up the plugin:
    111      *
    112      * - FENSE_BPVT_Loader. Orchestrates the hooks of the plugin.
    113      * - FENSE_BPVT_i18n. Defines internationalization functionality.
    114      * - FENSE_BPVT_Admin. Defines all hooks for the admin area.
    115      * - FENSE_BPVT_Public. Defines all hooks for the public side of the site.
    116      *
    117      * Create an instance of the loader which will be used to register the hooks
    118      * with WordPress.
    119      *
    120      * @since    1.0.0
    121      * @access   private
    122      */
    123     private function load_dependencies()
    124     {
    125 
    126         /**
    127          * The class responsible for orchestrating the actions and filters of the
    128          * core plugin.
    129          */
    130         require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-fense-bpvt-loader.php';
    131 
    132         /**
    133          * The class responsible for defining internationalization functionality
    134          * of the plugin.
    135          */
    136         require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-fense-bpvt-i18n.php';
    137 
    138         /**
    139          * The class responsible for defining all actions that occur in the admin area.
    140          */
    141         require_once plugin_dir_path(dirname(__FILE__)) . 'admin/class-fense-bpvt-admin.php';
    142 
    143         /**
    144          * The class responsible for defining all actions that occur in the public-facing
    145          * side of the site.
    146          */
     53   
     54    /**
     55     * The loader that's responsible for maintaining and registering all hooks that power
     56     * the plugin.
     57     *
     58     * @since    1.0.0
     59     * @access   protected
     60     * @var      FENSE_BPVT_Loader $loader Maintains and registers all hooks for the plugin.
     61     */
     62    protected $loader;
     63   
     64    /**
     65     * The unique identifier of this plugin.
     66     *
     67     * @since    1.0.0
     68     * @access   protected
     69     * @var      string $plugin_name The string used to uniquely identify this plugin.
     70     */
     71    protected $plugin_name;
     72   
     73    /**
     74     * The current version of the plugin.
     75     *
     76     * @since    1.0.0
     77     * @access   protected
     78     * @var      string $version The current version of the plugin.
     79     */
     80    protected $version;
     81   
     82    /**
     83     * Define the core functionality of the plugin.
     84     *
     85     * Set the plugin name and the plugin version that can be used throughout the plugin.
     86     * Load the dependencies, define the locale, and set the hooks for the admin area and
     87     * the public-facing side of the site.
     88     *
     89     * @since    1.0.0
     90     */
     91    public function __construct()
     92    {
     93        if ( defined( 'FENSE_BPVT_VERSION' ) ) {
     94            $this->version = FENSE_BPVT_VERSION;
     95        } else {
     96            $this->version = '1.0.0';
     97        }
     98        $this->plugin_name = 'fense-bpvt';
     99       
     100        $this->load_dependencies();
     101        $this->set_locale();
     102        $this->define_admin_hooks();
     103        $this->define_public_hooks();
     104       
     105    }
     106   
     107    /**
     108     * The name of the plugin used to uniquely identify it within the context of
     109     * WordPress and to define internationalization functionality.
     110     *
     111     * @return    string    The name of the plugin.
     112     * @since     1.0.0
     113     */
     114    public function get_plugin_name()
     115    {
     116        return $this->plugin_name;
     117    }
     118   
     119    /**
     120     * Retrieve the version number of the plugin.
     121     *
     122     * @return    string    The version number of the plugin.
     123     * @since     1.0.0
     124     */
     125    public function get_version()
     126    {
     127        return $this->version;
     128    }
     129   
     130    public function fense_enqueue_public_scripts(): void
     131    {
     132        if ( is_admin() ) {
     133            return;
     134        }
     135       
     136        if ( !get_option( 'FENSE_BPVT_DEVOZON_cache_safe_mode' ) ) return;
     137       
     138        $id = $this->plugin_name . '-scan';
     139       
     140        wp_register_script(
     141            $id,
     142            plugins_url( 'js/' . $id . '.js', __FILE__ ),
     143            [],        // deps (add 'jquery' if needed)
     144            $this->version,
     145            false            // load in footer
     146        );
     147       
     148        // Optional: pass data to the script (use REST endpoint or admin-ajax.php)
     149        wp_localize_script( $id, str_replace( '-', '_', $id ), [
     150            'ajax' => esc_url_raw( admin_url( 'admin-ajax.php' ) ),
     151            'key' => esc_html( FENSE_BPVT_PLUGIN_KEY ),
     152        ] );
     153       
     154        wp_enqueue_script( $id );
     155    }
     156   
     157    /**
     158     * Run the loader to execute all of the hooks with WordPress.
     159     *
     160     * @since    1.0.0
     161     */
     162    public function run()
     163    {
     164        $this->loader->run();
     165    }
     166   
     167    /**
     168     * The reference to the class that orchestrates the hooks with the plugin.
     169     *
     170     * @return    FENSE_BPVT_Loader    Orchestrates the hooks of the plugin.
     171     * @since     1.0.0
     172     */
     173    public function get_loader()
     174    {
     175        return $this->loader;
     176    }
     177   
     178    /**
     179     * Load the required dependencies for this plugin.
     180     *
     181     * Include the following files that make up the plugin:
     182     *
     183     * - FENSE_BPVT_Loader. Orchestrates the hooks of the plugin.
     184     * - FENSE_BPVT_i18n. Defines internationalization functionality.
     185     * - FENSE_BPVT_Admin. Defines all hooks for the admin area.
     186     * - FENSE_BPVT_Public. Defines all hooks for the public side of the site.
     187     *
     188     * Create an instance of the loader which will be used to register the hooks
     189     * with WordPress.
     190     *
     191     * @since    1.0.0
     192     * @access   private
     193     */
     194    private function load_dependencies()
     195    {
     196       
     197        /**
     198         * The class responsible for orchestrating the actions and filters of the
     199         * core plugin.
     200         */
     201        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-fense-bpvt-loader.php';
     202       
     203        /**
     204         * The class responsible for defining internationalization functionality
     205         * of the plugin.
     206         */
     207        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-fense-bpvt-i18n.php';
     208       
     209        /**
     210         * The class responsible for defining all actions that occur in the admin area.
     211         */
     212        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-fense-bpvt-admin.php';
     213       
     214        /**
     215         * The class responsible for defining all actions that occur in the public-facing
     216         * side of the site.
     217         */
    147218//        require_once plugin_dir_path(dirname(__FILE__)) . 'public/class-fense-bpvt-public.php';
    148 
    149         $this->loader = new FENSE_BPVT_Loader();
    150 
    151     }
    152 
    153     /**
    154      * Define the locale for this plugin for internationalization.
    155      *
    156      * Uses the FENSE_BPVT_i18n class in order to set the domain and to register the hook
    157      * with WordPress.
    158      *
    159      * @since    1.0.0
    160      * @access   private
    161      */
    162     private function set_locale()
    163     {
    164 
    165         $plugin_i18n = new FENSE_BPVT_i18n();
    166 
    167         $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');
    168 
    169     }
    170 
    171     /**
    172      * Register all of the hooks related to the admin area functionality
    173      * of the plugin.
    174      *
    175      * @since    1.0.0
    176      * @access   private
    177      */
    178     private function define_admin_hooks()
    179     {
    180 
    181         $plugin_admin = new FENSE_BPVT_Admin($this->get_plugin_name(), $this->get_version());
    182 
    183         $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');
    184         $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts');
    185 
    186     }
    187 
    188     /**
    189      * The name of the plugin used to uniquely identify it within the context of
    190      * WordPress and to define internationalization functionality.
    191      *
    192      * @return    string    The name of the plugin.
    193      * @since     1.0.0
    194      */
    195     public function get_plugin_name()
    196     {
    197         return $this->plugin_name;
    198     }
    199 
    200     /**
    201      * Retrieve the version number of the plugin.
    202      *
    203      * @return    string    The version number of the plugin.
    204      * @since     1.0.0
    205      */
    206     public function get_version()
    207     {
    208         return $this->version;
    209     }
    210 
    211     /**
    212      * Register all of the hooks related to the public-facing functionality
    213      * of the plugin.
    214      *
    215      * @since    1.0.0
    216      * @access   private
    217      */
    218     private function define_public_hooks()
    219     {
    220 
    221 //        $plugin_public = new FENSE_BPVT_Public($this->get_plugin_name(), $this->get_version());
    222 //
    223 //        $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles');
    224 //        $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts');
    225 
    226     }
    227 
    228     /**
    229      * Run the loader to execute all of the hooks with WordPress.
    230      *
    231      * @since    1.0.0
    232      */
    233     public function run()
    234     {
    235         $this->loader->run();
    236     }
    237 
    238     /**
    239      * The reference to the class that orchestrates the hooks with the plugin.
    240      *
    241      * @return    FENSE_BPVT_Loader    Orchestrates the hooks of the plugin.
    242      * @since     1.0.0
    243      */
    244     public function get_loader()
    245     {
    246         return $this->loader;
    247     }
    248 
     219       
     220        $this->loader = new FENSE_BPVT_Loader();
     221       
     222    }
     223   
     224    /**
     225     * Define the locale for this plugin for internationalization.
     226     *
     227     * Uses the FENSE_BPVT_i18n class in order to set the domain and to register the hook
     228     * with WordPress.
     229     *
     230     * @since    1.0.0
     231     * @access   private
     232     */
     233    private function set_locale()
     234    {
     235       
     236        $plugin_i18n = new FENSE_BPVT_i18n();
     237       
     238        $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
     239       
     240    }
     241   
     242    /**
     243     * Register all of the hooks related to the admin area functionality
     244     * of the plugin.
     245     *
     246     * @since    1.0.0
     247     * @access   private
     248     */
     249    private function define_admin_hooks()
     250    {
     251       
     252        $plugin_admin = new FENSE_BPVT_Admin( $this->get_plugin_name(), $this->get_version() );
     253       
     254        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
     255        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
     256       
     257    }
     258   
     259    /**
     260     * Register all of the hooks related to the public-facing functionality
     261     * of the plugin.
     262     *
     263     * @since    1.0.0
     264     * @access   private
     265     */
     266    private function define_public_hooks()
     267    {
     268       
     269        $this->loader->add_action( 'wp_enqueue_scripts', $this, 'fense_enqueue_public_scripts', 0 );
     270    }
     271   
    249272}
  • fense-block-vpn-proxy/trunk/includes/core/class-fense-bpvt-functions.php

    r3334974 r3342511  
    2525class FENSE_BPVT_FUN
    2626{
     27    private static bool $hasRun = false;
    2728   
    2829    public function IsKeyValid(): bool
     
    503504    {
    504505        return '<span id="fense-bpvt-settings-page"
    505                   data-s1="'. esc_html__( 'Settings error.' , 'fense-block-vpn-proxy' ).'"
    506                   data-s2="'. esc_html__( 'saving', 'fense-block-vpn-proxy' ) .'"
    507                   data-s3="'. esc_url( admin_url( '/options.php' ) ) .'"
    508                   data-s4="'. esc_html__( 'Save Changes', 'fense-block-vpn-proxy' ).'"
    509                   data-s5="'. esc_html__( 'Settings saved.', 'fense-block-vpn-proxy' ).'"
    510                   data-s6="'. esc_url( admin_url( 'admin-ajax.php' ) ) .'"
     506                  data-s1="' . esc_html__( 'Settings error.', 'fense-block-vpn-proxy' ) . '"
     507                  data-s2="' . esc_html__( 'saving', 'fense-block-vpn-proxy' ) . '"
     508                  data-s3="' . esc_url( admin_url( '/options.php' ) ) . '"
     509                  data-s4="' . esc_html__( 'Save Changes', 'fense-block-vpn-proxy' ) . '"
     510                  data-s5="' . esc_html__( 'Settings saved.', 'fense-block-vpn-proxy' ) . '"
     511                  data-s6="' . esc_url( admin_url( 'admin-ajax.php' ) ) . '"
    511512                ></span>';
    512513    }
     514   
     515    public static function runOnce(): bool
     516    {
     517        if ( self::$hasRun ) {
     518            return true;
     519        }
     520        self::$hasRun = true;
     521       
     522        return false;
     523    }
     524   
     525    public static function cleanUP(): bool
     526    {
     527        $transient = get_transient( 'fense_bpvt_clean_up' );
     528       
     529        if ( $transient ) return false;
     530       
     531        /** Clean Up and optimize */
     532        if ( function_exists( 'delete_expired_transients' ) ) {
     533            // true -> force DB cleanup (needed when object cache is in use)
     534            delete_expired_transients( true );
     535        }
     536       
     537        set_transient( 'fense_bpvt_clean_up', 'done', 3600 );
     538       
     539        return true;
     540    }
     541   
    513542}
  • fense-block-vpn-proxy/trunk/includes/core/class-fense-bpvt-run.php

    r3334974 r3342511  
    108108    }
    109109   
    110     public function cleanUP(): bool
    111     {
    112         $transient = get_transient( 'fense_bpvt_clean_up' );
    113        
    114         if ( $transient ) return false;
    115        
    116         /** Clean Up and optimize */
    117         $this->__delete_expired_transients( 'bpvt_' );
    118        
    119         set_transient( 'fense_bpvt_clean_up', 'done', 3600 );
    120        
    121         return true;
    122     }
    123    
    124     public static function __delete_expired_transients( string $prefix, int $batch_size = 10000 ): void
    125     {
    126         global $wpdb;
    127         $time = time();
    128         $opt_table = $wpdb->options;
    129         $like_timeout = $wpdb->esc_like( '_transient_timeout_' . $prefix ) . '%';
    130        
    131         do {
    132             // 1) Fetch up to $batch_size expired timeout keys
    133             $timeout_keys = $wpdb->get_col( $wpdb->prepare(
    134                 "SELECT option_name
    135              FROM {$opt_table}
    136              WHERE option_name LIKE %s
    137                AND option_value < %d
    138              LIMIT %d",
    139                 $like_timeout,
    140                 $time,
    141                 $batch_size
    142             ) );
    143            
    144             if ( empty( $timeout_keys ) ) {
    145                 break;
    146             }
    147            
    148             // Build list of paired transient names
    149             $transient_keys = array_map(
    150                 fn( $k ) => str_replace( '_transient_timeout_', '_transient_', $k ),
    151                 $timeout_keys
    152             );
    153            
    154             // Merge both sets for deletion
    155             $all_keys = array_merge( $timeout_keys, $transient_keys );
    156             $placeholders = implode( ',', array_fill( 0, count( $all_keys ), '%s' ) );
    157            
    158             // 2) Delete them in one query
    159             $wpdb->query(
    160                 $wpdb->prepare(
    161                     "DELETE FROM {$opt_table}
    162                  WHERE option_name IN ({$placeholders})",
    163                     ...$all_keys
    164                 )
    165             );
    166            
    167             // Repeat until no more expired
    168         } while ( count( $timeout_keys ) === $batch_size );
    169     }
    170    
    171110    public function __isDailyLimitReached(): bool
    172111    {
     
    339278        /** Run Clean UP only on Proxy */
    340279        if ( $this->ipData->proxy == 'yes' ) {
     280           
    341281            /** Clean UP */
    342             $this->cleanUP();
     282            FENSE_BPVT_FUN::cleanUP();
    343283        }
    344284       
     
    388328    public function __Whitelist(): bool
    389329    {
    390         if ( empty($this->settings->ip_whitelisting_enable) ) {
    391             return false;
    392         }
    393        
    394         $allowed = array_map('trim', explode(',', $this->settings->ip_whitelisting));
    395        
    396         if (in_array($this->ip, $allowed, true)) {
     330        if ( empty( $this->settings->ip_whitelisting_enable ) ) {
     331            return false;
     332        }
     333       
     334        $allowed = array_map( 'trim', explode( ',', $this->settings->ip_whitelisting ) );
     335       
     336        if ( in_array( $this->ip, $allowed, true ) ) {
    397337            // IP is in the list
    398338            return true;
    399339        }
    400340       
    401         $ipLong = ip2long($this->ip);
     341        $ipLong = ip2long( $this->ip );
    402342       
    403343        // if no Data break
    404         if (empty($this->settings->ip_whitelisting_range)) return false;
    405        
    406         foreach ($this->settings->ip_whitelisting_range as $range) {
    407             $from = ip2long($range['from']);
    408             $to   = ip2long($range['to']);
    409             if ($ipLong >= $from && $ipLong <= $to) {
     344        if ( empty( $this->settings->ip_whitelisting_range ) ) return false;
     345       
     346        foreach ( $this->settings->ip_whitelisting_range as $range ) {
     347            $from = ip2long( $range['from'] );
     348            $to = ip2long( $range['to'] );
     349            if ( $ipLong >= $from && $ipLong <= $to ) {
    410350                return true;
    411351            }
     
    417357    public function __Blacklist()
    418358    {
    419         if ( empty($this->settings->ip_blacklisting_enable) ) {
    420             return false;
    421         }
    422        
    423         $blocked = array_map('trim', explode(',', $this->settings->ip_blacklisting));
     359        if ( empty( $this->settings->ip_blacklisting_enable ) ) {
     360            return false;
     361        }
     362       
     363        $blocked = array_map( 'trim', explode( ',', $this->settings->ip_blacklisting ) );
    424364        $this->ipData->proxy = 'yes';
    425365       
    426         if (in_array($this->ip, $blocked, true)) {
     366        if ( in_array( $this->ip, $blocked, true ) ) {
    427367            // IP is in the list
    428368            return $this->__protection_mode();
    429369        }
    430370       
    431         $ipLong = ip2long($this->ip);
     371        $ipLong = ip2long( $this->ip );
    432372       
    433373        // if no Data break
    434         if (empty($this->settings->ip_blacklisting_range)) return false;
    435        
    436         foreach ($this->settings->ip_blacklisting_range as $range) {
    437             $from = ip2long($range['from']);
    438             $to   = ip2long($range['to']);
    439             if ($ipLong >= $from && $ipLong <= $to) {
     374        if ( empty( $this->settings->ip_blacklisting_range ) ) return false;
     375       
     376        foreach ( $this->settings->ip_blacklisting_range as $range ) {
     377            $from = ip2long( $range['from'] );
     378            $to = ip2long( $range['to'] );
     379            if ( $ipLong >= $from && $ipLong <= $to ) {
    440380                return $this->__protection_mode();
    441381            }
  • fense-block-vpn-proxy/trunk/includes/system/fense-bpvt-activate-plugin.php

    r3335460 r3342511  
    5656    add_option( $key . 'ip_whitelisting_enable', false );
    5757    add_option( $key . 'ip_blacklisting_enable', false );
     58   
     59    add_option( $key . 'cache_safe_mode', false );
    5860}
  • fense-block-vpn-proxy/trunk/includes/system/fense-bpvt-api-call.php

    r3335460 r3342511  
    3434function FENSE_BPVT_detection()
    3535{
    36     /**  RAN OPTIONS */
    37     static $ran = false;
    38     if ( $ran ) return null;
    39    
    40     /**  Load Once */
    41     $ran = true;
    42    
    4336    /**  Load Settings Class */
    4437    $RUN = new FENSE_BPVT_RUN();
     
    4942    /**  Disable on Logged in Or admin */
    5043    if ( $RUN->__isAdminOrLoggedIn() ) return null;
     44   
     45    /**  RAN OPTIONS */
     46    if ( FENSE_BPVT_FUN::runOnce() ) return null;
    5147   
    5248    /**  Disable on Daily Limit Reached */
     
    8682    return $RUN->__protection_mode();
    8783}
    88 
  • fense-block-vpn-proxy/trunk/includes/system/fense-bpvt-plugin-updates.php

    r3335460 r3342511  
    3030    if ( version_compare( $saved, FENSE_BPVT_VERSION, '<' ) ) {
    3131       
    32         update_option( $key . 'ip_whitelisting_enable', false );
    33         update_option( $key . 'ip_blacklisting_enable', false );
     32        update_option( $key . 'cache_safe_mode', false );
    3433       
    3534        // run your update code here
  • fense-block-vpn-proxy/trunk/languages/fense-block-vpn-proxy-ar.po

    r3334974 r3342511  
    33"Project-Id-Version: fense-block-vpn-proxy\n"
    44"POT-Creation-Date: 2021-12-04 13:17+0200\n"
    5 "PO-Revision-Date: 2025-07-27 21:38+0300\n"
     5"PO-Revision-Date: 2025-08-10 18:42+0300\n"
    66"Last-Translator: \n"
    77"Language-Team: \n"
     
    504504msgstr "خطا في حفظ الاعدادات"
    505505
     506#: admin/partials/fense-bpvt-admin-display.php:32
     507msgid "Enable Safe Mode"
     508msgstr "تفعيل الوضع الامن"
     509
     510#: admin/partials/fense-bpvt-admin-display.php:32
     511msgid "Enable this option only if you are using a WordPress caching plugin or a server-side caching system (e.g., Redis, Varnish, etc.) that caches website content."
     512msgstr "قم بتمكين هذا الخيار فقط إذا كنت تستخدم اضافات للكاش لـ WordPress أو نظام كاش في السيرفر (على سبيل المثال، Redis، Varnish، وما إلى ذلك) يخزن محتوى موقع الويب مؤقتًا ( كاش للمحتوي )."
     513
     514#: admin/partials/fense-bpvt-admin-display.php:32
     515msgid "When Safe Mode is active, the plugin operates after the content has loaded, ensuring full compatibility with any caching system."
     516msgstr "عندما يكون الوضع الآمن نشطًا، تعمل الاضافة بعد تحميل المحتوى، مما يضمن التوافق الكامل مع أي نظام تخزين مؤقت ( اضافات الكاش )."
     517
     518#: admin/partials/fense-bpvt-admin-display.php:32
     519msgid "Note: Safe Mode supports only one protection mode — Hide Content and Display a Message."
     520msgstr "ملاحظة: يدعم الوضع الآمن وضع حماية واحد فقط — إخفاء المحتوى وعرض رسالة."
     521
    506522#: includes/system/fense-bpvt-check-version.php:32
    507523msgid "Hello, there is a new version of Fense extension."
  • fense-block-vpn-proxy/trunk/readme.txt

    r3335460 r3342511  
    55Tested up to: 6.8.2
    66Requires PHP: 7.4
    7 Stable tag: 2.5.0
     7Stable tag: 2.6.0
    88License: GPLv2
    99
Note: See TracChangeset for help on using the changeset viewer.