Plugin Directory

Changeset 3408054


Ignore:
Timestamp:
12/02/2025 01:33:51 PM (4 months ago)
Author:
malakontask
Message:

v2.4.2 - LiteSpeed Cache compatibility with dedicated no-cache headers and cache-busting

Location:
atlas-dynamic-messages-for-woocommerce
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • atlas-dynamic-messages-for-woocommerce/tags/2.4.2/README.txt

    r3341139 r3408054  
    11=== Atlas Dynamic Messages for WooCommerce ===
    22Contributors: malakontask
    3 Tags: woocommerce, countdown, shipping, notification, messages, cache-compatible, real-time
     3Tags: woocommerce, countdown, shipping, timer, urgency
    44Requires at least: 5.0
    55Tested up to: 6.8.2
    66Requires PHP: 7.4
    7 Stable tag: 2.4.1
     7Stable tag: 2.4.2
    88License: GPL-2.0+
    99License URI: http://www.gnu.org/licenses/gpl-2.0.txt
    1010
    11 Real-time dynamic countdown messages that work perfectly with ALL caching plugins - WP Rocket, W3 Total Cache, Cloudflare, and more!
     11Real-time dynamic countdown messages that work perfectly with ALL caching plugins - LiteSpeed Cache, WP Rocket, W3 Total Cache, Cloudflare, and more!
    1212
    1313== Description ==
     
    1515**🚀 The ONLY WooCommerce countdown plugin that displays accurate, real-time countdowns even with page caching enabled!**
    1616
    17 While other countdown plugins show outdated times when pages are cached, Atlas Dynamic Messages uses advanced client-side technology to ensure your customers ALWAYS see the correct remaining time - whether you're using WP Rocket, W3 Total Cache, WP Super Cache, Cloudflare, Varnish, or any other caching solution.
     17While other countdown plugins show outdated times when pages are cached, Atlas Dynamic Messages uses advanced client-side technology to ensure your customers ALWAYS see the correct remaining time - whether you're using LiteSpeed Cache, WP Rocket, W3 Total Cache, WP Super Cache, Cloudflare, Varnish, or any other caching solution.
    1818
    1919**Why Atlas Dynamic Messages is Different:**
     
    6767**This is our secret sauce!** Unlike other countdown plugins, Atlas Dynamic Messages uses client-side JavaScript and REST API calls to fetch real-time data. This means:
    6868- The countdown timer bypasses ALL page caching
    69 - Works with WP Rocket, W3 Total Cache, WP Super Cache, Cloudflare, etc.
     69- Works with LiteSpeed Cache, WP Rocket, W3 Total Cache, WP Super Cache, Cloudflare, etc.
     70- Includes dedicated LiteSpeed Cache headers for optimal compatibility
    7071- No need to exclude pages from cache
    7172- Your pages stay cached for optimal performance
     
    120121- Minimal server load (one API call per page load)
    121122- Compatible with all caching layers (plugin, server, CDN)
     123- LiteSpeed Cache compatibility with dedicated X-LiteSpeed-Cache-Control headers
     124- Cache-busting parameters to bypass aggressive server-side caching
    122125
    123126== Screenshots ==
     
    131134
    132135== Changelog ==
     136
     137= 2.4.2 =
     138* NEW: Added LiteSpeed Cache compatibility with dedicated no-cache headers
     139* NEW: Added cache-busting parameter to REST API calls for better cache bypass
     140* Fixed: Plugin tags reduced to 5 as per WordPress.org guidelines
    133141
    134142= 2.4.1 =
  • atlas-dynamic-messages-for-woocommerce/tags/2.4.2/atlas-dynamic-messages-for-woocommerce.php

    r3341139 r3408054  
    33 * Plugin Name: Atlas Dynamic Messages for WooCommerce
    44 * Description: Cache-compatible real-time countdown messages for WooCommerce. Works perfectly with ALL caching plugins - the only countdown plugin that bypasses cache for accurate, live updates!
    5  * Version: 2.4.1
     5 * Version: 2.4.2
    66 * Author: PluginAtlas
    77 * Author URI: https://pluginatlas.com
     
    5555
    5656// Define plugin constants
    57 define('ATLAS_DMSG_VERSION', '2.4.1');
     57define('ATLAS_DMSG_VERSION', '2.4.2');
    5858define('ATLAS_DMSG_PLUGIN_DIR', plugin_dir_path(__FILE__));
    5959define('ATLAS_DMSG_PLUGIN_URL', plugin_dir_url(__FILE__));
  • atlas-dynamic-messages-for-woocommerce/tags/2.4.2/public/class-atlas-dynamic-messages-public.php

    r3341139 r3408054  
    4545use \DateTimeZone;
    4646use \DateInterval;
     47use \WP_REST_Response;
    4748
    4849if (!defined('ABSPATH')) exit;
     
    227228    /**
    228229     * Get scenarios data for REST API
    229      * 
    230      * @return array Scenarios data and server time
    231      */
    232     public function get_scenarios_data(): array {
     230     *
     231     * @return WP_REST_Response Scenarios data and server time with no-cache headers
     232     */
     233    public function get_scenarios_data(): WP_REST_Response {
    233234        $settings = get_option('atlas_dmsg_settings');
    234        
     235
    235236        // Use WordPress timezone
    236237        $timezone = new DateTimeZone(wp_timezone_string());
    237238        $server_datetime = new DateTime('now', $timezone);
    238        
     239
    239240        // Apply configurable time offset (default to 0 if not set)
    240241        $time_offset = intval($settings['time_offset'] ?? 0);
     
    247248            }
    248249        }
    249        
     250
    250251        $server_timestamp = $server_datetime->getTimestamp();
    251        
     252
    252253        $scenarios = isset($settings['scenarios']) ? $this->sanitize_scenarios($settings['scenarios']) : array();
    253        
     254
    254255        // Filter out inactive scenarios
    255         $active_scenarios = array_filter($scenarios, fn($scenario) => 
     256        $active_scenarios = array_filter($scenarios, fn($scenario) =>
    256257            isset($scenario['active']) && $scenario['active'] == 1
    257258        );
    258        
     259
    259260        // Get layout settings to send to frontend
    260261        $layout_settings = isset($settings['layouts']) ? $settings['layouts'] : array();
    261        
     262
    262263        // Important: Include current page info so JavaScript can filter appropriately
    263264        $current_page = $this->get_current_page_type();
    264        
    265         return array(
    266             'scenarios'      => array_values($active_scenarios), // Reset array keys
    267             'serverTime'     => $server_timestamp,
    268             'currentPage'    => $current_page, // Send current page type to JS
     265
     266        // Create WP_REST_Response with no-cache headers for LiteSpeed/other caching systems
     267        $response = new WP_REST_Response( array(
     268            'scenarios'       => array_values($active_scenarios), // Reset array keys
     269            'serverTime'      => $server_timestamp,
     270            'currentPage'     => $current_page, // Send current page type to JS
    269271            'layout_settings' => $layout_settings // Send layout settings to JS
    270         );
     272        ) );
     273
     274        // No-cache headers to bypass LiteSpeed and other caching systems
     275        $response->set_headers( array(
     276            'Cache-Control'             => 'no-cache, no-store, must-revalidate, max-age=0',
     277            'Pragma'                    => 'no-cache',
     278            'Expires'                   => '0',
     279            'X-LiteSpeed-Cache-Control' => 'no-cache', // LiteSpeed-specific header
     280        ) );
     281
     282        return $response;
    271283    }
    272284
  • atlas-dynamic-messages-for-woocommerce/tags/2.4.2/public/js/atlas-dynamic-messages.js

    r3341139 r3408054  
    2323    }
    2424
    25     fetch(atlasDmsgVars.apiUrl, {
     25    // Add cache-busting parameter to bypass LiteSpeed/other server caches
     26    fetch(atlasDmsgVars.apiUrl + '?_=' + Date.now(), {
    2627        headers: {
    2728            'X-WP-Nonce': atlasDmsgVars.nonce
  • atlas-dynamic-messages-for-woocommerce/trunk/README.txt

    r3341139 r3408054  
    11=== Atlas Dynamic Messages for WooCommerce ===
    22Contributors: malakontask
    3 Tags: woocommerce, countdown, shipping, notification, messages, cache-compatible, real-time
     3Tags: woocommerce, countdown, shipping, timer, urgency
    44Requires at least: 5.0
    55Tested up to: 6.8.2
    66Requires PHP: 7.4
    7 Stable tag: 2.4.1
     7Stable tag: 2.4.2
    88License: GPL-2.0+
    99License URI: http://www.gnu.org/licenses/gpl-2.0.txt
    1010
    11 Real-time dynamic countdown messages that work perfectly with ALL caching plugins - WP Rocket, W3 Total Cache, Cloudflare, and more!
     11Real-time dynamic countdown messages that work perfectly with ALL caching plugins - LiteSpeed Cache, WP Rocket, W3 Total Cache, Cloudflare, and more!
    1212
    1313== Description ==
     
    1515**🚀 The ONLY WooCommerce countdown plugin that displays accurate, real-time countdowns even with page caching enabled!**
    1616
    17 While other countdown plugins show outdated times when pages are cached, Atlas Dynamic Messages uses advanced client-side technology to ensure your customers ALWAYS see the correct remaining time - whether you're using WP Rocket, W3 Total Cache, WP Super Cache, Cloudflare, Varnish, or any other caching solution.
     17While other countdown plugins show outdated times when pages are cached, Atlas Dynamic Messages uses advanced client-side technology to ensure your customers ALWAYS see the correct remaining time - whether you're using LiteSpeed Cache, WP Rocket, W3 Total Cache, WP Super Cache, Cloudflare, Varnish, or any other caching solution.
    1818
    1919**Why Atlas Dynamic Messages is Different:**
     
    6767**This is our secret sauce!** Unlike other countdown plugins, Atlas Dynamic Messages uses client-side JavaScript and REST API calls to fetch real-time data. This means:
    6868- The countdown timer bypasses ALL page caching
    69 - Works with WP Rocket, W3 Total Cache, WP Super Cache, Cloudflare, etc.
     69- Works with LiteSpeed Cache, WP Rocket, W3 Total Cache, WP Super Cache, Cloudflare, etc.
     70- Includes dedicated LiteSpeed Cache headers for optimal compatibility
    7071- No need to exclude pages from cache
    7172- Your pages stay cached for optimal performance
     
    120121- Minimal server load (one API call per page load)
    121122- Compatible with all caching layers (plugin, server, CDN)
     123- LiteSpeed Cache compatibility with dedicated X-LiteSpeed-Cache-Control headers
     124- Cache-busting parameters to bypass aggressive server-side caching
    122125
    123126== Screenshots ==
     
    131134
    132135== Changelog ==
     136
     137= 2.4.2 =
     138* NEW: Added LiteSpeed Cache compatibility with dedicated no-cache headers
     139* NEW: Added cache-busting parameter to REST API calls for better cache bypass
     140* Fixed: Plugin tags reduced to 5 as per WordPress.org guidelines
    133141
    134142= 2.4.1 =
  • atlas-dynamic-messages-for-woocommerce/trunk/atlas-dynamic-messages-for-woocommerce.php

    r3341139 r3408054  
    33 * Plugin Name: Atlas Dynamic Messages for WooCommerce
    44 * Description: Cache-compatible real-time countdown messages for WooCommerce. Works perfectly with ALL caching plugins - the only countdown plugin that bypasses cache for accurate, live updates!
    5  * Version: 2.4.1
     5 * Version: 2.4.2
    66 * Author: PluginAtlas
    77 * Author URI: https://pluginatlas.com
     
    5555
    5656// Define plugin constants
    57 define('ATLAS_DMSG_VERSION', '2.4.1');
     57define('ATLAS_DMSG_VERSION', '2.4.2');
    5858define('ATLAS_DMSG_PLUGIN_DIR', plugin_dir_path(__FILE__));
    5959define('ATLAS_DMSG_PLUGIN_URL', plugin_dir_url(__FILE__));
  • atlas-dynamic-messages-for-woocommerce/trunk/public/class-atlas-dynamic-messages-public.php

    r3341139 r3408054  
    4545use \DateTimeZone;
    4646use \DateInterval;
     47use \WP_REST_Response;
    4748
    4849if (!defined('ABSPATH')) exit;
     
    227228    /**
    228229     * Get scenarios data for REST API
    229      * 
    230      * @return array Scenarios data and server time
    231      */
    232     public function get_scenarios_data(): array {
     230     *
     231     * @return WP_REST_Response Scenarios data and server time with no-cache headers
     232     */
     233    public function get_scenarios_data(): WP_REST_Response {
    233234        $settings = get_option('atlas_dmsg_settings');
    234        
     235
    235236        // Use WordPress timezone
    236237        $timezone = new DateTimeZone(wp_timezone_string());
    237238        $server_datetime = new DateTime('now', $timezone);
    238        
     239
    239240        // Apply configurable time offset (default to 0 if not set)
    240241        $time_offset = intval($settings['time_offset'] ?? 0);
     
    247248            }
    248249        }
    249        
     250
    250251        $server_timestamp = $server_datetime->getTimestamp();
    251        
     252
    252253        $scenarios = isset($settings['scenarios']) ? $this->sanitize_scenarios($settings['scenarios']) : array();
    253        
     254
    254255        // Filter out inactive scenarios
    255         $active_scenarios = array_filter($scenarios, fn($scenario) => 
     256        $active_scenarios = array_filter($scenarios, fn($scenario) =>
    256257            isset($scenario['active']) && $scenario['active'] == 1
    257258        );
    258        
     259
    259260        // Get layout settings to send to frontend
    260261        $layout_settings = isset($settings['layouts']) ? $settings['layouts'] : array();
    261        
     262
    262263        // Important: Include current page info so JavaScript can filter appropriately
    263264        $current_page = $this->get_current_page_type();
    264        
    265         return array(
    266             'scenarios'      => array_values($active_scenarios), // Reset array keys
    267             'serverTime'     => $server_timestamp,
    268             'currentPage'    => $current_page, // Send current page type to JS
     265
     266        // Create WP_REST_Response with no-cache headers for LiteSpeed/other caching systems
     267        $response = new WP_REST_Response( array(
     268            'scenarios'       => array_values($active_scenarios), // Reset array keys
     269            'serverTime'      => $server_timestamp,
     270            'currentPage'     => $current_page, // Send current page type to JS
    269271            'layout_settings' => $layout_settings // Send layout settings to JS
    270         );
     272        ) );
     273
     274        // No-cache headers to bypass LiteSpeed and other caching systems
     275        $response->set_headers( array(
     276            'Cache-Control'             => 'no-cache, no-store, must-revalidate, max-age=0',
     277            'Pragma'                    => 'no-cache',
     278            'Expires'                   => '0',
     279            'X-LiteSpeed-Cache-Control' => 'no-cache', // LiteSpeed-specific header
     280        ) );
     281
     282        return $response;
    271283    }
    272284
  • atlas-dynamic-messages-for-woocommerce/trunk/public/js/atlas-dynamic-messages.js

    r3341139 r3408054  
    2323    }
    2424
    25     fetch(atlasDmsgVars.apiUrl, {
     25    // Add cache-busting parameter to bypass LiteSpeed/other server caches
     26    fetch(atlasDmsgVars.apiUrl + '?_=' + Date.now(), {
    2627        headers: {
    2728            'X-WP-Nonce': atlasDmsgVars.nonce
Note: See TracChangeset for help on using the changeset viewer.