Changeset 3342511
- Timestamp:
- 08/10/2025 07:53:29 PM (8 months ago)
- Location:
- fense-block-vpn-proxy
- Files:
-
- 91 added
- 13 edited
-
tags/2.6.0 (added)
-
tags/2.6.0/admin (added)
-
tags/2.6.0/admin/class-fense-bpvt-admin.php (added)
-
tags/2.6.0/admin/css (added)
-
tags/2.6.0/admin/css/bootstrap-tagsinput.css (added)
-
tags/2.6.0/admin/css/fense-bpvt-admin.css (added)
-
tags/2.6.0/admin/css/fense-bpvt-mdb.css (added)
-
tags/2.6.0/admin/index.php (added)
-
tags/2.6.0/admin/js (added)
-
tags/2.6.0/admin/js/apex-chart.js (added)
-
tags/2.6.0/admin/js/bootstrap-tagsinput.min.js (added)
-
tags/2.6.0/admin/js/bootstrap.min.js (added)
-
tags/2.6.0/admin/js/bootstrap.min.js.map (added)
-
tags/2.6.0/admin/js/chart.js (added)
-
tags/2.6.0/admin/js/fense-bpvt-admin.js (added)
-
tags/2.6.0/admin/js/fense-bpvt-options.js (added)
-
tags/2.6.0/admin/js/ms.js (added)
-
tags/2.6.0/admin/partials (added)
-
tags/2.6.0/admin/partials/fense-bpvt-admin-display.php (added)
-
tags/2.6.0/admin/partials/fense-bpvt-admin-settings-display.php (added)
-
tags/2.6.0/admin/theme (added)
-
tags/2.6.0/admin/theme/css (added)
-
tags/2.6.0/admin/theme/css/app-rtl.min.css (added)
-
tags/2.6.0/admin/theme/css/app.min.css (added)
-
tags/2.6.0/admin/theme/css/bootstrap-rtl.min.css (added)
-
tags/2.6.0/admin/theme/css/bootstrap.min.css (added)
-
tags/2.6.0/admin/theme/css/custom.min.css (added)
-
tags/2.6.0/admin/theme/css/icons.min.css (added)
-
tags/2.6.0/admin/theme/fonts (added)
-
tags/2.6.0/admin/theme/fonts/boxicons.eot (added)
-
tags/2.6.0/admin/theme/fonts/boxicons.ttf (added)
-
tags/2.6.0/admin/theme/fonts/boxicons.woff (added)
-
tags/2.6.0/admin/theme/fonts/hkgrotesk-regular.woff (added)
-
tags/2.6.0/admin/theme/fonts/la-brands-400.eot (added)
-
tags/2.6.0/admin/theme/fonts/la-brands-400.ttf (added)
-
tags/2.6.0/admin/theme/fonts/la-brands-400.woff (added)
-
tags/2.6.0/admin/theme/fonts/la-brands-400d41d.eot (added)
-
tags/2.6.0/admin/theme/fonts/la-regular-400.eot (added)
-
tags/2.6.0/admin/theme/fonts/la-regular-400.ttf (added)
-
tags/2.6.0/admin/theme/fonts/la-regular-400.woff (added)
-
tags/2.6.0/admin/theme/fonts/la-regular-400d41d.eot (added)
-
tags/2.6.0/admin/theme/fonts/la-solid-900.eot (added)
-
tags/2.6.0/admin/theme/fonts/la-solid-900.ttf (added)
-
tags/2.6.0/admin/theme/fonts/la-solid-900.woff (added)
-
tags/2.6.0/admin/theme/fonts/la-solid-900d41d.eot (added)
-
tags/2.6.0/admin/theme/fonts/materialdesignicons-webfont1d2d.eot (added)
-
tags/2.6.0/admin/theme/fonts/materialdesignicons-webfont1d2d.ttf (added)
-
tags/2.6.0/admin/theme/fonts/materialdesignicons-webfont1d2d.woff (added)
-
tags/2.6.0/admin/theme/fonts/materialdesignicons-webfontd41d.eot (added)
-
tags/2.6.0/admin/theme/fonts/remixicondf6d.eot (added)
-
tags/2.6.0/admin/theme/fonts/remixicondf6d.ttf (added)
-
tags/2.6.0/admin/theme/fonts/remixicondf6d.woff (added)
-
tags/2.6.0/fense-bpvt.php (added)
-
tags/2.6.0/includes (added)
-
tags/2.6.0/includes/class-fense-bpvt-admin-inputs.php (added)
-
tags/2.6.0/includes/class-fense-bpvt-deactivator.php (added)
-
tags/2.6.0/includes/class-fense-bpvt-i18n.php (added)
-
tags/2.6.0/includes/class-fense-bpvt-loader.php (added)
-
tags/2.6.0/includes/class-fense-bpvt.php (added)
-
tags/2.6.0/includes/core (added)
-
tags/2.6.0/includes/core/class-fense-bpvt-functions.php (added)
-
tags/2.6.0/includes/core/class-fense-bpvt-run-save-mode.php (added)
-
tags/2.6.0/includes/core/class-fense-bpvt-run.php (added)
-
tags/2.6.0/includes/core/class-fense-bpvt-stats.php (added)
-
tags/2.6.0/includes/index.php (added)
-
tags/2.6.0/includes/js (added)
-
tags/2.6.0/includes/js/fense-bpvt-scan-debug.js (added)
-
tags/2.6.0/includes/js/fense-bpvt-scan.js (added)
-
tags/2.6.0/includes/system (added)
-
tags/2.6.0/includes/system/fense-bpvt-activate-plugin.php (added)
-
tags/2.6.0/includes/system/fense-bpvt-api-call.php (added)
-
tags/2.6.0/includes/system/fense-bpvt-cache-safe-mode.php (added)
-
tags/2.6.0/includes/system/fense-bpvt-check-version.php (added)
-
tags/2.6.0/includes/system/fense-bpvt-deactivate-plugin.php (added)
-
tags/2.6.0/includes/system/fense-bpvt-header-code.php (added)
-
tags/2.6.0/includes/system/fense-bpvt-load-stats.php (added)
-
tags/2.6.0/includes/system/fense-bpvt-plugin-settings.php (added)
-
tags/2.6.0/includes/system/fense-bpvt-plugin-updates.php (added)
-
tags/2.6.0/index.php (added)
-
tags/2.6.0/languages (added)
-
tags/2.6.0/languages/default.mo (added)
-
tags/2.6.0/languages/default.po (added)
-
tags/2.6.0/languages/fense-block-vpn-proxy-ar.mo (added)
-
tags/2.6.0/languages/fense-block-vpn-proxy-ar.po (added)
-
tags/2.6.0/readme.txt (added)
-
tags/2.6.0/uninstall.php (added)
-
trunk/admin/class-fense-bpvt-admin.php (modified) (3 diffs)
-
trunk/fense-bpvt.php (modified) (5 diffs)
-
trunk/includes/class-fense-bpvt-admin-inputs.php (modified) (1 diff)
-
trunk/includes/class-fense-bpvt-deactivator.php (modified) (1 diff)
-
trunk/includes/class-fense-bpvt.php (modified) (1 diff)
-
trunk/includes/core/class-fense-bpvt-functions.php (modified) (2 diffs)
-
trunk/includes/core/class-fense-bpvt-run-save-mode.php (added)
-
trunk/includes/core/class-fense-bpvt-run.php (modified) (4 diffs)
-
trunk/includes/js (added)
-
trunk/includes/js/fense-bpvt-scan-debug.js (added)
-
trunk/includes/js/fense-bpvt-scan.js (added)
-
trunk/includes/system/fense-bpvt-activate-plugin.php (modified) (1 diff)
-
trunk/includes/system/fense-bpvt-api-call.php (modified) (3 diffs)
-
trunk/includes/system/fense-bpvt-cache-safe-mode.php (added)
-
trunk/includes/system/fense-bpvt-plugin-updates.php (modified) (1 diff)
-
trunk/languages/fense-block-vpn-proxy-ar.mo (modified) (previous)
-
trunk/languages/fense-block-vpn-proxy-ar.po (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
fense-block-vpn-proxy/trunk/admin/class-fense-bpvt-admin.php
r3335460 r3342511 243 243 $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' ) ); 244 244 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 245 247 add_settings_section( 246 248 // ID used to identify this section and with which to register options … … 370 372 ); 371 373 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' ); 373 375 374 376 $this->Fense_FUN->add_option( __( 'IP Whitelisting', 'fense-block-vpn-proxy' ), 'ip_whitelisting', 'multi_input', 'checkbox', '', 'tab_6' ); … … 376 378 $this->Fense_FUN->add_option( __( 'IP Whitelisting Range', 'fense-block-vpn-proxy' ), 'ip_whitelisting_range', 'ip_ranges', 'checkbox', '', 'tab_6' ); 377 379 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' ); 383 385 } 384 386 -
fense-block-vpn-proxy/trunk/fense-bpvt.php
r3335460 r3342511 35 35 * Plugin URI: https://fense.in/ 36 36 * 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.037 * Version: 2.6.0 38 38 * Author: Devozon 39 39 * Author URI: https://devozon.com/ … … 49 49 } 50 50 51 const FENSE_BPVT_VERSION = '2. 5.0';51 const FENSE_BPVT_VERSION = '2.6.0'; 52 52 const FENSE_BPVT_API_LINK = 'https://api.fense.in/'; 53 53 const FENSE_BPVT_MAIN_LINK = 'https://fense.in/'; 54 const FENSE_BPVT_PLUGIN_KEY = 'FENSE_BPVT_'; 54 55 55 56 //? Activate plugin … … 58 59 //? Deactivate plugin 59 60 require_once plugin_dir_path( __FILE__ ) . 'includes/system/fense-bpvt-deactivate-plugin.php'; 60 61 61 62 62 //? Core … … 77 77 //? plugin run Class 78 78 require_once plugin_dir_path( __FILE__ ) . 'includes/core/class-fense-bpvt-run.php'; 79 require_once plugin_dir_path( __FILE__ ) . 'includes/core/class-fense-bpvt-run-save-mode.php'; 79 80 80 81 //? plugin Stats Class … … 96 97 require_once plugin_dir_path( __FILE__ ) . 'includes/system/fense-bpvt-api-call.php'; 97 98 99 require_once plugin_dir_path( __FILE__ ) . 'includes/system/fense-bpvt-cache-safe-mode.php'; 100 98 101 register_activation_hook( __FILE__, 'FENSE_BPVT_activate' ); 99 102 -
fense-block-vpn-proxy/trunk/includes/class-fense-bpvt-admin-inputs.php
r3334974 r3342511 393 393 $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>'; 394 394 395 $lpout .= (!empty($args['comment'])) ? '<div class="mt-2">' . $args['comment'] . '</div>' : ''; 396 395 397 echo self::tg_esc_html( $lpout ); 396 398 -
fense-block-vpn-proxy/trunk/includes/class-fense-bpvt-deactivator.php
r3026592 r3342511 40 40 */ 41 41 42 if ( !defined('ABSPATH')) exit; // Exit if accessed directly42 if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 43 43 44 44 45 45 class FENSE_BPVT_Deactivator 46 46 { 47 48 /**49 * Short Description. (use period)50 *51 * Long Description.52 *53 * @since 1.0.054 */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 60 60 } -
fense-block-vpn-proxy/trunk/includes/class-fense-bpvt.php
r3334974 r3342511 47 47 */ 48 48 49 if ( !defined('ABSPATH')) exit; // Exit if accessed directly49 if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 50 50 51 51 class FENSE_BPVT 52 52 { 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 */ 147 218 // 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 249 272 } -
fense-block-vpn-proxy/trunk/includes/core/class-fense-bpvt-functions.php
r3334974 r3342511 25 25 class FENSE_BPVT_FUN 26 26 { 27 private static bool $hasRun = false; 27 28 28 29 public function IsKeyValid(): bool … … 503 504 { 504 505 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' ) ) . '" 511 512 ></span>'; 512 513 } 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 513 542 } -
fense-block-vpn-proxy/trunk/includes/core/class-fense-bpvt-run.php
r3334974 r3342511 108 108 } 109 109 110 public function cleanUP(): bool111 {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 ): void125 {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 keys133 $timeout_keys = $wpdb->get_col( $wpdb->prepare(134 "SELECT option_name135 FROM {$opt_table}136 WHERE option_name LIKE %s137 AND option_value < %d138 LIMIT %d",139 $like_timeout,140 $time,141 $batch_size142 ) );143 144 if ( empty( $timeout_keys ) ) {145 break;146 }147 148 // Build list of paired transient names149 $transient_keys = array_map(150 fn( $k ) => str_replace( '_transient_timeout_', '_transient_', $k ),151 $timeout_keys152 );153 154 // Merge both sets for deletion155 $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 query159 $wpdb->query(160 $wpdb->prepare(161 "DELETE FROM {$opt_table}162 WHERE option_name IN ({$placeholders})",163 ...$all_keys164 )165 );166 167 // Repeat until no more expired168 } while ( count( $timeout_keys ) === $batch_size );169 }170 171 110 public function __isDailyLimitReached(): bool 172 111 { … … 339 278 /** Run Clean UP only on Proxy */ 340 279 if ( $this->ipData->proxy == 'yes' ) { 280 341 281 /** Clean UP */ 342 $this->cleanUP();282 FENSE_BPVT_FUN::cleanUP(); 343 283 } 344 284 … … 388 328 public function __Whitelist(): bool 389 329 { 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 ) ) { 397 337 // IP is in the list 398 338 return true; 399 339 } 400 340 401 $ipLong = ip2long( $this->ip);341 $ipLong = ip2long( $this->ip ); 402 342 403 343 // 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 ) { 410 350 return true; 411 351 } … … 417 357 public function __Blacklist() 418 358 { 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 ) ); 424 364 $this->ipData->proxy = 'yes'; 425 365 426 if ( in_array($this->ip, $blocked, true)) {366 if ( in_array( $this->ip, $blocked, true ) ) { 427 367 // IP is in the list 428 368 return $this->__protection_mode(); 429 369 } 430 370 431 $ipLong = ip2long( $this->ip);371 $ipLong = ip2long( $this->ip ); 432 372 433 373 // 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 ) { 440 380 return $this->__protection_mode(); 441 381 } -
fense-block-vpn-proxy/trunk/includes/system/fense-bpvt-activate-plugin.php
r3335460 r3342511 56 56 add_option( $key . 'ip_whitelisting_enable', false ); 57 57 add_option( $key . 'ip_blacklisting_enable', false ); 58 59 add_option( $key . 'cache_safe_mode', false ); 58 60 } -
fense-block-vpn-proxy/trunk/includes/system/fense-bpvt-api-call.php
r3335460 r3342511 34 34 function FENSE_BPVT_detection() 35 35 { 36 /** RAN OPTIONS */37 static $ran = false;38 if ( $ran ) return null;39 40 /** Load Once */41 $ran = true;42 43 36 /** Load Settings Class */ 44 37 $RUN = new FENSE_BPVT_RUN(); … … 49 42 /** Disable on Logged in Or admin */ 50 43 if ( $RUN->__isAdminOrLoggedIn() ) return null; 44 45 /** RAN OPTIONS */ 46 if ( FENSE_BPVT_FUN::runOnce() ) return null; 51 47 52 48 /** Disable on Daily Limit Reached */ … … 86 82 return $RUN->__protection_mode(); 87 83 } 88 -
fense-block-vpn-proxy/trunk/includes/system/fense-bpvt-plugin-updates.php
r3335460 r3342511 30 30 if ( version_compare( $saved, FENSE_BPVT_VERSION, '<' ) ) { 31 31 32 update_option( $key . 'ip_whitelisting_enable', false ); 33 update_option( $key . 'ip_blacklisting_enable', false ); 32 update_option( $key . 'cache_safe_mode', false ); 34 33 35 34 // run your update code here -
fense-block-vpn-proxy/trunk/languages/fense-block-vpn-proxy-ar.po
r3334974 r3342511 3 3 "Project-Id-Version: fense-block-vpn-proxy\n" 4 4 "POT-Creation-Date: 2021-12-04 13:17+0200\n" 5 "PO-Revision-Date: 2025-0 7-27 21:38+0300\n"5 "PO-Revision-Date: 2025-08-10 18:42+0300\n" 6 6 "Last-Translator: \n" 7 7 "Language-Team: \n" … … 504 504 msgstr "خطا في حفظ الاعدادات" 505 505 506 #: admin/partials/fense-bpvt-admin-display.php:32 507 msgid "Enable Safe Mode" 508 msgstr "تفعيل الوضع الامن" 509 510 #: admin/partials/fense-bpvt-admin-display.php:32 511 msgid "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." 512 msgstr "قم بتمكين هذا الخيار فقط إذا كنت تستخدم اضافات للكاش لـ WordPress أو نظام كاش في السيرفر (على سبيل المثال، Redis، Varnish، وما إلى ذلك) يخزن محتوى موقع الويب مؤقتًا ( كاش للمحتوي )." 513 514 #: admin/partials/fense-bpvt-admin-display.php:32 515 msgid "When Safe Mode is active, the plugin operates after the content has loaded, ensuring full compatibility with any caching system." 516 msgstr "عندما يكون الوضع الآمن نشطًا، تعمل الاضافة بعد تحميل المحتوى، مما يضمن التوافق الكامل مع أي نظام تخزين مؤقت ( اضافات الكاش )." 517 518 #: admin/partials/fense-bpvt-admin-display.php:32 519 msgid "Note: Safe Mode supports only one protection mode — Hide Content and Display a Message." 520 msgstr "ملاحظة: يدعم الوضع الآمن وضع حماية واحد فقط — إخفاء المحتوى وعرض رسالة." 521 506 522 #: includes/system/fense-bpvt-check-version.php:32 507 523 msgid "Hello, there is a new version of Fense extension." -
fense-block-vpn-proxy/trunk/readme.txt
r3335460 r3342511 5 5 Tested up to: 6.8.2 6 6 Requires PHP: 7.4 7 Stable tag: 2. 5.07 Stable tag: 2.6.0 8 8 License: GPLv2 9 9
Note: See TracChangeset
for help on using the changeset viewer.