PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.11.10
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.11.10
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 +17 -170 4.0.83.11.10 View file →
@@ -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 - 'crash_reporter',
50 49 'script_loader',
51 50 'dashboard_widget',
52 51 'rollback',
53 52 'uninstall_feedback',
@@ -64,9 +63,8 @@
64 63 'about_us',
65 64 'announcements',
66 65 'featured_plugins',
67 66 'float_widget',
68 - 'migrator',
69 67 ];
70 68 /**
71 69 * Holds the labels for the modules.
72 70 *
@@ -73,13 +71,12 @@
73 71 * @var array The labels for the modules.
74 72 */
75 73 public static $labels = [
76 74 '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',
75 + 'hurry_up' => 'Hurry up! Only %s left.',
76 + 'sale_live' => 'Themeisle Black Friday Sale is Live!',
77 + 'learn_more' => 'Learn more',
78 + 'max_savings' => 'Enjoy Maximum Savings on %s',
82 79 ],
83 80 'compatibilities' => [
84 81 'notice' => '%s requires a newer version of %s. Please %supdate%s %s %s to the latest version.',
85 82 'notice2' => '%s update requires a newer version of %s. Please %supdate%s %s %s.',
@@ -110,16 +107,12 @@
110 107 'autoactivate_notice' => '%s has been successfully activated using %s license !',
111 108 'valid' => 'Valid',
112 109 'invalid' => 'Invalid',
113 110 '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.',
111 + 'expired' => 'Your %s\'s License Key has expired. In order to continue receiving support and software updates you must %srenew%s your license key.',
117 112
118 113 '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 114 '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 115 ],
123 116 'promotions' => [
124 117 'recommended' => 'Recommended by %s',
125 118 'installActivate' => 'Install & Activate',
@@ -178,14 +171,8 @@
178 171 'install' => 'Install WP Full Pay',
179 172 'dismisscta' => 'Dismiss this notice.',
180 173 '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 174 ],
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 175 ],
189 176 'welcome' => [
190 177 'ctan' => 'No, thanks.',
191 178 'ctay' => 'Upgrade Now!',
@@ -198,14 +185,13 @@
198 185 'cta_info' => 'What info do we collect?',
199 186 'button_submit' => 'Submit & Deactivate',
200 187 'button_cancel' => 'Skip & Deactivate',
201 188 '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.',
189 + '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.',
190 + 'version' => '%s %s version %s %s %s %s',
191 + 'website' => '%sCurrent website:%s %s %s %s',
192 + 'usage' => '%sUsage time:%s %s %s%s',
193 + 'reason' => '%s Uninstall reason %s %s Selected reason from the above survey %s ',
208 194 ],
209 195
210 196 'options' => [
211 197 'id3' => [
@@ -256,11 +242,11 @@
256 242 'rollback' => [
257 243 'cta' => 'Rollback to v%s',
258 244 ],
259 245 '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',
246 + '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.',
247 + 'cta_y' => 'Sure, I would love to help.',
248 + 'cta_n' => 'No, thanks.',
263 249 ],
264 250 'about_us' => [
265 251 'title' => 'About Us',
266 252 'heroHeader' => 'Our Story',
@@ -269,44 +255,8 @@
269 255 'teamImageCaption' => 'Our team in WCEU2022 in Portugal',
270 256 'newsHeading' => 'Stay connected for news & updates!',
271 257 'emailPlaceholder' => 'Your email address',
272 258 '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 259 'installNow' => 'Install Now',
310 260 'activate' => 'Activate',
311 261 'learnMore' => 'Learn More',
312 262 'installed' => 'Installed',
@@ -374,9 +324,12 @@
374 324 /**
375 325 * Initialize the sdk logic.
376 326 */
377 327 public static function init() {
378 - self::localize_labels();
328 + /**
329 + * This filter can be used to localize the labels inside each product.
330 + */
331 + self::$labels = apply_filters( 'themeisle_sdk_labels', self::$labels );
379 332 if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Loader ) ) {
380 333 self::$instance = new Loader();
381 334 $modules = array_merge( self::$available_modules, apply_filters( 'themeisle_sdk_modules', [] ) );
382 335 foreach ( $modules as $key => $module ) {
@@ -384,96 +337,12 @@
384 337 unset( $modules[ $key ] );
385 338 }
386 339 }
387 340 self::$available_modules = $modules;
388 -
389 - add_action( 'themeisle_sdk_first_activation', array( __CLASS__, 'activate' ) );
390 -
391 341 }
392 342 }
393 -
394 - /**
395 - * Localize the labels.
396 - */
397 - public static function localize_labels() {
398 - $originals = self::$labels;
399 - $all_translations = [];
400 343
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 344 /**
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 345 * Get cache token used in API requests.
477 346 *
478 347 * @return string Cache token.
479 348 */
@@ -514,30 +383,8 @@
514 383
515 384 return self::$instance;
516 385 }
517 386
518 - /**
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 387 /**
541 388 * Get all registered modules by the SDK.
542 389 *
543 390 * @return array Modules available.