updated plugin Jetpack Protect version 1.4.2

This commit is contained in:
2023-10-22 22:21:06 +00:00
committed by Gitium
parent f512d25847
commit f07dfae114
242 changed files with 6494 additions and 1502 deletions

View File

@ -52,5 +52,4 @@ class Credentials {
return isset( $parsed_response->credentials ) ? $parsed_response->credentials : array();
}
}

View File

@ -13,7 +13,8 @@ use Automattic\Jetpack\Admin_UI\Admin_Menu;
use Automattic\Jetpack\Assets;
use Automattic\Jetpack\Connection\Initial_State as Connection_Initial_State;
use Automattic\Jetpack\Connection\Manager as Connection_Manager;
use Automattic\Jetpack\JITMS\JITM as JITM;
use Automattic\Jetpack\IP\Utils as IP_Utils;
use Automattic\Jetpack\JITMS\JITM;
use Automattic\Jetpack\Modules;
use Automattic\Jetpack\My_Jetpack\Initializer as My_Jetpack_Initializer;
use Automattic\Jetpack\My_Jetpack\Products as My_Jetpack_Products;
@ -151,8 +152,7 @@ class Jetpack_Protect {
$menu_label,
'manage_options',
'jetpack-protect',
array( $this, 'plugin_settings_page' ),
99
array( $this, 'plugin_settings_page' )
);
add_action( 'load-' . $page_suffix, array( $this, 'enqueue_admin_scripts' ) );
@ -183,7 +183,7 @@ class Jetpack_Protect {
// Required for Analytics.
wp_enqueue_script( 'jp-tracks', '//stats.wp.com/w.js', array(), gmdate( 'YW' ), true );
// Initial JS state including JP Connection data.
wp_add_inline_script( 'jetpack-protect', Connection_Initial_State::render(), 'before' );
Connection_Initial_State::render_script( 'jetpack-protect' );
wp_add_inline_script( 'jetpack-protect', $this->render_initial_state(), 'before' );
}
@ -218,7 +218,8 @@ class Jetpack_Protect {
'jetpackScan' => My_Jetpack_Products::get_product( 'scan' ),
'hasRequiredPlan' => Plan::has_required_plan(),
'waf' => array(
'isSupported' => Waf_Runner::is_supported_environment(),
'wafSupported' => Waf_Runner::is_supported_environment(),
'currentIp' => IP_Utils::get_ip(),
'isSeen' => self::get_waf_seen_status(),
'upgradeIsSeen' => self::get_waf_upgrade_seen_status(),
'displayUpgradeBadge' => self::get_waf_upgrade_badge_display_status(),
@ -331,11 +332,11 @@ class Jetpack_Protect {
}
/**
* Check for user licenses.
* Check if the user has an available license that includes Jetpack Scan.
*
* @param boolean $has_license Check if user has a license.
* @param object $licenses List of licenses.
* @param string $plugin_slug The plugin that initiated the flow.
* @param boolean $has_license Whether a license was already found.
* @param object[] $licenses Unattached licenses belonging to the user.
* @param string $plugin_slug Slug of the plugin that initiated the flow.
*
* @return boolean
*/
@ -347,6 +348,10 @@ class Jetpack_Protect {
$license_found = false;
foreach ( $licenses as $license ) {
if ( $license->attached_at || $license->revoked_at ) {
continue;
}
if ( in_array( $license->product_id, self::JETPACK_SCAN_PRODUCT_IDS, true ) ) {
$license_found = true;
break;
@ -448,5 +453,4 @@ class Jetpack_Protect {
'automaticRulesLastUpdated' => Waf_Stats::get_automatic_rules_last_updated(),
);
}
}

View File

@ -255,5 +255,4 @@ class Protect_Status extends Status {
return $core;
}
}

View File

@ -12,6 +12,7 @@ namespace Automattic\Jetpack\Protect;
use Automattic\Jetpack\Connection\Rest_Authentication as Connection_Rest_Authentication;
use Automattic\Jetpack\Waf\Waf_Runner;
use Jetpack_Protect;
use WP_Error;
use WP_REST_Response;
/**

View File

@ -356,5 +356,4 @@ class Scan_Status extends Status {
return $new_list;
}
}

View File

@ -310,5 +310,4 @@ class Status {
return $threats;
}
}

View File

@ -199,5 +199,4 @@ class Threats {
return true;
}
}

View File

@ -107,5 +107,4 @@ class Extension_Model {
$this->threats = $threats;
}
}

View File

@ -138,5 +138,4 @@ class Status_Model {
}
}
}
}

View File

@ -112,5 +112,4 @@ class Threat_Model {
}
}
}
}