Skip to content

Commit 3639685

Browse files
authored
release: fixes
- Fixes dashboard banner appearing in wrong conditions - Make --type optional on clear cache WP CLI command - Update dependencies
2 parents 0b8fbee + 2c9cad1 commit 3639685

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

assets/src/dashboard/parts/connected/index.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,23 @@ const ConnectedLayout = ({
6565
hasApplication,
6666
hasConflicts,
6767
siteSettings,
68-
extraVisits
68+
extraVisits,
69+
plan
6970
} = useSelect( select => {
7071
const {
7172
isConnected,
7273
hasApplication,
7374
getConflicts,
74-
getSiteSettings
75+
getSiteSettings,
76+
getUserData
7577
} = select( 'optimole' );
7678

7779
const conflicts = getConflicts();
7880
const siteSettings = getSiteSettings();
81+
const user = getUserData();
7982

8083
return {
84+
plan: user?.plan,
8185
isConnected: isConnected(),
8286
hasApplication: hasApplication(),
8387
hasConflicts: 0 < conflicts.count || 0,
@@ -144,9 +148,11 @@ const ConnectedLayout = ({
144148
}
145149
}, [ canSave ]);
146150

151+
const showBFBanner = 'free' === plan && optimoleDashboardApp?.bf_notices?.banner;
152+
147153
return (
148154
<div className="optml-connected 2xl:max-w-screen-xl max-w-screen px-4 mx-auto">
149-
{optimoleDashboardApp?.bf_notices?.banner && <BlackFridayBanner/>}
155+
{showBFBanner && <BlackFridayBanner/>}
150156

151157
<div className="flex flex-col xl:flex-row mx-auto gap-5">
152158
<div

composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inc/cli/cli_setting.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ private function update_setting( $new_setting ) {
129129
/**
130130
* Clear cache.
131131
*
132-
* --type=<type>
132+
* [--type=<type>]
133133
* : The type of cache to clear. Default is images.
134134
*/
135135
public function clear_cache( $args, $assoc_args ) {
136-
$type = '';
136+
$type = 'images';
137137

138138
// If assoc_args has a type key, use that.
139139
if ( isset( $assoc_args['type'] ) && $assoc_args['type'] === 'assets' ) {
@@ -147,6 +147,6 @@ public function clear_cache( $args, $assoc_args ) {
147147
\WP_CLI::error( $token->get_error_message() );
148148
}
149149

150-
\WP_CLI::success( sprintf( 'Cache type %s cleared', $assoc_args['type'] ) );
150+
\WP_CLI::success( sprintf( 'Cache type %s cleared', $type ) );
151151
}
152152
}

0 commit comments

Comments
 (0)