Skip to content

Commit

Permalink
New build
Browse files Browse the repository at this point in the history
  • Loading branch information
jeherve committed Sep 16, 2020
1 parent faaec93 commit c8abb61
Show file tree
Hide file tree
Showing 32 changed files with 232 additions and 201 deletions.
2 changes: 1 addition & 1 deletion _inc/build/admin.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-components', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '2cf65bdd63cd97de773825c537d64986');
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-components', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '5c94a36fe21e9c9d901cdc0619ca59d6');
6 changes: 3 additions & 3 deletions _inc/build/admin.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _inc/build/static.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions _inc/lib/debugger/class-jetpack-cxn-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ public static function increase_timeout() {
* @return array
*/
protected function test__blog_token_if_exists() {
if ( ! $this->helper_is_jetpack_connected() ) {
return self::skipped_test(
array(
'name' => __FUNCTION__,
'short_description' => __( 'Jetpack is not connected. No blog token to check.', 'jetpack' ),
)
);
}
$blog_token = $this->helper_get_blog_token();

if ( $blog_token ) {
Expand Down
17 changes: 17 additions & 0 deletions class.jetpack-plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ class Jetpack_Plan {
'videopress',
),
),
'security' => array(
'plans' => array(
'jetpack_security_daily',
'jetpack_security_daily_monthly',
'jetpack_security_realtime',
'jetpack_security_realtime_monthly',
),
'supports' => array(),
),
'business' => array(
'plans' => array(
'jetpack_business',
Expand All @@ -93,6 +102,14 @@ class Jetpack_Plan {
),
'supports' => array(),
),

'complete' => array(
'plans' => array(
'jetpack_complete',
'jetpack_complete_monthly',
),
'supports' => array(),
),
);

/**
Expand Down
11 changes: 9 additions & 2 deletions class.jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -792,8 +792,6 @@ public function configure() {
foreach (
array(
'sync',
'tracking',
'tos',
)
as $feature
) {
Expand Down Expand Up @@ -850,6 +848,15 @@ public function configure() {
require_once JETPACK__PLUGIN_DIR . '_inc/lib/class.jetpack-keyring-service-helper.php';
add_action( 'init', array( 'Jetpack_Keyring_Service_Helper', 'init' ), 9, 0 );
}

if ( ( new Tracking( $this->connection_manager ) )->should_enable_tracking( new Terms_Of_Service(), new Status() ) ) {
add_action( 'init', array( new Plugin_Tracking(), 'init' ) );
} else {
/**
* Initialize tracking right after the user agrees to the terms of service.
*/
add_action( 'jetpack_agreed_to_terms_of_service', array( new Plugin_Tracking(), 'init' ) );
}
}

/**
Expand Down
4 changes: 2 additions & 2 deletions class.photon.php
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ public static function filter_the_content( $content ) {

// If present, replace the link href with a Photoned URL for the full-size image.
if ( ! empty( $images['link_url'][ $index ] ) && self::validate_image_url( $images['link_url'][ $index ] ) ) {
$new_tag = preg_replace( '#(href=["|\'])' . $images['link_url'][ $index ] . '(["|\'])#i', '\1' . jetpack_photon_url( $images['link_url'][ $index ] ) . '\2', $new_tag, 1 );
$new_tag = preg_replace( '#(href=["|\'])' . preg_quote( $images['link_url'][ $index ], '#' ) . '(["|\'])#i', '\1' . jetpack_photon_url( $images['link_url'][ $index ] ) . '\2', $new_tag, 1 );
}

// Supplant the original source value with our Photon URL.
Expand Down Expand Up @@ -600,7 +600,7 @@ public static function filter_the_content( $content ) {
$content = str_replace( $tag, $new_tag, $content );
}
} elseif ( preg_match( '#^http(s)?://i[\d]{1}.wp.com#', $src ) && ! empty( $images['link_url'][ $index ] ) && self::validate_image_url( $images['link_url'][ $index ] ) ) {
$new_tag = preg_replace( '#(href=["|\'])' . $images['link_url'][ $index ] . '(["|\'])#i', '\1' . jetpack_photon_url( $images['link_url'][ $index ] ) . '\2', $tag, 1 );
$new_tag = preg_replace( '#(href=["|\'])' . preg_quote( $images['link_url'][ $index ], '#' ) . '(["|\'])#i', '\1' . jetpack_photon_url( $images['link_url'][ $index ] ) . '\2', $tag, 1 );

$content = str_replace( $tag, $new_tag, $content );
}
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
* Version: 8.9.1
* 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' );
define( 'JETPACK__VERSION', '8.9.1' );
define( 'JETPACK_MASTER_USER', true );
define( 'JETPACK__API_VERSION', 1 );
define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
Expand Down
2 changes: 1 addition & 1 deletion modules/google-analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Auto Activate: No
* Feature: Engagement
* Additional Search Queries: webmaster, google, analytics, console
* Plans: business, premium
* Plans: business, premium, security, complete
*/

include dirname( __FILE__ ) . "/google-analytics/wp-google-analytics.php";
2 changes: 1 addition & 1 deletion modules/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Auto Activate: No
* Feature: Search
* Additional Search Queries: search, elastic, elastic search, elasticsearch, fast search, search results, search performance, google search
* Plans: business
* Plans: business, complete
*/

require_once( dirname( __FILE__ ) . '/search/class.jetpack-search.php' );
Expand Down
21 changes: 17 additions & 4 deletions modules/search/class-jetpack-instant-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,21 @@ protected function inject_javascript_options() {
$posts_per_page = 20;
}

$excluded_post_types = get_option( $prefix . 'excluded_post_types' ) ? explode( ',', get_option( $prefix . 'excluded_post_types', '' ) ) : array();
$post_types = array_values(
get_post_types(
array(
'exclude_from_search' => false,
'public' => true,
)
)
);
$unexcluded_post_types = array_diff( $post_types, $excluded_post_types );
// NOTE: If all post types are being excluded, ignore the option value.
if ( count( $unexcluded_post_types ) === 0 ) {
$excluded_post_types = array();
}

$options = array(
'overlayOptions' => array(
'colorTheme' => get_option( $prefix . 'color_theme', 'light' ),
Expand All @@ -143,7 +158,7 @@ protected function inject_javascript_options() {

// search options.
'defaultSort' => get_option( $prefix . 'default_sort', 'relevance' ),
'excludedPostTypes' => explode( ',', get_option( $prefix . 'excluded_post_types', '' ) ),
'excludedPostTypes' => $excluded_post_types,

// widget info.
'hasOverlayWidgets' => count( $overlay_widget_ids ) > 0,
Expand Down Expand Up @@ -234,10 +249,8 @@ public function filter__posts_pre_query( $posts, $query ) {
* Run the aggregations API query for any filtering
*
* @since 8.3.0
*
* @param WP_Query $query The WP_Query being filtered.
*/
public function action__parse_query( $query ) {
public function action__parse_query() {
if ( ! empty( $this->search_result ) ) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/seo-tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Module Tags: Social, Appearance
* Feature: Traffic
* Additional Search Queries: search engine optimization, social preview, meta description, custom title format
* Plans: business, premium
* Plans: business, premium, security, complete
*/

include dirname( __FILE__ ) . '/seo-tools/jetpack-seo.php';
Expand Down
2 changes: 1 addition & 1 deletion modules/vaultpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Auto Activate: No
* Feature: Security, Health
* Additional Search Queries: backup, cloud backup, database backup, restore, wordpress backup, backup plugin, wordpress backup plugin, back up, backup wordpress, backwpup, vaultpress, backups, off-site backups, offsite backup, offsite, off-site, antivirus, malware scanner, security, virus, viruses, prevent viruses, scan, anti-virus, antimalware, protection, safe browsing, malware, wp security, wordpress security
* Plans: personal, business, premium
* Plans: personal, business, premium, security, complete
*/

add_action( 'jetpack_modules_loaded', 'vaultpress_jetpack_stub' );
Expand Down
2 changes: 1 addition & 1 deletion modules/videopress.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Module Tags: Photos and Videos
* Feature: Writing
* Additional Search Queries: video, videos, videopress, video gallery, video player, videoplayer, mobile video, vimeo, youtube, html5 video, stream
* Plans: business, premium
* Plans: business, premium, security, complete
*/

include_once dirname( __FILE__ ) . '/videopress/shortcode.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,11 @@ public function order_process( $order_id ) {

// loop through products in the order and queue a purchase event.
foreach ( $order->get_items() as $order_item_id => $order_item ) {
$product = $order->get_product_from_item( $order_item );
$product_id = is_callable( array( $order_item, 'get_product_id' ) ) ? $order_item->get_product_id() : -1;

$this->record_event(
'woocommerceanalytics_product_purchase',
$product->get_id(),
$product_id,
array(
'oi' => $order->get_order_number(),
'pq' => $order_item->get_quantity(),
Expand Down
2 changes: 1 addition & 1 deletion modules/wordads.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Auto Activate: No
* Module Tags: Traffic, Appearance
* Additional Search Queries: advertising, ad codes, ads
* Plans: premium, business
* Plans: premium, business, security, complete
*
* @package Jetpack
*/
Expand Down
18 changes: 17 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
=== Jetpack by WordPress.com ===
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, roccotripaldi, samhotchkiss, scarstocea, scottsweb, sdquirk, sermitr, simison, stephdau, tmoorewp, tyxla, Viper007Bond, westi, yoavf, zinigor
Tags: Jetpack, WordPress.com, backup, security, related posts, CDN, speed, anti-spam, social sharing, SEO, video, stats
Stable tag: 8.8.2
Stable tag: 8.9.1
Requires at least: 5.4
Requires PHP: 5.6
Tested up to: 5.5
Expand Down Expand Up @@ -96,6 +96,22 @@ There are opportunities for developers at all levels to contribute. [Learn more

== Changelog ==

= 8.9.1 =

* Release date: September 16, 2020

**Enhancements**

* Jetpack Dashboard: add support for new Jetpack plans.

**Bug fixes**

* General: avoid deprecation PHP notices when used with WooCommerce 4.4+.
* Image CDN: avoid PHP warning when replacing URLs by their image CDN equivalent.
* REST API: avoid authentication issues when using a third-party plugin also using the REST API.
* Search: fix a bug where no results appear when using Jetpack's Instant Search interface.
* Site Health Tools: skip a connection status test when in offline mode.

= 8.9 =

* Release date: September 1, 2020
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 ComposerAutoloaderInit11f765035d4a023576f2d4e7f67c377f::getLoader();
return ComposerAutoloaderInit2c0a7638f32f0b45e798df3127236e43::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\jp433d13274d23cbc897b75e5470fc0cdb;
namespace Automattic\Jetpack\Autoloader\jp051524c91c016472c86188026f52475a;

// phpcs:ignore

Expand Down
43 changes: 0 additions & 43 deletions vendor/automattic/jetpack-config/src/class-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Automattic\Jetpack\JITMS\JITM as JITMS_JITM;
use Automattic\Jetpack\JITM as JITM;
use Automattic\Jetpack\Connection\Plugin;
use Automattic\Jetpack\Plugin\Tracking as Plugin_Tracking;
use Automattic\Jetpack\Sync\Main as Sync_Main;

/**
Expand All @@ -32,8 +31,6 @@ class Config {
'jitm' => false,
'connection' => false,
'sync' => false,
'tracking' => false,
'tos' => false,
);

/**
Expand Down Expand Up @@ -80,12 +77,6 @@ public function on_plugins_loaded() {
&& $this->ensure_feature( 'connection' );
}

if ( $this->config['tracking'] ) {
$this->ensure_class( 'Automattic\Jetpack\Terms_Of_Service' )
&& $this->ensure_class( 'Automattic\Jetpack\Tracking' )
&& $this->ensure_feature( 'tracking' );
}

if ( $this->config['sync'] ) {
$this->ensure_class( 'Automattic\Jetpack\Sync\Main' )
&& $this->ensure_feature( 'sync' );
Expand Down Expand Up @@ -162,40 +153,6 @@ protected function ensure_feature( $feature ) {
return self::FEATURE_ENSURED;
}

/**
* Dummy method to enable Terms of Service.
*/
protected function enable_tos() {
return true;
}

/**
* 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();
$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 {
/**
* Initialize tracking right after the user agrees to the terms of service.
*/
add_action( 'jetpack_agreed_to_terms_of_service', array( $tracking, 'init' ) );
}

return true;
}

/**
* Enables the JITM feature.
*/
Expand Down
26 changes: 19 additions & 7 deletions vendor/automattic/jetpack-tracking/src/class-tracking.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

namespace Automattic\Jetpack;

use Automattic\Jetpack\Terms_Of_Service;

/**
* The Tracking class, used to record events in wpcom
*/
Expand Down Expand Up @@ -103,11 +101,9 @@ public function tracks_record_event( $user, $event_name, $properties = array(),
return false;
}
$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()
|| ! $this->connection->is_user_connected()
) {
$status = new Status();
// Don't track users who have not agreed to our TOS.
if ( ! $this->should_enable_tracking( $terms_of_service, $status ) ) {
return false;
}

Expand All @@ -120,6 +116,22 @@ public function tracks_record_event( $user, $event_name, $properties = array(),
return $event_obj->record();
}

/**
* Determines whether tracking should be enabled.
*
* @param Automattic\Jetpack\Terms_Of_Service $terms_of_service A Terms_Of_Service object.
* @param Automattic\Jetpack\Status $status A Status object.
*
* @return boolean True if tracking should be enabled, else false.
*/
public function should_enable_tracking( $terms_of_service, $status ) {
if ( $status->is_offline_mode() ) {
return false;
}

return $terms_of_service->has_agreed() || $this->connection->is_user_connected();
}

/**
* Procedurally build a Tracks Event Object.
* NOTE: Use this only when the simpler Automattic\Jetpack\Tracking->jetpack_tracks_record_event() function won't work for you.
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\jp433d13274d23cbc897b75e5470fc0cdb;
namespace Automattic\Jetpack\Autoloader\jp051524c91c016472c86188026f52475a;

// phpcs:ignore

Expand Down
Loading

0 comments on commit c8abb61

Please sign in to comment.