Plugin Directory

Changeset 3474704


Ignore:
Timestamp:
03/04/2026 03:56:12 PM (3 weeks ago)
Author:
recorp
Message:

Added tag 6.0.5.0

Location:
export-wp-page-to-static-html/tags/6.0.5.1
Files:
5 copied

Legend:

Unmodified
Added
Removed
  • export-wp-page-to-static-html/tags/6.0.5.1/README.txt

    r3474696 r3474704  
    55Tested up to:       6.7
    66Requires PHP:       7.4
    7 Stable tag:         6.0.5
     7Stable tag:         6.0.5.1
    88License:            GPLv2 or later
    99License 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  
    44 * Plugin URI:        https://myrecorp.com
    55 * 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.4
     6 * Version:           6.0.5.1
    77 * Author:            ReCorp
    88 * Author URI:        https://www.upwork.com/fl/rayhan1
     
    2020    load_plugin_textdomain('wp-to-html', false, dirname(plugin_basename(__FILE__)) . '/languages');
    2121});
    22 define('WP_TO_HTML_VERSION', '6.0.4');
     22define('WP_TO_HTML_VERSION', '6.0.6.1');
    2323define('WP_TO_HTML_PATH', plugin_dir_path(__FILE__));
    2424define('WP_TO_HTML_URL', plugin_dir_url(__FILE__));
     
    155155/**
    156156 * 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.
    157160 */
    158161add_action('admin_init', function () {
     
    162165    if (defined('WP_CLI') && WP_CLI) return;
    163166
    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');
    177172
    178173    // Don't redirect if already on the page.
     
    321316    global $wpdb;
    322317
    323     $installed_version = get_option('wp_to_html_version'); // previous plugin version
     318    $installed_version = get_option('wp_to_html_version', ''); // previous stored version
    324319    $current_version   = WP_TO_HTML_VERSION;
    325320    $tables_removed    = get_option('wp_to_html_old_tables_removed', false);
    326321
    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);
    346343    }
    347344}
Note: See TracChangeset for help on using the changeset viewer.