Settings lost upon deactivation
-
When temporarily deactivating wppp all settings are lost. Specifically I care for the dynamic_images module. Skimming through the code makes apparent the issue is in a lack of differentiation between deactivation vs uninstall, which are 2 separate hooks. The fix that currently worked for me:
wp-performance-pack.php
~line 459 add:register_deactivation_hook( __FILE__, array( $wp_performance_pack, 'deactivate' ) ); register_uninstall_hook( __FILE__, 'uninstall' ); // added
wp-performance-pack.php
~line 364 comment out the block of code below indeactivate()
:public function deactivate() { if ( $this->options['dynamic_images'] ) { // Delete rewrite rules from htaccess WPPP_Dynamic_Images::static_disable_rewrite_rules(); } /* if ( is_multisite() && isset( $_GET['networkwide'] ) && 1 == $_GET['networkwide'] ) { delete_site_option( self::wppp_options_name ); } else { delete_option( self::wppp_options_name ); } delete_option( 'wppp_dynimg_sizes' ); delete_option( 'wppp_version' ); */ // restore static links WPPP_CDN_Support::restore_static_links(); }
performance-pack.php
~line 378 move the commented out code above to a new functionuninstall()
:#alx359--> public function uninstall() { if ( is_multisite() && isset( $_GET['networkwide'] ) && 1 == $_GET['networkwide'] ) { delete_site_option( self::wppp_options_name ); } else { delete_option( self::wppp_options_name ); } delete_option( 'wppp_dynimg_sizes' ); delete_option( 'wppp_version' ); } #<--alx359
(This of course is just an example that seems to suit me atm. Bjoern would have to implement a throughout fix.)
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Settings lost upon deactivation’ is closed to new replies.