Changeset 3475592
- Timestamp:
- 03/05/2026 11:54:57 AM (3 weeks ago)
- Location:
- export-wp-page-to-static-html/trunk
- Files:
-
- 2 edited
-
README.txt (modified) (1 diff)
-
export-wp-page-to-static-html.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
export-wp-page-to-static-html/trunk/README.txt
r3475394 r3475592 3 3 Tags: static html export, static site generator, html export, export posts, export pages 4 4 Requires at least: 5.8 5 Tested up to: 6. 75 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 6.0.5. 47 Stable tag: 6.0.5.5 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/trunk/export-wp-page-to-static-html.php
r3475394 r3475592 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.5. 46 * Version: 6.0.5.5 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.5. 4');22 define('WP_TO_HTML_VERSION', '6.0.5.5'); 23 23 define('WP_TO_HTML_PATH', plugin_dir_path(__FILE__)); 24 24 define('WP_TO_HTML_URL', plugin_dir_url(__FILE__)); … … 123 123 }); 124 124 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 */ 130 add_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 125 140 require_once WP_TO_HTML_PATH . 'includes/class-core.php'; 126 141 require_once WP_TO_HTML_PATH . 'includes/class-admin.php'; … … 145 160 $installed_version = get_option('wp_to_html_version', ''); 146 161 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. 152 174 update_option('wp_to_html_version', WP_TO_HTML_VERSION, false); 153 175 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); 157 183 update_option('wp_to_html_version', WP_TO_HTML_VERSION, false); 158 184 } 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 165 187 ob_end_clean(); 166 188 }); … … 350 372 update_option('wp_to_html_version', $current_version, false); 351 373 352 // Show "What's New" on ly when upgrading FROM a version below 6.0.0.353 // Fresh installs (empty string) and 6.0.0+ upgrades areexcluded.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, '<')) { 355 377 set_transient('wp_to_html_redirect_to_whats_new', 1, 60); 356 378 }
Note: See TracChangeset
for help on using the changeset viewer.