diff --git a/includes/Performance.php b/includes/Performance.php index 7cca415..5db1612 100644 --- a/includes/Performance.php +++ b/includes/Performance.php @@ -74,8 +74,8 @@ public function __construct( Container $container ) { $cacheManager = new CacheManager( $container ); $cachePurger = new CachePurgingService( $cacheManager->getInstances() ); + add_action( 'admin_bar_menu', array( $this, 'adminBarMenu' ), 100 ); new LinkPrefetch( $container ); - new RestApi(); // Ensure that purgeable cache types are enabled before showing the UI. if ( $cachePurger->canPurge() ) { @@ -263,7 +263,6 @@ public function adminBarMenu( \WP_Admin_Bar $wp_admin_bar ) { } if ( current_user_can( 'manage_options' ) ) { - $wp_admin_bar->add_node( array( 'id' => 'nfd_purge_menu', @@ -291,12 +290,13 @@ public function adminBarMenu( \WP_Admin_Bar $wp_admin_bar ) { ); } + $brand = $this->container->get( 'plugin' )['id']; $wp_admin_bar->add_node( array( 'id' => 'nfd_purge_menu-cache_settings', 'title' => __( 'Cache Settings', 'newfold-module-performance' ), 'parent' => 'nfd_purge_menu', - 'href' => admin_url( 'options-general.php#' . self::SETTINGS_ID ), + 'href' => admin_url( "admin.php?page=$brand#/performance" ), ) ); }