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 -422 4.0.73.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,10 +45,8 @@
45 45 *
46 46 * @var array The modules which SDK will be using.
47 47 */
48 48 private static $available_modules = [
49 - 'crash_reporter',
50 - 'script_loader',
51 49 'dashboard_widget',
52 50 'rollback',
53 51 'uninstall_feedback',
54 52 'licenser',
@@ -53,323 +51,12 @@
53 51 'uninstall_feedback',
54 52 'licenser',
55 53 'logger',
56 54 'translate',
57 - 'translations',
58 55 'review',
59 56 'recommendation',
60 57 'notification',
61 - 'promotions',
62 - 'welcome',
63 - 'compatibilities',
64 - 'about_us',
65 - 'announcements',
66 - 'featured_plugins',
67 - 'float_widget',
68 - 'migrator',
69 - ];
70 - /**
71 - * Holds the labels for the modules.
72 - *
73 - * @var array The labels for the modules.
74 - */
75 - public static $labels = [
76 - 'announcements' => [
77 - 'notice_link_label' => 'See the deals',
78 - 'max_savings' => 'Best WordPress Black Friday deals of %s — themes, plugins, hosting. Curated by the Themeisle team.',
79 - 'black_friday' => 'Black Friday Sale',
80 - 'time_left' => '%s left',
81 - 'plugin_meta_message' => 'Black Friday Sale - 60% OFF',
82 - ],
83 - 'compatibilities' => [
84 - 'notice' => '%s requires a newer version of %s. Please %supdate%s %s %s to the latest version.',
85 - 'notice2' => '%s update requires a newer version of %s. Please %supdate%s %s %s.',
86 - '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.',
87 - '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.',
88 - 'theme' => 'theme',
89 - 'plugin' => 'plugin',
90 - ],
91 - 'dashboard_widget' => [
92 - 'title' => 'WordPress Guides/Tutorials',
93 - 'popular' => 'Popular %s',
94 - 'install' => 'Install',
95 - 'powered' => 'Powered by %s',
96 - ],
97 - 'licenser' => [
98 - 'activate' => 'Activate',
99 - 'invalid_msg' => 'Invalid license.',
100 - 'error_notice' => 'ERROR: Failed to connect to the license service. Please try again later. Reason: %s',
101 - 'error_notice2' => 'ERROR: Failed to validate license. Please try again in one minute.',
102 - 'error_invalid' => 'ERROR: Invalid license provided.',
103 - 'update_license' => 'Updating this theme will lose any customizations you have made. Cancel to stop, OK to update.',
104 - 'invalid_msg' => 'Invalid license.',
105 - 'already_active' => 'License is already active.',
106 - 'notice_update' => '%1$s is available. %2$sCheck out what\'s%3$s new or %4$supdate now%3$s.',
107 - 'not_active' => 'License not active.',
108 - 'deactivate' => 'Deactivate',
109 - 'renew_cta' => 'Renew license to update',
110 - 'autoactivate_notice' => '%s has been successfully activated using %s license !',
111 - 'valid' => 'Valid',
112 - 'invalid' => 'Invalid',
113 - 'notice' => 'Enter your license from %s purchase history in order to get %s updates',
114 - 'expired' => '%s license expired',
115 - 'expired_date' => 'Expired on %s',
116 - 'expired_notice' => 'Your current setup continues working, but premium features are disabled and you\'re no longer receive updates - including critical patches - or support.',
117 58
118 - '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.',
119 - '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.',
120 - 'renew_license' => 'Renew License',
121 - 'learn_more' => 'Learn More',
122 - ],
123 - 'promotions' => [
124 - 'recommended' => 'Recommended by %s',
125 - 'installActivate' => 'Install & Activate',
126 - 'preview' => 'Preview',
127 - 'installing' => 'Installing',
128 - 'activating' => 'Activating',
129 - 'connecting' => 'Connecting to API',
130 - 'learnmore' => 'Learn More',
131 - 'activate' => 'Activate',
132 - 'all_set' => 'Awesome! You are all set!',
133 - 'woo' => [
134 - 'title' => 'More extensions from Themeisle',
135 - 'title2' => 'Recommended extensions',
136 - 'cta_install' => 'Install',
137 - 'learn_more' => 'Learn More',
138 - 'dismiss' => 'Dismiss this suggestion',
139 - 'ppom_title' => 'Product Add-Ons',
140 - 'ppom_desc' => 'Add extra custom fields & add-ons on your product pages, like sizes, colors & more.',
141 - 'spark_title1' => 'Wishlist',
142 - 'spark_title2' => 'Multi-Announcement Bars',
143 - 'spark_title3' => 'Advanced Product Review',
144 - 'spark_desc1' => 'Loyalize your customers by allowing them to save their favorite products.',
145 - 'spark_desc2' => 'Add a top notification bar on your website to highlight the latest products, offers, or upcoming events.',
146 - 'spark_desc3' => 'Enable an advanced review section, enlarging the basic review options with lots of capabilities.',
147 - ],
148 -
149 - 'feedzy' => [
150 - 'import_desc' => 'Schedule automatic content imports from any RSS feed directly to your site. %sBuilt by %s%s',
151 - 'install_now' => 'Install Now',
152 - 'by' => 'by %s',
153 - 'editor_recommends' => '%s recommends %sFeedzy%s to display entries from any RSS feed with more advanced styling and filtering options.',
154 - ],
155 - 'optimole' => [
156 - 'installOptimole' => 'Install Optimole',
157 - 'gotodash' => 'Go to Optimole dashboard',
158 - 'dismisscta' => 'Dismiss this notice.',
159 - 'message1' => 'Increase this page speed and SEO ranking by optimizing images with Optimole.',
160 - 'message3' => 'Save your server space by storing images to Optimole and deliver them optimized from 400 locations around the globe. Unlimited images, Unlimited traffic.',
161 - 'message4' => 'This image looks to be too large and would affect your site speed, we recommend you to install Optimole to optimize your images.',
162 - 'message2' => 'Leverage Optimole\'s full integration with Elementor to automatically lazyload, resize, compress to AVIF/WebP and deliver from 400 locations around the globe!',
163 - ],
164 - 'redirectionCF7' => [
165 - 'gotodash' => 'Go to Contact Forms',
166 - 'dismisscta' => 'Dismiss this notice.',
167 - 'gst' => 'Get Started Free',
168 - 'message' => 'Add URL redirects, spam protection, execute JavaScript after submissions, and more with the Redirection for CF7 free plugin.',
169 - ],
170 - 'hyve' => [
171 - 'gotodash' => 'Go to Hyve Dashboard',
172 - 'install' => 'Install Hyve',
173 - 'dismisscta' => 'Dismiss this notice.',
174 - 'message' => 'Hyve is an AI-powered chatbot that turns your WordPress content into interactive conversations, helping you efficiently handle user inquiries.',
175 - ],
176 - 'wp_full_pay' => [
177 - 'gotodash' => 'Go to WP Full Pay Settings',
178 - 'install' => 'Install WP Full Pay',
179 - 'dismisscta' => 'Dismiss this notice.',
180 - '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.',
181 - ],
182 - 'masteriyo' => [
183 - 'gotodash' => 'Go to Masteriyo Dashboard',
184 - 'install' => 'Install Masteriyo',
185 - 'dismisscta' => 'Dismiss this notice.',
186 - '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.',
187 - ],
188 - ],
189 - 'welcome' => [
190 - 'ctan' => 'No, thanks.',
191 - 'ctay' => 'Upgrade Now!',
192 - '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>',
193 - ],
194 - 'uninstall' => [
195 - 'heading_plugin' => 'What\'s wrong?',
196 - 'heading_theme' => 'What does not work for you in {theme}?',
197 - 'submit' => 'Submit',
198 - 'cta_info' => 'What info do we collect?',
199 - 'button_submit' => 'Submit &amp; Deactivate',
200 - 'button_cancel' => 'Skip &amp; Deactivate',
201 - 'disclosure' => [
202 - '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.',
203 - 'version' => '%s %s version %s %s %s %s',
204 - 'website' => '%sCurrent website:%s %s %s %s',
205 - 'usage' => '%sUsage time:%s %s %s%s',
206 - 'reason' => '%s Uninstall reason %s %s Selected reason from the above survey %s ',
207 - 'diagnostics' => '%sCrash diagnostics:%s Anonymized technical details of errors recorded for this product, if any.',
208 - ],
209 -
210 - 'options' => [
211 - 'id3' => [
212 - 'title' => 'I found a better plugin',
213 - 'placeholder' => 'What\'s the plugin\'s name?',
214 - ],
215 - 'id4' => [
216 -
217 - 'title' => 'I could not get the plugin to work',
218 - 'placeholder' => 'What problem are you experiencing?',
219 - ],
220 - 'id5' => [
221 -
222 - 'title' => 'I no longer need the plugin',
223 - 'placeholder' => 'If you could improve one thing about our product, what would it be?',
224 - ],
225 - 'id6' => [
226 - 'title' => 'It\'s a temporary deactivation. I\'m just debugging an issue.',
227 - 'placeholder' => 'What problem are you experiencing?',
228 - ],
229 - 'id7' => [
230 - 'title' => 'I don\'t know how to make it look like demo',
231 - ],
232 - 'id8' => [
233 -
234 - 'placeholder' => 'What option is missing?',
235 - 'title' => 'It lacks options',
236 - ],
237 - 'id9' => [
238 - 'title' => 'Is not working with a plugin that I need',
239 - 'placeholder' => 'What is the name of the plugin',
240 - ],
241 - 'id10' => [
242 - 'title' => 'I want to try a new design, I don\'t like {theme} style',
243 - ],
244 - 'id999' => [
245 - 'title' => 'Other',
246 - 'placeholder' => 'What can we do better?',
247 - ],
248 - ],
249 - ],
250 - 'review' => [
251 - '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>',
252 - 'ctay' => 'Ok, I will gladly help.',
253 - 'ctan' => 'No, thanks.',
254 -
255 - ],
256 - 'rollback' => [
257 - 'cta' => 'Rollback to v%s',
258 - ],
259 - 'logger' => [
260 - 'notice' => 'Help improve <b>{product}</b> by sharing anonymous usage data about your setup. No personal data collected.',
261 - 'cta_y' => 'Count me in',
262 - 'cta_n' => 'No thanks',
263 - ],
264 - 'about_us' => [
265 - 'title' => 'About Us',
266 - 'heroHeader' => 'Our Story',
267 - '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.',
268 - '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.',
269 - 'teamImageCaption' => 'Our team in WCEU2022 in Portugal',
270 - 'newsHeading' => 'Stay connected for news & updates!',
271 - 'emailPlaceholder' => 'Your email address',
272 - 'signMeUp' => 'Sign me up',
273 - 'services' => [
274 - 'ariaLabel' => 'Themeisle services',
275 - 'trustpilotLabel' => 'Rated excellent on Trustpilot',
276 - 'trustpilotRated' => 'Rated',
277 - 'trustpilotOn' => 'on',
278 - 'trustpilotBrand' => 'Trustpilot',
279 - 'heading' => 'Expert WordPress services from the Themeisle team',
280 - 'description' => 'Done for you by the same people who build your plugins and themes.',
281 - 'cta' => 'Explore all services',
282 - 'items' => [
283 - 'websiteDesign' => [
284 - 'title' => 'Website Design',
285 - 'subtitle' => 'Built for your business',
286 - ],
287 - 'support' => [
288 - 'title' => 'Support',
289 - 'subtitle' => 'On-demand expert help',
290 - ],
291 - 'speed' => [
292 - 'title' => 'Speed Optimization',
293 - 'subtitle' => 'Core Web Vitals boost',
294 - ],
295 - 'seo' => [
296 - 'title' => 'SEO Foundation',
297 - 'subtitle' => 'Rank & get found',
298 - ],
299 - 'maintenance' => [
300 - 'title' => 'Maintenance',
301 - 'subtitle' => 'Updates, backups, security',
302 - ],
303 - 'hackedSite' => [
304 - 'title' => 'Hacked Site Repair',
305 - 'subtitle' => 'Malware removed fast',
306 - ],
307 - ],
308 - ],
309 - 'installNow' => 'Install Now',
310 - 'activate' => 'Activate',
311 - 'learnMore' => 'Learn More',
312 - 'installed' => 'Installed',
313 - 'notInstalled' => 'Not Installed',
314 - 'active' => 'Active',
315 - 'others' => [
316 - '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.',
317 - 'neve_desc' => 'A fast, lightweight, customizable WordPress theme offering responsive design, speed, and flexibility for various website types.',
318 - 'landingkit_desc' => 'Turn WordPress into a landing page powerhouse with Landing Kit, map domains to pages or any other published resource.',
319 - 'sparks_desc' => 'Extend your store functionality with 8 ultra-performant features like product comparisons, variation swatches, wishlist, and more.',
320 - 'tpc_desc' => 'Design, save, and revisit your templates anytime with your personal vault on Templates Cloud.',
321 - ],
322 - 'otter-page' => [
323 - 'heading' => 'Build innovative layouts with Otter Blocks and Gutenberg',
324 - 'text' => 'Otter is a lightweight, dynamic collection of page building blocks and templates for the WordPress block editor.',
325 - 'buttons' => [
326 - 'install_otter_free' => "Install Otter - It's free!",
327 - 'install_now' => 'Install Now',
328 - 'learn_more' => 'Learn More',
329 - ],
330 - 'features' => [
331 - 'advancedTitle' => 'Advanced Features',
332 - 'advancedDesc' => 'Add features such as Custom CSS, Animations & Visibility Conditions to all blocks.',
333 - 'fastTitle' => 'Lightweight and Fast',
334 - 'fastDesc' => 'Otter enhances WordPress site building experience without impacting site speed.',
335 - 'mobileTitle' => 'Mobile-Friendly',
336 - 'mobileDesc' => 'Each block can be tweaked to provide a consistent experience across all devices.',
337 - ],
338 - 'details' => [
339 - 's1Title' => 'A Better Page Building Experience',
340 - '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.',
341 - 's2Title' => 'A New Collection of Patterns',
342 - '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.',
343 - 's3Title' => 'Advanced Blocks',
344 - 's3Text' => 'Enhance your website’s design with powerful blocks, like the Add to Cart, Business Hours, Review Comparison, and dozens of WooCommerce blocks.',
345 - ],
346 - 'testimonials' => [
347 - 'heading' => 'Trusted by more than 300K website owners',
348 - 'users' => [
349 - 'user_1' => 'Loved the collection of blocks. If you want to create nice Gutenberg Pages, this plugin will be very handy and useful.',
350 - '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.',
351 - '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.',
352 - ],
353 - ],
354 - ],
355 - ],
356 - 'float_widget' => [
357 - 'button' => 'Toggle Help Widget for %s',
358 - 'panel' => [
359 - 'greeting' => 'Thank you for using %s',
360 - 'title' => 'How can we help you?',
361 - 'close' => 'Close Toggle Help Widget',
362 - ],
363 - 'links' => [
364 - 'documentation' => 'Documentation',
365 - 'support' => 'Get Support',
366 - 'wizard' => 'Run Setup Wizard',
367 - 'upgrade' => 'Upgrade to Pro',
368 - 'feature_request' => 'Suggest a Feature',
369 - 'rate' => 'Rate Us',
370 - ],
371 - ],
372 59 ];
373 60
374 61 /**
375 62 * Initialize the sdk logic.
@@ -374,9 +61,8 @@
374 61 /**
375 62 * Initialize the sdk logic.
376 63 */
377 64 public static function init() {
378 - self::localize_labels();
379 65 if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Loader ) ) {
380 66 self::$instance = new Loader();
381 67 $modules = array_merge( self::$available_modules, apply_filters( 'themeisle_sdk_modules', [] ) );
382 68 foreach ( $modules as $key => $module ) {
@@ -384,96 +70,12 @@
384 70 unset( $modules[ $key ] );
385 71 }
386 72 }
387 73 self::$available_modules = $modules;
388 -
389 - add_action( 'themeisle_sdk_first_activation', array( __CLASS__, 'activate' ) );
390 -
391 74 }
392 75 }
393 -
394 - /**
395 - * Localize the labels.
396 - */
397 - public static function localize_labels() {
398 - $originals = self::$labels;
399 - $all_translations = [];
400 76
401 - global $wp_filter;
402 - if ( isset( $wp_filter['themeisle_sdk_labels'] ) ) {
403 - foreach ( $wp_filter['themeisle_sdk_labels']->callbacks as $priority => $hooks ) {
404 - foreach ( $hooks as $hook ) {
405 - // Each callback gets fresh originals, not previous callback's output
406 - $result = call_user_func( $hook['function'], $originals );
407 - $all_translations[] = $result;
408 - }
409 - }
410 -
411 - // Remove the filter so it doesn't run again via apply_filters
412 - remove_all_filters( 'themeisle_sdk_labels' );
413 - }
414 -
415 - // Merge all results, first real translation wins
416 - self::$labels = self::merge_all_translations( $originals, $all_translations );
417 - }
418 77 /**
419 - * Merge all translations.
420 - *
421 - * @param array $originals The original labels.
422 - * @param array $all_translations The all translations.
423 - *
424 - * @return array The merged labels.
425 - */
426 - private static function merge_all_translations( $originals, $all_translations ) {
427 - $result = $originals;
428 -
429 - foreach ( $all_translations as $translations ) {
430 - $result = self::merge_if_translated( $result, $translations, $originals );
431 - }
432 -
433 - return $result;
434 - }
435 - /**
436 - * Merge if translated.
437 - *
438 - * @param array $current The current labels.
439 - * @param array $new The new labels.
440 - * @param array $originals The original labels.
441 - * @return array The merged labels.
442 - */
443 - private static function merge_if_translated( $current, $new, $originals ) {
444 - foreach ( $new as $key => $value ) {
445 - if ( ! isset( $originals[ $key ] ) ) {
446 - // New key, accept it
447 - if ( ! isset( $current[ $key ] ) ) {
448 - $current[ $key ] = $value;
449 - }
450 - continue;
451 - }
452 -
453 - if ( is_array( $value ) && is_array( $originals[ $key ] ) ) {
454 - $current[ $key ] = self::merge_if_translated(
455 - $current[ $key ],
456 - $value,
457 - $originals[ $key ]
458 - );
459 - } else {
460 - // Only accept if:
461 - // 1. New value is actually translated (differs from original)
462 - // 2. Current value is NOT already translated
463 - $is_new_translated = ( $value !== $originals[ $key ] );
464 - $is_current_untranslated = ( $current[ $key ] === $originals[ $key ] );
465 -
466 - if ( $is_new_translated && $is_current_untranslated ) {
467 - $current[ $key ] = $value;
468 - }
469 - }
470 - }
471 -
472 - return $current;
473 - }
474 -
475 - /**
476 78 * Get cache token used in API requests.
477 79 *
478 80 * @return string Cache token.
479 81 */
@@ -515,30 +117,8 @@
515 117 return self::$instance;
516 118 }
517 119
518 120 /**
519 - * Activate the product routine.
520 - *
521 - * @param string $file The base file of the product.
522 - *
523 - * @return void
524 - */
525 - public static function activate( $file ) {
526 -
527 - $dirname = trailingslashit( dirname( ( $file ) ) );
528 - if ( ! file_exists( $dirname . '_reference.php' ) ) {
529 - return;
530 - }
531 - $reference_data = require_once $dirname . '_reference.php';
532 - if ( ! is_array( $reference_data ) ||
533 - ! isset( $reference_data['key'] ) ||
534 - ! isset( $reference_data['value'] ) ||
535 - ! preg_match( '/^[a-zA-Z0-9_]+_reference_key$/', $reference_data['key'] ) ) {
536 - return;
537 - }
538 - add_option( $reference_data['key'], sanitize_key( $reference_data['value'] ) );
539 - }
540 - /**
541 121 * Get all registered modules by the SDK.
542 122 *
543 123 * @return array Modules available.
544 124 */
@@ -548,9 +128,9 @@
548 128
549 129 /**
550 130 * Get all products using the SDK.
551 131 *
552 - * @return array<Product> Products available.
132 + * @return array Products available.
553 133 */
554 134 public static function get_products() {
555 135 return self::$products;
556 136 }
@@ -562,5 +142,6 @@
562 142 */
563 143 public static function get_version() {
564 144 return self::$version;
565 145 }
146 +
566 147 }