@@ -54,6 +54,8 @@ function dfx_random_user_randomize_first_user() {
5454
5555global $ wpdb ;
5656
57+ update_option ( 'dfx_randomuserid_activation_show_activation_notice ' , true , true );
58+
5759// Check that user with ID=1 exists
5860$ user = get_userdata ( 1 );
5961if ( ! $ user ) {
@@ -83,8 +85,6 @@ function dfx_random_user_randomize_first_user() {
8385
8486update_option ('dfx_randomuserid_first_user_moved_to ' , $ new_id , false );
8587
86- delete_option ( 'dfx_randomuserid_activation_notice_dismissed ' );
87-
8888}
8989
9090}
@@ -94,7 +94,7 @@ function dfx_random_user_randomize_first_user() {
9494if ( ! function_exists ( 'dfx_random_user_show_activation_msg ' ) ) {
9595function dfx_random_user_show_activation_msg () {
9696
97- if ( ! get_option ( 'dfx_randomuserid_activation_notice_dismissed ' ) ) {
97+ if ( get_option ( 'dfx_randomuserid_activation_show_activation_notice ' ) ) {
9898
9999$ first_user_new_id = get_option ( 'dfx_randomuserid_first_user_moved_to ' );
100100
@@ -131,7 +131,11 @@ function dfx_random_user_dismissed_activation_msg() {
131131
132132if (isset ($ _GET ['dfx_randomuserid_dismiss_notice ' ])) {
133133
134- update_option ( 'dfx_randomuserid_activation_notice_dismissed ' , 'true ' , true );
134+ // Delete both the option to show the notice and the option keeping the new user id
135+ // to avoid database clutter. The less information in the database, the better.
136+
137+ delete_option ( 'dfx_randomuserid_activation_notice_dismissed ' );
138+ delete_option ( 'dfx_randomuserid_first_user_moved_to ' );
135139
136140}
137141}
0 commit comments