PluginProbe ʕ •ᴥ•ʔ
Security Optimizer – The All-In-One Protection Plugin / 1.5.4
Security Optimizer – The All-In-One Protection Plugin v1.5.4
1.6.2 1.6.1 trunk 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0
sg-security / sg-security.php
sg-security Last commit date
assets 1 year ago core 1 year ago templates 1 year ago vendor 1 year ago react-strings.php 1 year ago readme.txt 1 year ago sg-security.php 1 year ago uninstall.php 1 year ago
sg-security.php
74 lines
1 <?php
2 /**
3 * SG Security
4 *
5 * @package SG_Security
6 * @author SiteGround
7 * @link http://www.siteground.com/
8 *
9 * @wordpress-plugin
10 * Plugin Name: Security Optimizer
11 * Plugin URI: https://siteground.com
12 * Description: Security Optimizer by SiteGround is the all-in-one security solution for your WordPress website. With the carefully selected and easy to configure functions the plugin provides everything you need to secure your website and prevent a number of threats such as brute-force attacks, compromised login, data leaks and more.
13 * Version: 1.5.4
14 * Author: SiteGround
15 * Author URI: https://www.siteground.com
16 * Text Domain: sg-security
17 * Domain Path: /languages
18 * License: GPLv3
19 */
20
21 // Our namespace.
22 namespace SG_Security;
23
24 use SG_Security\Loader\Loader;
25 use SG_Security\Activator\Activator;
26 use SG_Security\Deactivator\Deactivator;
27
28 // If this file is called directly, abort.
29 if ( ! defined( 'WPINC' ) ) {
30 die;
31 }
32
33 // Define version constant.
34 if ( ! defined( __NAMESPACE__ . '\VERSION' ) ) {
35 define( __NAMESPACE__ . '\VERSION', '1.5.4' );
36 }
37
38 // Define slug constant.
39 if ( ! defined( __NAMESPACE__ . '\PLUGIN_SLUG' ) ) {
40 define( __NAMESPACE__ . '\PLUGIN_SLUG', 'sg-security' );
41 }
42
43 // Define root directory.
44 if ( ! defined( __NAMESPACE__ . '\DIR' ) ) {
45 define( __NAMESPACE__ . '\DIR', __DIR__ );
46 }
47
48 // Define root URL.
49 if ( ! defined( __NAMESPACE__ . '\URL' ) ) {
50 $root_url = \trailingslashit( DIR );
51
52 // Sanitize directory separator on Windows.
53 $root_url = str_replace( '\\', '/', $root_url );
54
55 $wp_plugin_dir = str_replace( '\\', '/', WP_PLUGIN_DIR );
56 $root_url = str_replace( $wp_plugin_dir, \plugins_url(), $root_url );
57
58 define( __NAMESPACE__ . '\URL', \untrailingslashit( $root_url ) );
59
60 unset( $root_url );
61 }
62
63 require_once( \SG_Security\DIR . '/vendor/autoload.php' );
64
65 register_activation_hook( __FILE__, array( new Activator(), 'activate' ) );
66 register_deactivation_hook( __FILE__, array( new Deactivator(), 'deactivate' ) );
67
68 // Initialize helper.
69 global $sg_security_loader;
70
71 if ( ! isset( $sg_security_loader ) ) {
72 $sg_security_loader = new Loader();
73 }
74