Skip to content

Instantly share code, notes, and snippets.

@kagg-design
Created October 31, 2019 15:04
Show Gist options
  • Save kagg-design/7e0807d6e6308c338d12a8179f9c797b to your computer and use it in GitHub Desktop.
Save kagg-design/7e0807d6e6308c338d12a8179f9c797b to your computer and use it in GitHub Desktop.
Fix performance issue in Jupiter X with WPML and Polylang. Replace code of \CustomizerMultilingual::get_custom_customizer_option
<?php
protected function get_custom_customizer_option() {
static $theme_slug = null;
$current_language = self::get_language();
if ( ! $theme_slug ) {
$theme_slug = get_option( 'template' );
}
$option_prefix = str_replace( '-', '_', $theme_slug );
$option_name = $option_prefix . self::get_option_key() . $current_language;
$value = wp_cache_get( $option_name, 'CustomizerMultilingual', false, $found );
if ( $found ) {
return $value;
}
$value = get_option( $option_name, false );
wp_cache_set( $option_name, $value, 'CustomizerMultilingual' );
return $value;
}
@ScKoDEV
Copy link

ScKoDEV commented Nov 19, 2019

Hello kagg-design,
we are facing some issues with WPML on our wordpress site which utilizes the Jupiter X theme. Our back-end speed is horrible, but when I deactivate WPML Multilingual CMS everything is fine. Would your fix help with my issue as well? Sry, but I don't understand what your code exactly does. Kind regards.

@kagg-design
Copy link
Author

Hello,

This is a partial fix of the problem. Please open ticket in the WPML support forum, specify versions of JupiterX theme, jupiter-core and raven plugins. Ticket will be escalated to me, and I will send to you a fix.

@ScKoDEV
Copy link

ScKoDEV commented Nov 21, 2019

Perfect, thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment