PluginProbe
Selection Lite / 1.6
Selection Lite v1.6
trunk 1.0 1.1 1.10 1.11 1.12 1.14 1.15 1.16 1.17 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9
selection-lite / selection-lite.php

selection-lite.php in Selection Lite 1.6, at selection-lite.php

166 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Selection Lite
4 *
5 * @encoding UTF-8
6 * @version 1.6
7 * @copyright (C) 2018 - 2021 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.6
18 * Requires at least: 3.0
19 * Requires PHP: 5.6
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: 5.9
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 /** Initialize Unity and Main variables. */
74 Unity::get_instance();
75
76 }
77
78 /**
79 * Setup the plugin.
80 *
81 * @since 1.0
82 * @access public
83 *
84 * @return void
85 **/
86 public function setup() {
87
88 /** Do critical compatibility checks and stop work if fails. */
89 if ( ! Unity::get_instance()->initial_checks( ['php56'] ) ) { return; }
90
91 /** Prepare custom plugin settings. */
92 Config::get_instance()->prepare_settings();
93
94 /** Setup the Unity. */
95 Unity::get_instance()->setup();
96
97 /** Custom setups for plugin. */
98 Caster::get_instance()->setup();
99
100 }
101
102 /**
103 * Called when a plugin is activated.
104 *
105 * @static
106 * @since 1.0
107 * @access public
108 *
109 * @return void
110 **/
111 public static function on_activation() {
112
113 /** Call Unity on plugin activation. */
114 Unity::on_activation();
115
116 }
117
118 /**
119 * Called when a plugin is deactivated.
120 *
121 * @static
122 * @since 1.0
123 * @access public
124 *
125 * @return void
126 **/
127 public static function on_deactivation() {
128
129 /** MP on plugin deactivation. */
130 Unity::on_deactivation();
131
132 }
133
134 /**
135 * Main Instance.
136 *
137 * Insures that only one instance of plugin exists in memory at any one time.
138 *
139 * @static
140 * @since 1.0
141 *
142 * @return SelectionLite
143 **/
144 public static function get_instance() {
145
146 if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) {
147
148 self::$instance = new self;
149
150 }
151
152 return self::$instance;
153
154 }
155
156 }
157
158 /** Run 'on_activation' when the plugin is activated. */
159 register_activation_hook( __FILE__, [ SelectionLite::class, 'on_activation' ] );
160
161 /** Run 'on_deactivation' when the plugin is deactivated. */
162 register_deactivation_hook( __FILE__, [ SelectionLite::class, 'on_deactivation' ] );
163
164 /** Run Plugin class once after activated plugins have loaded. */
165 add_action( 'plugins_loaded', [ SelectionLite::get_instance(), 'setup' ] );
166