Plugin Directory

Changeset 3457772


Ignore:
Timestamp:
02/10/2026 08:40:14 AM (7 weeks ago)
Author:
recorp
Message:

Fixed a minor issue.

Location:
export-wp-page-to-static-html/trunk
Files:
3 edited

Legend:

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

    r3388166 r3457772  
    44Requires at least: 4.1 
    55Tested up to: 6.8
    6 Stable tag: 5.0.0
     6Stable tag: 5.0.1
    77License: GPLv2 or later 
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html 
     
    9191
    9292== Changelog ==
     93
     94= 5.0.1 - 2 February 2026 =
     95* FIXED - A minor issue.
    9396
    9497= 5.0.0 - 1 November 2025 =
  • export-wp-page-to-static-html/trunk/admin/includes/AjaxRequests/assetsExporter.php

    r3388166 r3457772  
    172172        global $wpdb;
    173173
    174         // Known/whitelisted table (not user input)
    175174        $table = $wpdb->prefix . 'export_urls_logs';
    176175
    177         // Figure out which types we actually care about
     176        // Determine which asset types to check
    178177        $skip  = (array) $this->getSettings( 'skipAssetsFiles', array() );
    179178        $types = array();
     179
    180180        if ( ! array_key_exists( 'stylesheets', $skip ) ) { $types[] = 'css'; }
    181181        if ( ! array_key_exists( 'scripts', $skip ) )     { $types[] = 'js';  }
    182182
    183         // If everything is skipped, nothing to verify
     183        // Nothing to check → everything is fine
    184184        if ( empty( $types ) ) {
    185185            return true;
    186186        }
    187187
    188         // Build a stable cache key for this check
     188        // Cache
    189189        $cache_group = 'wpptsh_assets';
    190190        $cache_key   = 'all_exported_' . md5( $table . '|' . implode( ',', $types ) );
    191191
    192         // Use $found flag to distinguish "cached false" from "not found"
    193192        $found  = null;
    194193        $cached = wp_cache_get( $cache_key, $cache_group, false, $found );
     
    197196        }
    198197
    199         // Build a prepared IN() clause safely
     198        // Prepare IN() clause
    200199        $placeholders = implode( ',', array_fill( 0, count( $types ), '%s' ) );
    201200
    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
    214202        $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            ),
    223214            ARRAY_A
    224215        );
    225216
    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
    233223        wp_cache_set( $cache_key, (int) $all_done, $cache_group, 60 );
    234224
  • export-wp-page-to-static-html/trunk/export-wp-page-to-static-html.php

    r3388166 r3457772  
    1010 * Plugin URI:        https://myrecorp.com
    1111 * 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.0
     12 * Version:           5.0.1
    1313 * Author:            ReCorp
    1414 * Author URI:        https://www.upwork.com/fl/rayhan1
     
    5757         * Rename this for your plugin and update it as you release new versions.
    5858         */
    59         define( 'EXPORT_WP_PAGE_TO_STATIC_HTML_VERSION', '5.0.0' );
     59        define( 'EXPORT_WP_PAGE_TO_STATIC_HTML_VERSION', '5.0.1' );
    6060        define( 'EWPPTSH_PLUGIN_DIR_URL', plugin_dir_url(__FILE__) );
    6161        define( 'EWPPTSH_PLUGIN_DIR_PATH', plugin_dir_path(__FILE__) );
Note: See TracChangeset for help on using the changeset viewer.