PluginProbe
WebTotem Security / 2.4.4
WebTotem Security v2.4.4
3.0.1 3.0.0 trunk 1.0 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 2.0 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.1 2.2.2 2.2.3 2.2.4 All 109 releases
wt-security / wt-security.php

wt-security.php in WebTotem Security 2.4.4, at wt-security.php

140 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Plugin Name: WebTotem Security
5 * Description: The <a href="https://wtotem.com/" target="_blank">WebTotem</a> Security plugin monitors websites and prevents website attacks with the help of special internal and external utilities.
6 * Author URI: https://wtotem.com/
7 * Author: WebTotem
8 * Text Domain: wtotem
9 * Domain Path: /lang
10 * Version: 2.4.4
11 *
12 * PHP version 7
13 *
14 * @copyright 2021-2022 WebTotem
15 * @license https://www.gnu.org/licenses/gpl-2.0.txt GPL2
16 * @link https://wordpress.org/plugins/wt-security
17 */
18
19 /**
20 * Main file to control the plugin.
21 */
22 define('WEBTOTEM_INIT', true);
23
24 /**
25 * Plugin dependencies.
26 *
27 * list of required WordPress functions for the plugin to work.
28 */
29 $wtotem_dependencies = array(
30 'wp',
31 'wp_die',
32 'add_action',
33 'remove_action',
34 'wp_remote_get',
35 'wp_remote_post',
36 );
37
38 // Stopping execution if dependencies are not met.
39 foreach ($wtotem_dependencies as $dependency) {
40 if (!function_exists($dependency)) {
41 // Report invalid access.
42 header('HTTP/1.1 403 Forbidden');
43 die("Protected By WebTotem!");
44 }
45 }
46
47 // Stopping execution if the ABSPATH constant is not available
48 if (!defined('ABSPATH')) {
49 // Report invalid access.
50 header('HTTP/1.1 403 Forbidden');
51 die("Protected By WebTotem!");
52 }
53
54 /**
55 * Current version of the plugin's code.
56 */
57 define('WEBTOTEM_VERSION', '2.4.4');
58
59 /**
60 * The name of the folder where the plugin's files will be located.
61 */
62 define("WEBTOTEM_PLUGIN_FOLDER", basename(dirname(__FILE__)));
63
64 /**
65 * The fullpath where the plugin's files will be located.
66 */
67 define('WEBTOTEM_PLUGIN_PATH', WP_PLUGIN_DIR . '/' . WEBTOTEM_PLUGIN_FOLDER);
68
69 /**
70 * The local URL where the plugin's files and assets are served.
71 */
72 define('WEBTOTEM_URL', rtrim(plugin_dir_url(__FILE__), '/'));
73
74 /**
75 * The domain name of the current site, without protocol and www.
76 */
77 define("WEBTOTEM_SITE_DOMAIN", str_replace(['http://', 'https://', '//', '://', 'www.'], '', get_site_url()));
78
79 /**
80 * Remote URL where the public WebTotem API service is running.
81 */
82 if (!defined('WEBTOTEM_API_URL')) {
83 define('WEBTOTEM_API_URL', 'https://api.wtotem.com/graphql');
84 }
85
86 /**
87 * Unique name of the plugin through out all the code.
88 */
89 define("WEBTOTEM", 'wtotem');
90
91 /* Load plugin translations */
92 function wtotem_load_plugin_textdomain()
93 {
94 load_plugin_textdomain('wtotem', false, basename(dirname(__FILE__)) . '/lang/');
95 }
96 add_action('plugins_loaded', 'wtotem_load_plugin_textdomain');
97
98 $composer_autoload = __DIR__ . '/vendor/autoload.php';
99 if ( file_exists( $composer_autoload ) ) {
100 require_once $composer_autoload;
101 }
102
103 /* Load all classes before anything else. */
104 require_once 'lib/Helper.php';
105 require_once 'lib/API.php';
106 require_once 'lib/Interface.php';
107 require_once 'lib/AgentManager.php';
108 require_once 'lib/Option.php';
109 require_once 'lib/Request.php';
110 require_once 'lib/Template.php';
111 require_once 'lib/Country.php';
112 require_once 'lib/Ajax.php';
113
114 /* Load page and ajax handlers */
115 require_once 'src/PageHandler.php';
116
117 /* Load common variables and triggers */
118 require_once 'src/Common.php';
119
120 /**
121 * Uninstalled the plugin
122 *
123 * @return void
124 */
125 function wtotemUninstall() {
126
127 /* Delete settings from the database */
128 $options = WebTotemOption::getAllOptions();
129 WebTotemOption::clearOptions($options);
130 if(WebTotem::isMultiSite()){
131 WebTotemOption::clearAllHosts();
132 }
133
134 /* Delete all agents files and directories */
135 WebTotemAgentManager::removeAgents();
136
137 }
138
139 register_uninstall_hook(__FILE__, 'wtotemUninstall');
140