Changeset 3843542
- Timestamp:
- 12/03/2026 11:16:20 PM (less than one hour ago)
- Location:
- foundry-helper
- Files:
-
- 6 edited
- 1 copied
-
tags/5.0.2 (copied) (copied from foundry-helper/trunk )
-
tags/5.0.2/foundry-helper.php (modified) (2 diffs)
-
tags/5.0.2/includes/actions.php (modified) (2 diffs)
-
tags/5.0.2/readme.txt (modified) (2 diffs)
-
trunk/foundry-helper.php (modified) (2 diffs)
-
trunk/includes/actions.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
foundry-helper/tags/5.0.2/foundry-helper.php
r3843470 r3843542 12 12 * Plugin URI: https://wpfoundry.app 13 13 * Description: Manage this site from WP Foundry: plugins, themes, users, core updates, and backups. 14 * Version: 5.0. 114 * Version: 5.0.2 15 15 * Requires at least: 6.0 16 16 * Requires PHP: 7.4 … … 32 32 33 33 define( 'WPFOUNDRY_HELPER_LOADED', true ); 34 define( 'WPFOUNDRY_HELPER_VERSION', '5.0. 1' );34 define( 'WPFOUNDRY_HELPER_VERSION', '5.0.2' ); 35 35 define( 'WPFOUNDRY_HELPER_FILE', __FILE__ ); 36 36 define( 'WPFOUNDRY_HELPER_DIR', plugin_dir_path( __FILE__ ) ); -
foundry-helper/tags/5.0.2/includes/actions.php
r3843470 r3843542 254 254 return $file; 255 255 } 256 257 // Plugin_Upgrader::upgrade() silently deactivates active plugins before 258 // replacing files. Automatic_Upgrader_Skin does not reactivate them (the 259 // wp-admin skin does via an iframe). Track state and restore it ourselves. 260 $was_active = is_plugin_active( $file ); 261 $was_network_active = is_multisite() && is_plugin_active_for_network( $file ); 262 256 263 wpfoundry_load_upgrader(); 257 264 wp_update_plugins(); … … 259 266 $upgrader = new Plugin_Upgrader( $skin ); 260 267 $result = $upgrader->upgrade( $file ); 268 269 $new_file = $upgrader->plugin_info(); 270 if ( is_string( $new_file ) && $new_file !== '' ) { 271 $file = $new_file; 272 } 273 274 if ( is_wp_error( $result ) || true !== $result ) { 275 wpfoundry_reactivate_plugin_after_update( $file, $was_active, $was_network_active ); 276 if ( is_wp_error( $result ) ) { 277 return $result; 278 } 279 return new WP_Error( 'plugin_update_failed', 'Plugin update failed' ); 280 } 281 282 $reactivate = wpfoundry_reactivate_plugin_after_update( $file, $was_active, $was_network_active ); 283 if ( is_wp_error( $reactivate ) ) { 284 return new WP_Error( 285 'plugin_reactivate_failed', 286 sprintf( 287 /* translators: %s: activation error message */ 288 'Plugin updated but could not be reactivated: %s', 289 $reactivate->get_error_message() 290 ) 291 ); 292 } 293 294 return array( 295 'plugin' => $file, 296 'updated' => true, 297 'active' => is_plugin_active( $file ), 298 'reactivated' => (bool) $was_active, 299 ); 300 } 301 302 /** 303 * Reactivate a plugin that WordPress deactivated during an upgrade. 304 * 305 * @param string $file Plugin basename. 306 * @param bool $was_active Whether it was active before the update. 307 * @param bool $was_network_active Whether it was network-active before the update. 308 * @return true|WP_Error True on success / nothing to do, WP_Error on activation failure. 309 */ 310 function wpfoundry_reactivate_plugin_after_update( $file, $was_active, $was_network_active ) { 311 if ( ! $was_active ) { 312 return true; 313 } 314 if ( ! function_exists( 'activate_plugin' ) ) { 315 require_once ABSPATH . 'wp-admin/includes/plugin.php'; 316 } 317 if ( is_plugin_active( $file ) ) { 318 return true; 319 } 320 $result = activate_plugin( $file, '', (bool) $was_network_active, true ); 261 321 if ( is_wp_error( $result ) ) { 262 322 return $result; 263 323 } 264 if ( $result !== true ) { 265 return new WP_Error( 'plugin_update_failed', 'Plugin update failed' ); 266 } 267 return array( 'plugin' => $file, 'updated' => true ); 324 return true; 268 325 } 269 326 -
foundry-helper/tags/5.0.2/readme.txt
r3843470 r3843542 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 5.0. 17 Stable tag: 5.0.2 8 8 License: GPL-2.0-or-later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 52 52 == Changelog == 53 53 54 = 5.0.2 = 55 * Reactivate plugins after update. WordPress deactivates them during the upgrade and Automatic_Upgrader_Skin does not turn them back on. 56 54 57 = 5.0.1 = 55 58 * Database and other backup downloads keep their token on disk, so a site with an object cache can still download the file. -
foundry-helper/trunk/foundry-helper.php
r3843470 r3843542 12 12 * Plugin URI: https://wpfoundry.app 13 13 * Description: Manage this site from WP Foundry: plugins, themes, users, core updates, and backups. 14 * Version: 5.0. 114 * Version: 5.0.2 15 15 * Requires at least: 6.0 16 16 * Requires PHP: 7.4 … … 32 32 33 33 define( 'WPFOUNDRY_HELPER_LOADED', true ); 34 define( 'WPFOUNDRY_HELPER_VERSION', '5.0. 1' );34 define( 'WPFOUNDRY_HELPER_VERSION', '5.0.2' ); 35 35 define( 'WPFOUNDRY_HELPER_FILE', __FILE__ ); 36 36 define( 'WPFOUNDRY_HELPER_DIR', plugin_dir_path( __FILE__ ) ); -
foundry-helper/trunk/includes/actions.php
r3843470 r3843542 254 254 return $file; 255 255 } 256 257 // Plugin_Upgrader::upgrade() silently deactivates active plugins before 258 // replacing files. Automatic_Upgrader_Skin does not reactivate them (the 259 // wp-admin skin does via an iframe). Track state and restore it ourselves. 260 $was_active = is_plugin_active( $file ); 261 $was_network_active = is_multisite() && is_plugin_active_for_network( $file ); 262 256 263 wpfoundry_load_upgrader(); 257 264 wp_update_plugins(); … … 259 266 $upgrader = new Plugin_Upgrader( $skin ); 260 267 $result = $upgrader->upgrade( $file ); 268 269 $new_file = $upgrader->plugin_info(); 270 if ( is_string( $new_file ) && $new_file !== '' ) { 271 $file = $new_file; 272 } 273 274 if ( is_wp_error( $result ) || true !== $result ) { 275 wpfoundry_reactivate_plugin_after_update( $file, $was_active, $was_network_active ); 276 if ( is_wp_error( $result ) ) { 277 return $result; 278 } 279 return new WP_Error( 'plugin_update_failed', 'Plugin update failed' ); 280 } 281 282 $reactivate = wpfoundry_reactivate_plugin_after_update( $file, $was_active, $was_network_active ); 283 if ( is_wp_error( $reactivate ) ) { 284 return new WP_Error( 285 'plugin_reactivate_failed', 286 sprintf( 287 /* translators: %s: activation error message */ 288 'Plugin updated but could not be reactivated: %s', 289 $reactivate->get_error_message() 290 ) 291 ); 292 } 293 294 return array( 295 'plugin' => $file, 296 'updated' => true, 297 'active' => is_plugin_active( $file ), 298 'reactivated' => (bool) $was_active, 299 ); 300 } 301 302 /** 303 * Reactivate a plugin that WordPress deactivated during an upgrade. 304 * 305 * @param string $file Plugin basename. 306 * @param bool $was_active Whether it was active before the update. 307 * @param bool $was_network_active Whether it was network-active before the update. 308 * @return true|WP_Error True on success / nothing to do, WP_Error on activation failure. 309 */ 310 function wpfoundry_reactivate_plugin_after_update( $file, $was_active, $was_network_active ) { 311 if ( ! $was_active ) { 312 return true; 313 } 314 if ( ! function_exists( 'activate_plugin' ) ) { 315 require_once ABSPATH . 'wp-admin/includes/plugin.php'; 316 } 317 if ( is_plugin_active( $file ) ) { 318 return true; 319 } 320 $result = activate_plugin( $file, '', (bool) $was_network_active, true ); 261 321 if ( is_wp_error( $result ) ) { 262 322 return $result; 263 323 } 264 if ( $result !== true ) { 265 return new WP_Error( 'plugin_update_failed', 'Plugin update failed' ); 266 } 267 return array( 'plugin' => $file, 'updated' => true ); 324 return true; 268 325 } 269 326 -
foundry-helper/trunk/readme.txt
r3843470 r3843542 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 5.0. 17 Stable tag: 5.0.2 8 8 License: GPL-2.0-or-later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 52 52 == Changelog == 53 53 54 = 5.0.2 = 55 * Reactivate plugins after update. WordPress deactivates them during the upgrade and Automatic_Upgrader_Skin does not turn them back on. 56 54 57 = 5.0.1 = 55 58 * Database and other backup downloads keep their token on disk, so a site with an object cache can still download the file.
Note:
See TracChangeset
for help on using the changeset viewer.