AllTraits.php
1 year ago
Asset_Builder.php
9 months ago
Bootstrap.php
2 weeks ago
Compatibility_Support.php
2 months ago
Elements_Manager.php
7 months ago
Helper.php
1 month ago
Migration.php
5 months ago
Plugin_Usage_Tracker.php
5 months ago
WPDeveloper_Core_Installer.php
5 months ago
WPDeveloper_Notice.php
2 months ago
WPDeveloper_Plugin_Installer.php
5 months ago
WPDeveloper_Setup_Wizard.php
2 months ago
index.php
3 years ago
WPDeveloper_Setup_Wizard.php
938 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Essential_Addons_Elementor\Classes; |
| 4 | |
| 5 | // Exit if accessed directly |
| 6 | if ( !defined( 'ABSPATH' ) ) { |
| 7 | exit; |
| 8 | } |
| 9 | |
| 10 | // Ensure WordPress core functions are available |
| 11 | if ( !function_exists('__') ) { |
| 12 | require_once( ABSPATH . 'wp-includes/l10n.php' ); |
| 13 | } |
| 14 | |
| 15 | class WPDeveloper_Setup_Wizard { |
| 16 | public $templately_status; |
| 17 | public $eblocks_status; |
| 18 | |
| 19 | public function __construct() { |
| 20 | add_action( 'admin_enqueue_scripts', array( $this, 'setup_wizard_scripts' ) ); |
| 21 | add_action( 'admin_menu', array( $this, 'admin_menu' ) ); |
| 22 | add_action( 'wp_ajax_save_setup_wizard_data', [ $this, 'save_setup_wizard_data' ] ); |
| 23 | add_action( 'wp_ajax_enable_wpins_process', [ $this, 'enable_wpins_process' ] ); |
| 24 | add_action( 'wp_ajax_save_eael_elements_data', [ $this, 'save_eael_elements_data' ] ); |
| 25 | add_action( 'in_admin_header', [ $this, 'remove_notice' ], 1000 ); |
| 26 | $this->templately_status = $this->templately_active_status(); |
| 27 | $this->eblocks_status = $this->eblocks_active_status(); |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * templately_active_status |
| 32 | * @return bool |
| 33 | */ |
| 34 | public function templately_active_status() { |
| 35 | include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 36 | return is_plugin_active( 'templately/templately.php' ); |
| 37 | } |
| 38 | /** |
| 39 | * Essential Blocks active status |
| 40 | * @return bool |
| 41 | */ |
| 42 | public function eblocks_active_status() { |
| 43 | include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 44 | return is_plugin_active( 'essential-blocks/essential-blocks.php' ); |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Remove all notice in setup wizard page |
| 49 | */ |
| 50 | public function remove_notice() { |
| 51 | if ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] == 'eael-setup-wizard' ) { //phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.NonceVerification.Recommended |
| 52 | remove_all_actions( 'admin_notices' ); |
| 53 | remove_all_actions( 'all_admin_notices' ); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * setup_wizard_scripts |
| 59 | * @param $hook |
| 60 | * @return array |
| 61 | */ |
| 62 | public function setup_wizard_scripts( $hook ) { |
| 63 | if ( isset( $hook ) && $hook == 'admin_page_eael-setup-wizard' ) { |
| 64 | wp_enqueue_style( 'essential_addons_elementor-setup-wizard-css', EAEL_PLUGIN_URL . 'assets/admin/css/quick-setup.css', false, EAEL_PLUGIN_VERSION ); |
| 65 | wp_enqueue_style( 'essential_addons_elementor-setup-wizard-fonts', EAEL_PLUGIN_URL . 'includes/templates/admin/icons/style.css', false, EAEL_PLUGIN_VERSION ); |
| 66 | wp_enqueue_style( 'sweetalert2-css', EAEL_PLUGIN_URL . 'assets/admin/vendor/sweetalert2/css/sweetalert2.min.css', false, EAEL_PLUGIN_VERSION ); |
| 67 | wp_enqueue_script( 'sweetalert2-js', EAEL_PLUGIN_URL . 'assets/admin/vendor/sweetalert2/js/sweetalert2.min.js', array( 'jquery', 'sweetalert2-core-js' ), EAEL_PLUGIN_VERSION, true ); |
| 68 | wp_enqueue_script( 'sweetalert2-core-js', EAEL_PLUGIN_URL . 'assets/admin/vendor/sweetalert2/js/core.js', array( 'jquery' ), EAEL_PLUGIN_VERSION, true ); |
| 69 | // wp_enqueue_script( 'essential_addons_elementor-setup-wizard-js', EAEL_PLUGIN_URL . 'assets/admin/js/admin.js', array( 'jquery' ), EAEL_PLUGIN_VERSION, true ); |
| 70 | // wp_enqueue_script( 'essential_addons_elementor-setup-wizard-react-css', EAEL_PLUGIN_URL . 'includes/templates/admin/quick-setup/dist/quick-setup.min.css', array(), EAEL_PLUGIN_VERSION, true ); |
| 71 | wp_enqueue_script( 'essential_addons_elementor-setup-wizard-react-js', EAEL_PLUGIN_URL . 'includes/templates/admin/quick-setup/dist/quick-setup.min.js', array(), EAEL_PLUGIN_VERSION, true ); |
| 72 | |
| 73 | wp_localize_script( 'essential_addons_elementor-setup-wizard-react-js', 'localize', array( |
| 74 | 'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ), |
| 75 | 'nonce' => wp_create_nonce( 'essential-addons-elementor' ), |
| 76 | 'success_image' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/success.gif', |
| 77 | 'eael_quick_setup_data' => $this->eael_quick_setup_data(), |
| 78 | ) ); |
| 79 | } |
| 80 | return []; |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Create admin menu for setup wizard |
| 85 | */ |
| 86 | public function admin_menu() { |
| 87 | |
| 88 | add_submenu_page( |
| 89 | 'admin.php', |
| 90 | __( 'Essential Addons ', 'essential-addons-for-elementor-lite' ), |
| 91 | __( 'Essential Addons ', 'essential-addons-for-elementor-lite' ), |
| 92 | 'manage_options', |
| 93 | 'eael-setup-wizard', |
| 94 | [ $this, 'render_wizard' ] |
| 95 | ); |
| 96 | } |
| 97 | |
| 98 | |
| 99 | /** |
| 100 | * render_wizard |
| 101 | */ |
| 102 | public function render_wizard() { |
| 103 | ?> |
| 104 | <section id="eael-onboard--wrapper" class="eael-onboard--wrapper"> |
| 105 | </section> |
| 106 | <?php |
| 107 | } |
| 108 | |
| 109 | public function eael_quick_setup_data() { |
| 110 | $eael_quick_setup_data = [ |
| 111 | 'is_quick_setup' => 1, |
| 112 | 'menu_items' => $this->data_menu_items(), |
| 113 | 'getting_started_content' => $this->data_getting_started_content(), |
| 114 | 'configuration_content' => $this->data_configuration_content(), |
| 115 | 'elements_content' => $this->data_elements_content(), |
| 116 | 'go_pro_content' => $this->data_go_pro_content(), |
| 117 | 'plugins_content' => $this->data_plugins_content(), |
| 118 | 'integrations_content' => $this->data_integrations_content(), |
| 119 | 'modal_content' => $this->data_modal_content(), |
| 120 | ]; |
| 121 | |
| 122 | return $eael_quick_setup_data; |
| 123 | } |
| 124 | |
| 125 | public function data_menu_items(){ |
| 126 | $items = [ |
| 127 | 'started' => __( 'Getting Started', 'essential-addons-for-elementor-lite' ), |
| 128 | 'configuration' => __( 'Configuration', 'essential-addons-for-elementor-lite' ), |
| 129 | 'elements' => __( 'Elements', 'essential-addons-for-elementor-lite' ), |
| 130 | 'go_pro' => __( 'Go PRO', 'essential-addons-for-elementor-lite' ), |
| 131 | 'pluginspromo' => __( 'Plugins', 'essential-addons-for-elementor-lite' ), |
| 132 | 'integrations' => __( 'Integrations', 'essential-addons-for-elementor-lite' ), |
| 133 | ]; |
| 134 | |
| 135 | $menu_items = [ |
| 136 | 'templately_status' => $this->templately_status, |
| 137 | 'eblocks_status' => $this->eblocks_status, |
| 138 | 'wizard_column' => ! $this->templately_status || ! $this->eblocks_status ? 'five' : 'four', |
| 139 | 'items' => $items, |
| 140 | 'templately_local_plugin_data' => $this->get_local_plugin_data( 'templately/templately.php' ), |
| 141 | 'eblocks_local_plugin_data' => $this->get_local_plugin_data( 'essential-blocks/essential-blocks.php' ), |
| 142 | 'ea_pro_local_plugin_data' => $this->get_local_plugin_data( 'essential-addons-elementor/essential_adons_elementor.php' ), |
| 143 | ]; |
| 144 | |
| 145 | return $menu_items; |
| 146 | } |
| 147 | |
| 148 | public function data_getting_started_content(){ |
| 149 | $getting_started_content = [ |
| 150 | 'youtube_promo_src' => esc_url( EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/youtube-promo.png' ), |
| 151 | 'is_tracking_allowed' => $this->get_is_tracking_allowed(), |
| 152 | ]; |
| 153 | |
| 154 | return $getting_started_content; |
| 155 | } |
| 156 | |
| 157 | public function data_configuration_content(){ |
| 158 | $configuration_content = [ |
| 159 | 'ea_logo_src' => esc_url( EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/ea-new.png' ), |
| 160 | ]; |
| 161 | |
| 162 | return $configuration_content; |
| 163 | } |
| 164 | |
| 165 | public function data_elements_content(){ |
| 166 | $elements_content = [ |
| 167 | 'elements_list' => $this->get_element_list(), |
| 168 | ]; |
| 169 | |
| 170 | return $elements_content; |
| 171 | } |
| 172 | |
| 173 | public function data_go_pro_content(){ |
| 174 | $feature_items = [ |
| 175 | [ |
| 176 | 'title' => 'Smart Post List', |
| 177 | 'link' => 'https://essential-addons.com/post-list/', |
| 178 | 'img_src' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/smart-post-list.svg', |
| 179 | ], |
| 180 | [ |
| 181 | 'title' => 'Dynamic Gallery', |
| 182 | 'link' => 'https://essential-addons.com/dynamic-gallery/', |
| 183 | 'img_src' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/dynamic-gallery.svg', |
| 184 | ], |
| 185 | [ |
| 186 | 'title' => 'Custom JS', |
| 187 | 'link' => 'https://essential-addons.com/custom-js/', |
| 188 | 'img_src' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/custom-js.svg', |
| 189 | ], |
| 190 | [ |
| 191 | 'title' => 'Protected Content', |
| 192 | 'link' => 'https://essential-addons.com/protected-content/', |
| 193 | 'img_src' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/protected-content.svg', |
| 194 | ], |
| 195 | [ |
| 196 | 'title' => 'Interactive Animations', |
| 197 | 'link' => 'https://essential-addons.com/interactive-animations/', |
| 198 | 'img_src' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/lightbox-modal.svg', |
| 199 | ], |
| 200 | [ |
| 201 | 'title' => 'Advanced Google Map', |
| 202 | 'link' => 'https://essential-addons.com/advanced-google-map/', |
| 203 | 'img_src' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/advanced-google-map.svg', |
| 204 | ], |
| 205 | [ |
| 206 | 'title' => 'Mailchimp', |
| 207 | 'link' => 'https://essential-addons.com/mailchimp/', |
| 208 | 'img_src' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/mailchimp.svg', |
| 209 | ], |
| 210 | [ |
| 211 | 'title' => 'Instagram Feed', |
| 212 | 'link' => 'https://essential-addons.com/instagram-feed/', |
| 213 | 'img_src' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/instagram-feed.svg', |
| 214 | ], |
| 215 | [ |
| 216 | 'title' => 'Woo Product Slider', |
| 217 | 'link' => 'https://essential-addons.com/woo-product-slider/', |
| 218 | 'img_src' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/woo-product-slider.svg', |
| 219 | ], |
| 220 | [ |
| 221 | 'title' => 'Parallax', |
| 222 | 'link' => 'https://essential-addons.com/parallax-scrolling/', |
| 223 | 'img_src' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/parallax-scrolling.svg', |
| 224 | ], |
| 225 | [ |
| 226 | 'title' => 'Post Carousel', |
| 227 | 'link' => 'https://essential-addons.com/post-carousel/', |
| 228 | 'img_src' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/post-carousel.svg', |
| 229 | ], |
| 230 | [ |
| 231 | 'title' => 'LearnDash Course List', |
| 232 | 'link' => 'https://essential-addons.com/learndash-course-list/', |
| 233 | 'img_src' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/learndash-course-list.svg', |
| 234 | ], |
| 235 | [ |
| 236 | 'title' => 'Particle Effect', |
| 237 | 'link' => 'https://essential-addons.com/particle-effect/', |
| 238 | 'img_src' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/particle-effect.svg', |
| 239 | ], |
| 240 | [ |
| 241 | 'title' => 'Logo Carousel', |
| 242 | 'link' => 'https://essential-addons.com/logo-carousel/', |
| 243 | 'img_src' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/logo-carousel.svg', |
| 244 | ], |
| 245 | [ |
| 246 | 'title' => 'Image Hotspots', |
| 247 | 'link' => 'https://essential-addons.com/image-hotspots/', |
| 248 | 'img_src' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/image-hotspots.svg', |
| 249 | ] |
| 250 | ]; |
| 251 | |
| 252 | $go_pro_content = [ |
| 253 | 'feature_items' => $feature_items, |
| 254 | ]; |
| 255 | |
| 256 | return $go_pro_content; |
| 257 | } |
| 258 | |
| 259 | public function data_plugins_content(){ |
| 260 | $plugins_content = [ |
| 261 | 'tab_title' => __( 'Plugins', 'essential-addons-for-elementor-lite' ), |
| 262 | 'plugins' => [ |
| 263 | ], |
| 264 | ]; |
| 265 | |
| 266 | if ( ! $this->get_local_plugin_data( 'templately/templately.php' ) ) { |
| 267 | $plugins_content['plugins'][] = [ |
| 268 | 'slug' => 'templately', |
| 269 | 'basename' => 'templately/templately.php', |
| 270 | 'tab_title' => __( 'Templately', 'essential-addons-for-elementor-lite' ), |
| 271 | 'is_active' => is_plugin_active( 'templately/templately.php' ), |
| 272 | 'local_plugin_data' => $this->get_local_plugin_data( 'templately/templately.php' ), |
| 273 | 'promo_img_url' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/templately-qs-img.png', |
| 274 | 'titles' => [ |
| 275 | __("6500+", "essential-addons-for-elementor-lite"), |
| 276 | __("Ready Templates", "essential-addons-for-elementor-lite") |
| 277 | ], |
| 278 | 'features' => [ |
| 279 | [ |
| 280 | 'image_url' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/templately-icon-1.svg', |
| 281 | 'content' => __( "Stunning Ready Website Templates", "essential-addons-for-elementor-lite" ) |
| 282 | ], |
| 283 | [ |
| 284 | 'image_url' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/templately-icon-2.svg', |
| 285 | 'content' => __( "One-Click Full Site Import", "essential-addons-for-elementor-lite" ) |
| 286 | ], |
| 287 | [ |
| 288 | 'image_url' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/templately-icon-3.svg', |
| 289 | 'content' => __( "Team Collaboration WorkSpace", "essential-addons-for-elementor-lite" ) |
| 290 | ], |
| 291 | [ |
| 292 | 'image_url' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/templately-icon-4.svg', |
| 293 | 'content' => __( "Unlimited Cloud Storage", "essential-addons-for-elementor-lite" ) |
| 294 | ], |
| 295 | ], |
| 296 | ]; |
| 297 | } |
| 298 | |
| 299 | |
| 300 | if ( ! $this->get_local_plugin_data( 'essential-blocks/essential-blocks.php' ) ) { |
| 301 | $plugins_content['plugins'][] = [ |
| 302 | 'slug' => 'essential-blocks', |
| 303 | 'basename' => 'essential-blocks/essential-blocks.php', |
| 304 | 'tab_title' => __( 'Essential Blocks', 'essential-addons-for-elementor-lite' ), |
| 305 | 'is_active' => is_plugin_active( 'essential-blocks/essential-blocks.php' ), |
| 306 | 'local_plugin_data' => $this->get_local_plugin_data( 'essential-blocks/essential-blocks.php' ), |
| 307 | 'promo_img_url' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/eb-promo-image.png', |
| 308 | 'titles' => __("Power Up Gutenberg Editor", "essential-addons-for-elementor-lite") , |
| 309 | 'features' => [ |
| 310 | [ |
| 311 | 'image_url' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/eb-icon-1.png', |
| 312 | 'content' => __( "Access 60+ Essential Gutenberg Blocks", "essential-addons-for-elementor-lite" ) |
| 313 | ], |
| 314 | [ |
| 315 | 'image_url' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/eb-icon-2.png', |
| 316 | 'content' => __( "Get Global Styling & Typography Support", "essential-addons-for-elementor-lite" ) |
| 317 | ], |
| 318 | [ |
| 319 | 'image_url' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/eb-icon-3.png', |
| 320 | 'content' => __( "Avail 2,900+ Exclusive Gutenberg Templates", "essential-addons-for-elementor-lite" ) |
| 321 | ], |
| 322 | [ |
| 323 | 'image_url' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/eb-icon-4.png', |
| 324 | 'content' => __( "Use Ready Patterns & Reuse Facilities On Entire Site", "essential-addons-for-elementor-lite" ) |
| 325 | ], |
| 326 | ], |
| 327 | ]; |
| 328 | } |
| 329 | |
| 330 | return $plugins_content; |
| 331 | } |
| 332 | |
| 333 | public function data_integrations_content(){ |
| 334 | $integrations_content = [ |
| 335 | 'plugin_list' => $this->get_plugin_list(), |
| 336 | ]; |
| 337 | |
| 338 | return $integrations_content; |
| 339 | } |
| 340 | |
| 341 | public function data_modal_content(){ |
| 342 | $modal_content = [ |
| 343 | 'success_2_src' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/success-2.png', |
| 344 | ]; |
| 345 | |
| 346 | return $modal_content; |
| 347 | } |
| 348 | |
| 349 | /** |
| 350 | * get_plugin_list |
| 351 | * @return array |
| 352 | */ |
| 353 | public function get_plugin_list() { |
| 354 | return [ |
| 355 | [ |
| 356 | 'slug' => 'betterdocs', |
| 357 | 'basename' => 'betterdocs/betterdocs.php', |
| 358 | 'logo' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/bd-new.svg', |
| 359 | 'title' => __( 'BetterDocs', 'essential-addons-for-elementor-lite' ), |
| 360 | 'desc' => __( 'Create and organize your knowledge base, FAQ & documentation page efficiently, making it easy for visitors to find any helpful article quickly and effortlessly.', 'essential-addons-for-elementor-lite' ), |
| 361 | 'is_active' => is_plugin_active( 'betterdocs/betterdocs.php' ), |
| 362 | 'local_plugin_data' => $this->get_local_plugin_data( 'betterdocs/betterdocs.php' ), |
| 363 | ], |
| 364 | [ |
| 365 | 'slug' => 'betterlinks', |
| 366 | 'basename' => 'betterlinks/betterlinks.php', |
| 367 | 'logo' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/btl.svg', |
| 368 | 'title' => __( 'BetterLinks', 'essential-addons-for-elementor-lite' ), |
| 369 | 'desc' => __( 'Link Shortening tool to create, shorten & manage any URL. It helps to cross promote brands & products and gather analytics reports while running marketing campaigns.', 'essential-addons-for-elementor-lite' ), |
| 370 | 'is_active' => is_plugin_active( 'betterlinks/betterlinks.php' ), |
| 371 | 'local_plugin_data' => $this->get_local_plugin_data( 'betterlinks/betterlinks.php' ), |
| 372 | ], |
| 373 | [ |
| 374 | 'slug' => 'better-payment', |
| 375 | 'basename' => 'better-payment/better-payment.php', |
| 376 | 'logo' => EAEL_PLUGIN_URL . 'assets/admin/images/bp.svg', |
| 377 | 'title' => __( 'Better Payment', 'essential-addons-for-elementor-lite' ), |
| 378 | 'desc' => __( 'Streamline transactions in Elementor by integrating PayPal & Stripe. Experience advanced analytics, validation, and Elementor forms for secure & efficient payments.', 'essential-addons-for-elementor-lite' ), |
| 379 | 'is_active' => is_plugin_active( 'better-payment/better-payment.php' ), |
| 380 | 'local_plugin_data' => $this->get_local_plugin_data( 'better-payment/better-payment.php' ), |
| 381 | ], |
| 382 | [ |
| 383 | 'slug' => 'notificationx', |
| 384 | 'basename' => 'notificationx/notificationx.php', |
| 385 | 'logo' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/nx-logo.svg', |
| 386 | 'title' => __( 'NotificationX', 'essential-addons-for-elementor-lite' ), |
| 387 | 'desc' => __( 'Best FOMO & social proof plugin to boost sales conversion by creating stunning sales popups, growth & discount alerts, flashing tabs, notification bars & more.', 'essential-addons-for-elementor-lite' ), |
| 388 | 'is_active' => is_plugin_active( 'notificationx/notificationx.php' ), |
| 389 | 'local_plugin_data' => $this->get_local_plugin_data( 'notificationx/notificationx.php' ), |
| 390 | ], |
| 391 | [ |
| 392 | 'slug' => 'wp-scheduled-posts', |
| 393 | 'basename' => 'wp-scheduled-posts/wp-scheduled-posts.php', |
| 394 | 'logo' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/wscp.svg', |
| 395 | 'title' => __( 'SchedulePress', 'essential-addons-for-elementor-lite' ), |
| 396 | 'desc' => __( 'Advanced content marketing tool for WordPress to schedule posts & pages with Schedule Calendar, Auto & Manual Scheduler, etc. It also allows auto-social sharing.', 'essential-addons-for-elementor-lite' ), |
| 397 | 'is_active' => is_plugin_active( 'wp-scheduled-posts/wp-scheduled-posts.php' ), |
| 398 | 'local_plugin_data' => $this->get_local_plugin_data( 'wp-scheduled-posts/wp-scheduled-posts.php' ), |
| 399 | ], |
| 400 | [ |
| 401 | 'slug' => 'easyjobs', |
| 402 | 'basename' => 'easyjobs/easyjobs.php', |
| 403 | 'logo' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/easy-jobs-logo.svg', |
| 404 | 'title' => __( 'easy.jobs', 'essential-addons-for-elementor-lite' ), |
| 405 | 'desc' => __( 'Job recruitment tool to attract, manage, and hire the right talent faster. This talent recruitment solution lets you manage jobs and career pages in Elementor.', 'essential-addons-for-elementor-lite' ), |
| 406 | 'is_active' => is_plugin_active( 'easyjobs/easyjobs.php' ), |
| 407 | 'local_plugin_data' => $this->get_local_plugin_data( 'easyjobs/easyjobs.php' ), |
| 408 | ], |
| 409 | [ |
| 410 | 'slug' => 'embedpress', |
| 411 | 'basename' => 'embedpress/embedpress.php', |
| 412 | 'logo' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/ep-logo.png', |
| 413 | 'title' => __( 'EmbedPress', 'essential-addons-for-elementor-lite' ), |
| 414 | 'desc' => __( 'Embed videos, images, gifs, charts, docs, maps, audio, live streams, pdf & more from 150+ sources into your WordPress site and get seamless customization options.', 'essential-addons-for-elementor-lite' ), |
| 415 | 'is_active' => is_plugin_active( 'embedpress/embedpress.php' ), |
| 416 | 'local_plugin_data' => $this->get_local_plugin_data( 'embedpress/embedpress.php' ), |
| 417 | ], |
| 418 | [ |
| 419 | 'slug' => 'essential-blocks', |
| 420 | 'basename' => 'essential-blocks/essential-blocks.php', |
| 421 | 'logo' => EAEL_PLUGIN_URL . 'assets/admin/images/quick-setup/eb-new.svg', |
| 422 | 'title' => __( 'Essential Blocks', 'essential-addons-for-elementor-lite' ), |
| 423 | 'desc' => __( 'Enhance Gutenberg experience with 50+ unique blocks (more coming soon). Boost your block editor with easy-to-use blocks for a simpler WordPress page or post design.', 'essential-addons-for-elementor-lite' ), |
| 424 | 'is_active' => is_plugin_active( 'essential-blocks/essential-blocks.php' ), |
| 425 | 'local_plugin_data' => $this->get_local_plugin_data( 'essential-blocks/essential-blocks.php' ), |
| 426 | ], |
| 427 | ]; |
| 428 | } |
| 429 | |
| 430 | /** |
| 431 | * get_local_plugin_data |
| 432 | * |
| 433 | * @param mixed $basename |
| 434 | * @return array|false |
| 435 | */ |
| 436 | public function get_local_plugin_data( $basename = '' ) { |
| 437 | |
| 438 | if ( empty( $basename ) ) { |
| 439 | return false; |
| 440 | } |
| 441 | |
| 442 | if ( !function_exists( 'get_plugins' ) ) { |
| 443 | include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 444 | } |
| 445 | |
| 446 | $plugins = get_plugins(); |
| 447 | |
| 448 | if ( !isset( $plugins[ $basename ] ) ) { |
| 449 | return false; |
| 450 | } |
| 451 | |
| 452 | return $plugins[ $basename ]; |
| 453 | } |
| 454 | |
| 455 | /** |
| 456 | * Save setup wizard data |
| 457 | */ |
| 458 | public function save_setup_wizard_data() { |
| 459 | |
| 460 | check_ajax_referer( 'essential-addons-elementor', 'security' ); |
| 461 | |
| 462 | if ( !current_user_can( 'manage_options' ) ) { |
| 463 | wp_send_json_error( __( 'you are not allowed to do this action', 'essential-addons-for-elementor-lite' ) ); |
| 464 | } |
| 465 | |
| 466 | if ( !isset( $_POST[ 'fields' ] ) ) { |
| 467 | return; |
| 468 | } |
| 469 | |
| 470 | wp_parse_str( $_POST[ 'fields' ], $fields ); //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash |
| 471 | |
| 472 | if ( isset( $fields[ 'eael_user_email_address' ] ) && intval( $fields[ 'eael_user_email_address' ] ) == 1 ) { |
| 473 | $this->wpins_process(); |
| 474 | } |
| 475 | update_option( 'eael_setup_wizard', 'complete' ); |
| 476 | if ( $this->save_element_list( $fields ) ) { |
| 477 | wp_send_json_success( [ 'redirect_url' => esc_url( admin_url( 'admin.php?page=eael-settings' ) ) ] ); |
| 478 | } |
| 479 | wp_send_json_error(); |
| 480 | } |
| 481 | |
| 482 | public function enable_wpins_process() { |
| 483 | |
| 484 | check_ajax_referer( 'essential-addons-elementor', 'security' ); |
| 485 | |
| 486 | if ( !current_user_can( 'manage_options' ) ) { |
| 487 | wp_send_json_error( __( 'you are not allowed to do this action', 'essential-addons-for-elementor-lite' ) ); |
| 488 | } |
| 489 | |
| 490 | if ( !isset( $_POST[ 'fields' ] ) ) { |
| 491 | return; |
| 492 | } |
| 493 | |
| 494 | wp_parse_str( $_POST[ 'fields' ], $fields ); //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash |
| 495 | |
| 496 | $this->wpins_process(); |
| 497 | |
| 498 | wp_send_json_success(); |
| 499 | } |
| 500 | |
| 501 | /** |
| 502 | * save_eael_elements_data |
| 503 | */ |
| 504 | public function save_eael_elements_data() { |
| 505 | check_ajax_referer( 'essential-addons-elementor', 'security' ); |
| 506 | |
| 507 | if ( !current_user_can( 'manage_options' ) ) { |
| 508 | wp_send_json_error( __( 'you are not allowed to do this action', 'essential-addons-for-elementor-lite' ) ); |
| 509 | } |
| 510 | |
| 511 | if ( !isset( $_POST[ 'fields' ] ) ) { |
| 512 | return; |
| 513 | } |
| 514 | |
| 515 | wp_parse_str( $_POST[ 'fields' ], $fields ); //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash |
| 516 | |
| 517 | if ( $this->save_element_list( $fields ) ) { |
| 518 | wp_send_json_success(); |
| 519 | } |
| 520 | wp_send_json_error(); |
| 521 | } |
| 522 | |
| 523 | /** |
| 524 | * save_element_list |
| 525 | * @param $fields |
| 526 | * @return bool |
| 527 | */ |
| 528 | public function save_element_list( $fields ) { |
| 529 | if ( !empty( $fields ) ) { |
| 530 | |
| 531 | $el_list = $fields[ 'eael_element' ]; |
| 532 | $save_element = []; |
| 533 | foreach ( $GLOBALS[ 'eael_config' ][ 'elements' ] as $key => $item ) { |
| 534 | $save_element[ $key ] = ( isset( $el_list[ $key ] ) ) ? 1 : ''; |
| 535 | } |
| 536 | $save_element = array_merge( $save_element, $this->get_dummy_widget() ); |
| 537 | update_option( 'eael_save_settings', $save_element ); |
| 538 | return true; |
| 539 | } |
| 540 | return false; |
| 541 | } |
| 542 | |
| 543 | /** |
| 544 | * get_element_list |
| 545 | * @return array[] |
| 546 | */ |
| 547 | public function get_element_list() { |
| 548 | return [ |
| 549 | 'content-elements' => [ |
| 550 | 'title' => __( 'Content Elements', 'essential-addons-for-elementor-lite' ), |
| 551 | 'elements' => [ |
| 552 | [ |
| 553 | 'key' => 'creative-btn', |
| 554 | 'title' => __( 'Creative Button', 'essential-addons-for-elementor-lite' ), |
| 555 | 'preferences' => 'basic', |
| 556 | ], |
| 557 | [ |
| 558 | 'key' => 'team-members', |
| 559 | 'title' => __( 'Team Member', 'essential-addons-for-elementor-lite' ), |
| 560 | 'preferences' => 'basic', |
| 561 | ], |
| 562 | [ |
| 563 | 'key' => 'testimonials', |
| 564 | 'title' => __( 'Testimonial', 'essential-addons-for-elementor-lite' ), |
| 565 | 'preferences' => 'basic', |
| 566 | ], |
| 567 | [ |
| 568 | 'key' => 'flip-box', |
| 569 | 'title' => __( 'Flip Box', 'essential-addons-for-elementor-lite' ), |
| 570 | 'preferences' => 'basic', |
| 571 | ], |
| 572 | [ |
| 573 | 'key' => 'info-box', |
| 574 | 'title' => __( 'Info Box', 'essential-addons-for-elementor-lite' ), |
| 575 | 'preferences' => 'basic', |
| 576 | ], |
| 577 | [ |
| 578 | 'key' => 'dual-header', |
| 579 | 'title' => __( 'Dual Color Heading', 'essential-addons-for-elementor-lite' ), |
| 580 | 'preferences' => 'basic', |
| 581 | ], |
| 582 | [ |
| 583 | 'key' => 'tooltip', |
| 584 | 'title' => __( 'Tooltip', 'essential-addons-for-elementor-lite' ), |
| 585 | 'preferences' => 'basic', |
| 586 | ], |
| 587 | [ |
| 588 | 'key' => 'adv-accordion', |
| 589 | 'title' => __( 'Advanced Accordion', 'essential-addons-for-elementor-lite' ), |
| 590 | 'preferences' => 'basic', |
| 591 | ], |
| 592 | [ |
| 593 | 'key' => 'adv-tabs', |
| 594 | 'title' => __( 'Advanced Tabs', 'essential-addons-for-elementor-lite' ), |
| 595 | 'preferences' => 'basic', |
| 596 | ], |
| 597 | [ |
| 598 | 'key' => 'feature-list', |
| 599 | 'title' => __( 'Feature List', 'essential-addons-for-elementor-lite' ), |
| 600 | 'preferences' => 'basic', |
| 601 | |
| 602 | ], |
| 603 | [ |
| 604 | 'key' => 'sticky-video', |
| 605 | 'title' => __( 'Sticky Video', 'essential-addons-for-elementor-lite' ), |
| 606 | 'preferences' => 'basic', |
| 607 | ], |
| 608 | [ |
| 609 | 'key' => 'event-calendar', |
| 610 | 'title' => __( 'Event Calendar', 'essential-addons-for-elementor-lite' ), |
| 611 | 'preferences' => 'advance', |
| 612 | ], |
| 613 | [ |
| 614 | 'key' => 'simple-menu', |
| 615 | 'title' => __( 'Simple Menu', 'essential-addons-for-elementor-lite' ), |
| 616 | 'preferences' => 'basic', |
| 617 | ], |
| 618 | [ |
| 619 | 'key' => 'breadcrumbs', |
| 620 | 'title' => __( 'Breadcrumbs', 'essential-addons-for-elementor-lite' ), |
| 621 | 'preferences' => 'advance', |
| 622 | ], |
| 623 | [ |
| 624 | 'key' => 'code-snippet', |
| 625 | 'title' => __( 'Code Snippet', 'essential-addons-for-elementor-lite' ), |
| 626 | 'preferences' => 'advance', |
| 627 | ], |
| 628 | ] |
| 629 | ], |
| 630 | 'dynamic-content-elements' => [ |
| 631 | 'title' => __( 'Dynamic Content Elements', 'essential-addons-for-elementor-lite' ), |
| 632 | 'elements' => [ |
| 633 | [ |
| 634 | 'key' => 'post-grid', |
| 635 | 'title' => __( 'Post Grid', 'essential-addons-for-elementor-lite' ), |
| 636 | 'preferences' => 'advance', |
| 637 | ], |
| 638 | [ |
| 639 | 'key' => 'post-timeline', |
| 640 | 'title' => __( 'Post Timeline', 'essential-addons-for-elementor-lite' ), |
| 641 | ], |
| 642 | [ |
| 643 | 'key' => 'data-table', |
| 644 | 'title' => __( 'Data Table', 'essential-addons-for-elementor-lite' ), |
| 645 | 'preferences' => 'basic', |
| 646 | ], |
| 647 | [ |
| 648 | 'key' => 'advanced-data-table', |
| 649 | 'title' => __( 'Advanced Data Table', 'essential-addons-for-elementor-lite' ), |
| 650 | ], |
| 651 | [ |
| 652 | 'key' => 'content-ticker', |
| 653 | 'title' => __( 'Content Ticker', 'essential-addons-for-elementor-lite' ), |
| 654 | 'preferences' => 'basic', |
| 655 | ], |
| 656 | [ |
| 657 | 'key' => 'nft-gallery', |
| 658 | 'title' => __( 'NFT Gallery', 'essential-addons-for-elementor-lite' ), |
| 659 | 'preferences' => 'basic', |
| 660 | ], |
| 661 | [ |
| 662 | 'key' => 'business-reviews', |
| 663 | 'title' => __( 'Business Reviews', 'essential-addons-for-elementor-lite' ), |
| 664 | ], |
| 665 | ] |
| 666 | ], |
| 667 | 'creative-elements' => [ |
| 668 | 'title' => __( 'Creative Elements', 'essential-addons-for-elementor-lite' ), |
| 669 | 'elements' => [ |
| 670 | [ |
| 671 | 'key' => 'count-down', |
| 672 | 'title' => __( 'Countdown', 'essential-addons-for-elementor-lite' ), |
| 673 | 'preferences' => 'basic', |
| 674 | ], |
| 675 | [ |
| 676 | 'key' => 'fancy-text', |
| 677 | 'title' => __( 'Fancy Text', 'essential-addons-for-elementor-lite' ), |
| 678 | 'preferences' => 'basic', |
| 679 | ], |
| 680 | [ |
| 681 | 'key' => 'filter-gallery', |
| 682 | 'title' => __( 'Filterable Gallery', 'essential-addons-for-elementor-lite' ), |
| 683 | 'preferences' => 'basic', |
| 684 | ], |
| 685 | [ |
| 686 | 'key' => 'image-accordion', |
| 687 | 'title' => __( 'Image Accordion', 'essential-addons-for-elementor-lite' ), |
| 688 | 'preferences' => 'basic', |
| 689 | ], |
| 690 | [ |
| 691 | 'key' => 'progress-bar', |
| 692 | 'title' => __( 'Progress Bar', 'essential-addons-for-elementor-lite' ), |
| 693 | 'preferences' => 'basic', |
| 694 | ], |
| 695 | [ |
| 696 | 'key' => 'interactive-circle', |
| 697 | 'title' => __( 'Interactive Circle', 'essential-addons-for-elementor-lite' ), |
| 698 | 'preferences' => 'advance', |
| 699 | ], |
| 700 | [ |
| 701 | 'key' => 'svg-draw', |
| 702 | 'title' => __( 'SVG Draw', 'essential-addons-for-elementor-lite' ), |
| 703 | 'preferences' => 'advance', |
| 704 | ], |
| 705 | [ |
| 706 | 'key' => 'fancy-chart', |
| 707 | 'title' => __( 'Fancy Chart', 'essential-addons-for-elementor-lite' ), |
| 708 | 'preferences' => 'advance', |
| 709 | ], |
| 710 | [ |
| 711 | 'key' => 'stacked-cards', |
| 712 | 'title' => __( 'Stacked Cards', 'essential-addons-for-elementor-lite' ), |
| 713 | 'preferences' => 'advance', |
| 714 | ], |
| 715 | [ |
| 716 | 'key' => 'pricing-slider', |
| 717 | 'title' => __( 'Pricing Slider', 'essential-addons-for-elementor-lite' ), |
| 718 | 'preferences' => 'advance', |
| 719 | ], |
| 720 | [ |
| 721 | 'key' => 'sphere-photo-viewer', |
| 722 | 'title' => __( '360 Degree Photo Viewer', 'essential-addons-for-elementor-lite' ), |
| 723 | 'preferences' => 'advance', |
| 724 | ], |
| 725 | ] |
| 726 | ], |
| 727 | 'marketing-elements' => [ |
| 728 | 'title' => __( 'Marketing & Social Feed Elements', 'essential-addons-for-elementor-lite' ), |
| 729 | 'elements' => [ |
| 730 | [ |
| 731 | 'key' => 'call-to-action', |
| 732 | 'title' => __( 'Call To Action', 'essential-addons-for-elementor-lite' ), |
| 733 | 'preferences' => 'basic', |
| 734 | ], |
| 735 | [ |
| 736 | 'key' => 'price-table', |
| 737 | 'title' => __( 'Pricing Table', 'essential-addons-for-elementor-lite' ), |
| 738 | 'preferences' => 'basic', |
| 739 | ], |
| 740 | [ |
| 741 | 'key' => 'twitter-feed', |
| 742 | 'title' => __( 'Twitter Feed', 'essential-addons-for-elementor-lite' ), |
| 743 | 'preferences' => 'advance', |
| 744 | ], |
| 745 | [ |
| 746 | 'key' => 'facebook-feed', |
| 747 | 'title' => __( 'Facebook Feed', 'essential-addons-for-elementor-lite' ), |
| 748 | 'preferences' => 'advance', |
| 749 | ], |
| 750 | |
| 751 | ] |
| 752 | ], |
| 753 | 'form-styler-elements' => [ |
| 754 | 'title' => __( 'Form Styler Elements', 'essential-addons-for-elementor-lite' ), |
| 755 | 'elements' => [ |
| 756 | [ |
| 757 | 'key' => 'contact-form-7', |
| 758 | 'title' => __( 'Contact Form 7', 'essential-addons-for-elementor-lite' ), |
| 759 | 'preferences' => 'advance', |
| 760 | ], |
| 761 | [ |
| 762 | 'key' => 'weforms', |
| 763 | 'title' => __( 'weForms', 'essential-addons-for-elementor-lite' ), |
| 764 | ], |
| 765 | [ |
| 766 | 'key' => 'ninja-form', |
| 767 | 'title' => __( 'Ninja Form', 'essential-addons-for-elementor-lite' ), |
| 768 | ], |
| 769 | [ |
| 770 | 'key' => 'gravity-form', |
| 771 | 'title' => __( 'Gravity Form', 'essential-addons-for-elementor-lite' ), |
| 772 | ], |
| 773 | [ |
| 774 | 'key' => 'caldera-form', |
| 775 | 'title' => __( 'Caldera Form', 'essential-addons-for-elementor-lite' ), |
| 776 | ], |
| 777 | [ |
| 778 | 'key' => 'wpforms', |
| 779 | 'title' => __( 'WPForms', 'essential-addons-for-elementor-lite' ), |
| 780 | ], |
| 781 | [ |
| 782 | 'key' => 'fluentform', |
| 783 | 'title' => __( 'Fluent Forms', 'essential-addons-for-elementor-lite' ), |
| 784 | ], |
| 785 | [ |
| 786 | 'key' => 'formstack', |
| 787 | 'title' => __( 'Formstack', 'essential-addons-for-elementor-lite' ), |
| 788 | ], |
| 789 | [ |
| 790 | 'key' => 'typeform', |
| 791 | 'title' => __( 'Typeform', 'essential-addons-for-elementor-lite' ), |
| 792 | ], |
| 793 | [ |
| 794 | 'key' => 'login-register', |
| 795 | 'title' => __( 'Login Register Form', 'essential-addons-for-elementor-lite' ), |
| 796 | 'preferences' => 'advance', |
| 797 | ], |
| 798 | ] |
| 799 | ], |
| 800 | 'documentation-elements' => [ |
| 801 | 'title' => __( 'Documentation Elements', 'essential-addons-for-elementor-lite' ), |
| 802 | 'elements' => [ |
| 803 | [ |
| 804 | 'key' => 'betterdocs-category-grid', |
| 805 | 'title' => __( 'BetterDocs Category Grid', 'essential-addons-for-elementor-lite' ), |
| 806 | ], |
| 807 | [ |
| 808 | 'key' => 'betterdocs-category-box', |
| 809 | 'title' => __( 'BetterDocs Category Box', 'essential-addons-for-elementor-lite' ), |
| 810 | |
| 811 | ], |
| 812 | [ |
| 813 | 'key' => 'betterdocs-search-form', |
| 814 | 'title' => __( 'BetterDocs Search Form', 'essential-addons-for-elementor-lite' ), |
| 815 | ] |
| 816 | ] |
| 817 | ], |
| 818 | 'woocommerce-elements' => [ |
| 819 | 'title' => __( 'WooCommerce Elements', 'essential-addons-for-elementor-lite' ), |
| 820 | 'elements' => [ |
| 821 | [ |
| 822 | 'key' => 'product-grid', |
| 823 | 'title' => __( 'Woo Product Grid', 'essential-addons-for-elementor-lite' ), |
| 824 | 'preferences' => 'advance', |
| 825 | ], |
| 826 | [ |
| 827 | 'key' => 'woo-product-list', |
| 828 | 'title' => __( 'Woo Product List', 'essential-addons-for-elementor-lite' ), |
| 829 | 'preferences' => 'advance', |
| 830 | ], |
| 831 | [ |
| 832 | 'key' => 'woo-product-image', |
| 833 | 'title' => __( 'Woo Product Images', 'essential-addons-for-elementor-lite' ), |
| 834 | 'preferences' => 'advance', |
| 835 | ], |
| 836 | [ |
| 837 | 'key' => 'woo-add-to-cart', |
| 838 | 'title' => __( 'Woo Add To Cart', 'essential-addons-for-elementor-lite' ), |
| 839 | 'preferences' => 'advance', |
| 840 | ], |
| 841 | [ |
| 842 | 'key' => 'woo-product-price', |
| 843 | 'title' => __( 'Woo Product Price', 'essential-addons-for-elementor-lite' ), |
| 844 | 'preferences' => 'advance', |
| 845 | ], |
| 846 | [ |
| 847 | 'key' => 'woo-product-rating', |
| 848 | 'title' => __( 'Woo Product Rating', 'essential-addons-for-elementor-lite' ), |
| 849 | 'preferences' => 'advance', |
| 850 | ], |
| 851 | [ |
| 852 | 'key' => 'woo-product-carousel', |
| 853 | 'title' => __( 'Woo Product Carousel', 'essential-addons-for-elementor-lite' ), |
| 854 | ], |
| 855 | [ |
| 856 | 'key' => 'woo-checkout', |
| 857 | 'title' => __( 'Woo Checkout', 'essential-addons-for-elementor-lite' ), |
| 858 | ], |
| 859 | [ |
| 860 | 'key' => 'woo-cart', |
| 861 | 'title' => __( 'Woo Cart', 'essential-addons-for-elementor-lite' ), |
| 862 | ], |
| 863 | [ |
| 864 | 'key' => 'woo-cross-sells', |
| 865 | 'title' => __( 'Woo Cross Sells', 'essential-addons-for-elementor-lite' ), |
| 866 | ], |
| 867 | [ |
| 868 | 'key' => 'woo-product-compare', |
| 869 | 'title' => __( 'Woo Product Compare', 'essential-addons-for-elementor-lite' ), |
| 870 | 'preferences' => 'advance', |
| 871 | ], |
| 872 | [ |
| 873 | 'key' => 'woo-product-gallery', |
| 874 | 'title' => __( 'Woo Product Gallery', 'essential-addons-for-elementor-lite' ), |
| 875 | 'preferences' => 'advance', |
| 876 | ] |
| 877 | ] |
| 878 | ] |
| 879 | ]; |
| 880 | } |
| 881 | |
| 882 | public static function redirect() { |
| 883 | // Do not redirect AJAX requests |
| 884 | if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { |
| 885 | return; |
| 886 | } |
| 887 | |
| 888 | update_option( 'eael_setup_wizard', 'init' ); |
| 889 | wp_safe_redirect( admin_url( 'admin.php?page=eael-setup-wizard' ) ); |
| 890 | } |
| 891 | |
| 892 | public function change_site_title() { |
| 893 | ?> |
| 894 | <script> |
| 895 | document.title = "<?php esc_html_e( 'Quick Setup Wizard- Essential Addons', 'essential-addons-for-elementor-lite' ); ?>" |
| 896 | </script> |
| 897 | <?php |
| 898 | } |
| 899 | |
| 900 | public function wpins_process() { |
| 901 | $plugin_name = basename( EAEL_PLUGIN_FILE, '.php' ); |
| 902 | if ( class_exists( '\Essential_Addons_Elementor\Classes\Plugin_Usage_Tracker' ) ) { |
| 903 | $tracker = \Essential_Addons_Elementor\Classes\Plugin_Usage_Tracker::get_instance( EAEL_PLUGIN_FILE, [ |
| 904 | 'opt_in' => true, |
| 905 | 'goodbye_form' => true, |
| 906 | 'item_id' => '760e8569757fa16992d8' |
| 907 | ] ); |
| 908 | $tracker->set_is_tracking_allowed( true ); |
| 909 | $tracker->do_tracking( true ); |
| 910 | } |
| 911 | } |
| 912 | |
| 913 | public function get_is_tracking_allowed( $plugin = 'essential_adons_elementor' ){ |
| 914 | /** |
| 915 | * Get All Tracked Plugin List using this Tracker. |
| 916 | */ |
| 917 | $allow_tracking = get_option( 'wpins_allow_tracking' ); |
| 918 | /** |
| 919 | * Check user is opted out for tracking or not. |
| 920 | */ |
| 921 | return intval( isset( $allow_tracking[$plugin] ) ); |
| 922 | } |
| 923 | |
| 924 | public function get_dummy_widget() { |
| 925 | return [ |
| 926 | 'embedpress' => 1, |
| 927 | 'woocommerce-review' => 1, |
| 928 | 'career-page' => 1, |
| 929 | 'crowdfundly-single-campaign' => 1, |
| 930 | 'crowdfundly-organization' => 1, |
| 931 | 'crowdfundly-all-campaign' => 1, |
| 932 | 'better-payment' => 1, |
| 933 | ]; |
| 934 | } |
| 935 | } |
| 936 | |
| 937 | |
| 938 |