-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve wp-cache config functions #487
base: master
Are you sure you want to change the base?
Conversation
Tests for function var_dump( wpsc_var_export( false ) );
var_dump( wpsc_var_export( true ) );
var_dump( wpsc_var_export( 0 ) );
var_dump( wpsc_var_export( '0' ) );
var_dump( wpsc_var_export( 'test' ) );
var_dump( wpsc_var_export( array( ) ) );
var_dump( wpsc_var_export( array( 'bot1', 'bot2' ) ) );
var_dump( wpsc_var_export( array( 0 => 'bot1', 1 => 'bot2' ) ) );
$obj = new stdclass();
$obj->test = 'test';
var_dump( wpsc_var_export( $obj ) ); Output:
I've also checked I'll avoid replace spaces when |
That looks great, but I'll leave this until the next release after this one as it's a critical part of the plugin. |
I agree. We need to carefully test everything. I'm still testing it.. |
@@ -1707,7 +1707,7 @@ function wp_cache_time_update() { | |||
} | |||
|
|||
function wp_cache_edit_max_time() { | |||
global $cache_max_time, $wp_cache_config_file, $valid_nonce, $super_cache_enabled, $cache_schedule_type, $cache_scheduled_time, $cache_schedule_interval, $cache_time_interval, $cache_gc_email_me, $wp_cache_preload_on; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$valid_nonce needs to be a global variable in the functions that update settings because the REST API in rest/class.wp-super-cache-rest-update-settings.php sets it to true so it can use these update functions.
If we want to verify the nonce in each update function the REST API update code has to be modified to generate a valid POST nonce too. Probably best to keep that for a different PR?
wp_cache_replace_line
andwp_cache_update_rejected_pages
wpsc_var_export