PluginProbe ʕ •ᴥ•ʔ
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor / 3.4.8
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor v3.4.8
3.9.5 3.9.6 3.9.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.3.0 2.3.1 2.3.1.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.4.0 2.5.0 2.5.1 2.5.10 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.8.5 2.8.6 2.8.7 2.8.8 2.9.0 2.9.1 2.9.2 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 3.4.9 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.6.0 3.6.1 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8.0 3.8.1 3.8.2 3.9.0 3.9.1 3.9.2 trunk 1.2.6 1.2.7 1.2.9 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.10 1.5.11 1.5.12 1.5.2 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.0.9.1 2.0.9.2 2.0.9.3
elementskit-lite / elementskit-lite.php
elementskit-lite Last commit date
compatibility 1 year ago config 1 year ago core 3 years ago helpers 1 year ago languages 1 year ago libs 1 year ago modules 1 year ago traits 4 years ago widgets 1 year ago autoloader.php 4 years ago elementskit-lite.php 1 year ago plugin.php 1 year ago readme.txt 1 year ago wpml-config.xml 1 year ago
elementskit-lite.php
455 lines
1 <?php
2
3 use ElementsKit_Lite\Plugin;
4
5 defined( 'ABSPATH' ) || exit;
6
7 /**
8 * Plugin Name: ElementsKit Lite
9 * Description: The most advanced addons for Elementor with tons of widgets, Header builder, Footer builder, Mega menu builder, layout pack and powerful custom controls.
10 * Plugin URI: https://products.wpmet.com/elementskit
11 * Author: Wpmet
12 * Version: 3.4.8
13 * Author URI: https://wpmet.com/
14 * License: GPLv3 or later
15 * License URI: https://www.gnu.org/licenses/gpl-3.0.html
16 *
17 * Text Domain: elementskit-lite
18 * Domain Path: /languages
19 *
20 * ElementsKit is a powerful addon for Elementor page builder.
21 * It includes most comprehensive modules, such as "header footer builder", "mega menu",
22 * "layout installer", "quick form builder" etc under the hood.
23 * It has a tons of widgets to create any sites with an ease. It has some most unique
24 * and powerful custom controls for elementor, such as "image picker", "ajax select", "widget area".
25 *
26 */
27
28
29 final class ElementsKit_Lite {
30 /**
31 * Plugin Version
32 *
33 * @since 1.0.0
34 * @var string The plugin version.
35 */
36 static function version() {
37 return '3.4.8';
38 }
39
40 /**
41 * Package type
42 *
43 * @since 1.1.0
44 * @var string The plugin purchase type [pro/ free].
45 */
46 static function package_type() {
47 return apply_filters( 'elementskit/core/package_type', 'free' );
48 }
49
50
51 /**
52 * Package type
53 *
54 * @since 1.1.0
55 * @var string The plugin purchase type [pro/ free].
56 */
57 static function license_status() {
58 if ( ! class_exists( 'ElementsKit\Libs\Framework\Classes\License' ) ) {
59 return 'invalid';
60 }
61 if ( ElementsKit\Libs\Framework\Classes\License::instance()->status() != 'valid' ) {
62 return 'invalid';
63 }
64
65 return 'valid';
66 }
67
68 public static function license_data() {
69 if ( ! class_exists( '\ElementsKit_Lite\Libs\Framework\Classes\Utils' ) ) {
70 return array(
71 'key' => '',
72 'checksum' => '',
73 'plugin_package' => self::package_type(),
74 );
75 }
76
77 return array(
78 'key' => \ElementsKit_Lite\Libs\Framework\Classes\Utils::instance()->get_option( 'license_key' ),
79 'checksum' => get_option( '__validate_oppai__' ),
80 'plugin_package' => self::package_type(),
81 );
82 }
83
84
85 /**
86 * Product ID
87 *
88 * @since 1.2.6
89 * @var string The plugin ID in our server.
90 */
91 static function product_id() {
92 return '9';
93 }
94
95 /**
96 * Author Name
97 *
98 * @since 1.3.1
99 * @var string The plugin author.
100 */
101 static function author_name() {
102 return 'Wpmet';
103 }
104
105 /**
106 * Store Name
107 *
108 * @since 1.3.1
109 * @var string The store name: self site, envato.
110 */
111 static function store_name() {
112 return 'wordpressorg';
113 }
114
115 /**
116 * Minimum Elementor Version
117 *
118 * @since 1.0.0
119 * @var string Minimum Elementor version required to run the plugin.
120 */
121 static function min_el_version() {
122 return '3.0.0';
123 }
124
125 /**
126 * Minimum PHP Version
127 *
128 * @since 1.0.0
129 * @var string Minimum PHP version required to run the plugin.
130 */
131 static function min_php_version() {
132 return '7.0';
133 }
134
135 /**
136 * Plugin file
137 *
138 * @since 1.0.0
139 * @var string plugins's root file.
140 */
141 static function plugin_file() {
142 return __FILE__;
143 }
144
145 /**
146 * Plugin url
147 *
148 * @since 1.0.0
149 * @var string plugins's root url.
150 */
151 static function plugin_url() {
152 return trailingslashit( plugin_dir_url( __FILE__ ) );
153 }
154
155 /**
156 * Plugin dir
157 *
158 * @since 1.0.0
159 * @var string plugins's root directory.
160 */
161 static function plugin_dir() {
162 return trailingslashit( plugin_dir_path( __FILE__ ) );
163 }
164
165 /**
166 * Plugin's widget directory.
167 *
168 * @since 1.0.0
169 * @var string widget's root directory.
170 */
171 static function widget_dir() {
172 return self::plugin_dir() . 'widgets/';
173 }
174
175 /**
176 * Plugin's widget url.
177 *
178 * @since 1.0.0
179 * @var string widget's root url.
180 */
181 static function widget_url() {
182 return self::plugin_url() . 'widgets/';
183 }
184
185
186 /**
187 * API url
188 *
189 * @since 1.0.0
190 * @var string for license, layout notification related functions.
191 */
192 static function api_url() {
193 return 'https://api.wpmet.com/public/';
194 }
195
196 /**
197 * Account url
198 *
199 * @since 1.2.6
200 * @var string for plugin update notification, user account page.
201 */
202 static function account_url() {
203 return 'https://account.wpmet.com';
204 }
205
206 /**
207 * Plugin's module directory.
208 *
209 * @since 1.0.0
210 * @var string module's root directory.
211 */
212 static function module_dir() {
213 return self::plugin_dir() . 'modules/';
214 }
215
216 /**
217 * Plugin's module url.
218 *
219 * @since 1.0.0
220 * @var string module's root url.
221 */
222 static function module_url() {
223 return self::plugin_url() . 'modules/';
224 }
225
226
227 /**
228 * Plugin's lib directory.
229 *
230 * @since 1.0.0
231 * @var string lib's root directory.
232 */
233 static function lib_dir() {
234 return self::plugin_dir() . 'libs/';
235 }
236
237 /**
238 * Plugin's lib url.
239 *
240 * @since 1.0.0
241 * @var string lib's root url.
242 */
243 static function lib_url() {
244 return self::plugin_url() . 'libs/';
245 }
246
247 /**
248 * Active plugin's textdomain list
249 */
250 static function active_plugins() {
251 require_once ABSPATH . 'wp-admin/includes/plugin.php';
252 $apl = get_option( 'active_plugins' );
253 $plugins = get_plugins();
254 $filter_string = '';
255 foreach ( $apl as $p ) {
256 if ( isset( $plugins[ $p ] ) && isset( $plugins[ $p ]['TextDomain'] ) ) {
257 $filter_string .= ',' . $plugins[ $p ]['TextDomain'];
258 }
259 }
260 return ltrim( $filter_string, ',' );
261 }
262
263 /**
264 * Constructor
265 *
266 * @since 1.0.0
267 * @access public
268 */
269 public function __construct() {
270 // Load the main static helper class.
271 require_once self::plugin_dir() . 'libs/notice/notice.php'; // new notice system
272 require_once self::plugin_dir() . 'libs/banner/banner.php'; // new banner system
273 require_once self::plugin_dir() . 'libs/stories/stories.php'; // new stories system
274 require_once self::plugin_dir() . 'libs/rating/rating.php';
275 require_once self::plugin_dir() . 'libs/pro-awareness/pro-awareness.php'; // pro menu class file
276 require_once self::plugin_dir() . 'libs/forms/forms.php'; // form menu class file
277 require_once self::plugin_dir() . 'libs/our-plugins/our-plugins.php'; // used to display the wpmet other plugins
278 require_once self::plugin_dir() . 'libs/emailkit/emailkit.php';
279 require_once self::plugin_dir() . 'helpers/utils.php';
280
281 // Load translation
282 add_action( 'init', array( $this, 'i18n' ) );
283 // Init Plugin
284 add_action( 'plugins_loaded', array( $this, 'init' ), 100 );
285 }
286
287 /**
288 * Load Textdomain
289 *
290 * Load plugin localization files.
291 * Fired by `init` action hook.
292 *
293 * @since 1.0.0
294 * @access public
295 */
296 public function i18n() {
297 load_plugin_textdomain( 'elementskit-lite', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
298 }
299
300 /**
301 * Initialize the plugin
302 *
303 * Checks for basic plugin requirements, if one check fail don't continue,
304 * if all check have passed include the plugin class.
305 *
306 * Fired by `plugins_loaded` action hook.
307 *
308 * @since 1.0.0
309 * @access public
310 */
311 public function init() {
312 // Load the Plugin class, it's the core class of ElementsKit_Lite.
313 require_once self::plugin_dir() . 'plugin.php';
314
315 \ElementsKit_Lite\Plugin::registrar_autoloader();
316
317 // init notice class
318 \Oxaim\Libs\Notice::init();
319
320 // init pro menu class
321 \Wpmet\Libs\Pro_Awareness::init();
322
323 // Check if Elementor installed and activated.
324 if ( ! did_action( 'elementor/loaded' ) ) {
325 add_action( 'admin_head', array( $this, 'missing_elementor' ) );
326 return;
327 }
328
329 // Check for required PHP version.
330 if ( version_compare( PHP_VERSION, self::min_php_version(), '<' ) ) {
331 add_action( 'admin_head', array( $this, 'failed_php_version' ) );
332 return;
333 }
334
335 // Register ElementsKit_Lite widget category
336 add_action( 'elementor/elements/categories_registered', array( $this, 'elementor_widget_category' ) );
337
338 // initiate elementor custom controls
339 new \ElementsKit_Lite\Modules\Controls\Init();
340
341 add_action(
342 'elementor/init',
343 function() {
344 if ( class_exists( 'ElementsKit' ) && ! class_exists( 'ElementsKit_Comp' ) ) {
345 return;
346 }
347
348 // adding backward classes and methods for older 14 number themes.
349 require_once self::plugin_dir() . 'compatibility/backward/plugin-class-backward-compatibility.php';
350 require_once self::plugin_dir() . 'compatibility/backward/utils-backward-compablity.php';
351
352 // Run the instance.
353 Plugin::instance();
354
355 // adding backward classes and methods for older 14 number themes.
356 require_once self::plugin_dir() . 'compatibility/backward/module-list.php';
357 require_once self::plugin_dir() . 'compatibility/backward/widget-list.php';
358 }
359 );
360 }
361
362 /**
363 * Admin notice
364 *
365 * Warning when the site doesn't have required Elementor.
366 *
367 * @since 1.0.0
368 * @access public
369 */
370 public function missing_elementor() {
371 $btn = array(
372 'default_class' => 'button',
373 'class' => 'button-primary ', // button-primary button-secondary button-small button-large button-link
374 );
375
376 if ( file_exists( WP_PLUGIN_DIR . '/elementor/elementor.php' ) ) {
377 $btn['text'] = esc_html__( 'Activate Elementor', 'elementskit-lite' );
378 $btn['url'] = wp_nonce_url( 'plugins.php?action=activate&plugin=elementor/elementor.php&plugin_status=all&paged=1', 'activate-plugin_elementor/elementor.php' );
379 } else {
380 $btn['text'] = esc_html__( 'Install Elementor', 'elementskit-lite' );
381 $btn['url'] = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' );
382 }
383
384 \Oxaim\Libs\Notice::instance( 'elementskit-lite', 'unsupported-elementor-version' )
385 ->set_type( 'error' )
386 ->set_message( sprintf( '%1$s %2$s+, %3$s',
387 esc_html__( 'ElementsKit requires Elementor version', 'elementskit-lite' ),
388 self::min_el_version() ,
389 esc_html__( 'which is currently NOT RUNNING.', 'elementskit-lite' ),
390 ) )
391 ->set_button( $btn )
392 ->call();
393 }
394
395 /**
396 * Admin notice
397 *
398 * Warning when the site doesn't have a minimum required PHP version.
399 *
400 * @since 1.0.0
401 * @access public
402 */
403 public function failed_php_version() {
404 \Oxaim\Libs\Notice::instance( 'elementskit-lite', 'unsupported-php-version' )
405 ->set_type( 'error' )
406 ->set_message( sprintf( '%1$s %2$s+, %3$s',
407 esc_html__( 'ElementsKit requires PHP version', 'elementskit-lite' ),
408 self::min_php_version(),
409 esc_html__( 'which is currently NOT RUNNING on this server.', 'elementskit-lite' )
410 ))
411 ->call();
412 }
413
414 /**
415 * Rewrite flush.
416 *
417 * @since 1.0.7
418 * @access public
419 */
420 public static function install_activation_key() {
421 add_option( 'elementskit-lite__plugin_activated', self::plugin_file() );
422 }
423
424 /**
425 * Add category.
426 *
427 * Register custom widget category in Elementor's editor
428 *
429 * @since 1.0.0
430 * @access public
431 */
432 public function elementor_widget_category( $widgets_manager ) {
433 $widgets_manager->add_category(
434 'elementskit',
435 array(
436 'title' => esc_html__( 'ElementsKit', 'elementskit-lite' ),
437 'icon' => 'fa fa-plug',
438 ),
439 1
440 );
441 $widgets_manager->add_category(
442 'elementskit_headerfooter',
443 array(
444 'title' => esc_html__( 'ElementsKit Header Footer', 'elementskit-lite' ),
445 'icon' => 'fa fa-plug',
446 ),
447 1
448 );
449 }
450 }
451
452 new ElementsKit_Lite();
453
454 register_activation_hook( __FILE__, 'ElementsKit_Lite::install_activation_key' );
455