Skip to content

Commit

Permalink
Fix/bug with critical error when main jetpack plugin not installed (#…
Browse files Browse the repository at this point in the history
…41192)

* Fix critical error on standalones when Jetpack is not installed

* changelog
  • Loading branch information
CodeyGuyDylan authored Jan 21, 2025
1 parent 47714da commit ad9b2bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fix bug where My Jetpack would throw critical error if only a standalone plugin is not installed
11 changes: 9 additions & 2 deletions projects/packages/my-jetpack/src/class-initializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,13 @@ public static function enqueue_scripts() {
$waf_config = array();
$waf_supported = false;

$sandboxed_domain = '';
$is_dev_version = false;
if ( class_exists( 'Jetpack' ) ) {
$is_dev_version = Jetpack::is_development_version();
$sandboxed_domain = defined( 'JETPACK__SANDBOX_DOMAIN' ) ? JETPACK__SANDBOX_DOMAIN : '';
}

if ( class_exists( 'Automattic\Jetpack\Waf\Waf_Runner' ) ) {
$waf_config = Waf_Runner::get_config();
$waf_supported = Waf_Runner::is_supported_environment();
Expand Down Expand Up @@ -292,8 +299,8 @@ public static function enqueue_scripts() {
'isStatsModuleActive' => $modules->is_active( 'stats' ),
'isUserFromKnownHost' => self::is_user_from_known_host(),
'isCommercial' => self::is_commercial_site(),
'sandboxedDomain' => JETPACK__SANDBOX_DOMAIN,
'isDevVersion' => Jetpack::is_development_version(),
'sandboxedDomain' => $sandboxed_domain,
'isDevVersion' => $is_dev_version,
'isAtomic' => ( new Status_Host() )->is_woa_site(),
'jetpackManage' => array(
'isEnabled' => Jetpack_Manage::could_use_jp_manage(),
Expand Down

0 comments on commit ad9b2bc

Please sign in to comment.