| @@ -62,12 +62,9 @@ | ||
| 62 | 62 | return $news['date']; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | public function admin_notices_news() { |
| 66 | - // Verify the nonce before acting on the news-notice buttons (CSRF protection). | |
| 67 | - $nonce_ok = isset( $_POST['meowapps_news_nonce'] ) | |
| 68 | - && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['meowapps_news_nonce'] ) ), 'meowapps_news' ); | |
| 69 | - if ( $nonce_ok && isset( $_POST['meowapps_remind_me'] ) ) { | |
| 66 | + if ( isset( $_POST['meowapps_remind_me'] ) ) { | |
| 70 | 67 | $news = get_option( 'meowapps_news' ); |
| 71 | 68 | $twelve_hours = strtotime( '+12 hours' ); |
| 72 | 69 | $thirtysix_hours = strtotime( '+36 hours' ); |
| 73 | 70 | $news['date'] = mt_rand( $twelve_hours, $thirtysix_hours ); |
| @@ -73,9 +70,9 @@ | ||
| 73 | 70 | $news['date'] = mt_rand( $twelve_hours, $thirtysix_hours ); |
| 74 | 71 | update_option( 'meowapps_news', $news, false ); |
| 75 | 72 | return; |
| 76 | 73 | } |
| 77 | - else if ( $nonce_ok && isset( $_POST['meowapps_done_it'] ) ) { | |
| 74 | + else if ( isset( $_POST['meowapps_done_it'] ) ) { | |
| 78 | 75 | $news = get_option( 'meowapps_news' ); |
| 79 | 76 | $news['date'] = ''; |
| 80 | 77 | update_option( 'meowapps_news', $news, false ); |
| 81 | 78 | return; |
| @@ -83,26 +80,24 @@ | ||
| 83 | 80 | $html = wp_kses_post( '<div class="notice notice-success" style="margin: 20px 0;">' ); |
| 84 | 81 | $html .= '<p style="font-size: 100%;">'; |
| 85 | 82 | |
| 86 | 83 | // Title |
| 87 | - $html .= sprintf( __( '<h2 style="margin: 0 0 10px 0" class="title">AI Engine by Meow Apps: The Power of AI into WordPress 💫</h2>', $this->domain ) ); | |
| 84 | + $html .= sprintf( __( '<h2 style="margin: 0 0 10px 0" class="title">AI Engine by Meow Apps: The Power of AI into WordPress 💫</h2>' ) ); | |
| 88 | 85 | |
| 89 | 86 | // Content |
| 90 | 87 | $html .= sprintf( __( '<p style="font-size: 14px;">Since the end of 2022, I worked a lot to craft <b>the perfect AI plugin for WordPress</b>. Since March 2023, it\'s perfectly stable and packed with features. You\'ll get chatbots, AI forms, easy model training, content and images generation, a template system that will allow you to create your personal assistants for various tasks and much more! Here it is: <a href="%s" target="_blank">AI Engine</a>. Believe me, you will enjoy this. Have fun, and let me know how it goes! 🥳</p>', $this->domain ), 'https://wordpress.org/plugins/ai-engine/' ); |
| 91 | 88 | |
| 92 | - $news_nonce = esc_attr( wp_create_nonce( 'meowapps_news' ) ); | |
| 93 | - | |
| 94 | 89 | // Buttons |
| 95 | 90 | $html .= '<div style="padding: 10px 0 12px 0; display: flex; align-items: center;">'; |
| 96 | 91 | $html .= '<a href="https://wordpress.org/plugins/ai-engine/" target="_blank" class="button button-primary" style="margin-right: 10px;">' |
| 97 | 92 | . __( '👉 AI Engine at WordPress.org', $this->domain ) . '</a>'; |
| 98 | 93 | $html .= '<form method="post" action="" style="margin-right: 10px;"> |
| 99 | - <input type="hidden" name="meowapps_remind_me" value="true"><input type="hidden" name="meowapps_news_nonce" value="' . $news_nonce . '"> | |
| 94 | + <input type="hidden" name="meowapps_remind_me" value="true"> | |
| 100 | 95 | <input type="submit" name="submit" id="submit" class="button button-primary" value="' |
| 101 | 96 | . __( '⏰ Remind me later', $this->domain ) . '"></form>'; |
| 102 | 97 | $html .= '<div style="flex: auto;"></div>'; |
| 103 | 98 | $html .= '<form method="post" action=""> |
| 104 | - <input type="hidden" name="meowapps_done_it" value="true"><input type="hidden" name="meowapps_news_nonce" value="' . $news_nonce . '"> | |
| 99 | + <input type="hidden" name="meowapps_done_it" value="true"> | |
| 105 | 100 | <input type="submit" name="submit" id="submit" class="button" value="' |
| 106 | 101 | . __( '❌ Delete', $this->domain ) . '"> |
| 107 | 102 | </form> |
| 108 | 103 | </div>'; |