activate.php
1 year ago
config.php
1 year ago
connect-jp.php
1 year ago
enter.php
2 years ago
get.php
1 year ago
logo.php
2 years ago
notice.php
1 year ago
predefined.php
1 year ago
setup.php
1 year ago
start.php
1 year ago
stats.php
2 years ago
title.php
6 years ago
config.php
321 lines
| 1 | <?php |
| 2 | |
| 3 | //phpcs:disable VariableAnalysis |
| 4 | // There are "undefined" variables here because they're defined in the code that includes this file as a template. |
| 5 | $kses_allow_link_href = array( |
| 6 | 'a' => array( |
| 7 | 'href' => true, |
| 8 | ), |
| 9 | ); |
| 10 | ?> |
| 11 | <div id="akismet-plugin-container"> |
| 12 | <div class="akismet-masthead"> |
| 13 | <div class="akismet-masthead__inside-container"> |
| 14 | <?php Akismet::view( 'logo' ); ?> |
| 15 | </div> |
| 16 | </div> |
| 17 | <div class="akismet-lower"> |
| 18 | <?php if ( Akismet::get_api_key() ) { ?> |
| 19 | <?php Akismet_Admin::display_status(); ?> |
| 20 | <?php } ?> |
| 21 | <?php if ( ! empty( $notices ) ) { ?> |
| 22 | <?php foreach ( $notices as $notice ) { ?> |
| 23 | <?php Akismet::view( 'notice', array_merge( $notice, array( 'parent_view' => $name ) ) ); ?> |
| 24 | <?php } ?> |
| 25 | <?php } ?> |
| 26 | |
| 27 | <?php if ( isset( $stat_totals['all'] ) && isset( $stat_totals['6-months'] ) ) : ?> |
| 28 | <div class="akismet-card"> |
| 29 | <div class="akismet-section-header"> |
| 30 | <h2 class="akismet-section-header__label"> |
| 31 | <span><?php esc_html_e( 'Statistics', 'akismet' ); ?></span> |
| 32 | </h2> |
| 33 | |
| 34 | <div class="akismet-section-header__actions"> |
| 35 | <a href="<?php echo esc_url( Akismet_Admin::get_page_url( 'stats' ) ); ?>"> |
| 36 | <?php esc_html_e( 'Detailed stats', 'akismet' ); ?> |
| 37 | </a> |
| 38 | </div> |
| 39 | </div> <!-- close akismet-section-header --> |
| 40 | |
| 41 | <div class="akismet-new-snapshot"> |
| 42 | <?php /* name attribute on iframe is used as a cache-buster here to force Firefox to load the new style charts: https://bugzilla.mozilla.org/show_bug.cgi?id=356558 */ ?> |
| 43 | <div class="akismet-new-snapshot__chart"> |
| 44 | <iframe id="stats-iframe" allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 220px; overflow: hidden;" src="<?php echo esc_url( sprintf( 'https://tools.akismet.com/1.0/snapshot.php?blog=%s&token=%s&height=200&locale=%s&is_redecorated=1', rawurlencode( get_option( 'home' ) ), rawurlencode( Akismet::get_access_token() ), get_locale() ) ); ?>" name="<?php echo esc_attr( 'snapshot-' . filemtime( __FILE__ ) ); ?>" title="<?php echo esc_attr__( 'Akismet stats', 'akismet' ); ?>"></iframe> |
| 45 | </div> |
| 46 | |
| 47 | <ul class="akismet-new-snapshot__list"> |
| 48 | <li class="akismet-new-snapshot__item"> |
| 49 | <h3 class="akismet-new-snapshot__header"><?php esc_html_e( 'Past six months', 'akismet' ); ?></h3> |
| 50 | <span class="akismet-new-snapshot__number"><?php echo number_format( $stat_totals['6-months']->spam ); ?></span> |
| 51 | <span class="akismet-new-snapshot__text"><?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['6-months']->spam, 'akismet' ) ); ?></span> |
| 52 | </li> |
| 53 | <li class="akismet-new-snapshot__item"> |
| 54 | <h3 class="akismet-new-snapshot__header"><?php esc_html_e( 'All time', 'akismet' ); ?></h3> |
| 55 | <span class="akismet-new-snapshot__number"><?php echo number_format( $stat_totals['all']->spam ); ?></span> |
| 56 | <span class="akismet-new-snapshot__text"><?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['all']->spam, 'akismet' ) ); ?></span> |
| 57 | </li> |
| 58 | <li class="akismet-new-snapshot__item"> |
| 59 | <h3 class="akismet-new-snapshot__header"><?php esc_html_e( 'Accuracy', 'akismet' ); ?></h3> |
| 60 | <span class="akismet-new-snapshot__number"><?php echo floatval( $stat_totals['all']->accuracy ); ?>%</span> |
| 61 | <span class="akismet-new-snapshot__text"> |
| 62 | <?php |
| 63 | /* translators: %s: number of spam missed by Akismet */ |
| 64 | echo esc_html( sprintf( _n( '%s missed spam', '%s missed spam', $stat_totals['all']->missed_spam, 'akismet' ), number_format( $stat_totals['all']->missed_spam ) ) ) . ', '; |
| 65 | /* translators: %s: number of false positive spam flagged by Akismet */ |
| 66 | echo esc_html( sprintf( _n( '%s false positive', '%s false positives', $stat_totals['all']->false_positives, 'akismet' ), number_format( $stat_totals['all']->false_positives ) ) ); |
| 67 | ?> |
| 68 | </span> |
| 69 | </li> |
| 70 | </ul> |
| 71 | </div> <!-- close akismet-new-snapshot --> |
| 72 | </div> <!-- close akismet-card --> |
| 73 | <?php endif; ?> |
| 74 | |
| 75 | <?php if ( $akismet_user ) : ?> |
| 76 | <div class="akismet-card"> |
| 77 | <div class="akismet-section-header"> |
| 78 | <h2 class="akismet-section-header__label"> |
| 79 | <span><?php esc_html_e( 'Settings', 'akismet' ); ?></span> |
| 80 | </h2> |
| 81 | </div> |
| 82 | |
| 83 | <div class="inside"> |
| 84 | <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" autocomplete="off" method="POST" id="akismet-settings-form"> |
| 85 | |
| 86 | <div class="akismet-settings"> |
| 87 | <?php if ( ! Akismet::predefined_api_key() ) : ?> |
| 88 | <div class="akismet-settings__row"> |
| 89 | <h3 class="akismet-settings__row-title"> |
| 90 | <label class="akismet-settings__row-label" for="key"><?php esc_html_e( 'API key', 'akismet' ); ?></label> |
| 91 | </h3> |
| 92 | <div class="akismet-settings__row-input"> |
| 93 | <span class="api-key"><input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( get_option( 'wordpress_api_key' ) ); ?>" class="<?php echo esc_attr( 'regular-text code ' . $akismet_user->status ); ?>"></span> |
| 94 | </div> |
| 95 | </div> |
| 96 | <?php endif; ?> |
| 97 | |
| 98 | <?php |
| 99 | //phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 100 | if ( isset( $_GET['ssl_status'] ) ) : |
| 101 | ?> |
| 102 | <div class="akismet-settings__row"> |
| 103 | <div class="akismet-settings__row-text"> |
| 104 | <h3 class="akismet-settings__row-title"><?php esc_html_e( 'SSL status', 'akismet' ); ?></h3> |
| 105 | <div class="akismet-settings__row-description"> |
| 106 | <?php if ( ! wp_http_supports( array( 'ssl' ) ) ) : ?> |
| 107 | <strong><?php esc_html_e( 'Disabled.', 'akismet' ); ?></strong> |
| 108 | <?php esc_html_e( 'Your Web server cannot make SSL requests; contact your Web host and ask them to add support for SSL requests.', 'akismet' ); ?> |
| 109 | <?php else : ?> |
| 110 | <?php $ssl_disabled = get_option( 'akismet_ssl_disabled' ); ?> |
| 111 | |
| 112 | <?php if ( $ssl_disabled ) : ?> |
| 113 | <strong><?php esc_html_e( 'Temporarily disabled.', 'akismet' ); ?></strong> |
| 114 | <?php esc_html_e( 'Akismet encountered a problem with a previous SSL request and disabled it temporarily. It will begin using SSL for requests again shortly.', 'akismet' ); ?> |
| 115 | <?php else : ?> |
| 116 | <strong><?php esc_html_e( 'Enabled.', 'akismet' ); ?></strong> |
| 117 | <?php esc_html_e( 'All systems functional.', 'akismet' ); ?> |
| 118 | <?php endif; ?> |
| 119 | <?php endif; ?> |
| 120 | </div> |
| 121 | </div> |
| 122 | </div> |
| 123 | <?php endif; ?> |
| 124 | |
| 125 | <div class="akismet-settings__row"> |
| 126 | <div class="akismet-settings__row-text"> |
| 127 | <h3 class="akismet-settings__row-title"><?php esc_html_e( 'Comments', 'akismet' ); ?></h3> |
| 128 | </div> |
| 129 | <div class="akismet-settings__row-input"> |
| 130 | <label class="akismet-settings__row-input-label" for="akismet_show_user_comments_approved"> |
| 131 | <input |
| 132 | name="akismet_show_user_comments_approved" |
| 133 | id="akismet_show_user_comments_approved" |
| 134 | value="1" |
| 135 | type="checkbox" |
| 136 | <?php |
| 137 | // If the option isn't set, or if it's enabled ('1'), or if it was enabled a long time ago ('true'), check the checkbox. |
| 138 | checked( true, ( in_array( get_option( 'akismet_show_user_comments_approved' ), array( false, '1', 'true' ), true ) ) ); |
| 139 | ?> |
| 140 | /> |
| 141 | <span class="akismet-settings__row-label-text"> |
| 142 | <?php esc_html_e( 'Show the number of approved comments beside each comment author.', 'akismet' ); ?> |
| 143 | </span> |
| 144 | </label> |
| 145 | </div> |
| 146 | </div> |
| 147 | |
| 148 | <div class="akismet-settings__row is-radio"> |
| 149 | <div class="akismet-settings__row-text"> |
| 150 | <h3 class="akismet-settings__row-title"><?php esc_html_e( 'Spam filtering', 'akismet' ); ?></h3> |
| 151 | </div> |
| 152 | <div class="akismet-settings__row-input"> |
| 153 | <fieldset> |
| 154 | <legend class="screen-reader-text"> |
| 155 | <span><?php esc_html_e( 'Akismet Anti-spam strictness', 'akismet' ); ?></span> |
| 156 | </legend> |
| 157 | <div> |
| 158 | <label class="akismet-settings__row-input-label" for="akismet_strictness_1"> |
| 159 | <input type="radio" name="akismet_strictness" id="akismet_strictness_1" value="1" <?php checked( '1', get_option( 'akismet_strictness' ) ); ?> /> |
| 160 | <span class="akismet-settings__row-label-text"> |
| 161 | <?php esc_html_e( 'Silently discard the worst and most pervasive spam so I never see it.', 'akismet' ); ?> |
| 162 | </span> |
| 163 | </label> |
| 164 | </div> |
| 165 | <div> |
| 166 | <label class="akismet-settings__row-input-label" for="akismet_strictness_0"> |
| 167 | <input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked( '0', get_option( 'akismet_strictness' ) ); ?> /> |
| 168 | <span class="akismet-settings__row-label-text"> |
| 169 | <?php esc_html_e( 'Always put spam in the Spam folder for review.', 'akismet' ); ?> |
| 170 | </span> |
| 171 | </label> |
| 172 | </div> |
| 173 | </fieldset> |
| 174 | |
| 175 | <div class="akismet-settings__row-note"> |
| 176 | <strong><?php esc_html_e( 'Note:', 'akismet' ); ?></strong> |
| 177 | <?php |
| 178 | $delete_interval = max( 1, intval( apply_filters( 'akismet_delete_comment_interval', 15 ) ) ); |
| 179 | |
| 180 | $spam_folder_link = sprintf( |
| 181 | '<a href="%s">%s</a>', |
| 182 | esc_url( admin_url( 'edit-comments.php?comment_status=spam' ) ), |
| 183 | esc_html__( 'spam folder', 'akismet' ) |
| 184 | ); |
| 185 | |
| 186 | // The _n() needs to be on one line so the i18n tooling can extract the translator comment. |
| 187 | /* translators: %1$s: spam folder link, %2$d: delete interval in days */ |
| 188 | $delete_message = _n( 'Spam in the %1$s older than %2$d day is deleted automatically.', 'Spam in the %1$s older than %2$d days is deleted automatically.', $delete_interval, 'akismet' ); |
| 189 | |
| 190 | printf( |
| 191 | wp_kses( $delete_message, $kses_allow_link_href ), |
| 192 | wp_kses( $spam_folder_link, $kses_allow_link_href ), |
| 193 | esc_html( $delete_interval ) |
| 194 | ); |
| 195 | ?> |
| 196 | </div> |
| 197 | </div> |
| 198 | </div> |
| 199 | |
| 200 | <div class="akismet-settings__row is-radio"> |
| 201 | <div class="akismet-settings__row-text"> |
| 202 | <h3 class="akismet-settings__row-title"><?php esc_html_e( 'Privacy', 'akismet' ); ?></h3> |
| 203 | </div> |
| 204 | <div class="akismet-settings__row-input"> |
| 205 | <fieldset> |
| 206 | <legend class="screen-reader-text"> |
| 207 | <span><?php esc_html_e( 'Akismet privacy notice', 'akismet' ); ?></span> |
| 208 | </legend> |
| 209 | <div> |
| 210 | <label class="akismet-settings__row-input-label" for="akismet_comment_form_privacy_notice_display"> |
| 211 | <input type="radio" name="akismet_comment_form_privacy_notice" id="akismet_comment_form_privacy_notice_display" value="display" <?php checked( 'display', get_option( 'akismet_comment_form_privacy_notice' ) ); ?> /> |
| 212 | <span class="akismet-settings__row-label-text"> |
| 213 | <?php esc_html_e( 'Display a privacy notice under your comment forms.', 'akismet' ); ?> |
| 214 | </span> |
| 215 | </label> |
| 216 | </div> |
| 217 | <div> |
| 218 | <label class="akismet-settings__row-input-label" for="akismet_comment_form_privacy_notice_hide"> |
| 219 | <input type="radio" name="akismet_comment_form_privacy_notice" id="akismet_comment_form_privacy_notice_hide" value="hide" <?php echo in_array( get_option( 'akismet_comment_form_privacy_notice' ), array( 'display', 'hide' ), true ) ? checked( 'hide', get_option( 'akismet_comment_form_privacy_notice' ), false ) : 'checked="checked"'; ?> /> |
| 220 | <span class="akismet-settings__row-label-text"> |
| 221 | <?php esc_html_e( 'Do not display privacy notice.', 'akismet' ); ?> |
| 222 | </span> |
| 223 | </label> |
| 224 | </div> |
| 225 | </fieldset> |
| 226 | |
| 227 | <div class="akismet-settings__row-note"> |
| 228 | <?php esc_html_e( 'To help your site with transparency under privacy laws like the GDPR, Akismet can display a notice to your users under your comment forms.', 'akismet' ); ?> |
| 229 | </div> |
| 230 | </div> |
| 231 | </div> |
| 232 | </div> |
| 233 | |
| 234 | <div class="akismet-card-actions"> |
| 235 | <?php if ( ! Akismet::predefined_api_key() ) : ?> |
| 236 | <div id="delete-action" class="akismet-card-actions__secondary-action"> |
| 237 | <a class="submitdelete deletion" href="<?php echo esc_url( Akismet_Admin::get_page_url( 'delete_key' ) ); ?>"><?php esc_html_e( 'Disconnect this account', 'akismet' ); ?></a> |
| 238 | </div> |
| 239 | <?php endif; ?> |
| 240 | |
| 241 | <?php wp_nonce_field( Akismet_Admin::NONCE ); ?> |
| 242 | |
| 243 | <div id="publishing-action"> |
| 244 | <input type="hidden" name="action" value="enter-key"> |
| 245 | <input type="submit" name="submit" id="submit" class="akismet-button akismet-could-be-primary" value="<?php esc_attr_e( 'Save changes', 'akismet' ); ?>"> |
| 246 | </div> |
| 247 | </div> |
| 248 | </form> |
| 249 | </div> |
| 250 | </div> |
| 251 | |
| 252 | <?php if ( ! Akismet::predefined_api_key() ) : ?> |
| 253 | <div class="akismet-card"> |
| 254 | <div class="akismet-section-header"> |
| 255 | <h2 class="akismet-section-header__label"> |
| 256 | <span><?php esc_html_e( 'Account', 'akismet' ); ?></span> |
| 257 | </h2> |
| 258 | </div> |
| 259 | |
| 260 | <div class="inside"> |
| 261 | <table class="akismet-account"> |
| 262 | <tbody> |
| 263 | <tr> |
| 264 | <th scope="row"><?php esc_html_e( 'Subscription type', 'akismet' ); ?></th> |
| 265 | <td> |
| 266 | <?php echo esc_html( $akismet_user->account_name ); ?> |
| 267 | </td> |
| 268 | </tr> |
| 269 | <tr> |
| 270 | <th scope="row"><?php esc_html_e( 'Status', 'akismet' ); ?></th> |
| 271 | <td> |
| 272 | <?php |
| 273 | if ( 'cancelled' === $akismet_user->status ) : |
| 274 | esc_html_e( 'Cancelled', 'akismet' ); |
| 275 | elseif ( 'suspended' === $akismet_user->status ) : |
| 276 | esc_html_e( 'Suspended', 'akismet' ); |
| 277 | elseif ( 'missing' === $akismet_user->status ) : |
| 278 | esc_html_e( 'Missing', 'akismet' ); |
| 279 | elseif ( 'no-sub' === $akismet_user->status ) : |
| 280 | esc_html_e( 'No subscription found', 'akismet' ); |
| 281 | else : |
| 282 | esc_html_e( 'Active', 'akismet' ); |
| 283 | endif; |
| 284 | ?> |
| 285 | </td> |
| 286 | </tr> |
| 287 | <?php if ( $akismet_user->next_billing_date ) : ?> |
| 288 | <tr> |
| 289 | <th scope="row"><?php esc_html_e( 'Next billing date', 'akismet' ); ?></th> |
| 290 | <td> |
| 291 | <?php echo esc_html( gmdate( 'F j, Y', $akismet_user->next_billing_date ) ); ?> |
| 292 | </td> |
| 293 | </tr> |
| 294 | <?php endif; ?> |
| 295 | </tbody> |
| 296 | </table> |
| 297 | <div class="akismet-card-actions"> |
| 298 | <?php if ( $akismet_user->status === 'active' ) : ?> |
| 299 | <div class="akismet-card-actions__secondary-action"> |
| 300 | <a href="https://akismet.com/account" target="_blank" rel="noopener noreferrer" aria-label="Account overview on akismet.com (opens in a new window)"><?php esc_html_e( 'Account overview', 'akismet' ); ?></a> |
| 301 | </div> |
| 302 | <?php endif; ?> |
| 303 | <div id="publishing-action"> |
| 304 | <?php |
| 305 | Akismet::view( |
| 306 | 'get', |
| 307 | array( |
| 308 | 'text' => ( $akismet_user->account_type === 'free-api-key' && $akismet_user->status === 'active' ? __( 'Upgrade', 'akismet' ) : __( 'Change', 'akismet' ) ), |
| 309 | 'redirect' => 'upgrade', |
| 310 | ) |
| 311 | ); |
| 312 | ?> |
| 313 | </div> |
| 314 | </div> |
| 315 | </div> |
| 316 | </div> |
| 317 | <?php endif; ?> |
| 318 | <?php endif; ?> |
| 319 | </div> |
| 320 | </div> |
| 321 |