# wt-security/2.4.2/wt-security.php

WebTotem Security, version 2.4.2. 140 lines.

- Page: https://pluginprobe.com/plugins/wt-security/2.4.2/code/wt-security.php
- Raw: https://pluginprobe.com/plugins/wt-security/2.4.2/raw/wt-security.php
- Modified: 2022-05-05T03:36:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wt-security/2.4.2/code/wt-security.php#L10-L20`.

```php
<?php

/**
 * Plugin Name: WebTotem Security
 * 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.
 * Author URI: https://wtotem.com/
 * Author: WebTotem
 * Text Domain: wtotem
 * Domain Path: /lang
 * Version: 2.4.2
 *
 * PHP version 7
 *
 * @copyright  2021-2022 WebTotem
 * @license    https://www.gnu.org/licenses/gpl-2.0.txt GPL2
 * @link       https://wordpress.org/plugins/wt-security
 */

/**
 * Main file to control the plugin.
 */
define('WEBTOTEM_INIT', true);

/**
 * Plugin dependencies.
 *
 * list of required WordPress functions for the plugin to work.
 */
$wtotem_dependencies = array(
	'wp',
	'wp_die',
	'add_action',
	'remove_action',
	'wp_remote_get',
	'wp_remote_post',
);

// Stopping execution if dependencies are not met.
foreach ($wtotem_dependencies as $dependency) {
	if (!function_exists($dependency)) {
		// Report invalid access.
		header('HTTP/1.1 403 Forbidden');
		die("Protected By WebTotem!");
	}
}

// Stopping execution if the ABSPATH constant is not available
if (!defined('ABSPATH')) {
	// Report invalid access.
	header('HTTP/1.1 403 Forbidden');
	die("Protected By WebTotem!");
}

/**
 * Current version of the plugin's code.
 */
define('WEBTOTEM_VERSION', '2.4.2');

/**
 * The name of the folder where the plugin's files will be located.
 */
define("WEBTOTEM_PLUGIN_FOLDER", basename(dirname(__FILE__)));

/**
 * The fullpath where the plugin's files will be located.
 */
define('WEBTOTEM_PLUGIN_PATH', WP_PLUGIN_DIR . '/' . WEBTOTEM_PLUGIN_FOLDER);

/**
 * The local URL where the plugin's files and assets are served.
 */
define('WEBTOTEM_URL', rtrim(plugin_dir_url(__FILE__), '/'));

/**
 * The domain name of the current site, without protocol and www.
 */
define("WEBTOTEM_SITE_DOMAIN", str_replace(['http://', 'https://', '//', '://', 'www.'], '', get_site_url()));

/**
 * Remote URL where the public WebTotem API service is running.
 */
if (!defined('WEBTOTEM_API_URL')) {
	define('WEBTOTEM_API_URL', 'https://api.wtotem.com/graphql');
}

/**
 * Unique name of the plugin through out all the code.
 */
define("WEBTOTEM", 'wtotem');

/* Load plugin translations */
function wtotem_load_plugin_textdomain()
{
	load_plugin_textdomain('wtotem', false, basename(dirname(__FILE__)) . '/lang/');
}
add_action('plugins_loaded', 'wtotem_load_plugin_textdomain');

$composer_autoload = __DIR__ . '/vendor/autoload.php';
if ( file_exists( $composer_autoload ) ) {
	require_once $composer_autoload;
}

/* Load all classes before anything else. */
require_once 'lib/Helper.php';
require_once 'lib/API.php';
require_once 'lib/Interface.php';
require_once 'lib/AgentManager.php';
require_once 'lib/Option.php';
require_once 'lib/Request.php';
require_once 'lib/Template.php';
require_once 'lib/Country.php';
require_once 'lib/Ajax.php';

/* Load page and ajax handlers */
require_once 'src/PageHandler.php';

/* Load common variables and triggers */
require_once 'src/Common.php';

/**
 * Uninstalled the plugin
 *
 * @return void
 */
function wtotemUninstall() {

	/* Delete settings from the database */
	$options = WebTotemOption::getAllOptions();
	WebTotemOption::clearOptions($options);
	if(WebTotem::isMultiSite()){
		WebTotemOption::clearAllHosts();
	}

	/* Delete all agents files and directories */
	WebTotemAgentManager::removeAgents();

}

register_uninstall_hook(__FILE__, 'wtotemUninstall');

```
