| @@ -55,12 +55,9 @@ | ||
| 55 | 55 | return $rating_date; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | public function admin_notices_rating() { |
| 59 | - // Verify the nonce before acting on any of the review-notice buttons (CSRF protection). | |
| 60 | - $nonce_ok = isset( $_POST[ $this->prefix . '_rating_nonce' ] ) | |
| 61 | - && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST[ $this->prefix . '_rating_nonce' ] ) ), $this->prefix . '_rating' ); | |
| 62 | - if ( $nonce_ok && isset( $_POST[$this->prefix . '_remind_me'] ) ) { | |
| 59 | + if ( isset( $_POST[$this->prefix . '_remind_me'] ) ) { | |
| 63 | 60 | $two_weeks = strtotime( '+2 weeks' ); |
| 64 | 61 | $six_weeks = strtotime( '+6 weeks' ); |
| 65 | 62 | $future_date = mt_rand( $two_weeks, $six_weeks ); |
| 66 | 63 | update_option( $this->prefix . '_rating_date', $future_date, false ); |
| @@ -65,14 +62,14 @@ | ||
| 65 | 62 | $future_date = mt_rand( $two_weeks, $six_weeks ); |
| 66 | 63 | update_option( $this->prefix . '_rating_date', $future_date, false ); |
| 67 | 64 | return; |
| 68 | 65 | } |
| 69 | - else if ( $nonce_ok && isset( $_POST[$this->prefix . '_never_remind_me'] ) ) { | |
| 66 | + else if ( isset( $_POST[$this->prefix . '_never_remind_me'] ) ) { | |
| 70 | 67 | $twenty_years = strtotime( '+5 years' ); |
| 71 | 68 | update_option( $this->prefix . '_rating_date', $twenty_years, false ); |
| 72 | 69 | return; |
| 73 | 70 | } |
| 74 | - else if ( $nonce_ok && isset( $_POST[$this->prefix . '_did_it'] ) ) { | |
| 71 | + else if ( isset( $_POST[$this->prefix . '_did_it'] ) ) { | |
| 75 | 72 | $twenty_years = strtotime( '+100 years' ); |
| 76 | 73 | update_option( $this->prefix . '_rating_date', $twenty_years, false ); |
| 77 | 74 | return; |
| 78 | 75 | } |
| @@ -90,12 +87,11 @@ | ||
| 90 | 87 | $esc_nice_name = 'AI Engine'; |
| 91 | 88 | } |
| 92 | 89 | $esc_short_url = esc_attr( $this->nice_short_url_from_file( $this->mainfile ) ); |
| 93 | 90 | $escaped_prefix = $this->prefix; |
| 94 | - $rating_nonce = esc_attr( wp_create_nonce( $this->prefix . '_rating' ) ); | |
| 95 | 91 | $html .= '<p style="font-size: 100%;">'; |
| 96 | 92 | // Translators: %1$s is a plugin nicename, %2$s is a short url (slug) |
| 97 | - $url = 'https://wordpress.org/support/plugin/' . $esc_short_url . '/reviews/'; | |
| 93 | + $url = 'https://wordpress.org/support/plugin/' . $esc_short_url . '/reviews/?rate=5#new-post'; | |
| 98 | 94 | $html .= sprintf( |
| 99 | 95 | __( '<h2 style="margin: 0" class="title">You have been using <b>%1$s</b> for some time now. Thank you! 💕</h2><p>If you have a minute, can you write a <b><a target="_blank" href="' . $url . '">little review</a></b> for me? That would <b>really</b> bring me joy and motivation! 💫 <br />Don\'t hesitate to <b>share your feature requests</b> with the review, I always check them and try my best.</p> |
| 100 | 96 | ', $this->domain ), |
| 101 | 97 | $esc_nice_name |
| @@ -104,9 +100,9 @@ | ||
| 104 | 100 | $html .= '<a target="_blank" class="button button-primary" style="margin-right: 10px;" href="' . $url . '"> |
| 105 | 101 | ✏️ Write Review |
| 106 | 102 | </a> |
| 107 | 103 | <form method="post" action="" style="margin-right: 10px;"> |
| 108 | - <input type="hidden" name="' . $escaped_prefix . '_did_it" value="true"><input type="hidden" name="' . $escaped_prefix . '_rating_nonce" value="' . $rating_nonce . '"> | |
| 104 | + <input type="hidden" name="' . $escaped_prefix . '_did_it" value="true"> | |
| 109 | 105 | <input type="submit" name="submit" id="submit" class="button button-secondary" value="' |
| 110 | 106 | . __( '✌️ Done!', $this->domain ) . '"> |
| 111 | 107 | </form> |
| 112 | 108 | |
| @@ -112,15 +108,15 @@ | ||
| 112 | 108 | |
| 113 | 109 | <div style="flex: auto;"></div> |
| 114 | 110 | |
| 115 | 111 | <form method="post" action="" style="margin-right: 10px;"> |
| 116 | - <input type="hidden" name="' . $escaped_prefix . '_remind_me" value="true"><input type="hidden" name="' . $escaped_prefix . '_rating_nonce" value="' . $rating_nonce . '"> | |
| 112 | + <input type="hidden" name="' . $escaped_prefix . '_remind_me" value="true"> | |
| 117 | 113 | <input type="submit" name="submit" id="submit" class="button button-secondary" value="' |
| 118 | 114 | . __( '⏰ Remind me later', $this->domain ) . '"> |
| 119 | 115 | </form> |
| 120 | 116 | |
| 121 | 117 | <form method="post" action=""> |
| 122 | - <input type="hidden" name="' . $escaped_prefix . '_never_remind_me" value="true"><input type="hidden" name="' . $escaped_prefix . '_rating_nonce" value="' . $rating_nonce . '"> | |
| 118 | + <input type="hidden" name="' . $escaped_prefix . '_never_remind_me" value="true"> | |
| 123 | 119 | <input type="submit" name="submit" id="submit" class="button-link" style="font-size: small;" value="' |
| 124 | 120 | . __( 'Hide', $this->domain ) . '"> |
| 125 | 121 | </form> |
| 126 | 122 | </div>'; |