@@ -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