PluginProbe
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder / 3.1.4
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder v3.1.4
3.1.4 3.0.8 3.0.9 3.1.0 3.1.2 3.1.3 3.0.7 3.0.5 3.0.4 3.0.3 3.0.2 trunk 1.5.0 1.5.1 1.5.2 1.6.1 1.6.2 1.6.3 1.6.4 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 All 93 releases
← All changes | ultimate-store-kit.php +83 -147 2.0.13.1.4 View file →
@@ -1,55 +1,60 @@
1 1 <?php
2 2
3 3 /**
4 4 * Plugin Name: Ultimate Store Kit
5 - * Plugin URI: https://bdthemes.com/ultimate-store-kit/
6 - * Description: <a href="https://bdthemes.com/ultimate-store-kit/">Ultimate Store Kit</a> is a packed of elementor widgets. This plugin gives you extra widgets features for elementor page builder plugin that help you to build an ecommerce website with woocommerce.
7 - * Version: 2.0.1
5 + * Plugin URI: https://storekit.pro/
6 + * Description: Build online stores in WordPress with the powerful store builder addon for Elementor. Enjoy a wide range of customizations and easily build product grids, carousels, single product/page elements, checkouts and more.
7 + * Version: 3.1.4
8 8 * Author: BdThemes
9 9 * Author URI: https://bdthemes.com/
10 10 * Text Domain: ultimate-store-kit
11 11 * Domain Path: /languages
12 12 * License: GPL3
13 - * Elementor requires at least: 3.0.0
14 - * Elementor tested up to: 3.23.4
13 + * Elementor requires at least: 4.0.0
14 + * Elementor tested up to: 4.2.4
15 15 */
16 16
17 -// Some pre define value for easy use
18 -define( 'BDTUSK_VER', '2.0.1' );
19 -define( 'BDTUSK__FILE__', __FILE__ );
20 -define( 'BDTUSK_PNAME', basename( dirname( BDTUSK__FILE__ ) ) );
21 -define( 'BDTUSK_PBNAME', plugin_basename( BDTUSK__FILE__ ) );
22 -define( 'BDTUSK_PATH', plugin_dir_path( BDTUSK__FILE__ ) );
23 -define( 'BDTUSK_URL', plugins_url( '/', BDTUSK__FILE__ ) );
24 -define( 'BDTUSK_MODULES_PATH', BDTUSK_PATH . 'modules/' );
25 -define( 'BDTUSK_INC_PATH', BDTUSK_PATH . 'includes/' );
26 -define( 'BDTUSK_ADMIN_PATH', BDTUSK_PATH . 'admin/' );
27 -define( 'BDTUSK_ADMIN_URL', BDTUSK_URL . 'admin/' );
28 -define( 'BDTUSK_ASSETS_URL', BDTUSK_URL . 'assets/' );
29 -define( 'BDTUSK_ASSETS_PATH', BDTUSK_PATH . 'assets/' );
30 -define( 'BDTUSK_MODULES_URL', BDTUSK_URL . 'modules/' );
31 -define( 'BDTUSK_ADM_PATH', BDTUSK_PATH . 'admin/' );
32 -define( 'BDTUSK_ADM_ASSETS_URL', BDTUSK_URL . 'admin/assets/' );
33 17
34 -define( 'BDTUSK_TITLE', 'Ultimate Store Kit' );
35 18
36 -/**
37 - * The code that runs during plugin activation.
38 - */
39 -// function bdthemes_ultimate_store_kit_activate_plugin() {
40 -// require_once plugin_dir_path(__FILE__) . 'includes/ultimate-store-kit-activator.php';
41 -// Ultimate_Store_Kit_Activator::activate();
42 -// }
43 -// register_activation_hook(__FILE__, 'bdthemes_ultimate_store_kit_activate_plugin');
19 +if (! defined('ABSPATH')) {
20 + exit; // Exit if accessed directly
21 +}
44 22
23 +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals -- BDTUSK_ / ultimate_store_kit_ / ultimate-store-kit- are this plugin's established public prefixes.
45 24
25 +// Check if vendor directory and autoload.php exist
26 +$ultimate_store_kit_autoload_file = __DIR__ . '/vendor/autoload.php';
27 +if (file_exists($ultimate_store_kit_autoload_file)) {
28 + // Load autoloader (vendor/autoload.php).
29 + require_once $ultimate_store_kit_autoload_file;
30 +}
46 31
47 -if ( ! function_exists( '_is_usk_pro_installed' ) ) {
32 +// Some pre define value for easy use
33 +define('BDTUSK_VER', '3.1.4');
34 +define('BDTUSK__FILE__', __FILE__);
35 +define('BDTUSK_PNAME', basename(dirname(BDTUSK__FILE__)));
36 +define('BDTUSK_PBNAME', plugin_basename(BDTUSK__FILE__));
37 +define('BDTUSK_PATH', plugin_dir_path(BDTUSK__FILE__));
38 +define('BDTUSK_URL', plugins_url('/', BDTUSK__FILE__));
39 +define('BDTUSK_MODULES_PATH', BDTUSK_PATH . 'modules/');
40 +define('BDTUSK_INC_PATH', BDTUSK_PATH . 'includes/');
41 +define('BDTUSK_ADMIN_PATH', BDTUSK_PATH . 'admin/');
42 +define('BDTUSK_ADMIN_URL', BDTUSK_URL . 'admin/');
43 +define('BDTUSK_ASSETS_URL', BDTUSK_URL . 'assets/');
44 +define('BDTUSK_ASSETS_PATH', BDTUSK_PATH . 'assets/');
45 +define('BDTUSK_MODULES_URL', BDTUSK_URL . 'modules/');
46 +define('BDTUSK_ADM_PATH', BDTUSK_PATH . 'admin/');
47 +define('BDTUSK_ADM_ASSETS_URL', BDTUSK_URL . 'includes/Admin/assets/');
48 +define('BDTUSK_BUILD_URL', BDTUSK_URL . 'build/');
48 49
49 - function _is_usk_pro_installed() {
50 +define('BDTUSK_TITLE', 'Ultimate Store Kit');
50 51
51 - if ( ! function_exists( 'get_plugins' ) ) {
52 +if (! function_exists('ultimate_store_kit_is_pro_installed')) {
53 +
54 + function ultimate_store_kit_is_pro_installed() {
55 +
56 + if (! function_exists('get_plugins')) {
52 57 require_once ABSPATH . 'wp-admin/includes/plugin.php';
53 58 }
54 59
55 60 $file_path = 'ultimate-store-kit-pro/ultimate-store-kit-pro.php';
@@ -54,17 +59,17 @@
54 59
55 60 $file_path = 'ultimate-store-kit-pro/ultimate-store-kit-pro.php';
56 61 $installed_plugins = get_plugins();
57 62
58 - return isset( $installed_plugins[ $file_path ] );
63 + return isset($installed_plugins[$file_path]);
59 64 }
60 65 }
61 66
62 -if ( ! function_exists( '_is_usk_pro_activated' ) ) {
67 +if (! function_exists('ultimate_store_kit_is_pro_activated')) {
63 68
64 - function _is_usk_pro_activated() {
69 + function ultimate_store_kit_is_pro_activated() {
65 70
66 - if ( ! function_exists( 'get_plugins' ) ) {
71 + if (! function_exists('get_plugins')) {
67 72 require_once ABSPATH . 'wp-admin/includes/plugin.php';
68 73 }
69 74
70 75 $file_path = 'ultimate-store-kit-pro/ultimate-store-kit-pro.php';
@@ -69,9 +74,9 @@
69 74
70 75 $file_path = 'ultimate-store-kit-pro/ultimate-store-kit-pro.php';
71 76 $installed_plugins = get_plugins();
72 77
73 - if ( is_plugin_active( $file_path ) ) {
78 + if (is_plugin_active($file_path)) {
74 79 return true;
75 80 }
76 81
77 82 return false;
@@ -78,19 +83,19 @@
78 83 }
79 84 }
80 85
81 86 // Helper function here
82 -require ( dirname( __FILE__ ) . '/includes/helper.php' );
87 +require(dirname(__FILE__) . '/includes/helper.php');
83 88
84 -if ( ! _is_usk_pro_activated() ) {
89 +if (! ultimate_store_kit_is_pro_activated()) {
85 90 require_once BDTUSK_INC_PATH . 'class-pro-widget-map.php';
86 91 }
87 92
88 -if ( function_exists( 'usk_license_validation' ) && true !== usk_license_validation() ) {
93 +if (function_exists('ultimate_store_kit_license_validation') && true !== ultimate_store_kit_license_validation()) {
89 94 require_once BDTUSK_INC_PATH . 'class-pro-widget-map.php';
90 95 }
91 96
92 -require ( dirname( __FILE__ ) . '/includes/utils.php' );
97 +require(dirname(__FILE__) . '/includes/utils.php');
93 98
94 99
95 100 /**
96 101 * Plugin load here correctly
@@ -96,30 +101,26 @@
96 101 * Plugin load here correctly
97 102 * Also loaded the language file from here
98 103 */
99 104 function bdthemes_ultimate_store_kit_load_plugin() {
100 - load_plugin_textdomain( 'ultimate-store-kit', false, basename( dirname( __FILE__ ) ) . '/languages' );
101 105
102 - if ( ! did_action( 'elementor/loaded' ) ) {
103 - add_action( 'admin_notices', 'bdthemes_ultimate_store_kit_fail_load' );
106 + if (! did_action('elementor/loaded')) {
107 + add_action('admin_notices', 'bdthemes_ultimate_store_kit_fail_load');
104 108 return;
105 109 }
106 110
107 - if ( ( ! class_exists( 'Easy_Digital_Downloads' ) ) && ( ! class_exists( 'woocommerce' ) ) ) {
108 - add_action( 'admin_notices', 'bdthemes_ultimate_store_kit_dependencies_plugin_fail_load' );
111 + if ((! class_exists('Easy_Digital_Downloads')) && (! class_exists('woocommerce'))) {
112 + add_action('admin_notices', 'bdthemes_ultimate_store_kit_dependencies_plugin_fail_load');
109 113 return;
110 114 }
111 115
112 116 // Widgets filters here
113 - require ( BDTUSK_INC_PATH . 'ultimate-store-kit-filters.php' );
117 + require(BDTUSK_INC_PATH . 'ultimate-store-kit-filters.php');
114 118
115 119 // Element pack widget and assets loader
116 - require ( BDTUSK_PATH . 'loader.php' );
117 -
118 - // Notice class
119 - require ( BDTUSK_ADM_PATH . 'admin-notice.php' );
120 + require(BDTUSK_PATH . 'loader.php');
120 121 }
121 -add_action( 'plugins_loaded', 'bdthemes_ultimate_store_kit_load_plugin', 9 );
122 +add_action('plugins_loaded', 'bdthemes_ultimate_store_kit_load_plugin', 9);
122 123
123 124
124 125 /**
125 126 * Check Elementor installed and activated correctly
@@ -125,31 +126,31 @@
125 126 * Check Elementor installed and activated correctly
126 127 */
127 128 function bdthemes_ultimate_store_kit_fail_load() {
128 129 $screen = get_current_screen();
129 - if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) {
130 + if (isset($screen->parent_file) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id) {
130 131 return;
131 132 }
132 133
133 134 $plugin = 'elementor/elementor.php';
134 135
135 - if ( _is_dep_plugin_installed( $plugin ) ) {
136 - if ( ! current_user_can( 'activate_plugins' ) ) {
136 + if (ultimate_store_kit_is_dependency_plugin_installed($plugin)) {
137 + if (! current_user_can('activate_plugins')) {
137 138 return;
138 139 }
139 - $activation_url = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $plugin . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $plugin );
140 - $admin_message = '<p>' . esc_html__( 'Ops! Ultimate Store Kit not working because you need to activate the Elementor plugin first.', 'ultimate-store-kit' ) . '</p>';
141 - $admin_message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $activation_url, esc_html__( 'Activate Elementor Now', 'ultimate-store-kit' ) ) . '</p>';
140 + $activation_url = wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $plugin);
141 + $admin_message = '<p>' . esc_html__('Ops! Ultimate Store Kit not working because you need to activate the Elementor plugin first.', 'ultimate-store-kit') . '</p>';
142 + $admin_message .= '<p>' . sprintf('<a href="%s" class="button-primary">%s</a>', $activation_url, esc_html__('Activate Elementor Now', 'ultimate-store-kit')) . '</p>';
142 143 } else {
143 - if ( ! current_user_can( 'install_plugins' ) ) {
144 + if (! current_user_can('install_plugins')) {
144 145 return;
145 146 }
146 - $install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' );
147 - $admin_message = '<p>' . esc_html__( 'Ops! Ultimate Store Kit not working because you need to install the Elementor plugin', 'ultimate-store-kit' ) . '</p>';
148 - $admin_message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $install_url, esc_html__( 'Install Elementor Now', 'ultimate-store-kit' ) ) . '</p>';
147 + $install_url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=elementor'), 'install-plugin_elementor');
148 + $admin_message = '<p>' . esc_html__('Ops! Ultimate Store Kit not working because you need to install the Elementor plugin', 'ultimate-store-kit') . '</p>';
149 + $admin_message .= '<p>' . sprintf('<a href="%s" class="button-primary">%s</a>', $install_url, esc_html__('Install Elementor Now', 'ultimate-store-kit')) . '</p>';
149 150 }
150 151
151 - printf( '<div class="error">%1$s</div>', wp_kses_post( $admin_message ) );
152 + printf('<div class="error">%1$s</div>', wp_kses_post($admin_message));
152 153 }
153 154
154 155 /**
155 156 * Check Woocommerce installed and activated correctly
@@ -155,110 +156,45 @@
155 156 * Check Woocommerce installed and activated correctly
156 157 */
157 158 function bdthemes_ultimate_store_kit_dependencies_plugin_fail_load() {
158 159 $screen = get_current_screen();
159 - if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) {
160 + if (isset($screen->parent_file) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id) {
160 161 return;
161 162 }
162 163
163 164 $plugin = 'woocommerce/woocommerce.php';
164 165
165 -
166 -
167 -
168 -
169 - if ( _is_dep_plugin_installed( $plugin ) ) {
170 - if ( ! current_user_can( 'activate_plugins' ) ) {
166 + if (ultimate_store_kit_is_dependency_plugin_installed($plugin)) {
167 + if (! current_user_can('activate_plugins')) {
171 168 return;
172 169 }
173 - $admin_message = '<p>' . esc_html__( 'Ops! Ultimate Store Kit not working because you need to activate a eCommerce plugin like WooCommerce or Easy Digital Downloads first.', 'ultimate-store-kit' ) . '</p>';
170 + $activation_url = wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $plugin);
171 + $admin_message = '<p>' . esc_html__('Ops! Ultimate Store Kit not working because you need to activate a eCommerce plugin like WooCommerce or Easy Digital Downloads first.', 'ultimate-store-kit') . '</p>';
172 + $admin_message .= '<p>' . sprintf('<a href="%s" class="button-primary">%s</a>', $activation_url, esc_html__('Activate WooCommerce Now', 'ultimate-store-kit')) . '</p>';
174 173 } else {
175 - if ( ! current_user_can( 'install_plugins' ) ) {
174 + if (! current_user_can('install_plugins')) {
176 175 return;
177 176 }
178 - $admin_message = '<p>' . esc_html__( 'Ops! Ultimate Store Kit not working because you need to install a eCommerce plugin like WooCommerce or Easy Digital Download first.', 'ultimate-store-kit' ) . '</p>';
177 + $install_url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=woocommerce'), 'install-plugin_woocommerce');
178 + $admin_message = '<p>' . esc_html__('Ops! Ultimate Store Kit not working because you need to install a eCommerce plugin like WooCommerce or Easy Digital Download first.', 'ultimate-store-kit') . '</p>';
179 + $admin_message .= '<p>' . sprintf('<a href="%s" class="button-primary">%s</a>', $install_url, esc_html__('Install WooCommerce Now', 'ultimate-store-kit')) . '</p>';
179 180 }
180 181
181 - printf( '<div class="error">%1$s</div>', wp_kses_post( $admin_message ) );
182 + printf('<div class="error">%1$s</div>', wp_kses_post($admin_message));
182 183 }
183 184
185 +if (! function_exists('ultimate_store_kit_is_dependency_plugin_installed')) {
184 186
185 -/**
186 - * Check Woocommerce installed and activated correctly
187 - */
188 -function bdthemes_ultimate_store_kit_easy_digital_downloads_fail_load() {
189 - $screen = get_current_screen();
190 - if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) {
191 - return;
192 - }
193 -
194 - $plugin = 'easy-digital-downloads/easy-digital-downloads.php';
195 -
196 - if ( _is_dep_plugin_installed( $plugin ) ) {
197 - if ( ! current_user_can( 'activate_plugins' ) ) {
198 - return;
199 - }
200 - $activation_url = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $plugin . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $plugin );
201 - $admin_message = '<p>' . esc_html__( 'Ops! Ultimate Store Kit not working because you need to activate the Easy Digital Donwlaods plugin first.', 'ultimate-store-kit' ) . '</p>';
202 - $admin_message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $activation_url, esc_html__( 'Activate Easy Digital Donwlaods Now', 'ultimate-store-kit' ) ) . '</p>';
203 - } else {
204 - if ( ! current_user_can( 'install_plugins' ) ) {
205 - return;
206 - }
207 - $install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=easy-digital-downloads' ), 'install-plugin_easy_digital_downloads' );
208 - $admin_message = '<p>' . esc_html__( 'Ops! Ultimate Store Kit not working because you need to install the Easy Digital Downloads plugin', 'ultimate-store-kit' ) . '</p>';
209 - $admin_message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $install_url, esc_html__( 'Install Easy Digital Downloads Now', 'ultimate-store-kit' ) ) . '</p>';
210 - }
211 -
212 - printf( '<div class="error">%1$s</div>', wp_kses_post( $admin_message ) );
213 -}
214 -
215 -if ( ! function_exists( '_is_dep_plugin_installed' ) ) {
216 -
217 187 /**
218 188 * @plug_slug string plugins slug which you want to check installed or not
219 189 */
220 - function _is_dep_plugin_installed( $plugin_slug ) {
190 + function ultimate_store_kit_is_dependency_plugin_installed($plugin_slug) {
191 + if (! function_exists('get_plugins')) {
192 + require_once ABSPATH . 'wp-admin/includes/plugin.php';
193 + }
194 +
221 195 $file_path = $plugin_slug;
222 196 $installed_plugins = get_plugins();
223 197
224 - return isset( $installed_plugins[ $file_path ] );
198 + return isset($installed_plugins[$file_path]);
225 199 }
226 200 }
227 -
228 -
229 -/**
230 - * SDK Integration
231 - */
232 -
233 -if ( ! function_exists( 'dci_plugin_ultimate_store_kit' ) ) {
234 - function dci_plugin_ultimate_store_kit() {
235 -
236 - // Include DCI SDK.
237 - require_once dirname( __FILE__ ) . '/dci/start.php';
238 -
239 - wp_enqueue_style( 'dci-sdk-usk', plugins_url( 'dci/assets/css/dci.css', __FILE__ ), array(), '1.2.0', 'all' );
240 -
241 - dci_dynamic_init( array(
242 - 'sdk_version' => '1.2.1',
243 - 'product_id' => 6,
244 - 'plugin_name' => 'Ultimate Store Kit', // make simple, must not empty
245 - 'plugin_title' => 'Love using Ultimate Store Kit? Congrats 🎉 ( Never miss an Important Update )', // You can describe your plugin title here
246 - 'plugin_icon' => BDTUSK_ASSETS_URL . 'images/logo.svg', // delete the line of you don't need
247 - 'api_endpoint' => 'https://analytics.bdthemes.com/wp-json/dci/v1/data-insights',
248 - 'slug' => 'ultimate-store-kit', // write 'no-need' if you don't want to use
249 - 'menu' => array(
250 - 'slug' => 'ultimate_store_kit_options',
251 - ),
252 - 'public_key' => 'pk_IMF43HfTlEdsaQjoE8atAWlb6xTMjX3w',
253 - 'is_premium' => true,
254 - 'popup_notice' => false,
255 - 'deactivate_feedback' => true,
256 - 'delay_time' => [
257 - 'time' => 3 * DAY_IN_SECONDS,
258 - ],
259 - 'plugin_msg' => '<p>Be Top-contributor by sharing non-sensitive plugin data and create an impact to the global WordPress community today! You can receive valuable emails periodically.</p>',
260 - ) );
261 -
262 - }
263 - add_action( 'admin_init', 'dci_plugin_ultimate_store_kit' );
264 -}