| @@ -9,36 +9,16 @@ | ||
| 9 | 9 | |
| 10 | 10 | add_action('upgrader_process_complete', 'wt_security_upgrade_complete', 10, 2); |
| 11 | 11 | function wt_security_upgrade_complete($upgrader, $options) |
| 12 | 12 | { |
| 13 | - /** | |
| 14 | - * Creating a marker file after updating the plugin. | |
| 15 | - */ | |
| 16 | - if ($options['type'] === 'plugin' && $options['action'] === 'update' && $upgrader->result['destination_name'] == 'wt-security') { | |
| 17 | - WebTotemAgentManager::generateMarkerFile(); | |
| 18 | - } | |
| 19 | - | |
| 20 | - /** | |
| 21 | - * Check CVE list after install or update plugin. | |
| 22 | - */ | |
| 23 | -// if ($options['type'] === 'plugin' && ($options['action'] === 'update' || $options['action'] === 'install')){ | |
| 24 | -// WebTotem::updateCveDataByPluginName($upgrader->new_plugin_data); | |
| 25 | -// } | |
| 13 | + /** | |
| 14 | + * Creating a marker file after updating the plugin. | |
| 15 | + */ | |
| 16 | + if ($options['type'] === 'plugin' && $options['action'] === 'update' && $upgrader->result['destination_name'] == 'wt-security') { | |
| 17 | + WebTotemAgentManager::generateMarkerFile(); | |
| 18 | + } | |
| 26 | 19 | } |
| 27 | 20 | |
| 28 | -/** | |
| 29 | - * Remove CVE from list after plugin delete. | |
| 30 | - */ | |
| 31 | -//add_action( 'deleted_plugin', 'wt_security_deleted_plugin_action', 10, 2 ); | |
| 32 | -//function wt_security_deleted_plugin_action( $plugin_file, $deleted ){ | |
| 33 | -// if($deleted){ | |
| 34 | -// $slug = str_replace('.php', '', basename($plugin_file)); | |
| 35 | -// if($slug != 'wt-security'){ | |
| 36 | -// WebTotemDB::deleteData(['slug' => $slug], 'plugins_cve_list'); | |
| 37 | -// } | |
| 38 | -// } | |
| 39 | -//} | |
| 40 | - | |
| 41 | 21 | // WAF Include. |
| 42 | 22 | WebTotemAgentManager::wafInclude(); |
| 43 | 23 | |
| 44 | 24 | if (defined('WEBTOTEM')) { |
| @@ -108,9 +88,8 @@ | ||
| 108 | 88 | |
| 109 | 89 | function WtotemDailyCron() |
| 110 | 90 | { |
| 111 | 91 | WebTotemOption::setOptions(['scan_init' => 1]); |
| 112 | -// WebTotem::updateCveData(); | |
| 113 | 92 | } |
| 114 | 93 | |
| 115 | 94 | /** Launch of the minute cron. */ |
| 116 | 95 | if (WebTotemOption::getOption('scan_init')) { |
| @@ -145,25 +124,16 @@ | ||
| 145 | 124 | * @return array List of sub-pages of this plugin. |
| 146 | 125 | */ |
| 147 | 126 | function wtotemPages() |
| 148 | 127 | { |
| 149 | -// if (WebTotem::isMultiSite()) { | |
| 150 | -// $pages['wtotem_all_sites'] = ['title' => __('All sites', 'wtotem'), 'slug' => 'wtotem']; | |
| 151 | -// } | |
| 152 | -// $slug = WebTotem::isMultiSite() ? 'wtotem_' : 'wtotem'; | |
| 128 | + | |
| 153 | 129 | $slug = 'wtotem'; |
| 154 | 130 | |
| 155 | 131 | $pages['wtotem_dashboard'] = ['title' => __('Dashboard', 'wtotem'), 'slug' => $slug]; |
| 156 | 132 | $pages['wtotem_open_paths'] = ['title' => __('Open paths', 'wtotem'), 'slug' => $slug]; |
| 157 | 133 | $pages['wtotem_firewall'] = ['title' => __('Firewall', 'wtotem'), 'slug' => $slug]; |
| 158 | - | |
| 159 | -// if (!WebTotem::isMultiSite() or is_super_admin()) { | |
| 160 | -// $pages['wtotem_antivirus'] = ['title' => __('Antivirus', 'wtotem'), 'slug' => $slug]; | |
| 161 | -// $pages['wtotem_settings'] = ['title' => __('Settings', 'wtotem'), 'slug' => $slug]; | |
| 162 | -// } | |
| 163 | 134 | $pages['wtotem_antivirus'] = ['title' => __('Antivirus', 'wtotem'), 'slug' => $slug]; |
| 164 | 135 | $pages['wtotem_settings'] = ['title' => __('Settings', 'wtotem'), 'slug' => $slug]; |
| 165 | -// $pages['wtotem_reports'] = ['title' => __('Reports', 'wtotem'), 'slug' => $slug]; | |
| 166 | 136 | $pages['wtotem_documentation'] = ['title' => __('Documentation', 'wtotem'), 'slug' => 'wtotem']; |
| 167 | 137 | $pages['wtotem_wpscan'] = ['title' => __('WP scan', 'wtotem'), 'slug' => 'wtotem']; |
| 168 | 138 | |
| 169 | 139 | return $pages; |