PluginProbe ʕ •ᴥ•ʔ
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor / 4.0.1
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor v4.0.1
4.0.2 4.0.1 4.0.0 3.10.02 3.10.01 3.9.10 3.9.9 3.9.8 3.9.7 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 / plugin.php
elementskit-lite Last commit date
assets 3 weeks ago compatibility 3 weeks ago config 3 weeks ago core 3 weeks ago helpers 3 weeks ago languages 3 weeks ago libs 3 weeks ago mcp 3 weeks ago modules 3 weeks ago traits 4 years ago widgets 3 weeks ago autoloader.php 3 weeks ago elementskit-lite.php 3 weeks ago plugin.php 3 weeks ago readme.txt 3 weeks ago wpml-config.xml 3 weeks ago
plugin.php
517 lines
1 <?php
2 namespace ElementsKit_Lite;
3
4 defined( 'ABSPATH' ) || exit;
5
6
7 /**
8 * ElementsKit - the God class.
9 * Initiate all necessary classes, hooks, configs.
10 *
11 * @since 1.0.0
12 */
13 class Plugin {
14
15
16 /**
17 * The plugin instance.
18 *
19 * @since 1.0.0
20 * @access public
21 * @static
22 *
23 * @var Plugin
24 */
25 public static $instance = null;
26
27 /**
28 * Construct the plugin object.
29 *
30 * @since 1.0.0
31 * @access public
32 */
33 public function __construct() {
34
35 // check on-boarding status
36 Libs\Framework\Classes\Onboard_Status::instance()->onboard();
37
38 // Initialize deactivation feedback
39 Core\Plugin_Unsubscribe::instance();
40
41 // migrate old settings db to new format.
42 new Compatibility\Data_Migration\Settings_Db();
43
44 // compatibility for element manager.
45 new Compatibility\Element_Manager\Init();
46
47 // Enqueue admin scripts.
48 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin' ) );
49
50 // Enqueue inline scripts
51 Core\Build_Inline_Scripts::instance();
52
53 // Register plugin settings pages
54 Libs\Framework\Attr::instance();
55
56 // Register default widgets
57 Core\Build_Widgets::instance();
58
59 // Register default modules
60 Core\Build_Modules::instance();
61
62 // Register ElementsKit MCP support (shared service, WP Abilities,
63 // MCP server, REST proxy and the Angie editor tools).
64 Mcp\Manager::instance();
65
66 // register plugin activation actions
67 ( new Core\Activation_Actions() )->init();
68
69 add_action( 'send_headers', array( $this, 'add_meta_for_search_excluded' ) );
70
71 // Register ElementsKit supported widgets to Elementor from 3rd party plugins.
72 add_action( 'elementor/widgets/register', array( $this, 'register_widgets' ), 1050 );
73
74 // Register wpml compatibility
75 Compatibility\Wpml\Init::instance();
76
77 // Compatibility issues
78 Compatibility\Conflicts\Init::instance();
79
80 // Show forms sub menu page
81 \Wpmet\Libs\Forms::instance();
82
83 $is_pro_active = \ElementsKit_Lite\Utils::ekit_is_plugin_active( 'elementskit/elementskit.php');
84
85 // Initialize editor promotion for pro widgets
86 if( ! $is_pro_active ) {
87 add_action( 'elementor/editor/init', function() {
88 if ( class_exists( '\ElementsKit_Lite\Core\Editor_Promotion' ) ) {
89 \ElementsKit_Lite\Core\Editor_Promotion::instance()->init();
90 }
91 } );
92 }
93
94 if ( is_admin() && Libs\Framework\Classes\Utils::instance()->get_settings( 'ekit_user_consent_for_banner', 'yes' ) == 'yes' ) {
95 $filter_string = \ElementsKit_Lite::active_plugins();
96 /**
97 * Show WPMET stories widget in dashboard
98 */
99 \Wpmet\Libs\Stories::instance( 'elementskit-lite' )
100 // ->is_test(true)
101 ->set_filter( $filter_string )
102 ->set_plugin( 'ElementsKit', 'https://wpmet.com/plugin/elementskit/' )
103 ->set_api_url( 'https://api.wpmet.com/public/stories/' )
104 ->call();
105
106 /**
107 * Show WPMET banner (codename: jhanda)
108 */
109 \Wpmet\Libs\Banner::instance( 'elementskit-lite' )
110 // ->is_test(true)
111 ->set_filter( ltrim( $filter_string, ',' ) )
112 ->set_api_url( 'https://api.wpmet.com/public/jhanda' )
113 ->set_plugin_screens( 'edit-elementskit_template' )
114 ->set_plugin_screens( 'toplevel_page_elementskit' )
115 ->call();
116
117 /**
118 * Ask for rating
119 * A rating notice will appear depends on
120 * @set_first_appear_day methods
121 */
122 \Wpmet\Libs\Rating::instance( 'elementskit-lite' )
123 ->set_plugin( 'ElementsKit', 'https://wpmet.com/wordpress.org/rating/elementskit' )
124 ->set_plugin_logo( 'https://ps.w.org/elementskit-lite/assets/icon-128x128.gif', 'width:150px !important' )
125 ->set_allowed_screens( 'edit-elementskit_template' )
126 ->set_allowed_screens( 'toplevel_page_elementskit' )
127 ->set_allowed_screens( 'elementskit_page_elementskit-lite_get_help' )
128 ->set_priority( 10 )
129 ->set_first_appear_day( 7 )
130 ->set_condition( true )
131 ->call();
132
133 }
134
135 /**
136 * Show go Premium menu
137 */
138 $pro_awareness = \Wpmet\Libs\Pro_Awareness::instance('elementskit-lite');
139
140 if(version_compare($pro_awareness->get_version(), '1.2.0') >= 0) {
141 $pro_awareness
142 ->set_parent_menu_slug( 'elementskit' )
143 ->set_plugin_file( 'elementskit-lite/elementskit-lite.php' )
144 ->set_pro_link(
145 ( ( \ElementsKit_Lite::package_type() != 'free' ) ? '' : 'https://wpmet.com/elementskit-pricing' )
146 )
147 ->set_default_grid_thumbnail( \ElementsKit_Lite::lib_url() . 'pro-awareness/assets/support.png' )
148 ->set_page_grid(
149 array(
150 'url' => 'https://wpmet.com/fb-group',
151 'title' => esc_html__( 'Join the Community', 'elementskit-lite' ),
152 'thumbnail' => \ElementsKit_Lite::lib_url() . 'pro-awareness/assets/community.png',
153 'description' => esc_html__( 'Join our Facebook group to get 20% discount coupon on premium products. Follow us to get more exciting offers.', 'elementskit-lite' )
154 )
155 )
156 ->set_page_grid(
157 array(
158 'url' => 'https://www.youtube.com/playlist?list=PL3t2OjZ6gY8MVnyA4OLB6qXb77-roJOuY',
159 'title' => esc_html__( 'Video Tutorials', 'elementskit-lite' ),
160 'thumbnail' => \ElementsKit_Lite::lib_url() . 'pro-awareness/assets/videos.png',
161 'description' => esc_html__( 'Learn the step by step process for developing your site easily from video tutorials.', 'elementskit-lite' )
162 )
163 )
164 ->set_page_grid(
165 array(
166 'url' => 'https://wpmet.com/plugin/elementskit/roadmaps#ideas',
167 'title' => esc_html__( 'Request a feature', 'elementskit-lite' ),
168 'thumbnail' => \ElementsKit_Lite::lib_url() . 'pro-awareness/assets/request.png',
169 'description' => esc_html__( 'Have any special feature in mind? Let us know through the feature request.', 'elementskit-lite' )
170 )
171 )
172 ->set_page_grid(
173 array(
174 'url' => 'https://wpmet.com/doc/elementskit/',
175 'title' => esc_html__( 'Documentation', 'elementskit-lite' ),
176 'thumbnail' => \ElementsKit_Lite::lib_url() . 'pro-awareness/assets/documentation.png',
177 'description' => esc_html__( 'Detailed documentation to help you understand the functionality of each feature.', 'elementskit-lite' )
178 )
179 )
180 ->set_page_grid(
181 array(
182 'url' => 'https://wpmet.com/plugin/elementskit/roadmaps/',
183 'title' => esc_html__( 'Public Roadmap', 'elementskit-lite' ),
184 'thumbnail' => \ElementsKit_Lite::lib_url() . 'pro-awareness/assets/roadmaps.png',
185 'description' => esc_html__( 'Check our upcoming new features, detailed development stories and tasks', 'elementskit-lite' )
186 )
187 )
188 ->set_plugin_row_meta( esc_html__( 'Documentation', 'elementskit-lite' ), 'https://wpmet.com/elementskit-docs', array( 'target' => '_blank' ) )
189 ->set_plugin_row_meta( esc_html__( 'Facebook Community', 'elementskit-lite' ), 'https://wpmet.com/fb-group', array( 'target' => '_blank' ) )
190 ->set_plugin_row_meta( esc_html__( 'Rate the plugin �
191
192
193
194
195 ', 'elementskit-lite' ), 'https://wordpress.org/support/plugin/elementskit-lite/reviews/#new-post', array( 'target' => '_blank' ) )
196 ->set_plugin_action_link( esc_html__( 'Settings', 'elementskit-lite' ), admin_url() . 'admin.php?page=elementskit' )
197 ->set_plugin_action_link(
198 ( $is_pro_active ? '' : esc_html__( 'Go Premium', 'elementskit-lite' ) ),
199 'https://wpmet.com/elementskit-pricing',
200 array(
201 'target' => '_blank',
202 'style' => 'color: #FCB214; font-weight: bold;',
203 )
204 )
205 ->call();
206 }
207
208 // Adding pro lebel
209 if ( \ElementsKit_Lite::package_type() == 'free' ) {
210 new Libs\Pro_Label\Init();
211 }
212
213 /**
214 * Show our plugins menu for others wpmet plugins
215 */
216 \Wpmet\Libs\Our_Plugins::instance()->init('elementskit-lite') # @text_domain
217 ->set_parent_menu_slug('elementskit') # @plugin_slug
218 ->set_submenu_name(
219 esc_html__('Our Plugins', 'elementskit-lite')
220 ) # @submenu_name (optional- default: Our Plugins)
221 ->set_section_title(
222 esc_html__('Take Your WordPress Website To Next Level!', 'elementskit-lite')
223 ) # @section_title (optional)
224 ->set_section_description(
225 esc_html__('Our diverse range of plugins has every solution for WordPress, Gutenberg, Elementor, and WooCommerce.', 'elementskit-lite')
226 ) # @section_description (optional)
227 ->set_items_per_row(4) # @items_per_row (optional- default: 6)
228 ->set_plugins(
229 [
230 'gutenkit-blocks-addon/gutenkit-blocks-addon.php' => [
231 'name' => esc_html__('GutenKit', 'elementskit-lite'),
232 'url' => 'https://wordpress.org/plugins/gutenkit-blocks-addon/',
233 'icon' => 'https://ps.w.org/gutenkit-blocks-addon/assets/icon-256x256.gif?rev=3044956',
234 'desc' => esc_html__('Gutenberg blocks, patterns, and templates that extend the page-building experience using the WordPress block editor.', 'elementskit-lite'),
235 'docs' => 'https://wpmet.com/docs/gutenkit/',
236 ],
237 'rox-dynamic-cpt-fields-engine/rox-dynamic-cpt-fields-engine.php' => [
238 'name' => esc_html__('Dynamic CPT Fields Engine', 'elementskit-lite'),
239 'url' => 'https://wordpress.org/plugins/rox-dynamic-cpt-fields-engine/',
240 'icon' => 'https://ps.w.org/rox-dynamic-cpt-fields-engine/assets/icon-128x128.jpeg?rev=3538537',
241 'desc' => esc_html__('Build custom post types, fields, taxonomies, and dynamic frontend layouts for WordPress, with zero coding and full AI-generated schema.', 'elementskit-lite'),
242 'docs' => 'https://wpmet.com/doc/rox-dynamic-cpt-fields-engine/',
243 ],
244 'rox-appointment-booking/rox-appointment-booking.php' => [
245 'name' => esc_html__('Rox Appointment Booking', 'elementskit-lite'),
246 'url' => 'https://wordpress.org/plugins/rox-appointment-booking/',
247 'icon' => 'https://ps.w.org/rox-appointment-booking/assets/icon-128x128.png?rev=3575641',
248 'desc' => esc_html__(' Manage bookings, agents, payments, and calendars from one dashboard! A complete appointment and scheduling solution for WordPress.', 'elementskit-lite'),
249 'docs' => 'https://wpmet.com/doc/rox-appointment-booking/',
250 ],
251 'metform/metform.php' => [
252 'name' => esc_html__('MetForm', 'elementskit-lite'),
253 'url' => 'https://wordpress.org/plugins/genie-image-ai/',
254 'icon' => 'https://ps.w.org/metform/assets/icon-256x256.png?rev=2544152',
255 'desc' => esc_html__('Drag & drop form builder for Elementor to create contact forms, multi-step forms, and more — smoother, faster, and better!', 'elementskit-lite'),
256 'docs' => 'https://wpmet.com/doc/metform/',
257 ],
258 'shopengine/shopengine.php' => [
259 'name' => esc_html__('ShopEngine', 'elementskit-lite'),
260 'url' => 'https://wordpress.org/plugins/shopengine/',
261 'icon' => 'https://ps.w.org/shopengine/assets/icon-256x256.gif?rev=2505061',
262 'desc' => esc_html__('Complete WooCommerce solution for Elementor to fully customize any pages including cart, checkout, shop page, and so on.', 'elementskit-lite'),
263 'docs' => 'https://wpmet.com/doc/shopengine/',
264 ],
265 'popup-builder-block/popup-builder-block.php' => [
266 'name' => esc_html__('PopupKit', 'elementskit-lite'),
267 'url' => 'https://wordpress.org/plugins/popup-builder-block/',
268 'icon' => 'https://ps.w.org/popup-builder-block/assets/icon-256x256.png?rev=3316844',
269 'desc' => esc_html__('Design popups that convert, right in your WordPress dashboard.', 'elementskit-lite'),
270 'docs' => 'https://wpmet.com/docs/popupkit/',
271 ],
272 'table-builder-block/table-builder-block.php' => [
273 'name' => esc_html__('TableKit', 'elementskit-lite'),
274 'url' => 'https://wordpress.org/plugins/table-builder-block/',
275 'icon' => 'https://ps.w.org/table-builder-block/assets/icon-256x256.jpg?rev=3168211',
276 'desc' => esc_html__('Fully Customizable. Multi-Media Integration. Synch Any Data Files. All Within Block Editor.', 'elementskit-lite'),
277 'docs' => 'https://wpmet.com/docs/tablekit/',
278 ],
279 'getgenie/getgenie.php' => [
280 'name' => esc_html__('GetGenie AI', 'elementskit-lite'),
281 'url' => 'https://wordpress.org/plugins/getgenie/',
282 'icon' => 'https://ps.w.org/getgenie/assets/icon-256x256.gif?rev=2798355',
283 'desc' => esc_html__('Your personal AI assistant for content and SEO. Write content that ranks on Google with NLP keywords and SERP analysis data.', 'elementskit-lite'),
284 'docs' => 'https://getgenie.ai/docs/',
285 ],
286 'emailkit/EmailKit.php' => [
287 'name' => esc_html__('EmailKit', 'elementskit-lite'),
288 'url' => 'https://wordpress.org/plugins/genie-image-ai/',
289 'icon' => 'https://ps.w.org/emailkit/assets/icon-256x256.png?rev=3003571',
290 'desc' => esc_html__('Advanced email customizer for WooCommerce and WordPress. Build, customize, and send emails from WordPress to boost your sales!', 'elementskit-lite'),
291 'docs' => 'https://wpmet.com/doc/emailkit/',
292 ],
293 'wp-social/wp-social.php' => [
294 'name' => esc_html__('WP Social', 'elementskit-lite'),
295 'url' => 'https://wordpress.org/plugins/wp-social/',
296 'icon' => 'https://ps.w.org/wp-social/assets/icon-256x256.png?rev=2544214',
297 'desc' => esc_html__('Add social share, login, and engagement counter — unified solution for all social media with tons of different styles for your website.', 'elementskit-lite'),
298 'docs' => 'https://wpmet.com/doc/wp-social/',
299 ],
300 'blocks-for-shopengine/shopengine-gutenberg-addon.php' => [
301 'name' => esc_html__('Blocks for ShopEngine', 'elementskit-lite'),
302 'url' => 'https://wordpress.org/plugins/blocks-for-shopengine/',
303 'icon' => 'https://ps.w.org/blocks-for-shopengine/assets/icon-256x256.gif?rev=2702483',
304 'desc' => esc_html__('All in one WooCommerce solution for Gutenberg! Build your WooCommerce pages in a block editor with full customization.', 'elementskit-lite'),
305 'docs' => 'https://wpmet.com/doc/shopengine/shopengine-gutenberg/',
306 ],
307 ]
308 ) # @plugins
309 ->call();
310
311 $user_consent = Libs\Framework\Classes\Utils::instance()->get_settings('ekit_user_consent_for_banner', 'yes') == 'yes';
312
313 /**
314 * EmailKit Global Class initialization
315 *
316 */
317 if (
318 class_exists('WooCommerce')
319 && !class_exists('EmailKit')
320 && !did_action('edit_with_emailkit_loaded')
321 && class_exists('\Wpmet\Libs\Emailkit')
322 && $user_consent
323 ) {
324 new \Wpmet\Libs\Emailkit();
325 }
326
327 /**
328 * Initializes the Template Library of the Gutenkit plugin
329 *
330 * This code block checks if certain conditions are met and then initializes the Template Library of the Gutenkit plugin.
331 *
332 * Conditions:
333 * - The action 'edit_with_gutenkit_loaded' has not been performed yet.
334 * - The class '\ElementsKit_Lite\Libs\Template_Library\Init' exists.
335 * - The setting 'ekit_user_consent_for_banner' in the Utils class is set to 'yes'.
336 * - The plugin 'gutenkit-blocks-addon' is not active or install.
337 *
338 * If any of the above conditions are met, the Template Library is initialized by creating a new instance of
339 * the class '\ElementsKit_Lite\Libs\Template_Library\Init'.
340 *
341 * @since 3.1.4
342 */
343 if ($user_consent && class_exists('\ElementsKit_Lite\Libs\Template_Library\Init') && !did_action('gutenkit/init')) {
344 new \ElementsKit_Lite\Libs\Template_Library\Init();
345 }
346 }
347
348 /**
349 * Check the admin screen and show the rating notice if eligible
350 *
351 * @access private
352 * @return boolean
353 */
354 private function should_show_rating_notice() {
355
356 if ( \ElementsKit_Lite::package_type() == 'free' ) {
357 return true;
358 }
359
360 if ( ! function_exists( 'get_current_screen' ) ) {
361 return false;
362 }
363
364 $current_screen = ( get_current_screen() )->base;
365 $current_post_type = ( get_current_screen() )->post_type;
366 $eligible_post_type = array( 'elementskit_template' );
367 $eligible_screens = array( 'plugins', 'dashboard', 'elementskit', 'themes' );
368
369 if ( in_array( $current_post_type, $eligible_post_type ) ) {
370 return true;
371 }
372
373 if ( in_array( $current_screen, $eligible_screens ) ) {
374 return true;
375 }
376
377 return false;
378 }
379
380 /**
381 * Enqueue scripts
382 *
383 * Enqueue js and css to admin.
384 *
385 * @since 1.0.0
386 * @access public
387 */
388 public function enqueue_admin() {
389 $screen = get_current_screen();
390
391 if ( ! in_array( $screen->id, array( 'nav-menus', 'toplevel_page_elementskit', 'edit-elementskit_template', 'elementskit_page_elementskit-license', 'elementskit_page_elementskit-lite_get_help' ) ) ) {
392 return;
393 }
394
395 // Use the Font Awesome bundled with Elementor instead of shipping our own copy.
396 if ( defined( 'ELEMENTOR_ASSETS_URL' ) ) {
397 wp_register_style( 'fontawesome', ELEMENTOR_ASSETS_URL . 'lib/font-awesome/css/all.min.css', false, ELEMENTOR_VERSION );
398 }
399 wp_register_style( 'elementskit-font-css-admin', \ElementsKit_Lite::module_url() . 'elementskit-icon-pack/assets/css/ekiticons.css', false, \ElementsKit_Lite::version() );
400 wp_register_style( 'elementskit-init-css-admin', \ElementsKit_Lite::lib_url() . 'framework/assets/css/admin-style.css', false, \ElementsKit_Lite::version() );
401
402 wp_enqueue_style( 'fontawesome' );
403 wp_enqueue_style( 'elementskit-font-css-admin' );
404 wp_enqueue_style( 'elementskit-init-css-admin' );
405
406 wp_enqueue_script( 'ekit-admin-core', \ElementsKit_Lite::lib_url() . 'framework/assets/js/ekit-admin-core.js', array( 'jquery' ), \ElementsKit_Lite::version(), true );
407
408 $data['rest_url'] = get_rest_url();
409 $data['nonce'] = wp_create_nonce( 'wp_rest' );
410
411 wp_localize_script( 'ekit-admin-core', 'rest_config', $data );
412
413 wp_localize_script(
414 'ekit-admin-core',
415 'ekit_ajax_var',
416 array(
417 'nonce' => wp_create_nonce( 'ajax-nonce' ),
418 )
419 );
420
421 wp_localize_script(
422 'ekit-admin-core',
423 'ekit_admin_i18n',
424 array(
425 'disabled' => esc_html__( 'Disabled', 'elementskit-lite' ),
426 )
427 );
428 }
429
430 /**
431 * Control registrar.
432 *
433 * Register the custom controls for Elementor
434 * using `elementskit/widgets/widgets_registered` action.
435 *
436 * @since 1.0.0
437 * @access public
438 */
439 public function register_control( $widgets_manager ) {
440 do_action( 'elementskit/widgets/widgets_registered', $widgets_manager );
441 }
442
443
444 /**
445 * Widget registrar.
446 *
447 * Retrieve all the registered widgets
448 * using `elementor/widgets/register` action.
449 *
450 * @since 1.0.0
451 * @access public
452 */
453 public function register_widgets( $widgets_manager ) {
454 do_action( 'elementskit/widgets/widgets_registered', $widgets_manager );
455 }
456
457 /**
458 * Excluding ElementsKit template and megamenu content from search engine.
459 * See - https://wordpress.org/support/topic/google-is-indexing-elementskit-content-as-separate-pages/
460 *
461 * @since 1.4.5
462 * @access public
463 */
464 public function add_meta_for_search_excluded() {
465 if (
466 ! is_admin() &&
467 is_singular() &&
468 in_array(
469 get_post_type(),
470 array( 'elementskit_widget', 'elementskit_template', 'elementskit_content' ),
471 true
472 )
473 ) {
474 header( 'X-Robots-Tag: noindex', true );
475 }
476 }
477
478 /**
479 * Autoloader.
480 *
481 * ElementsKit autoloader loads all the classes needed to run the plugin.
482 *
483 * @since 1.0.0
484 * @access private
485 */
486 public static function registrar_autoloader() {
487 require_once \ElementsKit_Lite::plugin_dir() . '/autoloader.php';
488 Autoloader::run();
489 }
490
491 /**
492 * Instance.
493 *
494 * Ensures only one instance of the plugin class is loaded or can be loaded.
495 *
496 * @since 1.0.0
497 * @access public
498 * @static
499 *
500 * @return Plugin An instance of the class.
501 */
502 public static function instance() {
503 if ( is_null( self::$instance ) ) {
504
505 do_action( 'elementskit_lite/before_loaded' );
506
507 // Fire when ElementsKit instance.
508 self::$instance = new self();
509
510 do_action( 'elementskit/loaded' ); // legacy support
511 do_action( 'elementskit_lite/after_loaded' );
512 }
513
514 return self::$instance;
515 }
516 }
517