Plugin Directory

Changeset 3452186


Ignore:
Timestamp:
02/02/2026 02:40:54 PM (8 weeks ago)
Author:
poweredcache
Message:

Update to version 3.7.2 from GitHub

Location:
powered-cache
Files:
2 added
22 edited
1 copied

Legend:

Unmodified
Added
Removed
  • powered-cache/tags/3.7.2/includes/classes/Dependencies/MatthiasMullie/Minify/CSS.php

    r3160589 r3452186  
    1414
    1515use PoweredCache\Dependencies\MatthiasMullie\Minify\Exceptions\FileImportException;
     16use PoweredCache\Dependencies\MatthiasMullie\Minify\Exceptions\PatternMatchException;
    1617use PoweredCache\Dependencies\MatthiasMullie\PathConverter\Converter;
    1718use PoweredCache\Dependencies\MatthiasMullie\PathConverter\ConverterInterface;
     
    110111     * to save HTTP requests.
    111112     *
    112      * @param string   $source The file to combine imports for
    113      * @param string   $content The CSS content to combine imports for
     113     * @param string $source The file to combine imports for
     114     * @param string $content The CSS content to combine imports for
    114115     * @param string[] $parents Parent paths, for circular reference checks
    115116     *
     
    246247     * original file, to save HTTP requests.
    247248     *
    248      * @param string $source  The file to import files for
     249     * @param string $source The file to import files for
    249250     * @param string $content The CSS content to import files for
    250251     *
     
    297298     *
    298299     * @return string The minified data
     300     *
     301     * @throws PatternMatchException
    299302     */
    300303    public function execute($path = null, $parents = array())
     
    358361     *
    359362     * @param ConverterInterface $converter Relative path converter
    360      * @param string             $content  The CSS content to update relative urls for
     363     * @param string $content The CSS content to update relative urls for
    361364     *
    362365     * @return string
     
    591594        // convert `rgb` to `hex`
    592595        $dec = '([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])';
     596
    593597        return preg_replace_callback(
    594598            "/rgb\($dec $dec $dec\)/i",
     
    622626
    623627        // remove alpha channel if it's pointless ..
    624         $content = preg_replace('/' . $tag . '\(\s*([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+\/\s+1(?:(?:\.\d?)*|00%)?\s*\)/i', '$1($2 $3 $4)', $content);
     628        $content = preg_replace('/' . $tag . '\(\s*([^\s)]+)\s+([^\s)]+)\s+([^\s)]+)\s+\/\s+1(?:(?:\.\d?)*|00%)?\s*\)/i', '$1($2 $3 $4)', $content);
    625629
    626630        // replace `transparent` with shortcut ..
    627         $content = preg_replace('/' . $tag . '\(\s*[^\s]+\s+[^\s]+\s+[^\s]+\s+\/\s+0(?:[\.0%]*)?\s*\)/i', '#fff0', $content);
     631        $content = preg_replace('/' . $tag . '\(\s*[^\s)]+\s+[^\s)]+\s+[^\s)]+\s+\/\s+0(?:[\.0%]*)?\s*\)/i', '#fff0', $content);
    628632
    629633        return $content;
     
    733737     *
    734738     * @return string
     739     *
     740     * @throws PatternMatchException
    735741     */
    736742    protected function stripWhitespace($content)
    737743    {
    738744        // remove leading & trailing whitespace
    739         $content = preg_replace('/^\s*/m', '', $content);
    740         $content = preg_replace('/\s*$/m', '', $content);
     745        $content = $this->pregReplace('/^\s*/m', '', $content);
     746        $content = $this->pregReplace('/\s*$/m', '', $content);
    741747
    742748        // replace newlines with a single space
    743         $content = preg_replace('/\s+/', ' ', $content);
     749        $content = $this->pregReplace('/\s+/', ' ', $content);
    744750
    745751        // remove whitespace around meta characters
    746752        // inspired by stackoverflow.com/questions/15195750/minify-compress-css-with-regex
    747         $content = preg_replace('/\s*([\*$~^|]?+=|[{};,>~]|!important\b)\s*/', '$1', $content);
    748         $content = preg_replace('/([\[(:>\+])\s+/', '$1', $content);
    749         $content = preg_replace('/\s+([\]\)>\+])/', '$1', $content);
    750         $content = preg_replace('/\s+(:)(?![^\}]*\{)/', '$1', $content);
     753        $content = $this->pregReplace('/\s*([\*$~^|]?+=|[{};,>~]|!important\b)\s*/', '$1', $content);
     754        $content = $this->pregReplace('/([\[(:>\+])\s+/', '$1', $content);
     755        $content = $this->pregReplace('/\s+([\]\)>\+])/', '$1', $content);
     756        $content = $this->pregReplace('/\s+(:)(?![^\}]*\{)/', '$1', $content);
    751757
    752758        // whitespace around + and - can only be stripped inside some pseudo-
     
    755761        // selectors like `div.weird- p`
    756762        $pseudos = array('nth-child', 'nth-last-child', 'nth-last-of-type', 'nth-of-type');
    757         $content = preg_replace('/:(' . implode('|', $pseudos) . ')\(\s*([+-]?)\s*(.+?)\s*([+-]?)\s*(.*?)\s*\)/', ':$1($2$3$4$5)', $content);
     763        $content = $this->pregReplace('/:(' . implode('|', $pseudos) . ')\(\s*([+-]?)\s*(.+?)\s*([+-]?)\s*(.*?)\s*\)/', ':$1($2$3$4$5)', $content);
    758764
    759765        // remove semicolon/whitespace followed by closing bracket
     
    761767
    762768        return trim($content);
     769    }
     770
     771    /**
     772     * Perform a preg_replace and check for errors.
     773     *
     774     * @param string $pattern Pattern
     775     * @param string $replacement Replacement
     776     * @param string $subject String to process
     777     *
     778     * @return string
     779     *
     780     * @throws PatternMatchException
     781     */
     782    protected function pregReplace($pattern, $replacement, $subject)
     783    {
     784        $result = preg_replace($pattern, $replacement, $subject);
     785        if ($result === null) {
     786            throw PatternMatchException::fromLastError("Failed to replace with pattern '$pattern'");
     787        }
     788
     789        return $result;
    763790    }
    764791
  • powered-cache/tags/3.7.2/includes/classes/Dependencies/MatthiasMullie/Minify/Exception.php

    r2851003 r3452186  
    1818 * @author Matthias Mullie <[email protected]>
    1919 */
    20 abstract class Exception extends \Exception
    21 {
    22 }
     20abstract class Exception extends \Exception {}
  • powered-cache/tags/3.7.2/includes/classes/Dependencies/MatthiasMullie/Minify/Exceptions/BasicException.php

    r2851003 r3452186  
    2020 * @author Matthias Mullie <[email protected]>
    2121 */
    22 abstract class BasicException extends Exception
    23 {
    24 }
     22abstract class BasicException extends Exception {}
  • powered-cache/tags/3.7.2/includes/classes/Dependencies/MatthiasMullie/Minify/Exceptions/FileImportException.php

    r2851003 r3452186  
    1818 * @author Matthias Mullie <[email protected]>
    1919 */
    20 class FileImportException extends BasicException
    21 {
    22 }
     20class FileImportException extends BasicException {}
  • powered-cache/tags/3.7.2/includes/classes/Dependencies/MatthiasMullie/Minify/Exceptions/IOException.php

    r2851003 r3452186  
    1818 * @author Matthias Mullie <[email protected]>
    1919 */
    20 class IOException extends BasicException
    21 {
    22 }
     20class IOException extends BasicException {}
  • powered-cache/tags/3.7.2/includes/classes/Dependencies/MatthiasMullie/Minify/JS.php

    r3160589 r3452186  
    451451     *
    452452     * @param string[] $operators
    453      * @param string   $delimiter
     453     * @param string $delimiter
    454454     *
    455455     * @return string[]
     
    482482     *
    483483     * @param string[] $keywords
    484      * @param string   $delimiter
     484     * @param string $delimiter
    485485     *
    486486     * @return string[]
  • powered-cache/tags/3.7.2/includes/classes/Dependencies/MatthiasMullie/Minify/Minify.php

    r3160589 r3452186  
    1414
    1515use PoweredCache\Dependencies\MatthiasMullie\Minify\Exceptions\IOException;
     16use PoweredCache\Dependencies\MatthiasMullie\Minify\Exceptions\PatternMatchException;
    1617use Psr\Cache\CacheItemInterface;
    1718
     
    231232     *
    232233     * @param string $content The minified data
    233      * @param string $path    The path to save the minified data to
     234     * @param string $path The path to save the minified data to
    234235     *
    235236     * @throws IOException
     
    250251     * If you need that functionality, use a callback instead.
    251252     *
    252      * @param string          $pattern    PCRE pattern
     253     * @param string $pattern PCRE pattern
    253254     * @param string|callable $replacement Replacement value for matched pattern
    254255     */
     
    266267    protected function stripMultilineComments()
    267268    {
    268         // First extract comments we want to keep, so they can be restored later
    269         // PHP only supports $this inside anonymous functions since 5.4
    270269        $minifier = $this;
    271         $callback = function ($match) use ($minifier) {
    272             $count = count($minifier->extracted);
    273             $placeholder = '/*' . $count . '*/';
    274             $minifier->extracted[$placeholder] = $match[0];
    275 
    276             return $placeholder;
    277         };
    278         $this->registerPattern('/
    279             # optional newline
    280             \n?
    281 
    282             # start comment
    283             \/\*
    284 
     270        // Pattern for matching comments that we want to preserve
     271        $keepPattern = '/^
    285272            # comment content
    286273            (?:
     
    294281                @(?:license|preserve)
    295282            )
    296 
    297             # then match to the end of the comment
    298             .*?\*\/\n?
    299 
    300             /ixs', $callback);
    301 
    302         // Then strip all other comments
    303         $this->registerPattern('/\/\*.*?\*\//s', '');
     283            /ixs';
     284        $callback = function ($match) use ($minifier, $keepPattern) {
     285            if (preg_match($keepPattern, $match[1])) {
     286                // Preserve the comment
     287                $count = count($minifier->extracted);
     288                $placeholder = '/*' . $count . '*/';
     289                $minifier->extracted[$placeholder] = $match[0];
     290            } else {
     291                // Discard the comment but keep any single line feed
     292                $placeholder = strncmp($match[0], "\n", 1) === 0 || substr($match[0], -1) === "\n"
     293                    ? "\n"
     294                    : '';
     295            }
     296
     297            return $placeholder;
     298        };
     299
     300        $this->registerPattern('/\n?\/\*(.*?)\*\/\n?/s', $callback);
    304301    }
    305302
     
    315312     *
    316313     * @return string The (manipulated) content
     314     *
     315     * @throws PatternMatchException
    317316     */
    318317    protected function replace($content)
     
    342341
    343342                $match = null;
    344                 if (preg_match($pattern, $content, $match, PREG_OFFSET_CAPTURE, $processedOffset)) {
     343                $matchResult = preg_match($pattern, $content, $match, PREG_OFFSET_CAPTURE, $processedOffset);
     344                if ($matchResult) {
    345345                    $matches[$i] = $match;
    346346
     
    350350                    $positions[$i] = $match[0][1];
    351351                } else {
     352                    if ($matchResult === false) {
     353                        throw PatternMatchException::fromLastError(
     354                            "Failed to match pattern '$pattern' at $processedOffset"
     355                        );
     356                    }
    352357                    // if the pattern couldn't be matched, there's no point in
    353358                    // executing it again in later runs on this same content;
     
    391396     *
    392397     * @param string|callable $replacement Replacement value
    393      * @param array           $match      Match data, in PREG_OFFSET_CAPTURE form
     398     * @param array $match Match data, in PREG_OFFSET_CAPTURE form
    394399     *
    395400     * @return string
     
    446451
    447452        /*
     453         * Quantifier {0,65535} is used instead of *? to avoid exceeding
     454         * backtrack limit with large strings. 65535 is the maximum allowed
     455         * (see https://www.php.net/manual/en/regexp.reference.repetition.php)
     456         * and should be well sufficient for string representations here.
     457         *
    448458         * The \\ messiness explained:
    449459         * * Don't count ' or " as end-of-string if it's escaped (has backslash
     
    457467         * escaped (times 2)
    458468         */
    459         $this->registerPattern('/([' . $chars . '])(.*?(?<!\\\\)(\\\\\\\\)*+)\\1/s', $callback);
     469
     470        $this->registerPattern('/([' . $chars . '])(.{0,65535}?(?<!\\\\)(\\\\\\\\)*+)\\1/s', $callback);
    460471    }
    461472
     
    533544     *
    534545     * @param resource $handler The resource to write to
    535      * @param string   $content The content to write
    536      * @param string   $path    The path to the file (for exception printing only)
     546     * @param string $content The content to write
     547     * @param string $path The path to the file (for exception printing only)
    537548     *
    538549     * @throws IOException
  • powered-cache/tags/3.7.2/includes/package/deliciousbrains/wp-background-processing/classes/wp-background-process.php

    r3302134 r3452186  
    932932     */
    933933    public function get_chain_id() {
    934         if ( empty( $this->chain_id ) && wp_doing_ajax() ) {
     934        if ( empty( $this->chain_id ) && wp_doing_ajax() && isset( $_REQUEST['action'] ) && $_REQUEST['action'] === $this->identifier ) {
    935935            check_ajax_referer( $this->identifier, 'nonce' );
    936936
  • powered-cache/tags/3.7.2/languages/powered-cache.pot

    r3421853 r3452186  
    1 # Copyright (C) 2025 Powered Cache
     1# Copyright (C) 2026 Powered Cache
    22# This file is distributed under the GPL v2 or later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Powered Cache 3.7.1\n"
     5"Project-Id-Version: Powered Cache 3.7.2\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/powered-cache\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-12-17T11:50:28+00:00\n"
     12"POT-Creation-Date: 2026-02-02T14:36:26+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
  • powered-cache/tags/3.7.2/powered-cache.php

    r3421853 r3452186  
    44 * Plugin URI:        https://poweredcache.com
    55 * Description:       Powered Cache is the most powerful caching and performance suite for WordPress, designed to easily improve your PageSpeed and Web Vitals Score.
    6  * Version:           3.7.1
     6 * Version:           3.7.2
    77 * Requires at least: 5.7
    88 * Requires PHP:      7.4
     
    2626
    2727// Useful global constants.
    28 define( 'POWERED_CACHE_VERSION', '3.7.1' );
     28define( 'POWERED_CACHE_VERSION', '3.7.2' );
    2929define( 'POWERED_CACHE_DB_VERSION', '3.4' );
    3030define( 'POWERED_CACHE_PLUGIN_FILE', __FILE__ );
  • powered-cache/tags/3.7.2/readme.txt

    r3421853 r3452186  
    44Requires at least:  5.7
    55Tested up to:  6.9
    6 Stable tag:  3.7.1
     6Stable tag:  3.7.2
    77License: GPLv2 (or later)
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    171171
    172172== Changelog ==
     173
     174= 3.7.2 (February 02, 2026) =
     175- [Fixed] Elementor ajax conflict with background processing.
     176- [Updated] Dependencies.
    173177
    174178= 3.7.1 (December 17, 2025) =
  • powered-cache/trunk/includes/classes/Dependencies/MatthiasMullie/Minify/CSS.php

    r3160589 r3452186  
    1414
    1515use PoweredCache\Dependencies\MatthiasMullie\Minify\Exceptions\FileImportException;
     16use PoweredCache\Dependencies\MatthiasMullie\Minify\Exceptions\PatternMatchException;
    1617use PoweredCache\Dependencies\MatthiasMullie\PathConverter\Converter;
    1718use PoweredCache\Dependencies\MatthiasMullie\PathConverter\ConverterInterface;
     
    110111     * to save HTTP requests.
    111112     *
    112      * @param string   $source The file to combine imports for
    113      * @param string   $content The CSS content to combine imports for
     113     * @param string $source The file to combine imports for
     114     * @param string $content The CSS content to combine imports for
    114115     * @param string[] $parents Parent paths, for circular reference checks
    115116     *
     
    246247     * original file, to save HTTP requests.
    247248     *
    248      * @param string $source  The file to import files for
     249     * @param string $source The file to import files for
    249250     * @param string $content The CSS content to import files for
    250251     *
     
    297298     *
    298299     * @return string The minified data
     300     *
     301     * @throws PatternMatchException
    299302     */
    300303    public function execute($path = null, $parents = array())
     
    358361     *
    359362     * @param ConverterInterface $converter Relative path converter
    360      * @param string             $content  The CSS content to update relative urls for
     363     * @param string $content The CSS content to update relative urls for
    361364     *
    362365     * @return string
     
    591594        // convert `rgb` to `hex`
    592595        $dec = '([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])';
     596
    593597        return preg_replace_callback(
    594598            "/rgb\($dec $dec $dec\)/i",
     
    622626
    623627        // remove alpha channel if it's pointless ..
    624         $content = preg_replace('/' . $tag . '\(\s*([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+\/\s+1(?:(?:\.\d?)*|00%)?\s*\)/i', '$1($2 $3 $4)', $content);
     628        $content = preg_replace('/' . $tag . '\(\s*([^\s)]+)\s+([^\s)]+)\s+([^\s)]+)\s+\/\s+1(?:(?:\.\d?)*|00%)?\s*\)/i', '$1($2 $3 $4)', $content);
    625629
    626630        // replace `transparent` with shortcut ..
    627         $content = preg_replace('/' . $tag . '\(\s*[^\s]+\s+[^\s]+\s+[^\s]+\s+\/\s+0(?:[\.0%]*)?\s*\)/i', '#fff0', $content);
     631        $content = preg_replace('/' . $tag . '\(\s*[^\s)]+\s+[^\s)]+\s+[^\s)]+\s+\/\s+0(?:[\.0%]*)?\s*\)/i', '#fff0', $content);
    628632
    629633        return $content;
     
    733737     *
    734738     * @return string
     739     *
     740     * @throws PatternMatchException
    735741     */
    736742    protected function stripWhitespace($content)
    737743    {
    738744        // remove leading & trailing whitespace
    739         $content = preg_replace('/^\s*/m', '', $content);
    740         $content = preg_replace('/\s*$/m', '', $content);
     745        $content = $this->pregReplace('/^\s*/m', '', $content);
     746        $content = $this->pregReplace('/\s*$/m', '', $content);
    741747
    742748        // replace newlines with a single space
    743         $content = preg_replace('/\s+/', ' ', $content);
     749        $content = $this->pregReplace('/\s+/', ' ', $content);
    744750
    745751        // remove whitespace around meta characters
    746752        // inspired by stackoverflow.com/questions/15195750/minify-compress-css-with-regex
    747         $content = preg_replace('/\s*([\*$~^|]?+=|[{};,>~]|!important\b)\s*/', '$1', $content);
    748         $content = preg_replace('/([\[(:>\+])\s+/', '$1', $content);
    749         $content = preg_replace('/\s+([\]\)>\+])/', '$1', $content);
    750         $content = preg_replace('/\s+(:)(?![^\}]*\{)/', '$1', $content);
     753        $content = $this->pregReplace('/\s*([\*$~^|]?+=|[{};,>~]|!important\b)\s*/', '$1', $content);
     754        $content = $this->pregReplace('/([\[(:>\+])\s+/', '$1', $content);
     755        $content = $this->pregReplace('/\s+([\]\)>\+])/', '$1', $content);
     756        $content = $this->pregReplace('/\s+(:)(?![^\}]*\{)/', '$1', $content);
    751757
    752758        // whitespace around + and - can only be stripped inside some pseudo-
     
    755761        // selectors like `div.weird- p`
    756762        $pseudos = array('nth-child', 'nth-last-child', 'nth-last-of-type', 'nth-of-type');
    757         $content = preg_replace('/:(' . implode('|', $pseudos) . ')\(\s*([+-]?)\s*(.+?)\s*([+-]?)\s*(.*?)\s*\)/', ':$1($2$3$4$5)', $content);
     763        $content = $this->pregReplace('/:(' . implode('|', $pseudos) . ')\(\s*([+-]?)\s*(.+?)\s*([+-]?)\s*(.*?)\s*\)/', ':$1($2$3$4$5)', $content);
    758764
    759765        // remove semicolon/whitespace followed by closing bracket
     
    761767
    762768        return trim($content);
     769    }
     770
     771    /**
     772     * Perform a preg_replace and check for errors.
     773     *
     774     * @param string $pattern Pattern
     775     * @param string $replacement Replacement
     776     * @param string $subject String to process
     777     *
     778     * @return string
     779     *
     780     * @throws PatternMatchException
     781     */
     782    protected function pregReplace($pattern, $replacement, $subject)
     783    {
     784        $result = preg_replace($pattern, $replacement, $subject);
     785        if ($result === null) {
     786            throw PatternMatchException::fromLastError("Failed to replace with pattern '$pattern'");
     787        }
     788
     789        return $result;
    763790    }
    764791
  • powered-cache/trunk/includes/classes/Dependencies/MatthiasMullie/Minify/Exception.php

    r2851003 r3452186  
    1818 * @author Matthias Mullie <[email protected]>
    1919 */
    20 abstract class Exception extends \Exception
    21 {
    22 }
     20abstract class Exception extends \Exception {}
  • powered-cache/trunk/includes/classes/Dependencies/MatthiasMullie/Minify/Exceptions/BasicException.php

    r2851003 r3452186  
    2020 * @author Matthias Mullie <[email protected]>
    2121 */
    22 abstract class BasicException extends Exception
    23 {
    24 }
     22abstract class BasicException extends Exception {}
  • powered-cache/trunk/includes/classes/Dependencies/MatthiasMullie/Minify/Exceptions/FileImportException.php

    r2851003 r3452186  
    1818 * @author Matthias Mullie <[email protected]>
    1919 */
    20 class FileImportException extends BasicException
    21 {
    22 }
     20class FileImportException extends BasicException {}
  • powered-cache/trunk/includes/classes/Dependencies/MatthiasMullie/Minify/Exceptions/IOException.php

    r2851003 r3452186  
    1818 * @author Matthias Mullie <[email protected]>
    1919 */
    20 class IOException extends BasicException
    21 {
    22 }
     20class IOException extends BasicException {}
  • powered-cache/trunk/includes/classes/Dependencies/MatthiasMullie/Minify/JS.php

    r3160589 r3452186  
    451451     *
    452452     * @param string[] $operators
    453      * @param string   $delimiter
     453     * @param string $delimiter
    454454     *
    455455     * @return string[]
     
    482482     *
    483483     * @param string[] $keywords
    484      * @param string   $delimiter
     484     * @param string $delimiter
    485485     *
    486486     * @return string[]
  • powered-cache/trunk/includes/classes/Dependencies/MatthiasMullie/Minify/Minify.php

    r3160589 r3452186  
    1414
    1515use PoweredCache\Dependencies\MatthiasMullie\Minify\Exceptions\IOException;
     16use PoweredCache\Dependencies\MatthiasMullie\Minify\Exceptions\PatternMatchException;
    1617use Psr\Cache\CacheItemInterface;
    1718
     
    231232     *
    232233     * @param string $content The minified data
    233      * @param string $path    The path to save the minified data to
     234     * @param string $path The path to save the minified data to
    234235     *
    235236     * @throws IOException
     
    250251     * If you need that functionality, use a callback instead.
    251252     *
    252      * @param string          $pattern    PCRE pattern
     253     * @param string $pattern PCRE pattern
    253254     * @param string|callable $replacement Replacement value for matched pattern
    254255     */
     
    266267    protected function stripMultilineComments()
    267268    {
    268         // First extract comments we want to keep, so they can be restored later
    269         // PHP only supports $this inside anonymous functions since 5.4
    270269        $minifier = $this;
    271         $callback = function ($match) use ($minifier) {
    272             $count = count($minifier->extracted);
    273             $placeholder = '/*' . $count . '*/';
    274             $minifier->extracted[$placeholder] = $match[0];
    275 
    276             return $placeholder;
    277         };
    278         $this->registerPattern('/
    279             # optional newline
    280             \n?
    281 
    282             # start comment
    283             \/\*
    284 
     270        // Pattern for matching comments that we want to preserve
     271        $keepPattern = '/^
    285272            # comment content
    286273            (?:
     
    294281                @(?:license|preserve)
    295282            )
    296 
    297             # then match to the end of the comment
    298             .*?\*\/\n?
    299 
    300             /ixs', $callback);
    301 
    302         // Then strip all other comments
    303         $this->registerPattern('/\/\*.*?\*\//s', '');
     283            /ixs';
     284        $callback = function ($match) use ($minifier, $keepPattern) {
     285            if (preg_match($keepPattern, $match[1])) {
     286                // Preserve the comment
     287                $count = count($minifier->extracted);
     288                $placeholder = '/*' . $count . '*/';
     289                $minifier->extracted[$placeholder] = $match[0];
     290            } else {
     291                // Discard the comment but keep any single line feed
     292                $placeholder = strncmp($match[0], "\n", 1) === 0 || substr($match[0], -1) === "\n"
     293                    ? "\n"
     294                    : '';
     295            }
     296
     297            return $placeholder;
     298        };
     299
     300        $this->registerPattern('/\n?\/\*(.*?)\*\/\n?/s', $callback);
    304301    }
    305302
     
    315312     *
    316313     * @return string The (manipulated) content
     314     *
     315     * @throws PatternMatchException
    317316     */
    318317    protected function replace($content)
     
    342341
    343342                $match = null;
    344                 if (preg_match($pattern, $content, $match, PREG_OFFSET_CAPTURE, $processedOffset)) {
     343                $matchResult = preg_match($pattern, $content, $match, PREG_OFFSET_CAPTURE, $processedOffset);
     344                if ($matchResult) {
    345345                    $matches[$i] = $match;
    346346
     
    350350                    $positions[$i] = $match[0][1];
    351351                } else {
     352                    if ($matchResult === false) {
     353                        throw PatternMatchException::fromLastError(
     354                            "Failed to match pattern '$pattern' at $processedOffset"
     355                        );
     356                    }
    352357                    // if the pattern couldn't be matched, there's no point in
    353358                    // executing it again in later runs on this same content;
     
    391396     *
    392397     * @param string|callable $replacement Replacement value
    393      * @param array           $match      Match data, in PREG_OFFSET_CAPTURE form
     398     * @param array $match Match data, in PREG_OFFSET_CAPTURE form
    394399     *
    395400     * @return string
     
    446451
    447452        /*
     453         * Quantifier {0,65535} is used instead of *? to avoid exceeding
     454         * backtrack limit with large strings. 65535 is the maximum allowed
     455         * (see https://www.php.net/manual/en/regexp.reference.repetition.php)
     456         * and should be well sufficient for string representations here.
     457         *
    448458         * The \\ messiness explained:
    449459         * * Don't count ' or " as end-of-string if it's escaped (has backslash
     
    457467         * escaped (times 2)
    458468         */
    459         $this->registerPattern('/([' . $chars . '])(.*?(?<!\\\\)(\\\\\\\\)*+)\\1/s', $callback);
     469
     470        $this->registerPattern('/([' . $chars . '])(.{0,65535}?(?<!\\\\)(\\\\\\\\)*+)\\1/s', $callback);
    460471    }
    461472
     
    533544     *
    534545     * @param resource $handler The resource to write to
    535      * @param string   $content The content to write
    536      * @param string   $path    The path to the file (for exception printing only)
     546     * @param string $content The content to write
     547     * @param string $path The path to the file (for exception printing only)
    537548     *
    538549     * @throws IOException
  • powered-cache/trunk/includes/package/deliciousbrains/wp-background-processing/classes/wp-background-process.php

    r3302134 r3452186  
    932932     */
    933933    public function get_chain_id() {
    934         if ( empty( $this->chain_id ) && wp_doing_ajax() ) {
     934        if ( empty( $this->chain_id ) && wp_doing_ajax() && isset( $_REQUEST['action'] ) && $_REQUEST['action'] === $this->identifier ) {
    935935            check_ajax_referer( $this->identifier, 'nonce' );
    936936
  • powered-cache/trunk/languages/powered-cache.pot

    r3421853 r3452186  
    1 # Copyright (C) 2025 Powered Cache
     1# Copyright (C) 2026 Powered Cache
    22# This file is distributed under the GPL v2 or later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Powered Cache 3.7.1\n"
     5"Project-Id-Version: Powered Cache 3.7.2\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/powered-cache\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-12-17T11:50:28+00:00\n"
     12"POT-Creation-Date: 2026-02-02T14:36:26+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
  • powered-cache/trunk/powered-cache.php

    r3421853 r3452186  
    44 * Plugin URI:        https://poweredcache.com
    55 * Description:       Powered Cache is the most powerful caching and performance suite for WordPress, designed to easily improve your PageSpeed and Web Vitals Score.
    6  * Version:           3.7.1
     6 * Version:           3.7.2
    77 * Requires at least: 5.7
    88 * Requires PHP:      7.4
     
    2626
    2727// Useful global constants.
    28 define( 'POWERED_CACHE_VERSION', '3.7.1' );
     28define( 'POWERED_CACHE_VERSION', '3.7.2' );
    2929define( 'POWERED_CACHE_DB_VERSION', '3.4' );
    3030define( 'POWERED_CACHE_PLUGIN_FILE', __FILE__ );
  • powered-cache/trunk/readme.txt

    r3421853 r3452186  
    44Requires at least:  5.7
    55Tested up to:  6.9
    6 Stable tag:  3.7.1
     6Stable tag:  3.7.2
    77License: GPLv2 (or later)
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    171171
    172172== Changelog ==
     173
     174= 3.7.2 (February 02, 2026) =
     175- [Fixed] Elementor ajax conflict with background processing.
     176- [Updated] Dependencies.
    173177
    174178= 3.7.1 (December 17, 2025) =
Note: See TracChangeset for help on using the changeset viewer.