Skip to content

Commit

Permalink
easy lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
circlecube committed Aug 14, 2024
1 parent 0af6828 commit dbdce38
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions includes/Performance.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function __construct( Container $container ) {

// Ensure that purgeable cache types are enabled before showing the UI.
if ( $cachePurger->canPurge() ) {
add_action( 'admin_bar_menu', [ $this, 'adminBarMenu' ], 100 );
add_action( 'admin_bar_menu', array( $this, 'adminBarMenu' ), 100 );
}

$container->set( 'cachePurger', $cachePurger );
Expand Down Expand Up @@ -102,9 +102,9 @@ function () {
*/
public function hooks( Container $container ) {

add_action( 'admin_init', [ $this, 'registerSettings' ], 11 );
add_action( 'admin_init', array( $this, 'registerSettings' ), 11 );

new OptionListener( self::OPTION_CACHE_LEVEL, [ $this, 'onCacheLevelChange' ] );
new OptionListener( self::OPTION_CACHE_LEVEL, array( $this, 'onCacheLevelChange' ) );

/**
* On CLI requests, mod_rewrite is unavailable, so it fails to update
Expand All @@ -129,7 +129,7 @@ function () {
}
);

add_action( 'after_mod_rewrite_rules', [ $this, 'onRewrite' ] );
add_action( 'after_mod_rewrite_rules', array( $this, 'onRewrite' ) );
add_filter( 'action_scheduler_retention_period', array( $this, 'nfd_asr_default' ) );
}

Expand Down Expand Up @@ -213,42 +213,40 @@ 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',
'title' => __( 'Caching', 'newfold-module-performance' ),
]
)
);

$wp_admin_bar->add_node(
[
array(
'id' => 'nfd_purge_menu-purge_all',
'title' => __( 'Purge All', 'newfold-module-performance' ),
'parent' => 'nfd_purge_menu',
'href' => add_query_arg( [ self::PURGE_ALL => true ] ),
]
'href' => add_query_arg( array( self::PURGE_ALL => true ) ),
)
);

if ( ! is_admin() ) {
$wp_admin_bar->add_node(
[
array(
'id' => 'nfd_purge_menu-purge_single',
'title' => __( 'Purge This Page', 'newfold-module-performance' ),
'parent' => 'nfd_purge_menu',
'href' => add_query_arg( [ self::PURGE_URL => true ] ),
]
'href' => add_query_arg( array( self::PURGE_URL => true ) ),
)
);
}

$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#' . Performance::SETTINGS_ID ),
]
)
);
}

}

}

0 comments on commit dbdce38

Please sign in to comment.