Skip to content

Commit

Permalink
New build
Browse files Browse the repository at this point in the history
  • Loading branch information
jeherve committed Aug 26, 2020
1 parent 5e9c2c2 commit 7bed1f8
Show file tree
Hide file tree
Showing 20 changed files with 525 additions and 522 deletions.
18 changes: 6 additions & 12 deletions class.jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -5777,9 +5777,15 @@ public static function check_privacy( $file ) {
/**
* Helper method for multicall XMLRPC.
*
* @deprecated since 8.9.0
* @see Automattic\\Jetpack\\Connection\\Xmlrpc_Async_Call::add_call()
*
* @param ...$args Args for the async_call.
*/
public static function xmlrpc_async_call( ...$args ) {

_deprecated_function( 'Jetpack::xmlrpc_async_call', 'jetpack-8.9.0', 'Automattic\\Jetpack\\Connection\\Xmlrpc_Async_Call::add_call' );

global $blog_id;
static $clients = array();

Expand Down Expand Up @@ -7163,18 +7169,6 @@ public static function get_calypso_host() {
}
}

/**
* Checks whether or not TOS has been agreed upon.
* Will return true if a user has clicked to register, or is already connected.
*/
public static function jetpack_tos_agreed() {
_deprecated_function( 'Jetpack::jetpack_tos_agreed', 'Jetpack 7.9.0', '\Automattic\Jetpack\Terms_Of_Service->has_agreed' );

$terms_of_service = new Terms_Of_Service();
return $terms_of_service->has_agreed();

}

/**
* Handles activating default modules as well general cleanup for the new connection.
*
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: 8.9-beta
* Version: 8.9-beta2
* Author URI: https://jetpack.com
* License: GPL2+
* Text Domain: jetpack
Expand All @@ -16,7 +16,7 @@

define( 'JETPACK__MINIMUM_WP_VERSION', '5.4' );
define( 'JETPACK__MINIMUM_PHP_VERSION', '5.6' );
define( 'JETPACK__VERSION', '8.9-beta' );
define( 'JETPACK__VERSION', '8.9-beta2' );
define( 'JETPACK_MASTER_USER', true );
define( 'JETPACK__API_VERSION', 1 );
define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@

// POST /sites/%s/sync
class Jetpack_JSON_API_Sync_Endpoint extends Jetpack_JSON_API_Endpoint {
protected $needed_capabilities = 'manage_options';

/**
* Sync endpoints allow authentication via a blog token therefore require no user capabilities.
*
* @var array
*/
protected $needed_capabilities = array();

protected function validate_call( $_blog_id, $capability, $check_manage_active = true ) {
return parent::validate_call( $_blog_id, $capability, false );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
use Automattic\Jetpack\Sync\Defaults;

class WPCOM_JSON_API_Get_Option_Endpoint extends Jetpack_JSON_API_Endpoint {

protected $needed_capabilities = 'manage_options';
/**
* This endpoint allows authentication via a blog token therefore requires no user capabilities.
*
* @var array
*/
protected $needed_capabilities = array();

public $option_name;
public $site_option;
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 ComposerAutoloaderInitdfe0ed5e7113adc3f091baa06093e16d::getLoader();
return ComposerAutoloaderInit569b6b55d20a0867af23e7e7aed8d2ba::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\jp406c107db405d3e59691fcfa0989a5e0;
namespace Automattic\Jetpack\Autoloader\jpb1600f044876c39fb460ee2acd748d03;

// phpcs:ignore

Expand Down
11 changes: 8 additions & 3 deletions vendor/automattic/jetpack-config/src/class-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,21 @@ protected function enable_tos() {
}

/**
* Enables the tracking feature. Depends on the Terms of Service package, so enables it too.
* Enables the tracking feature.
* Depends on the Terms of Service package and the Connection package,
* so enables them too.
*/
protected function enable_tracking() {

// Enabling dependencies.
$this->ensure_feature( 'tos' );
$this->ensure_feature( 'connection' );

$terms_of_service = new Terms_Of_Service();
$tracking = new Plugin_Tracking();
if ( $terms_of_service->has_agreed() ) {
$connection = new Manager();
$tracking = new Plugin_Tracking( $connection );

if ( $terms_of_service->has_agreed() && $connection->is_user_connected() ) {
add_action( 'init', array( $tracking, 'init' ) );
} else {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace Automattic\Jetpack;

use Automattic\Jetpack\Connection\Manager;
use Automattic\Jetpack\Status;

/**
Expand Down Expand Up @@ -55,16 +54,23 @@ public function reject() {
* The following conditions have to be met in order to agree to the terms of service.
* 1. The master user has gone though the connect flow.
* 2. The site is not in dev mode.
* 3. The master user of the site is still connected.
* 3. The master user of the site is still connected (deprecated @since 8.9.0).
*
* @return bool
*/
public function has_agreed() {
if ( $this->is_offline_mode() ) {
return false;
}

return $this->get_raw_has_agreed() || $this->is_active();
/**
* Before 8.9.0 we used to also check if the master user of the site is connected
* by calling the Connection related `is_active` method.
* As of 8.9.0 we have removed this check in order to resolve the
* circular dependencies it was introducing to composer packages.
*
* @since 8.9.0
*/
return $this->get_raw_has_agreed();
}

/**
Expand All @@ -77,16 +83,6 @@ protected function is_offline_mode() {
return ( new Status() )->is_offline_mode();
}

/**
* Tells us if the site is connected.
* Abstracted for testing purposes.
*
* @return bool
*/
protected function is_active() {
return ( new Manager() )->is_active();
}

/**
* Gets just the Jetpack Option that contains the terms of service state.
* Abstracted for testing purposes.
Expand Down
5 changes: 4 additions & 1 deletion vendor/automattic/jetpack-tracking/src/class-tracking.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ public function tracks_record_event( $user, $event_name, $properties = array(),
}
$terms_of_service = new Terms_Of_Service();
// Don't track users who have opted out or not agreed to our TOS, or are not running an active Jetpack.
if ( ! $terms_of_service->has_agreed() ) {
if (
! $terms_of_service->has_agreed()
|| ! $this->connection->is_user_connected()
) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion vendor/class-autoloader-handler.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\jp406c107db405d3e59691fcfa0989a5e0;
namespace Automattic\Jetpack\Autoloader\jpb1600f044876c39fb460ee2acd748d03;

// phpcs:ignore

Expand Down
2 changes: 1 addition & 1 deletion vendor/class-classes-handler.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\jp406c107db405d3e59691fcfa0989a5e0;
namespace Automattic\Jetpack\Autoloader\jpb1600f044876c39fb460ee2acd748d03;

// phpcs:ignore

Expand Down
2 changes: 1 addition & 1 deletion vendor/class-files-handler.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\jp406c107db405d3e59691fcfa0989a5e0;
namespace Automattic\Jetpack\Autoloader\jpb1600f044876c39fb460ee2acd748d03;

// phpcs:ignore

Expand Down
2 changes: 1 addition & 1 deletion vendor/class-plugins-handler.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\jp406c107db405d3e59691fcfa0989a5e0;
namespace Automattic\Jetpack\Autoloader\jpb1600f044876c39fb460ee2acd748d03;

// phpcs:ignore

Expand Down
2 changes: 1 addition & 1 deletion vendor/class-version-selector.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\jp406c107db405d3e59691fcfa0989a5e0;
namespace Automattic\Jetpack\Autoloader\jpb1600f044876c39fb460ee2acd748d03;

// phpcs:ignore

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 ComposerAutoloaderInitdfe0ed5e7113adc3f091baa06093e16d
class ComposerAutoloaderInit569b6b55d20a0867af23e7e7aed8d2ba
{
private static $loader;

Expand All @@ -22,15 +22,15 @@ public static function getLoader()
return self::$loader;
}

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

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

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

if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInitdfe0ed5e7113adc3f091baa06093e16d::$files;
$includeFiles = Composer\Autoload\ComposerStaticInit569b6b55d20a0867af23e7e7aed8d2ba::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequiredfe0ed5e7113adc3f091baa06093e16d($fileIdentifier, $file);
composerRequire569b6b55d20a0867af23e7e7aed8d2ba($fileIdentifier, $file);
}

return $loader;
}
}

function composerRequiredfe0ed5e7113adc3f091baa06093e16d($fileIdentifier, $file)
function composerRequire569b6b55d20a0867af23e7e7aed8d2ba($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
Expand Down
8 changes: 4 additions & 4 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 ComposerStaticInitdfe0ed5e7113adc3f091baa06093e16d
class ComposerStaticInit569b6b55d20a0867af23e7e7aed8d2ba
{
public static $files = array (
'bce4ecd6aabb2a2948e06d0e2c4ea9a6' => __DIR__ . '/..' . '/automattic/jetpack-connection/legacy/load-ixr.php',
Expand Down Expand Up @@ -122,9 +122,9 @@ class ComposerStaticInitdfe0ed5e7113adc3f091baa06093e16d
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitdfe0ed5e7113adc3f091baa06093e16d::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitdfe0ed5e7113adc3f091baa06093e16d::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitdfe0ed5e7113adc3f091baa06093e16d::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit569b6b55d20a0867af23e7e7aed8d2ba::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit569b6b55d20a0867af23e7e7aed8d2ba::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit569b6b55d20a0867af23e7e7aed8d2ba::$classMap;

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

0 comments on commit 7bed1f8

Please sign in to comment.