To complete fixing problems which WP_DEBUG set to true reports (deprecated function call), in includes/admin.php, line 164 should be changed to this:
unregister_setting( ‘jr_mt_settings’, ‘jr_mt_settings’ );
Also in includes/functions.php
lines 153-170 to:
if ( function_exists( 'mb_strlen' ) ) {
function jr_mt_strlen( $string ) {
return mb_strlen( $string ?? '' );
}
} else {
function jr_mt_strlen( $string ) {
return strlen( $string ?? '' );
}
}
if ( function_exists( 'mb_strtolower' ) ) {
function jr_mt_strtolower( $string ) {
return mb_strtolower( $string ?? '');
}
} else {
function jr_mt_strtolower( $string ) {
return strtolower( $string ?? '' );
}
}
Hi Lovro, Thank you very much for your code changes. This stopped the entries in the error log but unfortunately resulted in a crash of the frontend, but motivated me to look deeper into the code. I had to change some more to get it to work again. In includes/functions.php lines 177-180 of the original file, function jr_mt_current_theme() should be changed to:
function jr_mt_current_theme( $option ) {
global $jr_mt_options_cache;
return !empty( $jr_mt_options_cache[$option] ) ? $jr_mt_options_cache[$option] : '';
}
In includes/select-theme.php lines 43-44 of the original file, two calls to function add_filter() should be changed to:
add_filter( 'pre_option_stylesheet', 'jr_mt_stylesheet', 10, 3 );
add_filter( 'pre_option_template', 'jr_mt_template', 10, 3 );
In includes/select-theme.php lines 98-104 of the original file, functions jr_mt_stylesheet() and jr_mt_template() should be changed to:
function jr_mt_stylesheet( $pre_option, $option, $default_value ) {
$pre_stylesheet = jr_mt_theme( 'stylesheet' );
return !empty( $pre_stylesheet ) ? $pre_stylesheet : $default_value;
}
function jr_mt_template( $pre_option, $option, $default_value ) {
$pre_template = jr_mt_theme( 'template' );
return !empty( $pre_template ) ? $pre_template : $default_value;
}
This solved my problem. May be the site gets a bit slow, but it does work. For others with other configurations this still may not be enough to solve the problems.
I’ve testet it on the production server now and could not find any slow downs in loading times.
It is not necessarily about slowing loading, but about producing warning message. I didn’t test loading time. Anyway, thanks for your code changes.
to get this working without ANY error messages in the log, I had to do two more things in my environment:
1) in /includes/functions.php
extend the “add_action (‘init’, function() ) {
to also include the “if ( is_plugin_active_for_network($jr_mt_plugin_basename)“
2)
and (just before that is_plugin_active_for_network($jr_mt_plugin_basename)
I had to add the following line to make sure the variable is available:
if (!isset ($jr_mt_plugin_basename) ) {$jr_mt_plugin_basename = plugin_basename( JR_MT_FILE );}
this did it for me!
-
This reply was modified 10 months, 3 weeks ago by
sitsvienna.