Changeset 3474704
- Timestamp:
- 03/04/2026 03:56:12 PM (3 weeks ago)
- Location:
- export-wp-page-to-static-html/tags/6.0.5.1
- Files:
-
- 5 copied
-
. (copied) (copied from export-wp-page-to-static-html/trunk)
-
LICENSE.txt (copied) (copied from export-wp-page-to-static-html/trunk/LICENSE.txt)
-
README.txt (copied) (copied from export-wp-page-to-static-html/trunk/README.txt) (1 diff)
-
export-wp-page-to-static-html.php (copied) (copied from export-wp-page-to-static-html/trunk/export-wp-page-to-static-html.php) (5 diffs)
-
includes/class-admin.php (copied) (copied from export-wp-page-to-static-html/trunk/includes/class-admin.php)
Legend:
- Unmodified
- Added
- Removed
-
export-wp-page-to-static-html/tags/6.0.5.1/README.txt
r3474696 r3474704 5 5 Tested up to: 6.7 6 6 Requires PHP: 7.4 7 Stable tag: 6.0.5 7 Stable tag: 6.0.5.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
export-wp-page-to-static-html/tags/6.0.5.1/export-wp-page-to-static-html.php
r3474696 r3474704 4 4 * Plugin URI: https://myrecorp.com 5 5 * Description: Export WP Pages to Static HTML is the most flexible static HTML export plugin for WordPress. Unlike full-site generators, Export WP Pages to Static HTML gives you surgical control — export exactly the posts, pages, or custom post types you need, in the status you want, as the user role you choose. 6 * Version: 6.0. 46 * Version: 6.0.5.1 7 7 * Author: ReCorp 8 8 * Author URI: https://www.upwork.com/fl/rayhan1 … … 20 20 load_plugin_textdomain('wp-to-html', false, dirname(plugin_basename(__FILE__)) . '/languages'); 21 21 }); 22 define('WP_TO_HTML_VERSION', '6.0. 4');22 define('WP_TO_HTML_VERSION', '6.0.6.1'); 23 23 define('WP_TO_HTML_PATH', plugin_dir_path(__FILE__)); 24 24 define('WP_TO_HTML_URL', plugin_dir_url(__FILE__)); … … 155 155 /** 156 156 * Redirect to "What's New" page after plugin update (not on first activation). 157 * 158 * Uses a dedicated transient set by wp_to_html_plugin_update() so that the 159 * version bump and the redirect trigger are fully decoupled. 157 160 */ 158 161 add_action('admin_init', function () { … … 162 165 if (defined('WP_CLI') && WP_CLI) return; 163 166 164 $stored = get_option('wp_to_html_version', ''); 165 166 // First install — store version, no redirect. 167 if ($stored === '') { 168 update_option('wp_to_html_version', WP_TO_HTML_VERSION, false); 169 return; 170 } 171 172 // Not an update — nothing to do. 173 if (!version_compare($stored, WP_TO_HTML_VERSION, '<')) return; 174 175 // Plugin was updated — bump stored version first to prevent loop. 176 update_option('wp_to_html_version', WP_TO_HTML_VERSION, false); 167 // Only redirect if the update routine flagged it. 168 if (!get_transient('wp_to_html_redirect_to_whats_new')) return; 169 170 // Clear immediately so it only fires once. 171 delete_transient('wp_to_html_redirect_to_whats_new'); 177 172 178 173 // Don't redirect if already on the page. … … 321 316 global $wpdb; 322 317 323 $installed_version = get_option('wp_to_html_version' ); // previous pluginversion318 $installed_version = get_option('wp_to_html_version', ''); // previous stored version 324 319 $current_version = WP_TO_HTML_VERSION; 325 320 $tables_removed = get_option('wp_to_html_old_tables_removed', false); 326 321 327 // Run only if plugin version has changed 328 if ( $installed_version !== $current_version ) { 329 330 // Remove old tables only once 331 if ( ! $tables_removed ) { 332 $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}exportable_urls" ); 333 $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}export_page_to_html_logs" ); 334 $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}export_urls_logs" ); 335 336 // Mark old tables as removed 337 update_option( 'wp_to_html_old_tables_removed', true ); 338 339 // Create new tables 340 wp_to_html_ensure_tables(); 341 } 342 343 344 // Update plugin version 345 update_option( 'wp_to_html_version', $current_version ); 322 // Nothing to do if already up to date. 323 if ($installed_version === $current_version) return; 324 325 // Remove legacy tables only once (upgrades from pre-6.x). 326 if (!$tables_removed) { 327 $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}exportable_urls"); 328 $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}export_page_to_html_logs"); 329 $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}export_urls_logs"); 330 331 update_option('wp_to_html_old_tables_removed', true); 332 333 // Create new tables for fresh/migrating installs. 334 wp_to_html_ensure_tables(); 335 } 336 337 // Bump stored version FIRST so this block won't re-run on the next load. 338 update_option('wp_to_html_version', $current_version, false); 339 340 // Signal the admin_init redirect — but only for real updates, not first installs. 341 if ($installed_version !== '') { 342 set_transient('wp_to_html_redirect_to_whats_new', 1, 60); 346 343 } 347 344 }
Note: See TracChangeset
for help on using the changeset viewer.