Changeset 3457772
- Timestamp:
- 02/10/2026 08:40:14 AM (7 weeks ago)
- Location:
- export-wp-page-to-static-html/trunk
- Files:
-
- 3 edited
-
README.txt (modified) (2 diffs)
-
admin/includes/AjaxRequests/assetsExporter.php (modified) (2 diffs)
-
export-wp-page-to-static-html.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
export-wp-page-to-static-html/trunk/README.txt
r3388166 r3457772 4 4 Requires at least: 4.1 5 5 Tested up to: 6.8 6 Stable tag: 5.0. 06 Stable tag: 5.0.1 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 91 91 92 92 == Changelog == 93 94 = 5.0.1 - 2 February 2026 = 95 * FIXED - A minor issue. 93 96 94 97 = 5.0.0 - 1 November 2025 = -
export-wp-page-to-static-html/trunk/admin/includes/AjaxRequests/assetsExporter.php
r3388166 r3457772 172 172 global $wpdb; 173 173 174 // Known/whitelisted table (not user input)175 174 $table = $wpdb->prefix . 'export_urls_logs'; 176 175 177 // Figure out which types we actually care about176 // Determine which asset types to check 178 177 $skip = (array) $this->getSettings( 'skipAssetsFiles', array() ); 179 178 $types = array(); 179 180 180 if ( ! array_key_exists( 'stylesheets', $skip ) ) { $types[] = 'css'; } 181 181 if ( ! array_key_exists( 'scripts', $skip ) ) { $types[] = 'js'; } 182 182 183 // If everything is skipped, nothing to verify183 // Nothing to check → everything is fine 184 184 if ( empty( $types ) ) { 185 185 return true; 186 186 } 187 187 188 // Build a stable cache key for this check188 // Cache 189 189 $cache_group = 'wpptsh_assets'; 190 190 $cache_key = 'all_exported_' . md5( $table . '|' . implode( ',', $types ) ); 191 191 192 // Use $found flag to distinguish "cached false" from "not found"193 192 $found = null; 194 193 $cached = wp_cache_get( $cache_key, $cache_group, false, $found ); … … 197 196 } 198 197 199 // Build a prepared IN() clause safely198 // Prepare IN() clause 200 199 $placeholders = implode( ',', array_fill( 0, count( $types ), '%s' ) ); 201 200 202 // Note: identifiers (table/column) cannot be prepared; ensure $table is whitelisted. 203 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- $table is a known internal table 204 $sql = " 205 SELECT 206 COUNT(*) AS total, 207 SUM(CASE WHEN exported = 1 THEN 1 ELSE 0 END) AS exported 208 FROM `{$table}` 209 WHERE type IN ({$placeholders}) 210 "; 211 212 // One read-only, prepared query (cached below). 213 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery 201 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared 214 202 $row = $wpdb->get_row( 215 // Variadic args so PHPCS recognizes proper preparation 216 $wpdb->prepare( " 217 SELECT 218 COUNT(*) AS total, 219 SUM(CASE WHEN exported = 1 THEN 1 ELSE 0 END) AS exported 220 FROM `{$table}` 221 WHERE type IN ({$placeholders}) 222 ", ...$types ), 203 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery 204 $wpdb->prepare( 205 " 206 SELECT 207 COUNT(*) AS total, 208 SUM(CASE WHEN exported = 1 THEN 1 ELSE 0 END) AS exported 209 FROM `{$table}` 210 WHERE type IN ({$placeholders}) 211 ", 212 ...$types 213 ), 223 214 ARRAY_A 224 215 ); 225 216 226 $total = isset( $row['total'] ) ? (int) $row['total'] : 0; 227 $exported = isset( $row['exported'] ) ? (int) $row['exported'] : 0; 228 229 // If there are no matching assets, "not all exported" 230 $all_done = ( $total > 0 ) && ( $total === $exported ); 231 232 // Short TTL to keep it fresh; adjust if your export status changes less/more often 217 $total = (int) ( $row['total'] ?? 0 ); 218 $exported = (int) ( $row['exported'] ?? 0 ); 219 220 // ✔ Your rule: if nothing exists, return true 221 $all_done = ( $total === 0 ) || ( $total === $exported ); 222 233 223 wp_cache_set( $cache_key, (int) $all_done, $cache_group, 60 ); 234 224 -
export-wp-page-to-static-html/trunk/export-wp-page-to-static-html.php
r3388166 r3457772 10 10 * Plugin URI: https://myrecorp.com 11 11 * Description: Seamlessly export any WordPress page or post into lightweight, fully responsive static HTML/CSS and print-ready PDF with a single click. Boost your site’s performance and security by serving pre-rendered pages, create offline-friendly backups. Perfect for developers, content creators, and businesses needing fast, reliable exports of WordPress content. 12 * Version: 5.0. 012 * Version: 5.0.1 13 13 * Author: ReCorp 14 14 * Author URI: https://www.upwork.com/fl/rayhan1 … … 57 57 * Rename this for your plugin and update it as you release new versions. 58 58 */ 59 define( 'EXPORT_WP_PAGE_TO_STATIC_HTML_VERSION', '5.0. 0' );59 define( 'EXPORT_WP_PAGE_TO_STATIC_HTML_VERSION', '5.0.1' ); 60 60 define( 'EWPPTSH_PLUGIN_DIR_URL', plugin_dir_url(__FILE__) ); 61 61 define( 'EWPPTSH_PLUGIN_DIR_PATH', plugin_dir_path(__FILE__) );
Note: See TracChangeset
for help on using the changeset viewer.