Plugin Directory

Changeset 3475590


Ignore:
Timestamp:
03/05/2026 11:54:07 AM (3 weeks ago)
Author:
recorp
Message:

added tag 6.0.5.5

Location:
export-wp-page-to-static-html/tags/6.0.5.5
Files:
6 copied

Legend:

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

    r3475394 r3475590  
    33Tags:               static html export, static site generator, html export, export posts, export pages
    44Requires at least:  5.8
    5 Tested up to:       6.7
     5Tested up to:       6.9
    66Requires PHP:       7.4
    7 Stable tag:         6.0.5.4
     7Stable tag:         6.0.5.5
    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.5/export-wp-page-to-static-html.php

    r3475394 r3475590  
    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.5.4
     6 * Version:           6.0.5.5
    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.5.4');
     22define('WP_TO_HTML_VERSION', '6.0.5.5');
    2323define('WP_TO_HTML_PATH', plugin_dir_path(__FILE__));
    2424define('WP_TO_HTML_URL', plugin_dir_url(__FILE__));
     
    123123});
    124124
     125/**
     126 * Safety net: if tables are missing (e.g. activation hook failed silently or
     127 * was skipped on some hosts), recreate them before anything else runs.
     128 * Priority 5 ensures this fires before wp_to_html_plugin_update() (priority 10).
     129 */
     130add_action('plugins_loaded', function () {
     131    global $wpdb;
     132    $queue = $wpdb->prefix . 'wp_to_html_queue';
     133    if (!$wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $queue))) {
     134        ob_start();
     135        wp_to_html_ensure_tables();
     136        ob_end_clean();
     137    }
     138}, 5);
     139
    125140require_once WP_TO_HTML_PATH . 'includes/class-core.php';
    126141require_once WP_TO_HTML_PATH . 'includes/class-admin.php';
     
    145160    $installed_version = get_option('wp_to_html_version', '');
    146161
    147     // If stored version is HIGHER than the version being activated, the plugin
    148     // was deleted and reinstalled with an older version. Reset stored version
    149     // to the reinstalled version so the update routine correctly detects the
    150     // upcoming upgrade and shows "What's New" if upgrading past 6.0.0.
    151     if ($installed_version !== '' && version_compare($installed_version, WP_TO_HTML_VERSION, '>')) {
     162    // Buffer output to prevent PHP warnings/notices from dbDelta()
     163    // from being counted as "unexpected output" during activation.
     164    ob_start();
     165
     166    if ($installed_version === '') {
     167        // Fresh install — store current version, no "What's New" redirect.
     168        update_option('wp_to_html_version', WP_TO_HTML_VERSION, false);
     169        wp_to_html_ensure_tables();
     170
     171    } elseif (version_compare($installed_version, WP_TO_HTML_VERSION, '>')) {
     172        // Downgrade: stored version is higher than what's being activated.
     173        // Reset so the next upgrade detects a version change correctly.
    152174        update_option('wp_to_html_version', WP_TO_HTML_VERSION, false);
    153175        update_option('wp_to_html_old_tables_removed', false);
    154     } else {
    155         // Fresh install — store current version so "What's New" is never shown
    156         // on a clean install.
     176        wp_to_html_ensure_tables();
     177
     178    } elseif (version_compare($installed_version, WP_TO_HTML_VERSION, '<')) {
     179        // Upgrade: create/restore tables (deactivation dropped them),
     180        // flag the "What's New" redirect, then bump the stored version.
     181        wp_to_html_ensure_tables();
     182        set_transient('wp_to_html_redirect_to_whats_new', 1, 60);
    157183        update_option('wp_to_html_version', WP_TO_HTML_VERSION, false);
    158184    }
    159 
    160     // Buffer output to prevent PHP warnings/notices from dbDelta()
    161     // from being counted as "unexpected output" during activation
    162     // (especially when WP_DEBUG_DISPLAY is enabled).
    163     ob_start();
    164     wp_to_html_ensure_tables();
     185    // Same version re-activation: nothing to do.
     186
    165187    ob_end_clean();
    166188});
     
    350372    update_option('wp_to_html_version', $current_version, false);
    351373
    352     // Show "What's New" only when upgrading FROM a version below 6.0.0.
    353     // Fresh installs (empty string) and 6.0.0+ upgrades are excluded.
    354     if ($installed_version !== '' && version_compare($installed_version, '6.0.0', '<')) {
     374    // Show "What's New" on any version upgrade (covers FTP/manual updates where
     375    // the activation hook never fires). Fresh installs (empty string) excluded.
     376    if ($installed_version !== '' && version_compare($installed_version, $current_version, '<')) {
    355377        set_transient('wp_to_html_redirect_to_whats_new', 1, 60);
    356378    }
Note: See TracChangeset for help on using the changeset viewer.