| @@ -3,9 +3,9 @@ | ||
| 3 | 3 | /* |
| 4 | 4 | Plugin Name: WT Security |
| 5 | 5 | Description: WT is a SaaS which provides powerful tools for securing and monitoring your website in one place in easy and flexible way. |
| 6 | 6 | Author: WT Security |
| 7 | -Version: 2.1.9 | |
| 7 | +Version: 2.2.2 | |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | define("WTSEC_PAGE_TITLE", 'Dashboard'); |
| 11 | 11 | define("WTSEC_MENU_TITLE", 'WT Security'); |
| @@ -25,9 +25,9 @@ | ||
| 25 | 25 | } |
| 26 | 26 | define("WTSEC_PLUGIN_URL", plugins_url("", __FILE__)); |
| 27 | 27 | define("WTSEC_SITE_URL", str_replace(['http://', 'https://', 'www.', '//', '://'], '', get_site_url())); |
| 28 | 28 | |
| 29 | -define("WTSEC_PLUGIN_INFORMATION_VERSION", "2.1"); | |
| 29 | +define("WTSEC_PLUGIN_INFORMATION_VERSION", "2.2"); | |
| 30 | 30 | |
| 31 | 31 | add_action('admin_init', 'wtsec_admin_init'); |
| 32 | 32 | add_action('wp_loaded', 'wtsec_init'); |
| 33 | 33 | |
| @@ -34,16 +34,20 @@ | ||
| 34 | 34 | function wtsec_init() |
| 35 | 35 | { |
| 36 | 36 | require_once WTSEC_PLUGIN_PATH . 'library/App.php'; |
| 37 | 37 | require_once WTSEC_PLUGIN_PATH . 'library/Request.php'; |
| 38 | -// if (!is_admin() && in_array(WTSEC_LIBRARY_App::getOption('waf_status'), ["start", "uninstalled"])) { | |
| 39 | -// if ($waf = WTSEC_LIBRARY_App::getOption(("waf_installed_file"))) { | |
| 40 | -// $path_to_waf = WTSEC_INSTALLATION_DIR . '/' . $waf; | |
| 41 | -// if (is_file($path_to_waf) && is_readable($path_to_waf)) { | |
| 42 | -// include $path_to_waf; | |
| 43 | -// } | |
| 44 | -// } | |
| 45 | -// } | |
| 38 | + | |
| 39 | + // WAF include (Если не админка и статус waf = "start", "uninstalled") | |
| 40 | + // && in_array(WTSEC_LIBRARY_App::getOption('waf_status'), ["start", "uninstalled"]) | |
| 41 | + if (!is_admin()) { | |
| 42 | + if ($waf = WTSEC_LIBRARY_App::getOption(("waf_installed_file"))) { | |
| 43 | + $path_to_waf = $_SERVER['DOCUMENT_ROOT'] . '/_include_' . $waf; | |
| 44 | + if (is_file($path_to_waf) && is_readable($path_to_waf)) { | |
| 45 | + include_once $path_to_waf; | |
| 46 | + } | |
| 47 | + } | |
| 48 | + } | |
| 49 | + | |
| 46 | 50 | if (is_admin()) { |
| 47 | 51 | require_once WTSEC_PLUGIN_PATH . 'library/WT.php'; |
| 48 | 52 | require_once WTSEC_PLUGIN_PATH . 'library/Localization.php'; |
| 49 | 53 | require_once WTSEC_PLUGIN_PATH . 'library/Idn.php'; |
| @@ -50,8 +54,9 @@ | ||
| 50 | 54 | require_once WTSEC_PLUGIN_PATH . 'library/Session.php'; |
| 51 | 55 | require_once WTSEC_PLUGIN_PATH . 'routes.php'; |
| 52 | 56 | require_once WTSEC_PLUGIN_PATH . 'services.php'; |
| 53 | 57 | require_once WTSEC_PLUGIN_PATH . 'helpers.php'; |
| 58 | + | |
| 54 | 59 | function wtsec_request() |
| 55 | 60 | { |
| 56 | 61 | return new WTSEC_LIBRARY_Request(); |
| 57 | 62 | } |
| @@ -97,9 +102,13 @@ | ||
| 97 | 102 | function wtsec_admin_init() |
| 98 | 103 | { |
| 99 | 104 | if (is_admin() && stripos(wtsec_request()->page, WTSEC_PLUGIN_NAME) !== false) { |
| 100 | 105 | wp_enqueue_script('subscriber', plugins_url('/htdocs/js/subscriber.js', __FILE__), [], false, true); |
| 101 | - wp_enqueue_script('plug', 'https://d3js.org/d3.v5.min.js', [], false, true); | |
| 106 | + wp_enqueue_script('plug', plugins_url('/htdocs/js/d3.v5.min.js', __FILE__), [], false, true); | |
| 107 | + wp_enqueue_script('jsdelivr', plugins_url('/htdocs/js/jsdelivr_chart.js', __FILE__), array( 'jquery' ), false, true); | |
| 108 | + wp_enqueue_script('d3-v3', plugins_url('/htdocs/js/d3.v4.js', __FILE__), array( 'jquery' ), false, true); | |
| 109 | + wp_enqueue_script('d3-scale', plugins_url('/htdocs/js/d3-scale-chromatic.v1.min.js', __FILE__), array( 'jquery' ), false, true); | |
| 110 | + wp_enqueue_script('d3-geo', plugins_url('/htdocs/js/d3-geo-projection.v2.min.js', __FILE__), array( 'jquery' ), false, true); | |
| 102 | 111 | wp_enqueue_script('chart', plugins_url('/htdocs/js/Chart.js', __FILE__), [], false, true); |
| 103 | 112 | wp_enqueue_script('circle-progress', plugins_url('/htdocs/js/circle-progress.js', __FILE__), [], false, true); |
| 104 | 113 | wp_enqueue_script('range-plugin', plugins_url('/htdocs/js/rangePlugin.js', __FILE__), array( 'jquery' ), false, true); |
| 105 | 114 | wp_enqueue_script('flatpickr', plugins_url('/htdocs/js/flatpickr.js', __FILE__), array( 'jquery' ), false, true); |
| @@ -105,11 +114,15 @@ | ||
| 105 | 114 | wp_enqueue_script('flatpickr', plugins_url('/htdocs/js/flatpickr.js', __FILE__), array( 'jquery' ), false, true); |
| 106 | 115 | wp_enqueue_script('filter-calendar', plugins_url('/htdocs/js/filterCalendar.js', __FILE__), array( 'jquery' ), false, true); |
| 107 | 116 | wp_enqueue_script('line-progress', plugins_url('/htdocs/js/line-progress.js', __FILE__), [], false, true); |
| 108 | 117 | wp_enqueue_script('main', plugins_url('/htdocs/js/main.js', __FILE__), [], false, true); |
| 109 | - wp_enqueue_script( 'ajax', plugins_url( '/htdocs/js/ajax.js', __FILE__ ), array( 'jquery' ),false, true ); | |
| 118 | + wp_enqueue_script('ajax', plugins_url( '/htdocs/js/ajax.js', __FILE__ ), array( 'jquery' ),false, true ); | |
| 110 | 119 | wp_enqueue_script('subscriber'); |
| 111 | 120 | wp_enqueue_script('plug'); |
| 121 | + wp_enqueue_script('jsdelivr'); | |
| 122 | + wp_enqueue_script('d3-v3'); | |
| 123 | + wp_enqueue_script('d3-scale'); | |
| 124 | + wp_enqueue_script('d3-geo'); | |
| 112 | 125 | wp_enqueue_script('chart'); |
| 113 | 126 | wp_enqueue_script('circle-progress'); |
| 114 | 127 | wp_enqueue_script('line-progress'); |
| 115 | 128 | wp_enqueue_script('range-plugin'); |
| @@ -117,17 +130,19 @@ | ||
| 117 | 130 | wp_enqueue_script('filter-calendar'); |
| 118 | 131 | wp_enqueue_script('main'); |
| 119 | 132 | wp_enqueue_script('ajax'); |
| 120 | 133 | |
| 121 | - | |
| 122 | - | |
| 123 | 134 | wp_register_style('flatpickr-css', 'https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css'); |
| 124 | 135 | wp_register_style('font', 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap'); |
| 125 | 136 | wp_register_style('normalize', plugins_url('/htdocs/css/normalize.css', __FILE__)); |
| 137 | + wp_register_style('options', plugins_url('/htdocs/css/options.css', __FILE__)); | |
| 138 | + wp_register_style('header', plugins_url('/htdocs/css/header.css', __FILE__)); | |
| 126 | 139 | wp_register_style('main', plugins_url('/htdocs/css/main.css', __FILE__)); |
| 127 | 140 | wp_enqueue_style('flatpickr-css'); |
| 128 | 141 | wp_enqueue_style('font'); |
| 129 | 142 | wp_enqueue_style('normalize'); |
| 143 | + wp_enqueue_style('header'); | |
| 144 | + wp_enqueue_style('options'); | |
| 130 | 145 | wp_enqueue_style('main'); |
| 131 | 146 | |
| 132 | 147 | $page = wtsec_request()->page; |
| 133 | 148 | if ($page === wtsec_getRoute("login")) { |