Skip to content

Commit

Permalink
New build
Browse files Browse the repository at this point in the history
  • Loading branch information
jeherve committed Jan 18, 2021
1 parent cf2e3ae commit 4150c43
Show file tree
Hide file tree
Showing 29 changed files with 177 additions and 112 deletions.
10 changes: 9 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@

**This is a list detailing changes for all Jetpack releases.**

= 9.3.2 =

* Release date: January 19, 2021

**Enhancements**

* Synchronization: improvements to the way data is synchronized back to WordPress.com.

= 9.3.1 =

* Release date:
* Release date: January 14, 2021

**Bug fixes**

Expand Down
4 changes: 2 additions & 2 deletions jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://jetpack.com
* Description: Bring the power of the WordPress.com cloud to your self-hosted WordPress. Jetpack enables you to connect your blog to a WordPress.com account to use the powerful features normally only available to WordPress.com users.
* Author: Automattic
* Version: 9.3.1
* Version: 9.3.2
* Author URI: https://jetpack.com
* License: GPL2+
* Text Domain: jetpack
Expand All @@ -16,7 +16,7 @@

define( 'JETPACK__MINIMUM_WP_VERSION', '5.5' );
define( 'JETPACK__MINIMUM_PHP_VERSION', '5.6' );
define( 'JETPACK__VERSION', '9.3.1' );
define( 'JETPACK__VERSION', '9.3.2' );

/**
* Constant used to fetch the connection owner token
Expand Down
12 changes: 10 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
=== Jetpack - WP Security, Backup, Speed, & Growth ===
Contributors: automattic, adamkheckler, aduth, akirk, allendav, alternatekev, andy, annezazu, apeatling, azaozz, batmoo, barry, beaulebens, biskobe, blobaugh, brbrr, cainm, cena, cfinke, chaselivingston, chellycat, clickysteve, csonnek, danielbachhuber, davoraltman, daniloercoli, delawski, designsimply, dllh, drawmyface, dsmart, dzver, ebinnion, egregor, eliorivero, enej, eoigal, erania-pinnera, ethitter, fgiannar, gcorne, georgestephanis, gibrown, goldsounds, hew, hugobaeta, hypertextranch, iammattthomas, iandunn, jblz, jasmussen, jeffgolenski, jeherve, jenhooks, jenia, jessefriedman, jgs, jkudish, jmdodd, joanrho, johnjamesjacoby, jshreve, kbrownkd, keoshi, koke, kraftbj, lancewillett, leogermani, lschuyler, macmanx, martinremy, matt, matveb, mattwiebe, maverick3x6, mcsf, mdawaffe, mdbitz, MichaelArestad, migueluy, mikeyarce, mkaz, nancythanki, nickmomrik, obenland, oskosk, pento, professor44, rachelsquirrel, rdcoll, ryancowles, richardmuscat, richardmtl, robertbpugh, roccotripaldi, samhotchkiss, scarstocea, scottsweb, sdquirk, sermitr, simison, stephdau, tmoorewp, tyxla, Viper007Bond, westi, yoavf, zinigor
Tags: WP, backup, social, AMP, WooCommerce, malware, scan, spam, CDN, social
Stable tag: 9.3.1
Stable tag: 9.3.2
Requires at least: 5.5
Requires PHP: 5.6
Tested up to: 5.6
Expand Down Expand Up @@ -239,9 +239,17 @@ Our Cookie and Consent Banner can help you comply with GDPR. The European Union

== Changelog ==

= 9.3.2 =

* Release date: January 19, 2021

**Enhancements**

* Synchronization: improvements to the way data is synchronized back to WordPress.com.

= 9.3.1 =

* Release date:
* Release date: January 14, 2021

**Bug fixes**

Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit0c2a830fc5e83fd354fddd8ce525ab7d::getLoader();
return ComposerAutoloaderInite12a77269bbc61c939280ef237e26c51::getLoader();
2 changes: 1 addition & 1 deletion vendor/autoload_packages.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package automattic/jetpack-autoloader
*/

namespace Automattic\Jetpack\Autoloader\jp0c2a830fc5e83fd354fddd8ce525ab7d;
namespace Automattic\Jetpack\Autoloader\jpe12a77269bbc61c939280ef237e26c51;

// phpcs:ignore

Expand Down
19 changes: 13 additions & 6 deletions vendor/automattic/jetpack-sync/src/class-lock.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ class Lock {

/**
* Default Lifetime of the lock.
* This is the expiration value as such we are setting it high to handle cases where there are
* long running requests. Short expiration value leads to concurrent requests and performance issues.
*
* @access public
*
* @var int
*/
const LOCK_TRANSIENT_EXPIRY = 15; // Seconds.
const LOCK_TRANSIENT_EXPIRY = 300; // Seconds.

/**
* Attempt to lock.
Expand All @@ -42,24 +44,29 @@ class Lock {
public function attempt( $name, $expiry = self::LOCK_TRANSIENT_EXPIRY ) {
$name = self::LOCK_PREFIX . $name;
$locked_time = get_option( $name );

if ( $locked_time ) {
if ( microtime( true ) < $locked_time ) {
return false;
}
}
update_option( $name, microtime( true ) + $expiry );
$locked_time = microtime( true ) + $expiry;
update_option( $name, $locked_time );

return true;
return $locked_time;
}

/**
* Remove the lock.
*
* @access public
*
* @param string $name lock name.
* @param string $name lock name.
* @param bool|float $lock_expiration lock expiration.
*/
public function remove( $name ) {
delete_option( self::LOCK_PREFIX . $name );
public function remove( $name, $lock_expiration = false ) {
if ( true === $lock_expiration || (string) get_option( self::LOCK_PREFIX . $name ) === (string) $lock_expiration ) {
delete_option( self::LOCK_PREFIX . $name );
}
}
}
6 changes: 5 additions & 1 deletion vendor/automattic/jetpack-sync/src/class-replicastore.php
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,11 @@ public function checksum_histogram( $table, $buckets = null, $start_id = null, $
return $range_edges;
}

$object_count = $range_edges['item_count'];
$object_count = (int) $range_edges['item_count'];

if ( 0 === $object_count ) {
return array();
}

$bucket_size = (int) ceil( $object_count / $buckets );
$previous_max_id = max( 0, $range_edges['min_range'] );
Expand Down
6 changes: 6 additions & 0 deletions vendor/automattic/jetpack-sync/src/class-sender.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,12 @@ public function do_full_sync() {
if ( ! Settings::get_setting( 'full_sync_sender_enabled' ) ) {
return;
}

// Don't sync if request is marked as read only.
if ( Constants::is_true( 'JETPACK_SYNC_READ_ONLY' ) ) {
return new \WP_Error( 'jetpack_sync_read_only' );
}

$this->continue_full_sync_enqueue();
// immediate full sync sends data in continue_full_sync_enqueue.
if ( false === strpos( get_class( $sync_module ), 'Full_Sync_Immediately' ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public function is_finished() {
*/
public function reset_data() {
$this->clear_status();
( new Lock() )->remove( self::LOCK_NAME );
( new Lock() )->remove( self::LOCK_NAME, true );
}

/**
Expand Down Expand Up @@ -330,13 +330,25 @@ public function continue_enqueuing() {
* @access public
*/
public function continue_sending() {
if ( ! ( new Lock() )->attempt( self::LOCK_NAME ) || ! $this->is_started() || $this->get_status()['finished'] ) {
// Return early if Full Sync is not running.
if ( ! $this->is_started() || $this->get_status()['finished'] ) {
return;
}

// Obtain send Lock.
$lock = new Lock();
$lock_expiration = $lock->attempt( self::LOCK_NAME );

// Return if unable to obtain lock.
if ( false === $lock_expiration ) {
return;
}

// Send Full Sync actions.
$this->send();

( new Lock() )->remove( self::LOCK_NAME );
// Remove lock.
$lock->remove( self::LOCK_NAME, $lock_expiration );
}

/**
Expand Down
18 changes: 15 additions & 3 deletions vendor/automattic/jetpack-sync/src/modules/class-full-sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,25 @@ public function start( $module_configs = null ) {
* @param array $configs Full sync configuration for all sync modules.
*/
public function continue_enqueuing( $configs = null ) {
if ( ! $this->is_started() || ! ( new Lock() )->attempt( self::ENQUEUE_LOCK_NAME ) || $this->get_status_option( 'queue_finished' ) ) {
// Return early if not in progress.
if ( ! $this->get_status_option( 'started' ) || $this->get_status_option( 'queue_finished' ) ) {
return;
}

// Attempt to obtain lock.
$lock = new Lock();
$lock_expiration = $lock->attempt( self::ENQUEUE_LOCK_NAME );

// Return if unable to obtain lock.
if ( false === $lock_expiration ) {
return;
}

// enqueue full sync actions.
$this->enqueue( $configs );

( new Lock() )->remove( self::ENQUEUE_LOCK_NAME );
// Remove lock.
$lock->remove( self::ENQUEUE_LOCK_NAME, $lock_expiration );
}

/**
Expand Down Expand Up @@ -612,7 +624,7 @@ public function clear_status() {
public function reset_data() {
$this->clear_status();
$this->delete_config();
( new Lock() )->remove( self::ENQUEUE_LOCK_NAME );
( new Lock() )->remove( self::ENQUEUE_LOCK_NAME, true );

$listener = Listener::get_instance();
$listener->get_full_sync_queue()->reset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,14 @@ private function build_checksum_query( $range_from = null, $range_to = null, $fi
$salt = $wpdb->prepare( '%s', $this->salt ); // TODO escape or prepare statement.

// Prepare the compound key.
$key_fields = implode( ',', $this->key_fields );
$key_fields = array();

// Prefix the fields with the table name, to avoid clashes in queries with sub-queries (e.g. meta tables).
foreach ( $this->key_fields as $field ) {
$key_fields[] = $this->table . '.' . $field;
}

$key_fields = implode( ',', $key_fields );

// Prepare the checksum fields.
$checksum_fields_string = implode( ',', array_merge( $this->checksum_fields, array( $salt ) ) );
Expand All @@ -431,7 +438,7 @@ private function build_checksum_query( $range_from = null, $range_to = null, $fi
if ( $granular_result ) {
// TODO uniq the fields as sometimes(most) range_index is the key and there's no need to select the same field twice.
$additional_fields = "
{$this->range_field} as range_index,
{$this->table}.{$this->range_field} as range_index,
{$key_fields},
";
}
Expand Down Expand Up @@ -469,6 +476,7 @@ private function build_checksum_query( $range_from = null, $range_to = null, $fi
if ( $granular_result ) {
$query .= "
GROUP BY {$key_fields}
LIMIT 9999999
";
}

Expand Down
10 changes: 5 additions & 5 deletions vendor/composer/InstalledVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class InstalledVersions
'aliases' =>
array (
),
'reference' => '229695368def0e1943a0b6788c544fc94e879ac1',
'reference' => 'b977eff5338271f4a9dc73b3014d6f43385b74fc',
'name' => 'automattic/jetpack',
),
'versions' =>
Expand All @@ -41,7 +41,7 @@ class InstalledVersions
'aliases' =>
array (
),
'reference' => '229695368def0e1943a0b6788c544fc94e879ac1',
'reference' => 'b977eff5338271f4a9dc73b3014d6f43385b74fc',
),
'automattic/jetpack-a8c-mc-stats' =>
array (
Expand Down Expand Up @@ -243,12 +243,12 @@ class InstalledVersions
),
'automattic/jetpack-sync' =>
array (
'pretty_version' => 'v1.19.1',
'version' => '1.19.1.0',
'pretty_version' => 'v1.19.4',
'version' => '1.19.4.0',
'aliases' =>
array (
),
'reference' => '25f3e1723230922f6a396e1184a2f17a6ec82f72',
'reference' => '2748a94b6731a1bf757824737f31ee3088ff8871',
),
'automattic/jetpack-terms-of-service' =>
array (
Expand Down
14 changes: 7 additions & 7 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit0c2a830fc5e83fd354fddd8ce525ab7d
class ComposerAutoloaderInite12a77269bbc61c939280ef237e26c51
{
private static $loader;

Expand All @@ -24,15 +24,15 @@ public static function getLoader()

require __DIR__ . '/platform_check.php';

spl_autoload_register(array('ComposerAutoloaderInit0c2a830fc5e83fd354fddd8ce525ab7d', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInite12a77269bbc61c939280ef237e26c51', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit0c2a830fc5e83fd354fddd8ce525ab7d', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInite12a77269bbc61c939280ef237e26c51', 'loadClassLoader'));

$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';

call_user_func(\Composer\Autoload\ComposerStaticInit0c2a830fc5e83fd354fddd8ce525ab7d::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInite12a77269bbc61c939280ef237e26c51::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
Expand All @@ -44,19 +44,19 @@ public static function getLoader()
$loader->register(true);

if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit0c2a830fc5e83fd354fddd8ce525ab7d::$files;
$includeFiles = Composer\Autoload\ComposerStaticInite12a77269bbc61c939280ef237e26c51::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire0c2a830fc5e83fd354fddd8ce525ab7d($fileIdentifier, $file);
composerRequiree12a77269bbc61c939280ef237e26c51($fileIdentifier, $file);
}

return $loader;
}
}

function composerRequire0c2a830fc5e83fd354fddd8ce525ab7d($fileIdentifier, $file)
function composerRequiree12a77269bbc61c939280ef237e26c51($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
Expand Down
10 changes: 5 additions & 5 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInit0c2a830fc5e83fd354fddd8ce525ab7d
class ComposerStaticInite12a77269bbc61c939280ef237e26c51
{
public static $files = array (
'bce4ecd6aabb2a2948e06d0e2c4ea9a6' => __DIR__ . '/..' . '/automattic/jetpack-connection/legacy/load-ixr.php',
Expand Down Expand Up @@ -150,10 +150,10 @@ class ComposerStaticInit0c2a830fc5e83fd354fddd8ce525ab7d
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit0c2a830fc5e83fd354fddd8ce525ab7d::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit0c2a830fc5e83fd354fddd8ce525ab7d::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInit0c2a830fc5e83fd354fddd8ce525ab7d::$prefixesPsr0;
$loader->classMap = ComposerStaticInit0c2a830fc5e83fd354fddd8ce525ab7d::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInite12a77269bbc61c939280ef237e26c51::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInite12a77269bbc61c939280ef237e26c51::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInite12a77269bbc61c939280ef237e26c51::$prefixesPsr0;
$loader->classMap = ComposerStaticInite12a77269bbc61c939280ef237e26c51::$classMap;

}, null, ClassLoader::class);
}
Expand Down
Loading

0 comments on commit 4150c43

Please sign in to comment.