From 549c8f244eb154940077ced6ff3255ef5466f651 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Wed, 8 May 2024 12:55:47 -0400 Subject: [PATCH] setup performance module with features --- bootstrap.php | 1 + inc/Admin.php | 4 ++-- src/app/data/routes.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bootstrap.php b/bootstrap.php index f08608e2c..ac4d138a4 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -202,4 +202,5 @@ function () { // These shouldn't be needed once the autoloader is properly running in tagged releases require_once BLUEHOST_PLUGIN_DIR . '/vendor/newfold-labs/wp-module-staging/includes/StagingFeature.php'; +require_once BLUEHOST_PLUGIN_DIR . '/vendor/newfold-labs/wp-module-performance/includes/PerformanceFeature.php'; require_once BLUEHOST_PLUGIN_DIR . '/vendor/newfold-labs/wp-module-features/includes/functions.php'; diff --git a/inc/Admin.php b/inc/Admin.php index b612c57fd..dd4cf3754 100644 --- a/inc/Admin.php +++ b/inc/Admin.php @@ -77,7 +77,7 @@ public static function subpages() { 'bluehost#/marketplace' => __( 'Marketplace', 'wp-plugin-bluehost' ), ); // wp-cloud adjustment - $performance = ( 'atomic' === getContext( 'platform' ) ) + $performance = isEnabled( 'performance' ) ? array( 'bluehost#/performance' => __( 'Performance', 'wp-plugin-bluehost' ), ) @@ -203,7 +203,7 @@ public static function assets( $hook ) { \wp_register_script( 'bluehost-script', BLUEHOST_BUILD_URL . '/index.js', - array_merge( $asset['dependencies'], array( 'nfd-runtime' ) ), + array_merge( $asset['dependencies'], array( 'newfold-features', 'nfd-runtime' ) ), $asset['version'], true ); diff --git a/src/app/data/routes.js b/src/app/data/routes.js index d89fa6c0d..25f544f3d 100644 --- a/src/app/data/routes.js +++ b/src/app/data/routes.js @@ -133,7 +133,7 @@ export const routes = [ title: __( 'Performance', 'wp-plugin-bluehost' ), Component: Performance, Icon: BoltIcon, - condition: 'atomic' !== window.NewfoldRuntime.context.platform, + condition: window.NewfoldRuntime.features.performance, }, { name: '/settings',