| 1 |
<?php |
| 2 |
/** |
| 3 |
* Selection Lite |
| 4 |
* |
| 5 |
* @encoding UTF-8 |
| 6 |
* @version 1.17 |
| 7 |
* @copyright (C) 2018-2026 Merkulove ( https://merkulov.design/ ). All rights reserved. |
| 8 |
* @license GPLv3 |
| 9 |
* @contributors merkulove, vladcherviakov, phoenixmkua, podolianochka, viktorialev01 |
| 10 |
* @support help@merkulov.design |
| 11 |
* @license GPLv3 |
| 12 |
* |
| 13 |
* @wordpress-plugin |
| 14 |
* Plugin Name: Selection Lite |
| 15 |
* Plugin URI: https://1.envato.market/selection |
| 16 |
* Description: Carefully selected Elementor addons bundle, for building the most awesome websites |
| 17 |
* Version: 1.17 |
| 18 |
* Requires at least: 5.0 |
| 19 |
* Requires PHP: 7.4 |
| 20 |
* Author: Merkulove |
| 21 |
* Author URI: https://1.envato.market/cc-merkulove |
| 22 |
* License: GPLv3 |
| 23 |
* Text Domain: selection-lite |
| 24 |
* Domain Path: /languages |
| 25 |
* Tested up to: 7.0 |
| 26 |
**/ |
| 27 |
|
| 28 |
namespace Merkulove; |
| 29 |
|
| 30 |
/** Exit if accessed directly. */ |
| 31 |
if ( ! defined( 'ABSPATH' ) ) { |
| 32 |
header( 'Status: 403 Forbidden' ); |
| 33 |
header( 'HTTP/1.1 403 Forbidden' ); |
| 34 |
exit; |
| 35 |
} |
| 36 |
|
| 37 |
/** Include plugin autoloader for additional classes. */ |
| 38 |
require __DIR__ . '/src/autoload.php'; |
| 39 |
|
| 40 |
use Merkulove\SelectionLite\Caster; |
| 41 |
use Merkulove\SelectionLite\Config; |
| 42 |
use Merkulove\SelectionLite\Unity\Unity; |
| 43 |
|
| 44 |
/** |
| 45 |
* SINGLETON: Core class used to implement a plugin. |
| 46 |
* |
| 47 |
* This is used to define internationalization, admin-specific hooks, and public-facing site hooks. |
| 48 |
* |
| 49 |
* @since 1.0 |
| 50 |
* |
| 51 |
**/ |
| 52 |
final class SelectionLite { |
| 53 |
|
| 54 |
/** |
| 55 |
* The one true SelectionLite. |
| 56 |
* |
| 57 |
* @var SelectionLite |
| 58 |
* @since 1.0 |
| 59 |
* @access private |
| 60 |
**/ |
| 61 |
private static $instance; |
| 62 |
|
| 63 |
/** |
| 64 |
* Sets up a new plugin instance. |
| 65 |
* |
| 66 |
* @since 1.0 |
| 67 |
* @access private |
| 68 |
* |
| 69 |
* @return void |
| 70 |
**/ |
| 71 |
private function __construct() { |
| 72 |
|
| 73 |
/** |
| 74 |
* Translations are loaded automatically by WordPress (since 4.6) |
| 75 |
* for plugins hosted on WordPress.org, so no manual |
| 76 |
* load_plugin_textdomain() call is needed. |
| 77 |
*/ |
| 78 |
|
| 79 |
} |
| 80 |
|
| 81 |
/** |
| 82 |
* Setup the plugin. |
| 83 |
* |
| 84 |
* @since 1.0 |
| 85 |
* @access public |
| 86 |
* |
| 87 |
* @return void |
| 88 |
**/ |
| 89 |
public function setup() { |
| 90 |
|
| 91 |
add_action( 'init', function () { |
| 92 |
|
| 93 |
/** Do critical compatibility checks and stop work if fails. */ |
| 94 |
if ( ! Unity::get_instance()->initial_checks( ['php56'] ) ) { return; } |
| 95 |
|
| 96 |
/** Initialize Unity and Main variables. */ |
| 97 |
Unity::get_instance(); |
| 98 |
|
| 99 |
/** Prepare custom plugin settings. */ |
| 100 |
Config::get_instance()->prepare_settings(); |
| 101 |
|
| 102 |
/** Setup the Unity. */ |
| 103 |
Unity::get_instance()->setup(); |
| 104 |
|
| 105 |
/** Custom setups for plugin. */ |
| 106 |
Caster::get_instance()->setup(); |
| 107 |
|
| 108 |
} ); |
| 109 |
|
| 110 |
} |
| 111 |
|
| 112 |
/** |
| 113 |
* Called when a plugin is activated. |
| 114 |
* |
| 115 |
* @static |
| 116 |
* @since 1.0 |
| 117 |
* @access public |
| 118 |
* |
| 119 |
* @return void |
| 120 |
**/ |
| 121 |
public static function on_activation() { |
| 122 |
|
| 123 |
/** Call Unity on plugin activation. */ |
| 124 |
Unity::on_activation(); |
| 125 |
|
| 126 |
} |
| 127 |
|
| 128 |
/** |
| 129 |
* Called when a plugin is deactivated. |
| 130 |
* |
| 131 |
* @static |
| 132 |
* @since 1.0 |
| 133 |
* @access public |
| 134 |
* |
| 135 |
* @return void |
| 136 |
**/ |
| 137 |
public static function on_deactivation() { |
| 138 |
|
| 139 |
/** MP on plugin deactivation. */ |
| 140 |
Unity::on_deactivation(); |
| 141 |
|
| 142 |
} |
| 143 |
|
| 144 |
/** |
| 145 |
* Main Instance. |
| 146 |
* |
| 147 |
* Insures that only one instance of plugin exists in memory at any one time. |
| 148 |
* |
| 149 |
* @static |
| 150 |
* @since 1.0 |
| 151 |
* |
| 152 |
* @return SelectionLite |
| 153 |
**/ |
| 154 |
public static function get_instance() { |
| 155 |
|
| 156 |
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) { |
| 157 |
|
| 158 |
self::$instance = new self; |
| 159 |
|
| 160 |
} |
| 161 |
|
| 162 |
return self::$instance; |
| 163 |
|
| 164 |
} |
| 165 |
|
| 166 |
} |
| 167 |
|
| 168 |
/** Run 'on_activation' when the plugin is activated. */ |
| 169 |
register_activation_hook( __FILE__, [ SelectionLite::class, 'on_activation' ] ); |
| 170 |
|
| 171 |
/** Run 'on_deactivation' when the plugin is deactivated. */ |
| 172 |
register_deactivation_hook( __FILE__, [ SelectionLite::class, 'on_deactivation' ] ); |
| 173 |
|
| 174 |
/** Run Plugin class once after activated plugins have loaded. */ |
| 175 |
add_action( 'plugins_loaded', [ SelectionLite::get_instance(), 'setup' ] ); |
| 176 |
|