PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 4.0.9
Visualizer – Tables & Charts Manager with Built-in AI Generator v4.0.9
4.0.9 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 All 150 releases
← All changes | vendor/codeinwp/themeisle-sdk/src/Loader.php +278 -37 3.10.13 → 4.0.9 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 The products which use the SDK.
40 + * @var array<Product> The products which use the SDK.
41 41 */
42 42 private static $products = [];
43 43 /**
44 44 * Holds available modules to load.
@@ -45,8 +45,9 @@
45 45 *
46 46 * @var array The modules which SDK will be using.
47 47 */
48 48 private static $available_modules = [
49 + 'crash_reporter',
49 50 'script_loader',
50 51 'dashboard_widget',
51 52 'rollback',
52 53 'uninstall_feedback',
@@ -52,8 +53,9 @@
52 53 'uninstall_feedback',
53 54 'licenser',
54 55 'logger',
55 56 'translate',
57 + 'translations',
56 58 'review',
57 59 'recommendation',
58 60 'notification',
59 61 'promotions',
@@ -61,8 +63,11 @@
61 63 'compatibilities',
62 64 'about_us',
63 65 'announcements',
64 66 'featured_plugins',
67 + 'float_widget',
68 + 'migrator',
69 + 'ai_connect',
65 70 ];
66 71 /**
67 72 * Holds the labels for the modules.
68 73 *
@@ -69,12 +74,13 @@
69 74 * @var array The labels for the modules.
70 75 */
71 76 public static $labels = [
72 77 'announcements' => [
73 - 'hurry_up' => 'Hurry up! Only %s left.',
74 - 'sale_live' => 'Themeisle Black Friday Sale is Live!',
75 - 'learn_more' => 'Learn more',
76 - 'max_savings' => 'Enjoy Maximum Savings on %s',
78 + 'notice_link_label' => 'See the deals',
79 + 'max_savings' => 'Best WordPress Black Friday deals of %s — themes, plugins, hosting. Curated by the Themeisle team.',
80 + 'black_friday' => 'Black Friday Sale',
81 + 'time_left' => '%s left',
82 + 'plugin_meta_message' => 'Black Friday Sale - 60% OFF',
77 83 ],
78 84 'compatibilities' => [
79 85 'notice' => '%s requires a newer version of %s. Please %supdate%s %s %s to the latest version.',
80 86 'notice2' => '%s update requires a newer version of %s. Please %supdate%s %s %s.',
@@ -105,16 +111,28 @@
105 111 'autoactivate_notice' => '%s has been successfully activated using %s license !',
106 112 'valid' => 'Valid',
107 113 'invalid' => 'Invalid',
108 114 'notice' => 'Enter your license from %s purchase history in order to get %s updates',
109 - 'expired' => 'Your %s\'s License Key has expired. In order to continue receiving support and software updates you must %srenew%s your license key.',
115 + 'expired' => '%s license expired',
116 + 'expired_date' => 'Expired on %s',
117 + 'expired_notice' => 'Your current setup continues working, but premium features are disabled and you\'re no longer receive updates - including critical patches - or support.',
110 118
111 119 '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.',
112 120 '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.',
121 + 'renew_license' => 'Renew License',
122 + 'learn_more' => 'Learn More',
113 123 ],
114 124 'promotions' => [
115 - 'recommended' => 'Recommended by %s',
116 - 'woo' => [
125 + 'recommended' => 'Recommended by %s',
126 + 'installActivate' => 'Install & Activate',
127 + 'preview' => 'Preview',
128 + 'installing' => 'Installing',
129 + 'activating' => 'Activating',
130 + 'connecting' => 'Connecting to API',
131 + 'learnmore' => 'Learn More',
132 + 'activate' => 'Activate',
133 + 'all_set' => 'Awesome! You are all set!',
134 + 'woo' => [
117 135 'title' => 'More extensions from Themeisle',
118 136 'title2' => 'Recommended extensions',
119 137 'cta_install' => 'Install',
120 138 'learn_more' => 'Learn More',
@@ -127,25 +145,54 @@
127 145 'spark_desc1' => 'Loyalize your customers by allowing them to save their favorite products.',
128 146 'spark_desc2' => 'Add a top notification bar on your website to highlight the latest products, offers, or upcoming events.',
129 147 'spark_desc3' => 'Enable an advanced review section, enlarging the basic review options with lots of capabilities.',
130 148 ],
131 - 'optimole' => [
132 - 'all_set' => 'Awesome! You are all set!',
133 - 'gotodash' => 'Go to Optimole dashboard',
134 - 'installing' => 'Installing',
135 - 'activating' => 'Activating',
136 - 'connecting' => 'Connecting to API',
137 - 'start_cta' => 'Start using Optimole',
138 - 'dismisscta' => 'Dismiss this notice.',
139 - 'gst' => 'Get Started Free',
140 - 'heading' => 'Get more with Optimole',
141 - 'learnmore' => 'Learn more',
142 - 'message1' => 'Increase this page speed and SEO ranking by optimizing images with Optimole.',
143 - 'message3' => 'Save your server space by storing images to Optimole and deliver them optimized from 400 locations around the globe. Unlimited images, Unlimited traffic.',
144 - 'message4' => 'This image looks to be too large and would affect your site speed, we recommend you to install Optimole to optimize your images.',
145 - 'message2' => 'Leverage Optimole\'s full integration with Elementor to automatically lazyload, resize, compress to AVIF/WebP and deliver from 400 locations around the globe!',
146 - 'email_placeholder' => 'Email address',
149 +
150 + 'feedzy' => [
151 + 'import_desc' => 'Schedule automatic content imports from any RSS feed directly to your site. %sBuilt by %s%s',
152 + 'install_now' => 'Install Now',
153 + 'by' => 'by %s',
154 + 'editor_recommends' => '%s recommends %sFeedzy%s to display entries from any RSS feed with more advanced styling and filtering options.',
147 155 ],
156 + 'optimole' => [
157 + 'installOptimole' => 'Install Optimole',
158 + 'gotodash' => 'Go to Optimole dashboard',
159 + 'dismisscta' => 'Dismiss this notice.',
160 + 'message1' => 'Increase this page speed and SEO ranking by optimizing images with Optimole.',
161 + 'message3' => 'Save your server space by storing images to Optimole and deliver them optimized from 400 locations around the globe. Unlimited images, Unlimited traffic.',
162 + 'message4' => 'This image looks to be too large and would affect your site speed, we recommend you to install Optimole to optimize your images.',
163 + 'message2' => 'Leverage Optimole\'s full integration with Elementor to automatically lazyload, resize, compress to AVIF/WebP and deliver from 400 locations around the globe!',
164 + ],
165 + 'redirectionCF7' => [
166 + 'gotodash' => 'Go to Contact Forms',
167 + 'dismisscta' => 'Dismiss this notice.',
168 + 'gst' => 'Get Started Free',
169 + 'message' => 'Add URL redirects, spam protection, execute JavaScript after submissions, and more with the Redirection for CF7 free plugin.',
170 + ],
171 + 'hyve' => [
172 + 'gotodash' => 'Go to Hyve Dashboard',
173 + 'install' => 'Install Hyve',
174 + 'dismisscta' => 'Dismiss this notice.',
175 + 'message' => 'Hyve is an AI-powered chatbot that turns your WordPress content into interactive conversations, helping you efficiently handle user inquiries.',
176 + ],
177 + 'wp_full_pay' => [
178 + 'gotodash' => 'Go to WP Full Pay Settings',
179 + 'install' => 'Install WP Full Pay',
180 + 'dismisscta' => 'Dismiss this notice.',
181 + '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.',
182 + ],
183 + 'masteriyo' => [
184 + 'gotodash' => 'Go to Masteriyo Dashboard',
185 + 'install' => 'Install Masteriyo',
186 + 'dismisscta' => 'Dismiss this notice.',
187 + '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.',
188 + ],
189 + 'easy_mcp' => [
190 + 'gotodash' => 'Go to Easy MCP Dashboard',
191 + 'install' => 'Install Easy MCP AI',
192 + 'dismisscta' => 'Dismiss this notice.',
193 + 'message' => 'Connect Claude, ChatGPT, and other AI assistants to this site with Easy MCP AI — a free MCP server that lets your AI manage content, media, and SEO data, with per-scope permissions and a full audit trail.',
194 + ],
148 195 ],
149 196 'welcome' => [
150 197 'ctan' => 'No, thanks.',
151 198 'ctay' => 'Upgrade Now!',
@@ -158,13 +205,14 @@
158 205 'cta_info' => 'What info do we collect?',
159 206 'button_submit' => 'Submit &amp; Deactivate',
160 207 'button_cancel' => 'Skip &amp; Deactivate',
161 208 'disclosure' => [
162 - '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.',
163 - 'version' => '%s %s version %s %s %s %s',
164 - 'website' => '%sCurrent website:%s %s %s %s',
165 - 'usage' => '%sUsage time:%s %s %s%s',
166 - 'reason' => '%s Uninstall reason %s %s Selected reason from the above survey %s ',
209 + '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.',
210 + 'version' => '%s %s version %s %s %s %s',
211 + 'website' => '%sCurrent website:%s %s %s %s',
212 + 'usage' => '%sUsage time:%s %s %s%s',
213 + 'reason' => '%s Uninstall reason %s %s Selected reason from the above survey %s ',
214 + 'diagnostics' => '%sCrash diagnostics:%s Anonymized technical details of errors recorded for this product, if any.',
167 215 ],
168 216
169 217 'options' => [
170 218 'id3' => [
@@ -215,11 +263,11 @@
215 263 'rollback' => [
216 264 'cta' => 'Rollback to v%s',
217 265 ],
218 266 'logger' => [
219 - 'notice' => 'Do you enjoy <b>{product}</b>? Become a contributor by opting in to our anonymous data tracking. We guarantee no sensitive data is collected.',
220 - 'cta_y' => 'Sure, I would love to help.',
221 - 'cta_n' => 'No, thanks.',
267 + 'notice' => 'Help improve <b>{product}</b> by sharing anonymous usage data about your setup. No personal data collected.',
268 + 'cta_y' => 'Count me in',
269 + 'cta_n' => 'No thanks',
222 270 ],
223 271 'about_us' => [
224 272 'title' => 'About Us',
225 273 'heroHeader' => 'Our Story',
@@ -228,8 +276,44 @@
228 276 'teamImageCaption' => 'Our team in WCEU2022 in Portugal',
229 277 'newsHeading' => 'Stay connected for news & updates!',
230 278 'emailPlaceholder' => 'Your email address',
231 279 'signMeUp' => 'Sign me up',
280 + 'services' => [
281 + 'ariaLabel' => 'Themeisle services',
282 + 'trustpilotLabel' => 'Rated excellent on Trustpilot',
283 + 'trustpilotRated' => 'Rated',
284 + 'trustpilotOn' => 'on',
285 + 'trustpilotBrand' => 'Trustpilot',
286 + 'heading' => 'Expert WordPress services from the Themeisle team',
287 + 'description' => 'Done for you by the same people who build your plugins and themes.',
288 + 'cta' => 'Explore all services',
289 + 'items' => [
290 + 'websiteDesign' => [
291 + 'title' => 'Website Design',
292 + 'subtitle' => 'Built for your business',
293 + ],
294 + 'support' => [
295 + 'title' => 'Support',
296 + 'subtitle' => 'On-demand expert help',
297 + ],
298 + 'speed' => [
299 + 'title' => 'Speed Optimization',
300 + 'subtitle' => 'Core Web Vitals boost',
301 + ],
302 + 'seo' => [
303 + 'title' => 'SEO Foundation',
304 + 'subtitle' => 'Rank & get found',
305 + ],
306 + 'maintenance' => [
307 + 'title' => 'Maintenance',
308 + 'subtitle' => 'Updates, backups, security',
309 + ],
310 + 'hackedSite' => [
311 + 'title' => 'Hacked Site Repair',
312 + 'subtitle' => 'Malware removed fast',
313 + ],
314 + ],
315 + ],
232 316 'installNow' => 'Install Now',
233 317 'activate' => 'Activate',
234 318 'learnMore' => 'Learn More',
235 319 'installed' => 'Installed',
@@ -275,8 +359,62 @@
275 359 ],
276 360 ],
277 361 ],
278 362 ],
363 + 'ai_connect' => [
364 + 'row_link' => 'Connect with your AI agent',
365 + // translators: %s is the product name.
366 + 'notice_title' => 'Manage %s with your AI agent.',
367 + // translators: %s is a list of things the agent can do, e.g. "optimize new uploads, purge cached images or offload originals".
368 + 'notice_text' => 'Ask Claude, ChatGPT or Cursor to %s.',
369 + // translators: 1: comma-separated use cases, 2: the last use case.
370 + 'cases_join' => '%1$s or %2$s',
371 + 'notice_button' => 'Connect your AI agent',
372 + 'eyebrow' => 'Works with Claude, ChatGPT, Cursor and any MCP agent',
373 + // translators: %s is the product name.
374 + 'title' => 'Use %s from your AI agent',
375 + // translators: %s is the product name.
376 + 'lead' => 'Activate your site’s MCP URL, connect the agent you already use, and %s becomes something you can simply ask for.',
377 + 'enable' => 'Install and activate Easy MCP',
378 + 'enable_installed' => 'Activate Easy MCP',
379 + 'enabling' => 'Installing…',
380 + 'activating' => 'Activating…',
381 + 'enabled' => 'Easy MCP is active',
382 + // translators: %s is the product name.
383 + 'enable_note' => 'Easy MCP is free, by the %s team. It enables your site’s MCP URL.',
384 + 'url_label' => 'Your site’s MCP URL',
385 + 'copy' => 'Copy',
386 + 'copied' => 'Copied',
387 + 'close' => 'Close',
388 + 'connect_heading' => 'Connect your agent',
389 + 'connect_claude' => 'Connect to Claude',
390 + 'connect_chatgpt' => 'Connect to ChatGPT',
391 + 'connect_cursor' => 'Add to Cursor',
392 + 'hint_off' => 'Your agents can connect once Easy MCP is active.',
393 + 'hint_on' => 'Each button opens your agent with this site pre-filled. ChatGPT asks you to paste the URL above.',
394 + 'more_agents' => 'Using another agent?',
395 + 'more_agents_link' => 'See how to connect it.',
396 + 'prompts_off' => 'Once Easy MCP is active, you can ask your AI agent things like',
397 + 'prompts_on' => 'Try asking',
398 + 'error_permission' => 'You are not allowed to do this.',
399 + 'error_install' => 'Easy MCP could not be activated. Please try again.',
400 + ],
401 + 'float_widget' => [
402 + 'button' => 'Toggle Help Widget for %s',
403 + 'panel' => [
404 + 'greeting' => 'Thank you for using %s',
405 + 'title' => 'How can we help you?',
406 + 'close' => 'Close Toggle Help Widget',
407 + ],
408 + 'links' => [
409 + 'documentation' => 'Documentation',
410 + 'support' => 'Get Support',
411 + 'wizard' => 'Run Setup Wizard',
412 + 'upgrade' => 'Upgrade to Pro',
413 + 'feature_request' => 'Suggest a Feature',
414 + 'rate' => 'Rate Us',
415 + ],
416 + ],
279 417 ];
280 418
281 419 /**
282 420 * Initialize the sdk logic.
@@ -281,12 +419,9 @@
281 419 /**
282 420 * Initialize the sdk logic.
283 421 */
284 422 public static function init() {
285 - /**
286 - * This filter can be used to localize the labels inside each product.
287 - */
288 - self::$labels = apply_filters( 'themeisle_sdk_labels', self::$labels );
423 + self::localize_labels();
289 424 if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Loader ) ) {
290 425 self::$instance = new Loader();
291 426 $modules = array_merge( self::$available_modules, apply_filters( 'themeisle_sdk_modules', [] ) );
292 427 foreach ( $modules as $key => $module ) {
@@ -294,12 +429,96 @@
294 429 unset( $modules[ $key ] );
295 430 }
296 431 }
297 432 self::$available_modules = $modules;
433 +
434 + add_action( 'themeisle_sdk_first_activation', array( __CLASS__, 'activate' ) );
435 +
298 436 }
299 437 }
438 +
439 + /**
440 + * Localize the labels.
441 + */
442 + public static function localize_labels() {
443 + $originals = self::$labels;
444 + $all_translations = [];
300 445
446 + global $wp_filter;
447 + if ( isset( $wp_filter['themeisle_sdk_labels'] ) ) {
448 + foreach ( $wp_filter['themeisle_sdk_labels']->callbacks as $priority => $hooks ) {
449 + foreach ( $hooks as $hook ) {
450 + // Each callback gets fresh originals, not previous callback's output
451 + $result = call_user_func( $hook['function'], $originals );
452 + $all_translations[] = $result;
453 + }
454 + }
455 +
456 + // Remove the filter so it doesn't run again via apply_filters
457 + remove_all_filters( 'themeisle_sdk_labels' );
458 + }
459 +
460 + // Merge all results, first real translation wins
461 + self::$labels = self::merge_all_translations( $originals, $all_translations );
462 + }
301 463 /**
464 + * Merge all translations.
465 + *
466 + * @param array $originals The original labels.
467 + * @param array $all_translations The all translations.
468 + *
469 + * @return array The merged labels.
470 + */
471 + private static function merge_all_translations( $originals, $all_translations ) {
472 + $result = $originals;
473 +
474 + foreach ( $all_translations as $translations ) {
475 + $result = self::merge_if_translated( $result, $translations, $originals );
476 + }
477 +
478 + return $result;
479 + }
480 + /**
481 + * Merge if translated.
482 + *
483 + * @param array $current The current labels.
484 + * @param array $new The new labels.
485 + * @param array $originals The original labels.
486 + * @return array The merged labels.
487 + */
488 + private static function merge_if_translated( $current, $new, $originals ) {
489 + foreach ( $new as $key => $value ) {
490 + if ( ! isset( $originals[ $key ] ) ) {
491 + // New key, accept it
492 + if ( ! isset( $current[ $key ] ) ) {
493 + $current[ $key ] = $value;
494 + }
495 + continue;
496 + }
497 +
498 + if ( is_array( $value ) && is_array( $originals[ $key ] ) ) {
499 + $current[ $key ] = self::merge_if_translated(
500 + $current[ $key ],
501 + $value,
502 + $originals[ $key ]
503 + );
504 + } else {
505 + // Only accept if:
506 + // 1. New value is actually translated (differs from original)
507 + // 2. Current value is NOT already translated
508 + $is_new_translated = ( $value !== $originals[ $key ] );
509 + $is_current_untranslated = ( $current[ $key ] === $originals[ $key ] );
510 +
511 + if ( $is_new_translated && $is_current_untranslated ) {
512 + $current[ $key ] = $value;
513 + }
514 + }
515 + }
516 +
517 + return $current;
518 + }
519 +
520 + /**
302 521 * Get cache token used in API requests.
303 522 *
304 523 * @return string Cache token.
305 524 */
@@ -341,8 +560,30 @@
341 560 return self::$instance;
342 561 }
343 562
344 563 /**
564 + * Activate the product routine.
565 + *
566 + * @param string $file The base file of the product.
567 + *
568 + * @return void
569 + */
570 + public static function activate( $file ) {
571 +
572 + $dirname = trailingslashit( dirname( ( $file ) ) );
573 + if ( ! file_exists( $dirname . '_reference.php' ) ) {
574 + return;
575 + }
576 + $reference_data = require_once $dirname . '_reference.php';
577 + if ( ! is_array( $reference_data ) ||
578 + ! isset( $reference_data['key'] ) ||
579 + ! isset( $reference_data['value'] ) ||
580 + ! preg_match( '/^[a-zA-Z0-9_]+_reference_key$/', $reference_data['key'] ) ) {
581 + return;
582 + }
583 + add_option( $reference_data['key'], sanitize_key( $reference_data['value'] ) );
584 + }
585 + /**
345 586 * Get all registered modules by the SDK.
346 587 *
347 588 * @return array Modules available.
348 589 */
@@ -352,9 +593,9 @@
352 593
353 594 /**
354 595 * Get all products using the SDK.
355 596 *
356 - * @return array Products available.
597 + * @return array<Product> Products available.
357 598 */
358 599 public static function get_products() {
359 600 return self::$products;
360 601 }