Plugin Directory

Changeset 3000905


Ignore:
Timestamp:
11/23/2023 11:33:58 PM (2 years ago)
Author:
daevsupport
Message:

Update to 1.11.2

Location:
wpsynchro
Files:
143 added
10 edited

Legend:

Unmodified
Added
Removed
  • wpsynchro/trunk/changelog.txt

    r2989449 r3000905  
     1= 1.11.2 =
     2 * Bugfix: Fix PHP timeout issue caused by serialized data, kinda like 1.11.1 hotfix, but caused by another data.
     3 * Improvement: Added more safety against timeout issues in serialized data, so it wont happen again
     4
    15= 1.11.1 =
    26 * Bugfix: Fix PHP timeout issue caused by serialized string search/replace handler, that goes into endless loop for defective serialized strings
  • wpsynchro/trunk/readme.txt

    r2989449 r3000905  
    55Requires at least: 5.2
    66Tested up to: 6.4
    7 Stable tag: 1.11.1
     7Stable tag: 1.11.2
    88Requires PHP: 7.0
    99License: GPLv3
     
    114114== Changelog ==
    115115
     116= 1.11.2 =
     117 * Bugfix: Fix PHP timeout issue caused by serialized data, kinda like 1.11.1 hotfix, but caused by another data.
     118 * Improvement: Added more safety against timeout issues in serialized data, so it wont happen again
     119
    116120= 1.11.1 =
    117121 * Bugfix: Fix PHP timeout issue caused by serialized string search/replace handler, that goes into endless loop for defective serialized strings
     
    142146 * Improvement: Optimize the way database migration was done to better handle large datasets in rows
    143147
    144 = 1.9.1 =
    145  * Bump support for WP 6.2
    146  * Improvement: API now flushes data before returning
    147 
    148 = 1.9.0 =
    149  * Bug: Fix issue where MU plugin did not load properly
    150  * Improvement: Ensure WP 6.1 and PHP 8.1 compatibility
    151  * Improvement: Improve the warning message when different versions of WP is used
    152  * Improvement: Add search/replaces for db for cases where the protocol part of the url is wrong in db
    153  * Improvement: Add check for MU plugin enabled on the target site, when file migration is done, to ensure performance and result
    154  * Improvement: Add "resume" button when migrations fail, which can used to attempt resume, in such cases where a simple timeout is the problem
    155 
    156 
    157148** Only showing the last few releases - See rest of changelog in changelog.txt or in menu "Changelog" **
  • wpsynchro/trunk/src/Database/SerializedStringHandler.php

    r2989449 r3000905  
    1414    const STRING_TOKENIZE_LENGTH = 2;
    1515    const STRING_END_PART = '";';
     16    const MAX_TIME_ALLOWED = 500; // ms
    1617
    1718    /**
     
    2122    public function searchReplaceSerialized(string &$data, array $search_replaces)
    2223    {
     24        $start_time = microtime(true);
     25        $rounds = 0;
    2326        $offset = 0;
    2427        $last_offset = -1;
    2528        while (($data_pos = strpos($data, self::STRING_START_PART, $offset)) !== false) {
     29            $rounds++;
    2630            // Make sure we dont do endless loops, if the serialized content is broken
    2731            if ($offset == $last_offset) {
     
    3034            $last_offset = $offset;
    3135
     36            // Every some rounds, we just check that we have not spent more time here than we should.
     37            if ($rounds % 10000 == 0) {
     38                $current_time = microtime(true);
     39                $time_spent_in_ms = ($current_time - $start_time) * 1000;
     40                if ($time_spent_in_ms > self::MAX_TIME_ALLOWED) {
     41                    // Likely that something is broken, so we break
     42                    throw new SerializedStringException(
     43                        'Skipping large serialized value that could not be search/replaced within reasonable time. First part of string:',
     44                        0,
     45                        substr($data, 0, 200)
     46                    );
     47                }
     48            }
     49
    3250            // Get string length
    3351            $length_start_pos = $data_pos + self::STRING_TOKENIZE_LENGTH;
    3452            $length_end_pos = strpos($data, ':', $length_start_pos);
    3553            $length_length = $length_end_pos - $length_start_pos;
     54            $expected_string_length = substr($data, $length_start_pos, $length_length);
    3655
    3756            // Get string value
    3857            $string_start_pos = $length_start_pos + $length_length + 2;
    39             $string_end_pos = strpos($data, self::STRING_END_PART, $string_start_pos);
     58            $string_end_pos = $string_start_pos + $expected_string_length;
    4059            $string_length = $string_end_pos - $string_start_pos;
     60
     61            // Check that string ends there and if not, something is wrong and we abort
     62            if (substr($data, $string_end_pos, 2) !== self::STRING_END_PART) {
     63                throw new SerializedStringException('Skipping serialized value that is broken, so no search/replaces could be done in this value.', 0, $data);
     64            }
     65
    4166            $string_value = substr($data, $string_start_pos, $string_length);
    4267
  • wpsynchro/trunk/src/Logger/FileLogger.php

    r2989449 r3000905  
    6464        // If context, print that on newline
    6565        if (is_array($context) || is_object($context)) {
    66             $formatted_msg .= PHP_EOL . print_r($context, true) . PHP_EOL;
     66            $formatted_msg .= PHP_EOL . esc_html(print_r($context, true)) . PHP_EOL;
    6767        } elseif (is_string($context) && strlen($context) > 0) {
    68             $formatted_msg .= $context . PHP_EOL;
     68            $formatted_msg .= esc_html($context) . PHP_EOL;
    6969        }
    7070        $complete_path = $this->filepath . $this->filename_prefix . $this->filename;
  • wpsynchro/trunk/src/Utilities/Compatibility/wpsynchro-mu-plugin-compat.php

    r2967397 r3000905  
    1010 */
    1111
     12// phpcs:ignoreFile
    1213define('WPSYNCHRO_MU_COMPATIBILITY_VERSION', '1.0.5');
    1314
  • wpsynchro/trunk/vendor/autoload.php

    r2989449 r3000905  
    55require_once __DIR__ . '/composer/autoload_real.php';
    66
    7 return ComposerAutoloaderInit2ba422472cd5840f904f9f3bdbae873f::getLoader();
     7return ComposerAutoloaderInite718c56e304758bfb3fc87c744bcf1dc::getLoader();
  • wpsynchro/trunk/vendor/composer/autoload_real.php

    r2989449 r3000905  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit2ba422472cd5840f904f9f3bdbae873f
     5class ComposerAutoloaderInite718c56e304758bfb3fc87c744bcf1dc
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit2ba422472cd5840f904f9f3bdbae873f', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInite718c56e304758bfb3fc87c744bcf1dc', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit2ba422472cd5840f904f9f3bdbae873f', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInite718c56e304758bfb3fc87c744bcf1dc', 'loadClassLoader'));
    3030
    3131        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     
    3333            require __DIR__ . '/autoload_static.php';
    3434
    35             call_user_func(\Composer\Autoload\ComposerStaticInit2ba422472cd5840f904f9f3bdbae873f::getInitializer($loader));
     35            call_user_func(\Composer\Autoload\ComposerStaticInite718c56e304758bfb3fc87c744bcf1dc::getInitializer($loader));
    3636        } else {
    3737            $map = require __DIR__ . '/autoload_namespaces.php';
  • wpsynchro/trunk/vendor/composer/autoload_static.php

    r2989449 r3000905  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit2ba422472cd5840f904f9f3bdbae873f
     7class ComposerStaticInite718c56e304758bfb3fc87c744bcf1dc
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    133133    {
    134134        return \Closure::bind(function () use ($loader) {
    135             $loader->prefixLengthsPsr4 = ComposerStaticInit2ba422472cd5840f904f9f3bdbae873f::$prefixLengthsPsr4;
    136             $loader->prefixDirsPsr4 = ComposerStaticInit2ba422472cd5840f904f9f3bdbae873f::$prefixDirsPsr4;
    137             $loader->classMap = ComposerStaticInit2ba422472cd5840f904f9f3bdbae873f::$classMap;
     135            $loader->prefixLengthsPsr4 = ComposerStaticInite718c56e304758bfb3fc87c744bcf1dc::$prefixLengthsPsr4;
     136            $loader->prefixDirsPsr4 = ComposerStaticInite718c56e304758bfb3fc87c744bcf1dc::$prefixDirsPsr4;
     137            $loader->classMap = ComposerStaticInite718c56e304758bfb3fc87c744bcf1dc::$classMap;
    138138
    139139        }, null, ClassLoader::class);
  • wpsynchro/trunk/vendor/composer/installed.php

    r2989449 r3000905  
    66        'install_path' => __DIR__ . '/../../',
    77        'aliases' => array(),
    8         'reference' => '8bd85e12bebcf2b3a76cb79086d56a033d95eff6',
     8        'reference' => 'dfb307600c26c043ac336e699b86b75bcee47d7c',
    99        'name' => 'wpsynchro/wpsynchro',
    1010        'dev' => false,
     
    1717            'install_path' => __DIR__ . '/../../',
    1818            'aliases' => array(),
    19             'reference' => '8bd85e12bebcf2b3a76cb79086d56a033d95eff6',
     19            'reference' => 'dfb307600c26c043ac336e699b86b75bcee47d7c',
    2020            'dev_requirement' => false,
    2121        ),
  • wpsynchro/trunk/wpsynchro.php

    r2989449 r3000905  
    44  Plugin URI: https://wpsynchro.com/home
    55  Description: Professional migration plugin for WordPress - Migration of database and files made easy
    6   Version: 1.11.1
     6  Version: 1.11.2
    77  Author: WPSynchro
    88  Author URI: https://wpsynchro.com
     
    3434} // Exit if accessed directly
    3535
    36 define('WPSYNCHRO_VERSION', '1.11.1');
     36define('WPSYNCHRO_VERSION', '1.11.2');
    3737define('WPSYNCHRO_DB_VERSION', '9');
    3838define('WPSYNCHRO_NEWEST_MU_COMPATIBILITY_VERSION', '1.0.5');
Note: See TracChangeset for help on using the changeset viewer.