Skip to content

Commit b221940

Browse files
committed
minor tweaks
1 parent 7d31eb1 commit b221940

3 files changed

Lines changed: 8 additions & 11 deletions

File tree

classes/class-badges.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,28 @@ class Badges {
1717
/**
1818
* Content badges.
1919
*
20-
* @var array<\Progress_Planner\Badges\Badge>
20+
* @var \Progress_Planner\Badges\Badge[]
2121
*/
2222
private $content = [];
2323

2424
/**
2525
* Maintenance badges.
2626
*
27-
* @var array<\Progress_Planner\Badges\Badge>
27+
* @var \Progress_Planner\Badges\Badge[]
2828
*/
2929
private $maintenance = [];
3030

3131
/**
3232
* Monthly badges.
3333
*
34-
* @var array<\Progress_Planner\Badges\Badge>
34+
* @var \Progress_Planner\Badges\Badge[]
3535
*/
3636
private $monthly = [];
3737

3838
/**
3939
* Monthly badges flat.
4040
*
41-
* @var array<\Progress_Planner\Badges\Badge>
41+
* @var \Progress_Planner\Badges\Badge[]
4242
*/
4343
private $monthly_flat = [];
4444

@@ -80,7 +80,7 @@ public function __construct() {
8080
*
8181
* @param string $context The badges context (content|maintenance|monthly).
8282
*
83-
* @return array<\Progress_Planner\Badges\Badge>
83+
* @return \Progress_Planner\Badges\Badge[]
8484
*/
8585
public function get_badges( $context ) {
8686
return isset( $this->$context ) ? $this->$context : [];

classes/class-base.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,7 @@ public function is_local_site() {
389389
$host = ! empty( $url_parts['host'] ) ? $url_parts['host'] : false;
390390

391391
if ( ! empty( $url ) && ! empty( $host ) ) {
392-
if (
393-
'localhost' === $host
392+
if ( 'localhost' === $host
394393
|| (
395394
false !== \ip2long( $host )
396395
&& ! \filter_var( $host, \FILTER_VALIDATE_IP, \FILTER_FLAG_NO_PRIV_RANGE | \FILTER_FLAG_NO_RES_RANGE )

classes/utils/class-playground.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class Playground {
1717
*/
1818
public function __construct() {
1919
\add_action( 'init', [ $this, 'register_hooks' ], 9 );
20-
2120
\add_action( 'plugins_loaded', [ $this, 'enable_debug_tools' ], 1 );
2221
}
2322

@@ -79,13 +78,12 @@ private function toggle_onboarding( $action ) {
7978

8079
if ( $action === 'hide' ) {
8180
\add_option( 'progress_planner_license_key', str_replace( ' ', '-', $this->create_random_string( 20 ) ) );
82-
\update_option( 'progress_planner_force_show_onboarding', false );
8381
$message = \esc_html__( 'Onboarding hidden successfully', 'progress-planner' );
8482
} else {
8583
\delete_option( 'progress_planner_license_key' );
86-
\update_option( 'progress_planner_force_show_onboarding', true );
8784
$message = \esc_html__( 'Onboarding shown successfully', 'progress-planner' );
8885
}
86+
\update_option( 'progress_planner_force_show_onboarding', $action !== 'hide' );
8987

9088
\wp_send_json_success( [ 'message' => $message ] );
9189
}
@@ -238,7 +236,7 @@ private function create_random_string( $length ) {
238236
$sentence = '';
239237

240238
foreach ( (array) $word_keys as $key ) {
241-
$sentence .= $words[ $key ] . ' ';
239+
$sentence .= $words[ $key ] . ' ';
242240
}
243241

244242
// Capitalize the first word and add a period at the end.

0 commit comments

Comments
 (0)