Changeset 3408054
- Timestamp:
- 12/02/2025 01:33:51 PM (4 months ago)
- Location:
- atlas-dynamic-messages-for-woocommerce
- Files:
-
- 8 edited
- 1 copied
-
tags/2.4.2 (copied) (copied from atlas-dynamic-messages-for-woocommerce/trunk)
-
tags/2.4.2/README.txt (modified) (5 diffs)
-
tags/2.4.2/atlas-dynamic-messages-for-woocommerce.php (modified) (2 diffs)
-
tags/2.4.2/public/class-atlas-dynamic-messages-public.php (modified) (3 diffs)
-
tags/2.4.2/public/js/atlas-dynamic-messages.js (modified) (1 diff)
-
trunk/README.txt (modified) (5 diffs)
-
trunk/atlas-dynamic-messages-for-woocommerce.php (modified) (2 diffs)
-
trunk/public/class-atlas-dynamic-messages-public.php (modified) (3 diffs)
-
trunk/public/js/atlas-dynamic-messages.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
atlas-dynamic-messages-for-woocommerce/tags/2.4.2/README.txt
r3341139 r3408054 1 1 === Atlas Dynamic Messages for WooCommerce === 2 2 Contributors: malakontask 3 Tags: woocommerce, countdown, shipping, notification, messages, cache-compatible, real-time3 Tags: woocommerce, countdown, shipping, timer, urgency 4 4 Requires at least: 5.0 5 5 Tested up to: 6.8.2 6 6 Requires PHP: 7.4 7 Stable tag: 2.4. 17 Stable tag: 2.4.2 8 8 License: GPL-2.0+ 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.txt 10 10 11 Real-time dynamic countdown messages that work perfectly with ALL caching plugins - WP Rocket, W3 Total Cache, Cloudflare, and more!11 Real-time dynamic countdown messages that work perfectly with ALL caching plugins - LiteSpeed Cache, WP Rocket, W3 Total Cache, Cloudflare, and more! 12 12 13 13 == Description == … … 15 15 **🚀 The ONLY WooCommerce countdown plugin that displays accurate, real-time countdowns even with page caching enabled!** 16 16 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.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 LiteSpeed Cache, WP Rocket, W3 Total Cache, WP Super Cache, Cloudflare, Varnish, or any other caching solution. 18 18 19 19 **Why Atlas Dynamic Messages is Different:** … … 67 67 **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: 68 68 - 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 70 71 - No need to exclude pages from cache 71 72 - Your pages stay cached for optimal performance … … 120 121 - Minimal server load (one API call per page load) 121 122 - 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 122 125 123 126 == Screenshots == … … 131 134 132 135 == 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 133 141 134 142 = 2.4.1 = -
atlas-dynamic-messages-for-woocommerce/tags/2.4.2/atlas-dynamic-messages-for-woocommerce.php
r3341139 r3408054 3 3 * Plugin Name: Atlas Dynamic Messages for WooCommerce 4 4 * 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. 15 * Version: 2.4.2 6 6 * Author: PluginAtlas 7 7 * Author URI: https://pluginatlas.com … … 55 55 56 56 // Define plugin constants 57 define('ATLAS_DMSG_VERSION', '2.4. 1');57 define('ATLAS_DMSG_VERSION', '2.4.2'); 58 58 define('ATLAS_DMSG_PLUGIN_DIR', plugin_dir_path(__FILE__)); 59 59 define('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 45 45 use \DateTimeZone; 46 46 use \DateInterval; 47 use \WP_REST_Response; 47 48 48 49 if (!defined('ABSPATH')) exit; … … 227 228 /** 228 229 * Get scenarios data for REST API 229 * 230 * @return array Scenarios data and server time231 */ 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 { 233 234 $settings = get_option('atlas_dmsg_settings'); 234 235 235 236 // Use WordPress timezone 236 237 $timezone = new DateTimeZone(wp_timezone_string()); 237 238 $server_datetime = new DateTime('now', $timezone); 238 239 239 240 // Apply configurable time offset (default to 0 if not set) 240 241 $time_offset = intval($settings['time_offset'] ?? 0); … … 247 248 } 248 249 } 249 250 250 251 $server_timestamp = $server_datetime->getTimestamp(); 251 252 252 253 $scenarios = isset($settings['scenarios']) ? $this->sanitize_scenarios($settings['scenarios']) : array(); 253 254 254 255 // Filter out inactive scenarios 255 $active_scenarios = array_filter($scenarios, fn($scenario) => 256 $active_scenarios = array_filter($scenarios, fn($scenario) => 256 257 isset($scenario['active']) && $scenario['active'] == 1 257 258 ); 258 259 259 260 // Get layout settings to send to frontend 260 261 $layout_settings = isset($settings['layouts']) ? $settings['layouts'] : array(); 261 262 262 263 // Important: Include current page info so JavaScript can filter appropriately 263 264 $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 269 271 '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; 271 283 } 272 284 -
atlas-dynamic-messages-for-woocommerce/tags/2.4.2/public/js/atlas-dynamic-messages.js
r3341139 r3408054 23 23 } 24 24 25 fetch(atlasDmsgVars.apiUrl, { 25 // Add cache-busting parameter to bypass LiteSpeed/other server caches 26 fetch(atlasDmsgVars.apiUrl + '?_=' + Date.now(), { 26 27 headers: { 27 28 'X-WP-Nonce': atlasDmsgVars.nonce -
atlas-dynamic-messages-for-woocommerce/trunk/README.txt
r3341139 r3408054 1 1 === Atlas Dynamic Messages for WooCommerce === 2 2 Contributors: malakontask 3 Tags: woocommerce, countdown, shipping, notification, messages, cache-compatible, real-time3 Tags: woocommerce, countdown, shipping, timer, urgency 4 4 Requires at least: 5.0 5 5 Tested up to: 6.8.2 6 6 Requires PHP: 7.4 7 Stable tag: 2.4. 17 Stable tag: 2.4.2 8 8 License: GPL-2.0+ 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.txt 10 10 11 Real-time dynamic countdown messages that work perfectly with ALL caching plugins - WP Rocket, W3 Total Cache, Cloudflare, and more!11 Real-time dynamic countdown messages that work perfectly with ALL caching plugins - LiteSpeed Cache, WP Rocket, W3 Total Cache, Cloudflare, and more! 12 12 13 13 == Description == … … 15 15 **🚀 The ONLY WooCommerce countdown plugin that displays accurate, real-time countdowns even with page caching enabled!** 16 16 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.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 LiteSpeed Cache, WP Rocket, W3 Total Cache, WP Super Cache, Cloudflare, Varnish, or any other caching solution. 18 18 19 19 **Why Atlas Dynamic Messages is Different:** … … 67 67 **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: 68 68 - 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 70 71 - No need to exclude pages from cache 71 72 - Your pages stay cached for optimal performance … … 120 121 - Minimal server load (one API call per page load) 121 122 - 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 122 125 123 126 == Screenshots == … … 131 134 132 135 == 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 133 141 134 142 = 2.4.1 = -
atlas-dynamic-messages-for-woocommerce/trunk/atlas-dynamic-messages-for-woocommerce.php
r3341139 r3408054 3 3 * Plugin Name: Atlas Dynamic Messages for WooCommerce 4 4 * 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. 15 * Version: 2.4.2 6 6 * Author: PluginAtlas 7 7 * Author URI: https://pluginatlas.com … … 55 55 56 56 // Define plugin constants 57 define('ATLAS_DMSG_VERSION', '2.4. 1');57 define('ATLAS_DMSG_VERSION', '2.4.2'); 58 58 define('ATLAS_DMSG_PLUGIN_DIR', plugin_dir_path(__FILE__)); 59 59 define('ATLAS_DMSG_PLUGIN_URL', plugin_dir_url(__FILE__)); -
atlas-dynamic-messages-for-woocommerce/trunk/public/class-atlas-dynamic-messages-public.php
r3341139 r3408054 45 45 use \DateTimeZone; 46 46 use \DateInterval; 47 use \WP_REST_Response; 47 48 48 49 if (!defined('ABSPATH')) exit; … … 227 228 /** 228 229 * Get scenarios data for REST API 229 * 230 * @return array Scenarios data and server time231 */ 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 { 233 234 $settings = get_option('atlas_dmsg_settings'); 234 235 235 236 // Use WordPress timezone 236 237 $timezone = new DateTimeZone(wp_timezone_string()); 237 238 $server_datetime = new DateTime('now', $timezone); 238 239 239 240 // Apply configurable time offset (default to 0 if not set) 240 241 $time_offset = intval($settings['time_offset'] ?? 0); … … 247 248 } 248 249 } 249 250 250 251 $server_timestamp = $server_datetime->getTimestamp(); 251 252 252 253 $scenarios = isset($settings['scenarios']) ? $this->sanitize_scenarios($settings['scenarios']) : array(); 253 254 254 255 // Filter out inactive scenarios 255 $active_scenarios = array_filter($scenarios, fn($scenario) => 256 $active_scenarios = array_filter($scenarios, fn($scenario) => 256 257 isset($scenario['active']) && $scenario['active'] == 1 257 258 ); 258 259 259 260 // Get layout settings to send to frontend 260 261 $layout_settings = isset($settings['layouts']) ? $settings['layouts'] : array(); 261 262 262 263 // Important: Include current page info so JavaScript can filter appropriately 263 264 $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 269 271 '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; 271 283 } 272 284 -
atlas-dynamic-messages-for-woocommerce/trunk/public/js/atlas-dynamic-messages.js
r3341139 r3408054 23 23 } 24 24 25 fetch(atlasDmsgVars.apiUrl, { 25 // Add cache-busting parameter to bypass LiteSpeed/other server caches 26 fetch(atlasDmsgVars.apiUrl + '?_=' + Date.now(), { 26 27 headers: { 27 28 'X-WP-Nonce': atlasDmsgVars.nonce
Note: See TracChangeset
for help on using the changeset viewer.