PluginProbe ʕ •ᴥ•ʔ
Essential Classy Addons for Elementor – 150+ Widgets, Templates & Performance Tools / 3.0.52
Essential Classy Addons for Elementor – 150+ Widgets, Templates & Performance Tools v3.0.52
3.0.59 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 3.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.18 3.0.2 3.0.20 3.0.21 3.0.22 3.0.23 3.0.24 3.0.25 3.0.26 3.0.27 3.0.28 3.0.29 3.0.3 3.0.30 3.0.31 3.0.32 3.0.33 3.0.34 3.0.35 3.0.36 3.0.37 3.0.38 3.0.39 3.0.4 3.0.40 3.0.41 3.0.42 3.0.43 3.0.44 3.0.45 3.0.46 3.0.47 3.0.48 3.0.49 3.0.5 3.0.50 3.0.51 3.0.52 3.0.53 3.0.54 3.0.55 3.0.56 3.0.57 3.0.58 3.0.6 3.0.7 3.0.8 3.0.9
essential-classy-addons-for-elementor / classes / class-loader.php
essential-classy-addons-for-elementor / classes Last commit date
builders 5 months ago documents 5 months ago builder-content.php 5 months ago class-helper.php 5 months ago class-loader.php 5 months ago class-panel-options.php 5 months ago conditions-file.php 5 months ago conditions-rules.php 5 months ago elementor-document.php 5 months ago theme-builder.php 5 months ago widgets-passing-lists.php 5 months ago
class-loader.php
247 lines
1 <?php
2 namespace EcafeAddons;
3 use Elementor\Utils;
4 use Elementor\Core\Settings\Manager as SettingsManager;
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly.
8 }
9
10 final class EcafeElementLoad {
11
12 private static $_instance;
13
14
15 private $_modules_manager;
16
17 public static function instance() {
18 if ( is_null( self::$_instance ) ) {
19 self::$_instance = new self();
20 self::$_instance->init();
21 }
22 return self::$_instance;
23 }
24
25 public function init() {
26 include_once( ECAFE_CLASSES_URL . 'builder-content.php' );
27 include_once( ECAFE_CLASSES_URL . 'builders/theme-template.php' );
28 include_once( ECAFE_CLASSES_URL . 'conditions-file.php' );
29 include_once( ECAFE_CLASSES_URL . 'theme-builder.php' );
30 include_once( ECAFE_CLASSES_URL . 'elementor-document.php' );
31 include_once( ECAFE_CLASSES_URL . 'conditions-rules.php' );
32
33 register_activation_hook( ECAFE_BASE_NAME, [ __CLASS__, 'activation_hook' ] );
34 }
35
36 private function includes() {
37
38 require_once ECAFE_CLASSES_URL .'class-helper.php';
39
40 $defaultOnLoad='ecafedefaultoptions';
41 $value='1';
42 if ( is_admin() && get_option( $defaultOnLoad ) !== false ) {
43 } else if( is_admin() ){
44 $defaultLoad=get_option( 'ecafe_widgets' );
45 if ( $defaultLoad !== false && $defaultLoad!='') {
46 $defaultNull = null;
47 $onLoadAuto = 'no';
48 add_option( $defaultOnLoad,$value,$defaultNull,$onLoadAuto );
49 }else{
50 $widgetsPage=get_option( 'ecafe_widgets' );
51 $widgetsPage['widgetsload']= array('ecafe-accordion','ecafe-adv-text-block','ecafe-business-hours','ecafe-button','ecafe-changelog','ecafe-chart','ecafe-image-hover-effect','ecafe-infobox','ecafe-social-icons','ecafe-title','ecafe-grid-post-listing','ecafe-lottie','ecafe-marketing-link','ecafe-tabs');
52
53 $defaultNull = null;
54 $onLoadAuto = 'no';
55 add_option( 'ecafe_widgets',$widgetsPage, $defaultNull, $onLoadAuto );
56 add_option( $defaultOnLoad,$value,$defaultNull,$onLoadAuto );
57 }
58 }
59
60 require ECAFE_CLASSES_URL.'class-panel-options.php';
61
62 }
63
64 /**
65 * Carry widgets
66 */
67 public function carryWidgets() {
68 require_once ECAFE_CLASSES_URL.'widgets-passing-lists.php';
69 }
70
71 /**
72 * Editor load style
73 */
74 public function afterEnqueueStylesEditor(){
75 wp_enqueue_style( 'ecafe-elementor', ECAFE_ASSETS_PATH .'css/admin/ecafe-elementor.css', array(),ECAFE_VERSION,false );
76
77 $ui_theme = SettingsManager::get_settings_managers( 'editorPreferences' )->get_model()->get_settings( 'ui_theme' );
78 if(!empty($ui_theme) && $ui_theme=='dark'){
79 wp_enqueue_style( 'ecafe-dark-elementor',ECAFE_ASSETS_PATH .'css/admin/ecafe-dark-elementor.css', array(),ECAFE_VERSION,false);
80 }
81 }
82
83 /**
84 * Admin load style
85 */
86 public function ecafeElementorAdminCss($hook){
87 wp_enqueue_style('ecafe-elementor',ECAFE_ASSETS_PATH .'css/admin/ecafe-elementor.css', array(),ECAFE_VERSION,false);
88 wp_enqueue_script('ecafe-backuser',ECAFE_ASSETS_PATH .'js/admin/ecafe-admin.js', array('jquery'),ECAFE_VERSION,false);
89
90 if ( ('post-new.php' === $hook || 'post.php' === $hook ) && get_post_type()===ECAFE_POST) {
91 wp_enqueue_style('select2-css', ECAFE_ASSETS_PATH .'css/admin/select2.min.css', array(), ECAFE_VERSION);
92
93 wp_enqueue_script('select2-js', ECAFE_ASSETS_PATH .'js/admin/select2.min.js', array('jquery'), ECAFE_VERSION, true);
94
95 wp_localize_script('ecafe-backuser', 'ecafe_data', array(
96 'nonce' => wp_create_nonce('ecafe-temp-nonce'),
97 ));
98 }
99 }
100
101 /**
102 * Category for elementor
103 */
104 public function categoryForElementor() {
105 $EI = \Elementor\Plugin::$instance;
106 $EI->elements_manager->add_category('essential',['title' => esc_html__( 'EC Essential', 'essential-classy-addons-for-elementor' ),'icon' => 'ecaddons',],1);
107 $EI->elements_manager->add_category('ecwoocommerce',['title' => esc_html__( 'EC WooCommerce', 'essential-classy-addons-for-elementor' ),'icon' => 'ecaddons',],1);
108 $EI->elements_manager->add_category('ecforms',['title' => esc_html__( 'EC Forms', 'essential-classy-addons-for-elementor' ),'icon' => 'ecaddons',],1);
109 $EI->elements_manager->add_category('ecembed',['title' => esc_html__( 'EC Embed', 'essential-classy-addons-for-elementor' ),'icon' => 'ecaddons',],1);
110 $EI->elements_manager->add_category('ecpro',['title' => esc_html__( 'EC Pro', 'essential-classy-addons-for-elementor' ),'icon' => 'ecaddons',],1);
111 $EI->elements_manager->add_category('ecproschema',['title' => esc_html__( 'EC Schema', 'essential-classy-addons-for-elementor' ),'icon' => 'ecaddons',],1);
112 $EI->elements_manager->add_category('ecacf',['title' => esc_html__( 'EC ACF', 'essential-classy-addons-for-elementor' ),'icon' => 'ecaddons',],1);
113 $EI->elements_manager->add_category('eccfs',['title' => esc_html__( 'EC CFS', 'essential-classy-addons-for-elementor' ),'icon' => 'ecaddons',],1);
114 $EI->elements_manager->add_category('ecjetengine',['title' => esc_html__( 'EC JetEngine', 'essential-classy-addons-for-elementor' ),'icon' => 'ecaddons',],1);
115 $EI->elements_manager->add_category('ecmetabox',['title' => esc_html__( 'EC Metabox', 'essential-classy-addons-for-elementor' ),'icon' => 'ecaddons',],1);
116 $EI->elements_manager->add_category('ecpods',['title' => esc_html__( 'EC Pods', 'essential-classy-addons-for-elementor' ),'icon' => 'ecaddons',],1);
117 $EI->elements_manager->add_category('ectoolset',['title' => esc_html__( 'EC Toolset', 'essential-classy-addons-for-elementor' ),'icon' => 'ecaddons',],1);
118 $EI->elements_manager->add_category('ecwck',['title' => esc_html__( 'EC WCK', 'essential-classy-addons-for-elementor' ),'icon' => 'ecaddons',],1);
119 }
120
121 /**
122 * Settings links
123 */
124 function ecafeSettingsLinks($settingsLinks) {
125 $settingsLinksArray = array(
126 '<a href="'.admin_url('admin.php?page=ecafe_widgets').'">'.esc_html__("Settings","essential-classy-addons-for-elementor").'</a>',
127 );
128 return array_merge( $settingsLinks, $settingsLinksArray );
129 }
130
131 function ecafeSettingsLinksRest($settingsLinks) {
132 if(defined('ECAFEP_VERSION')){
133 $get_values = unserialize(get_option('ecafewhitelabel'));
134 if(!empty($get_values['plugin_name_free'])){
135 $settingsLinksArray = array();
136 }else{
137 $settingsLinksArray = array(
138 ' | <a href="https://www.facebook.com/groups/340597333894907" target="_blank" style="color:#000; font-weight: bold;">' . __('Join/Contact US', 'essential-classy-addons-for-elementor') . '</a> | <a href="https://ecaddons.com/docs/" target="_blank" style="color:#000; font-weight: bold;">' . __('Document', 'essential-classy-addons-for-elementor') . '</a> | <a href="http://store.kapasias.com/helpdesk/" target="_blank" style="color:#000; font-weight: bold;">' . __('Support', 'essential-classy-addons-for-elementor') . '</a>',
139 );
140 }
141 }else{
142 $settingsLinksArray = array(
143 ' | <a href="https://www.facebook.com/groups/340597333894907" target="_blank" style="color:#000; font-weight: bold;">' . __('Join/Contact US', 'essential-classy-addons-for-elementor') . '</a> | <a href="https://ecaddons.com/docs/" target="_blank" style="color:#000; font-weight: bold;">' . __('Document', 'essential-classy-addons-for-elementor') . '</a> | <a href="http://store.kapasias.com/helpdesk/" target="_blank" style="color:#000; font-weight: bold;">' . __('Support', 'essential-classy-addons-for-elementor') . '</a>',
144 );
145 }
146
147 return array_merge( $settingsLinks, $settingsLinksArray );
148 }
149
150 public function ecafeEnqueueStyles() {
151 wp_enqueue_style('ecafe-frontend-css',ECAFE_ASSETS_PATH . 'css/custom/ecafe-front.min.css',[],ECAFE_VERSION);
152 //wp_enqueue_style('ecafe-lightbox',ECAFE_ASSETS_PATH . 'css/baharni/lightbox.css',[],ECAFE_VERSION);
153 wp_enqueue_style('font-awesome-5-all',ELEMENTOR_ASSETS_URL . 'lib/font-awesome/css/all.min.css',[],ECAFE_VERSION);
154
155 if(isset($_GET['elementor-preview']) && (int)$_GET['elementor-preview']){
156 wp_register_script('ecafe-tilt-js-3rd', ECAFE_ASSETS_PATH . 'js/baharni/tilt.jquery.js', array('jquery'),ECAFE_VERSION,false );
157 wp_register_script('ecafe-tilt-js', ECAFE_ASSETS_PATH . 'js/custom/ecafe-tilt-custom.min.js', array('ecafe-tilt-js-3rd'),ECAFE_VERSION,false );
158 wp_enqueue_script( 'ecafe-tilt-js' );
159
160 wp_enqueue_style( 'ecafe-tippy-css', ECAFE_ASSETS_PATH .'css/baharni/tippy.min.css', array(),ECAFE_VERSION,false );
161 wp_register_script('ecafe-popper-js', ECAFE_ASSETS_PATH . 'js/baharni/popper.min.js', array('jquery'),ECAFE_VERSION,false );
162 wp_register_script('ecafe-tippy-js-3rd', ECAFE_ASSETS_PATH . 'js/baharni/tippy-bundle.umd.min.js', array('ecafe-popper-js'),ECAFE_VERSION,false );
163 wp_register_script('ecafe-tippy-js', ECAFE_ASSETS_PATH . 'js/custom/ecafe-tippy-custom.min.js', array('ecafe-popper-js','ecafe-tippy-js-3rd'),ECAFE_VERSION,false );
164 wp_enqueue_script( 'ecafe-tippy-js' );
165 }
166
167 wp_register_script('ecafe-accordion', ECAFE_ASSETS_PATH . 'js/custom/ecafe-accordion.min.js', array('jquery'),ECAFE_VERSION,false );
168 wp_register_script('ecafe-back-to-top', ECAFE_ASSETS_PATH . 'js/custom/ecafe-back-to-top.min.js', array('jquery'),ECAFE_VERSION,false );
169 wp_register_script('ecafe-chart-3rd',ECAFE_ASSETS_PATH .'js/baharni/chart.js', array('jquery'),ECAFE_VERSION,false);
170 wp_register_script('ecafe-chart', ECAFE_ASSETS_PATH . 'js/custom/ecafe-chart.min.js', array('ecafe-chart-3rd'),ECAFE_VERSION,false );
171 wp_register_script('ecafe-calendly-3rd', ECAFE_ASSETS_PATH . 'js/baharni/calendlywidget.js', array('jquery'),ECAFE_VERSION,false );
172 wp_register_script('ecafe-changelog', ECAFE_ASSETS_PATH . 'js/custom/ecafe-changelog.min.js', array('jquery'),ECAFE_VERSION,false );
173 //wp_register_script('ecafe-lightbox', ECAFE_ASSETS_PATH . 'js/baharni/lightbox.js', array('jquery'),ECAFE_VERSION,false );
174 wp_register_script('ecafe-infounfold',ECAFE_ASSETS_PATH .'js/custom/ecafe-infounfold.min.js', array('jquery'),ECAFE_VERSION,false);
175 wp_register_script('ecafe-lax',ECAFE_ASSETS_PATH .'js/baharni/lax.min.js', array('jquery'),ECAFE_VERSION,false);
176 wp_register_script('ecafe-min-js', ECAFE_ASSETS_PATH . 'js/custom/ecafe.min.js', array('jquery'),ECAFE_VERSION,false );
177 wp_register_script('ecafe-isotope',ECAFE_ASSETS_PATH .'js/baharni/isotope.pkgd.min.js', array('jquery'),ECAFE_VERSION,false);
178 wp_register_script('ecafe-imagesloaded',ECAFE_ASSETS_PATH .'js/baharni/imagesloaded.pkgd.min.js', array('jquery'),ECAFE_VERSION,false);
179 wp_register_script('ecafe-post-listing', ECAFE_ASSETS_PATH . 'js/custom/ecafe-post-listing.min.js', array('ecafe-isotope','ecafe-imagesloaded'),ECAFE_VERSION,false );
180 wp_register_script('ecafe-tabs', ECAFE_ASSETS_PATH . 'js/custom/ecafe-tabs.min.js', array('jquery'),ECAFE_VERSION,false );
181 wp_register_script('ecafe-whatsapp', ECAFE_ASSETS_PATH . 'js/custom/ecafe-whatsapp.min.js', array('jquery'),ECAFE_VERSION,false );
182 wp_register_script('ecafe-countdown', ECAFE_ASSETS_PATH . 'js/custom/ecafe-countdown.min.js', array('jquery'),ECAFE_VERSION,false );
183 wp_register_script('ecafe-coupon-code', ECAFE_ASSETS_PATH . 'js/custom/ecafe-coupon-code.min.js', array('jquery'),ECAFE_VERSION,false );
184 wp_register_script('ecafe-lottie-3rd',ECAFE_ASSETS_PATH .'js/baharni/lottie.min.js', array('jquery'),ECAFE_VERSION,false);
185 wp_register_script('ecafe-lottie', ECAFE_ASSETS_PATH . 'js/custom/ecafe-lottie.min.js', array('ecafe-lottie-3rd'),ECAFE_VERSION,false );
186 wp_register_script('ecafe-marketing-link',ECAFE_ASSETS_PATH .'js/custom/ecafe-marketing-link.min.js', array('jquery'),ECAFE_VERSION,false);
187 wp_register_script('ecafe-scroll-progress', ECAFE_ASSETS_PATH . 'js/custom/ecafe-scroll-progress.min.js', array('jquery'),ECAFE_VERSION,false );
188 wp_register_script('ecafe-image-scroll', ECAFE_ASSETS_PATH . 'js/custom/ecafe-image-scroll.min.js', array('jquery'),ECAFE_VERSION,false );
189 wp_register_script('ecafe-image-accordion', ECAFE_ASSETS_PATH . 'js/custom/ecafe-image-accordion.min.js', array('jquery'),ECAFE_VERSION,false );
190 wp_register_script('ecafe-hover-background', ECAFE_ASSETS_PATH . 'js/custom/ecafe-hover-background.min.js', array('jquery'),ECAFE_VERSION,false );
191 wp_register_script('ecafe-post-image', ECAFE_ASSETS_PATH . 'js/custom/ecafe-post-image.min.js', array('jquery'),ECAFE_VERSION,false );
192 wp_register_script('ecafe-page-piling-3rd',ECAFE_ASSETS_PATH .'js/baharni/pagepiling.min.js', array('jquery'),ECAFE_VERSION,false);
193 wp_register_script('ecafe-page-piling', ECAFE_ASSETS_PATH . 'js/custom/ecafe-page-piling.min.js', array('ecafe-page-piling-3rd'),ECAFE_VERSION,false );
194 wp_register_script('ecafe-page-scroll-to-id-3rd',ECAFE_ASSETS_PATH .'js/baharni/jquery.PageScroll2id.min.js', array('jquery'),ECAFE_VERSION,false);
195 wp_register_script('ecafe-page-scroll-to-id', ECAFE_ASSETS_PATH . 'js/custom/ecafe-page-scroll-to-id.min.js', array('ecafe-page-scroll-to-id-3rd'),ECAFE_VERSION,false );
196 wp_register_script('ecafe-pdf-viewer-3rd',ECAFE_ASSETS_PATH .'js/baharni/pdfobject.min.js', array('jquery'),ECAFE_VERSION,false);
197 wp_register_script('ecafe-pdf-viewer', ECAFE_ASSETS_PATH . 'js/custom/ecafe-pdf-viewer.min.js', array('ecafe-pdf-viewer-3rd'),ECAFE_VERSION,false );
198 wp_register_script('ecafe-tocbot-3rd',ECAFE_ASSETS_PATH .'js/baharni/tocbot.min.js', array('jquery'),ECAFE_VERSION,false);
199 wp_register_script('ecafe-toc', ECAFE_ASSETS_PATH . 'js/custom/ecafe-toc.min.js', array('ecafe-tocbot-3rd'),ECAFE_VERSION,false );
200 wp_register_script('ecafe-qrcode-3rd', ECAFE_ASSETS_PATH . 'js/baharni/jquery.qrcode.js', array('jquery'),ECAFE_VERSION,false );
201 wp_register_script('ecafe-qrcode', ECAFE_ASSETS_PATH . 'js/custom/ecafe-qrcode.min.js', array('ecafe-qrcode-3rd'),ECAFE_VERSION,false );
202 wp_register_script('ecafe-infocircle',ECAFE_ASSETS_PATH .'js/custom/ecafe-infocircle.min.js', array('jquery'),ECAFE_VERSION,false);
203 wp_register_script('ecafe-sticky-video', ECAFE_ASSETS_PATH . 'js/custom/ecafe-sticky-video.min.js', array('jquery'),ECAFE_VERSION,false );
204 wp_register_script('ec-confettieffect-3rd', ECAFE_ASSETS_PATH . 'js/baharni/js-confetti.browser.js', array('jquery'),ECAFE_VERSION,false );
205 wp_register_script('ec-confettieffect', ECAFE_ASSETS_PATH . 'js/custom/ec-confettieffect.min.js', array('ec-confettieffect-3rd'),ECAFE_VERSION,false );
206
207 wp_localize_script(
208 'jquery', 'ecafe_data', array(
209 'eca_ajax_url' => admin_url('admin-ajax.php'),
210 )
211 );
212 }
213
214 /**
215 * Hooks
216 */
217 private function hooks() {
218 add_action('elementor/elements/categories_registered',[$this,'categoryForElementor']);
219
220 // Register Widget Styles & Script
221 add_action( 'wp_enqueue_scripts', [ $this, 'ecafeEnqueueStyles' ] );
222
223 add_action('elementor/editor/after_enqueue_styles',[$this,'afterEnqueueStylesEditor']);
224 add_action('admin_enqueue_scripts', [ $this,'ecafeElementorAdminCss']);
225 add_filter('plugin_action_links_'.ECAFE_BASE_NAME,[$this, 'ecafeSettingsLinks']);
226 add_filter('plugin_action_links_'.ECAFE_BASE_NAME,[$this, 'ecafeSettingsLinksRest']);
227 }
228
229 /**
230 * Activation Hook
231 */
232 public static function activation_hook( $network_wide ) {
233 flush_rewrite_rules();
234 }
235
236 /**
237 * Constructor
238 */
239 private function __construct() {
240 $this->includes();
241 $this->hooks();
242 $this->carryWidgets();
243 ecafeWidgetsPassed();
244 }
245 }
246
247 EcafeElementLoad::instance();