Plugin Directory

Changeset 3253405


Ignore:
Timestamp:
03/10/2025 02:59:57 PM (13 months ago)
Author:
marknokes
Message:

2.8.3

  • Improve option handling
Location:
cache-using-gzip
Files:
20 added
3 edited

Legend:

Unmodified
Added
Removed
  • cache-using-gzip/trunk/cache-using-gzip.php

    r3235050 r3253405  
    22/**
    33 * Plugin Name: Cache Using Gzip
    4  * Version: 2.8.2
    5  * Description: Creates gzipped files on your server to immensly improve page speed for site visitors
     4 * Version: 2.8.3
     5 * Description: Creates gzip files on your server to immensly improve page speed for site visitors
    66 * Author: Cache Using Gzip
    77 * Author URI: https://wpgzipcache.com
  • cache-using-gzip/trunk/classes/CUGZ/class-cugz-gzip-cache.php

    r3235050 r3253405  
    192192
    193193    public static function cugz_get_option($option_name)
    194     {
    195         if(self::cugz_skip_option(self::$options[$option_name])) return false;
    196 
    197         $cached_value = wp_cache_get($option_name, 'options');
    198        
    199         if ($cached_value === false) {
    200 
    201             $option_value = get_option($option_name);
    202 
    203             if ($option_value !== false) {
    204 
    205                 wp_cache_set($option_name, $option_value, 'options');
    206 
    207             }
    208 
    209             return $option_value;
    210 
    211         } else {
    212 
    213             return $cached_value;
    214 
    215         }
    216     }
     194    {
     195        if(isset(self::$options[$option_name]) && self::cugz_skip_option(self::$options[$option_name])) return false;
     196
     197        $cached_value = wp_cache_get($option_name, 'options');
     198       
     199        if ($cached_value === false) {
     200
     201            $option_value = get_option($option_name);
     202
     203            if ($option_value === false) {
     204
     205                $option_value = self::$options[$option_name]['default'] ?? false;
     206
     207                add_option($option_name, $option_value, '', false);
     208
     209            }
     210
     211            wp_cache_set($option_name, $option_value, 'options');
     212
     213            return $option_value;
     214
     215        } else {
     216
     217            return maybe_unserialize($cached_value);
     218
     219        }
     220    }
    217221
    218222    public function cugz_notice($message, $type)
  • cache-using-gzip/trunk/readme.txt

    r3235057 r3253405  
    55Tested up to: 6.7.2
    66Requires PHP: 7.4
    7 Stable tag: 2.8.2
     7Stable tag: 2.8.3
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Creates gzipped files on your server to immensly improve page speed for site visitors
     11Creates gzip files on your server to immensly improve page speed for site visitors
    1212
    1313== Description ==
     
    5858
    5959== Changelog ==
     60
     61= 2.8.3 =
     62* Improve option handling
    6063
    6164= 2.8.2 =
Note: See TracChangeset for help on using the changeset viewer.