Changeset 3396811
- Timestamp:
- 11/16/2025 11:26:30 PM (6 weeks ago)
- Location:
- simply-static/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
simply-static.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simply-static/trunk/readme.txt
r3396663 r3396811 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 3.5.2 7 Stable tag: 3.5.2.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 260 260 261 261 == Changelog == 262 263 = 3.5.2.1 = 264 265 * fail-safe upgrade mechanism (alongside pro) 262 266 263 267 = 3.5.2 = -
simply-static/trunk/simply-static.php
r3396663 r3396811 9 9 * Plugin URI: https://simplystatic.com 10 10 * Description: A static site generator to create fast and secure static versions of your WordPress website. 11 * Version: 3.5.2 11 * Version: 3.5.2.1 12 12 * Author: Patrick Posner 13 13 * Author URI: https://patrickposner.com … … 20 20 define( 'SIMPLY_STATIC_PATH', plugin_dir_path( __FILE__ ) ); 21 21 define( 'SIMPLY_STATIC_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) ); 22 define( 'SIMPLY_STATIC_VERSION', '3.5.2 ' );22 define( 'SIMPLY_STATIC_VERSION', '3.5.2.1' ); 23 23 24 24 // Check PHP version. … … 71 71 } 72 72 73 // Update required? 74 if ( defined( 'SIMPLY_STATIC_PRO_VERSION' ) && version_compare( SIMPLY_STATIC_PRO_VERSION, '1.6.3.2', '<' ) ) { 75 // Site notice. 76 add_action( 77 'admin_notices', 78 function () { 79 $message = esc_html__( 'You need to update Simply Static Pro to version 1.6.3.2 before continuing to use Simply Static, as we made significant changes requiring an upgrade.', 'simply-static' ); 80 echo wp_kses_post( '<div class="notice notice-error"><p>' . $message . '</p></div>' ); 81 } 82 ); 73 // Enforce Pro compatibility for Simply Static >= 3.5.2. 74 // When Simply Static is >= 3.5.2, we require Simply Static Pro >= 2.0.1. 75 add_action( 'plugins_loaded', function () { 76 if ( ! defined( 'SIMPLY_STATIC_VERSION' ) || version_compare( SIMPLY_STATIC_VERSION, '3.5.2', '<' ) ) { 77 return; 78 } 83 79 84 // Network notice. 85 if ( function_exists( 'is_network_admin' ) ) { 86 if ( is_network_admin() ) { 87 add_action( 88 'network_admin_notices', 89 function () { 90 $message = esc_html__( 'You need to update Simply Static Pro to version 1.6.3.2 before continuing to use Simply Static, as we made significant changes requiring an upgrade.', 'simply-static' ); 91 echo wp_kses_post( '<div class="notice notice-error"><p>' . $message . '</p></div>' ); 92 } 93 ); 94 } 95 } 96 } 80 // Bail if Pro isn't active at all. 81 if ( ! function_exists( 'deactivate_plugins' ) || ! function_exists( 'is_plugin_active' ) || ! function_exists( 'is_plugin_active_for_network' ) ) { 82 require_once ABSPATH . 'wp-admin/includes/plugin.php'; 83 } 84 85 $pro_basename = 'simply-static-pro/simply-static-pro.php'; 86 $pro_active = function_exists( 'is_plugin_active' ) && is_plugin_active( $pro_basename ); 87 $pro_netactive = function_exists( 'is_plugin_active_for_network' ) && is_plugin_active_for_network( $pro_basename ); 88 89 if ( ! $pro_active && ! $pro_netactive ) { 90 return; // Pro not active; nothing to enforce. 91 } 92 93 // If Pro is active but version is missing or too low, deactivate and notify. 94 if ( ! defined( 'SIMPLY_STATIC_PRO_VERSION' ) || version_compare( SIMPLY_STATIC_PRO_VERSION, '2.0.1', '<' ) ) { 95 $network_wide = $pro_netactive; 96 deactivate_plugins( $pro_basename, false, $network_wide ); 97 98 // Prevent Pro boot during current request if it already hooked into plugins_loaded. 99 if ( function_exists( 'ssp_run_plugin' ) ) { 100 remove_action( 'plugins_loaded', 'ssp_run_plugin' ); 101 } 102 103 // Site admin notice. 104 add_action( 105 'admin_notices', 106 function () { 107 $message = sprintf( 108 /* translators: 1: required Simply Static Pro version */ 109 esc_html__( 'Simply Static Pro has been deactivated because it is not compatible with this version of Simply Static. Please update Simply Static Pro to at least version %1$s and then reactivate it.', 'simply-static' ), 110 '2.0.1' 111 ); 112 echo wp_kses_post( '<div class="notice notice-error"><p>' . $message . '</p></div>' ); 113 } 114 ); 115 116 // Network admin notice (multisite). 117 add_action( 118 'network_admin_notices', 119 function () { 120 $message = sprintf( 121 /* translators: 1: required Simply Static Pro version */ 122 esc_html__( 'Simply Static Pro has been deactivated network-wide because it is not compatible with this version of Simply Static. Please update Simply Static Pro to at least version %1$s and then reactivate it.', 'simply-static' ), 123 '2.0.1' 124 ); 125 echo wp_kses_post( '<div class="notice notice-error"><p>' . $message . '</p></div>' ); 126 } 127 ); 128 } 129 }, 1 ); 97 130 } 98 131
Note: See TracChangeset
for help on using the changeset viewer.