PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.4.8
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.4.8
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | vendor/codeinwp/themeisle-sdk/src/Loader.php +3 -384 4.0.33.4.8 View file →
@@ -36,9 +36,9 @@
36 36 private static $version = '2.0.0';
37 37 /**
38 38 * Holds registered products.
39 39 *
40 - * @var array<Product> The products which use the SDK.
40 + * @var array The products which use the SDK.
41 41 */
42 42 private static $products = [];
43 43 /**
44 44 * Holds available modules to load.
@@ -45,9 +45,8 @@
45 45 *
46 46 * @var array The modules which SDK will be using.
47 47 */
48 48 private static $available_modules = [
49 - 'script_loader',
50 49 'dashboard_widget',
51 50 'rollback',
52 51 'uninstall_feedback',
53 52 'licenser',
@@ -52,286 +51,12 @@
52 51 'uninstall_feedback',
53 52 'licenser',
54 53 'logger',
55 54 'translate',
56 - 'translations',
57 55 'review',
58 56 'recommendation',
59 57 'notification',
60 - 'promotions',
61 - 'welcome',
62 - 'compatibilities',
63 - 'about_us',
64 - 'announcements',
65 - 'featured_plugins',
66 - 'float_widget',
67 - 'migrator',
68 - ];
69 - /**
70 - * Holds the labels for the modules.
71 - *
72 - * @var array The labels for the modules.
73 - */
74 - public static $labels = [
75 - 'announcements' => [
76 - 'notice_link_label' => 'See the deals',
77 - 'max_savings' => 'Best WordPress Black Friday deals of %s — themes, plugins, hosting. Curated by the Themeisle team.',
78 - 'black_friday' => 'Black Friday Sale',
79 - 'time_left' => '%s left',
80 - 'plugin_meta_message' => 'Black Friday Sale - 60% OFF',
81 - ],
82 - 'compatibilities' => [
83 - 'notice' => '%s requires a newer version of %s. Please %supdate%s %s %s to the latest version.',
84 - 'notice2' => '%s update requires a newer version of %s. Please %supdate%s %s %s.',
85 - 'notice_theme' => '%1$sWarning:%2$s This theme has not been tested with your current version of %1$s%3$s%2$s. Please update %3$s plugin.',
86 - 'notice_plugin' => '%1$sWarning:%2$s This plugin has not been tested with your current version of %1$s%3$s%2$s. Please update %3$s %4$s.',
87 - 'theme' => 'theme',
88 - 'plugin' => 'plugin',
89 - ],
90 - 'dashboard_widget' => [
91 - 'title' => 'WordPress Guides/Tutorials',
92 - 'popular' => 'Popular %s',
93 - 'install' => 'Install',
94 - 'powered' => 'Powered by %s',
95 - ],
96 - 'licenser' => [
97 - 'activate' => 'Activate',
98 - 'invalid_msg' => 'Invalid license.',
99 - 'error_notice' => 'ERROR: Failed to connect to the license service. Please try again later. Reason: %s',
100 - 'error_notice2' => 'ERROR: Failed to validate license. Please try again in one minute.',
101 - 'error_invalid' => 'ERROR: Invalid license provided.',
102 - 'update_license' => 'Updating this theme will lose any customizations you have made. Cancel to stop, OK to update.',
103 - 'invalid_msg' => 'Invalid license.',
104 - 'already_active' => 'License is already active.',
105 - 'notice_update' => '%1$s is available. %2$sCheck out what\'s%3$s new or %4$supdate now%3$s.',
106 - 'not_active' => 'License not active.',
107 - 'deactivate' => 'Deactivate',
108 - 'renew_cta' => 'Renew license to update',
109 - 'autoactivate_notice' => '%s has been successfully activated using %s license !',
110 - 'valid' => 'Valid',
111 - 'invalid' => 'Invalid',
112 - 'notice' => 'Enter your license from %s purchase history in order to get %s updates',
113 - 'expired' => '%s license expired',
114 - 'expired_date' => 'Expired on %s',
115 - 'expired_notice' => 'Your current setup continues working, but premium features are disabled and you\'re no longer receive updates - including critical patches - or support.',
116 58
117 - 'inactive' => 'In order to benefit from updates and support for %s, please add your license code from your %spurchase history%s and validate it %shere%s.',
118 - 'no_activations' => 'No more activations left for %s. You need to upgrade your plan in order to use %s on more websites. If you need assistance, please get in touch with %s staff.',
119 - 'renew_license' => 'Renew License',
120 - 'learn_more' => 'Learn More',
121 - ],
122 - 'promotions' => [
123 - 'recommended' => 'Recommended by %s',
124 - 'installActivate' => 'Install & Activate',
125 - 'preview' => 'Preview',
126 - 'installing' => 'Installing',
127 - 'activating' => 'Activating',
128 - 'connecting' => 'Connecting to API',
129 - 'learnmore' => 'Learn More',
130 - 'activate' => 'Activate',
131 - 'all_set' => 'Awesome! You are all set!',
132 - 'woo' => [
133 - 'title' => 'More extensions from Themeisle',
134 - 'title2' => 'Recommended extensions',
135 - 'cta_install' => 'Install',
136 - 'learn_more' => 'Learn More',
137 - 'dismiss' => 'Dismiss this suggestion',
138 - 'ppom_title' => 'Product Add-Ons',
139 - 'ppom_desc' => 'Add extra custom fields & add-ons on your product pages, like sizes, colors & more.',
140 - 'spark_title1' => 'Wishlist',
141 - 'spark_title2' => 'Multi-Announcement Bars',
142 - 'spark_title3' => 'Advanced Product Review',
143 - 'spark_desc1' => 'Loyalize your customers by allowing them to save their favorite products.',
144 - 'spark_desc2' => 'Add a top notification bar on your website to highlight the latest products, offers, or upcoming events.',
145 - 'spark_desc3' => 'Enable an advanced review section, enlarging the basic review options with lots of capabilities.',
146 - ],
147 -
148 - 'feedzy' => [
149 - 'import_desc' => 'Schedule automatic content imports from any RSS feed directly to your site. %sBuilt by %s%s',
150 - 'install_now' => 'Install Now',
151 - 'by' => 'by %s',
152 - 'editor_recommends' => '%s recommends %sFeedzy%s to display entries from any RSS feed with more advanced styling and filtering options.',
153 - ],
154 - 'optimole' => [
155 - 'installOptimole' => 'Install Optimole',
156 - 'gotodash' => 'Go to Optimole dashboard',
157 - 'dismisscta' => 'Dismiss this notice.',
158 - 'message1' => 'Increase this page speed and SEO ranking by optimizing images with Optimole.',
159 - 'message3' => 'Save your server space by storing images to Optimole and deliver them optimized from 400 locations around the globe. Unlimited images, Unlimited traffic.',
160 - 'message4' => 'This image looks to be too large and would affect your site speed, we recommend you to install Optimole to optimize your images.',
161 - 'message2' => 'Leverage Optimole\'s full integration with Elementor to automatically lazyload, resize, compress to AVIF/WebP and deliver from 400 locations around the globe!',
162 - ],
163 - 'redirectionCF7' => [
164 - 'gotodash' => 'Go to Contact Forms',
165 - 'dismisscta' => 'Dismiss this notice.',
166 - 'gst' => 'Get Started Free',
167 - 'message' => 'Add URL redirects, spam protection, execute JavaScript after submissions, and more with the Redirection for CF7 free plugin.',
168 - ],
169 - 'hyve' => [
170 - 'gotodash' => 'Go to Hyve Dashboard',
171 - 'install' => 'Install Hyve',
172 - 'dismisscta' => 'Dismiss this notice.',
173 - 'message' => 'Hyve is an AI-powered chatbot that turns your WordPress content into interactive conversations, helping you efficiently handle user inquiries.',
174 - ],
175 - 'wp_full_pay' => [
176 - 'gotodash' => 'Go to WP Full Pay Settings',
177 - 'install' => 'Install WP Full Pay',
178 - 'dismisscta' => 'Dismiss this notice.',
179 - 'message' => 'Enhance your donation page with WP Full Pay—create custom Stripe forms for one-time and recurring donations, manage transactions easily, and boost support with a seamless setup.',
180 - ],
181 - 'masteriyo' => [
182 - 'gotodash' => 'Go to Masteriyo Dashboard',
183 - 'install' => 'Install Masteriyo',
184 - 'dismisscta' => 'Dismiss this notice.',
185 - 'message' => 'Transform your site into a learning hub with Masteriyo LMS. Build engaging courses with intuitive tools, track student progress effortlessly, and grow your education business with powerful marketing features and seamless payment integration.',
186 - ],
187 - ],
188 - 'welcome' => [
189 - 'ctan' => 'No, thanks.',
190 - 'ctay' => 'Upgrade Now!',
191 - 'message' => '<p>You\'ve been using <b>{product}</b> for 7 days now and we appreciate your loyalty! We also want to make sure you\'re getting the most out of our product. That\'s why we\'re offering you a special deal - upgrade to <b>{pro_product}</b> in the next 5 days and receive a discount of <b>up to 30%</b>. <a href="{cta_link}" target="_blank">Upgrade now</a> and unlock all the amazing features of <b>{pro_product}</b>!</p>',
192 - ],
193 - 'uninstall' => [
194 - 'heading_plugin' => 'What\'s wrong?',
195 - 'heading_theme' => 'What does not work for you in {theme}?',
196 - 'submit' => 'Submit',
197 - 'cta_info' => 'What info do we collect?',
198 - 'button_submit' => 'Submit &amp; Deactivate',
199 - 'button_cancel' => 'Skip &amp; Deactivate',
200 - 'disclosure' => [
201 - 'title' => 'Below is a detailed view of all data that Themeisle will receive if you fill in this survey. No email address or IP addresses are transmitted after you submit the survey.',
202 - 'version' => '%s %s version %s %s %s %s',
203 - 'website' => '%sCurrent website:%s %s %s %s',
204 - 'usage' => '%sUsage time:%s %s %s%s',
205 - 'reason' => '%s Uninstall reason %s %s Selected reason from the above survey %s ',
206 - ],
207 -
208 - 'options' => [
209 - 'id3' => [
210 - 'title' => 'I found a better plugin',
211 - 'placeholder' => 'What\'s the plugin\'s name?',
212 - ],
213 - 'id4' => [
214 -
215 - 'title' => 'I could not get the plugin to work',
216 - 'placeholder' => 'What problem are you experiencing?',
217 - ],
218 - 'id5' => [
219 -
220 - 'title' => 'I no longer need the plugin',
221 - 'placeholder' => 'If you could improve one thing about our product, what would it be?',
222 - ],
223 - 'id6' => [
224 - 'title' => 'It\'s a temporary deactivation. I\'m just debugging an issue.',
225 - 'placeholder' => 'What problem are you experiencing?',
226 - ],
227 - 'id7' => [
228 - 'title' => 'I don\'t know how to make it look like demo',
229 - ],
230 - 'id8' => [
231 -
232 - 'placeholder' => 'What option is missing?',
233 - 'title' => 'It lacks options',
234 - ],
235 - 'id9' => [
236 - 'title' => 'Is not working with a plugin that I need',
237 - 'placeholder' => 'What is the name of the plugin',
238 - ],
239 - 'id10' => [
240 - 'title' => 'I want to try a new design, I don\'t like {theme} style',
241 - ],
242 - 'id999' => [
243 - 'title' => 'Other',
244 - 'placeholder' => 'What can we do better?',
245 - ],
246 - ],
247 - ],
248 - 'review' => [
249 - 'notice' => '<p>Hey, it\'s great to see you have <b>{product}</b> active for a few days now. How is everything going? If you can spare a few moments to rate it on WordPress.org it would help us a lot (and boost my motivation). Cheers! <br/> <br/>~ {developer}, developer of {product}</p>',
250 - 'ctay' => 'Ok, I will gladly help.',
251 - 'ctan' => 'No, thanks.',
252 -
253 - ],
254 - 'rollback' => [
255 - 'cta' => 'Rollback to v%s',
256 - ],
257 - 'logger' => [
258 - 'notice' => 'Help improve <b>{product}</b> by sharing anonymous usage data about your setup. No personal data collected.',
259 - 'cta_y' => 'Count me in',
260 - 'cta_n' => 'No thanks',
261 - ],
262 - 'about_us' => [
263 - 'title' => 'About Us',
264 - 'heroHeader' => 'Our Story',
265 - 'heroTextFirst' => 'Themeisle was founded in 2012 by a group of passionate developers who wanted to create beautiful and functional WordPress themes and plugins. Since then, we have grown into a team of over 20 dedicated professionals who are committed to delivering the best possible products to our customers.',
266 - 'heroTextSecond' => 'At Themeisle, we offer a wide range of WordPress themes and plugins that are designed to meet the needs of both beginners and advanced users. Our products are feature-rich, easy to use, and are designed to help you create beautiful and functional websites.',
267 - 'teamImageCaption' => 'Our team in WCEU2022 in Portugal',
268 - 'newsHeading' => 'Stay connected for news & updates!',
269 - 'emailPlaceholder' => 'Your email address',
270 - 'signMeUp' => 'Sign me up',
271 - 'installNow' => 'Install Now',
272 - 'activate' => 'Activate',
273 - 'learnMore' => 'Learn More',
274 - 'installed' => 'Installed',
275 - 'notInstalled' => 'Not Installed',
276 - 'active' => 'Active',
277 - 'others' => [
278 - 'optimole_desc' => 'Optimole is an image optimization service that automatically optimizes your images and serves them to your visitors via a global CDN, making your website lighter, faster and helping you reduce your bandwidth usage.',
279 - 'neve_desc' => 'A fast, lightweight, customizable WordPress theme offering responsive design, speed, and flexibility for various website types.',
280 - 'landingkit_desc' => 'Turn WordPress into a landing page powerhouse with Landing Kit, map domains to pages or any other published resource.',
281 - 'sparks_desc' => 'Extend your store functionality with 8 ultra-performant features like product comparisons, variation swatches, wishlist, and more.',
282 - 'tpc_desc' => 'Design, save, and revisit your templates anytime with your personal vault on Templates Cloud.',
283 - ],
284 - 'otter-page' => [
285 - 'heading' => 'Build innovative layouts with Otter Blocks and Gutenberg',
286 - 'text' => 'Otter is a lightweight, dynamic collection of page building blocks and templates for the WordPress block editor.',
287 - 'buttons' => [
288 - 'install_otter_free' => "Install Otter - It's free!",
289 - 'install_now' => 'Install Now',
290 - 'learn_more' => 'Learn More',
291 - ],
292 - 'features' => [
293 - 'advancedTitle' => 'Advanced Features',
294 - 'advancedDesc' => 'Add features such as Custom CSS, Animations & Visibility Conditions to all blocks.',
295 - 'fastTitle' => 'Lightweight and Fast',
296 - 'fastDesc' => 'Otter enhances WordPress site building experience without impacting site speed.',
297 - 'mobileTitle' => 'Mobile-Friendly',
298 - 'mobileDesc' => 'Each block can be tweaked to provide a consistent experience across all devices.',
299 - ],
300 - 'details' => [
301 - 's1Title' => 'A Better Page Building Experience',
302 - 's1Text' => 'Otter can be used to build everything from a personal blog to an e-commerce site without losing the personal touch. Otter’s ease of use transforms basic blocks into expressive layouts in seconds.',
303 - 's2Title' => 'A New Collection of Patterns',
304 - 's2Text' => 'A New Patterns Library, containing a range of different elements in a variety of styles to help you build great pages. All of your website’s most important areas are covered: headers, testimonials, pricing tables, sections and more.',
305 - 's3Title' => 'Advanced Blocks',
306 - 's3Text' => 'Enhance your website’s design with powerful blocks, like the Add to Cart, Business Hours, Review Comparison, and dozens of WooCommerce blocks.',
307 - ],
308 - 'testimonials' => [
309 - 'heading' => 'Trusted by more than 300K website owners',
310 - 'users' => [
311 - 'user_1' => 'Loved the collection of blocks. If you want to create nice Gutenberg Pages, this plugin will be very handy and useful.',
312 - 'user_2' => 'I am very satisfied with Otter – a fantastic collection of blocks. And the plugin is perfectly integrated with Gutenberg and complete enough for my needs.',
313 - 'user_3' => 'Otter Blocks work really well and I like the customization options. Easy to use and format to fit in with my site theme – and I’ve not encountered any compatibility or speed issues.',
314 - ],
315 - ],
316 - ],
317 - ],
318 - 'float_widget' => [
319 - 'button' => 'Toggle Help Widget for %s',
320 - 'panel' => [
321 - 'greeting' => 'Thank you for using %s',
322 - 'title' => 'How can we help you?',
323 - 'close' => 'Close Toggle Help Widget',
324 - ],
325 - 'links' => [
326 - 'documentation' => 'Documentation',
327 - 'support' => 'Get Support',
328 - 'wizard' => 'Run Setup Wizard',
329 - 'upgrade' => 'Upgrade to Pro',
330 - 'feature_request' => 'Suggest a Feature',
331 - 'rate' => 'Rate Us',
332 - ],
333 - ],
334 59 ];
335 60
336 61 /**
337 62 * Initialize the sdk logic.
@@ -336,9 +61,8 @@
336 61 /**
337 62 * Initialize the sdk logic.
338 63 */
339 64 public static function init() {
340 - self::localize_labels();
341 65 if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Loader ) ) {
342 66 self::$instance = new Loader();
343 67 $modules = array_merge( self::$available_modules, apply_filters( 'themeisle_sdk_modules', [] ) );
344 68 foreach ( $modules as $key => $module ) {
@@ -346,96 +70,12 @@
346 70 unset( $modules[ $key ] );
347 71 }
348 72 }
349 73 self::$available_modules = $modules;
350 -
351 - add_action( 'themeisle_sdk_first_activation', array( __CLASS__, 'activate' ) );
352 -
353 74 }
354 75 }
355 -
356 - /**
357 - * Localize the labels.
358 - */
359 - public static function localize_labels() {
360 - $originals = self::$labels;
361 - $all_translations = [];
362 76
363 - global $wp_filter;
364 - if ( isset( $wp_filter['themeisle_sdk_labels'] ) ) {
365 - foreach ( $wp_filter['themeisle_sdk_labels']->callbacks as $priority => $hooks ) {
366 - foreach ( $hooks as $hook ) {
367 - // Each callback gets fresh originals, not previous callback's output
368 - $result = call_user_func( $hook['function'], $originals );
369 - $all_translations[] = $result;
370 - }
371 - }
372 -
373 - // Remove the filter so it doesn't run again via apply_filters
374 - remove_all_filters( 'themeisle_sdk_labels' );
375 - }
376 -
377 - // Merge all results, first real translation wins
378 - self::$labels = self::merge_all_translations( $originals, $all_translations );
379 - }
380 77 /**
381 - * Merge all translations.
382 - *
383 - * @param array $originals The original labels.
384 - * @param array $all_translations The all translations.
385 - *
386 - * @return array The merged labels.
387 - */
388 - private static function merge_all_translations( $originals, $all_translations ) {
389 - $result = $originals;
390 -
391 - foreach ( $all_translations as $translations ) {
392 - $result = self::merge_if_translated( $result, $translations, $originals );
393 - }
394 -
395 - return $result;
396 - }
397 - /**
398 - * Merge if translated.
399 - *
400 - * @param array $current The current labels.
401 - * @param array $new The new labels.
402 - * @param array $originals The original labels.
403 - * @return array The merged labels.
404 - */
405 - private static function merge_if_translated( $current, $new, $originals ) {
406 - foreach ( $new as $key => $value ) {
407 - if ( ! isset( $originals[ $key ] ) ) {
408 - // New key, accept it
409 - if ( ! isset( $current[ $key ] ) ) {
410 - $current[ $key ] = $value;
411 - }
412 - continue;
413 - }
414 -
415 - if ( is_array( $value ) && is_array( $originals[ $key ] ) ) {
416 - $current[ $key ] = self::merge_if_translated(
417 - $current[ $key ],
418 - $value,
419 - $originals[ $key ]
420 - );
421 - } else {
422 - // Only accept if:
423 - // 1. New value is actually translated (differs from original)
424 - // 2. Current value is NOT already translated
425 - $is_new_translated = ( $value !== $originals[ $key ] );
426 - $is_current_untranslated = ( $current[ $key ] === $originals[ $key ] );
427 -
428 - if ( $is_new_translated && $is_current_untranslated ) {
429 - $current[ $key ] = $value;
430 - }
431 - }
432 - }
433 -
434 - return $current;
435 - }
436 -
437 - /**
438 78 * Get cache token used in API requests.
439 79 *
440 80 * @return string Cache token.
441 81 */
@@ -477,30 +117,8 @@
477 117 return self::$instance;
478 118 }
479 119
480 120 /**
481 - * Activate the product routine.
482 - *
483 - * @param string $file The base file of the product.
484 - *
485 - * @return void
486 - */
487 - public static function activate( $file ) {
488 -
489 - $dirname = trailingslashit( dirname( ( $file ) ) );
490 - if ( ! file_exists( $dirname . '_reference.php' ) ) {
491 - return;
492 - }
493 - $reference_data = require_once $dirname . '_reference.php';
494 - if ( ! is_array( $reference_data ) ||
495 - ! isset( $reference_data['key'] ) ||
496 - ! isset( $reference_data['value'] ) ||
497 - ! preg_match( '/^[a-zA-Z0-9_]+_reference_key$/', $reference_data['key'] ) ) {
498 - return;
499 - }
500 - add_option( $reference_data['key'], sanitize_key( $reference_data['value'] ) );
501 - }
502 - /**
503 121 * Get all registered modules by the SDK.
504 122 *
505 123 * @return array Modules available.
506 124 */
@@ -510,9 +128,9 @@
510 128
511 129 /**
512 130 * Get all products using the SDK.
513 131 *
514 - * @return array<Product> Products available.
132 + * @return array Products available.
515 133 */
516 134 public static function get_products() {
517 135 return self::$products;
518 136 }
@@ -524,5 +142,6 @@
524 142 */
525 143 public static function get_version() {
526 144 return self::$version;
527 145 }
146 +
528 147 }