[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-content/plugins/akismet/views/ -> config.php (source)

   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', $notice ); ?>
  24              <?php } ?>
  25          <?php } ?>
  26  
  27          <div class="akismet-card">
  28              <div class="akismet-section-header">
  29                  <h2 class="akismet-section-header__label">
  30                      <span><?php esc_html_e( 'Statistics', 'akismet' ); ?></span>
  31                  </h2>
  32  
  33                  <div class="akismet-section-header__actions">
  34                      <a href="<?php echo esc_url( Akismet_Admin::get_page_url( 'stats' ) ); ?>">
  35                          <?php esc_html_e( 'Detailed stats', 'akismet' ); ?>
  36                      </a>
  37                  </div>
  38              </div> <!-- close akismet-section-header -->
  39  
  40              <div class="akismet-new-snapshot">
  41                  <?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 */ ?>
  42                  <div class="akismet-new-snapshot__chart">
  43                      <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' ); ?>"></iframe>
  44                  </div>
  45                  <ul class="akismet-new-snapshot__list">
  46                      <li class="akismet-new-snapshot__item">
  47                          <h3 class="akismet-new-snapshot__header"><?php esc_html_e( 'Past six months', 'akismet' ); ?></h3>
  48                          <span class="akismet-new-snapshot__number"><?php echo number_format( $stat_totals['6-months']->spam ); ?></span>
  49                          <span class="akismet-new-snapshot__text"><?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['6-months']->spam, 'akismet' ) ); ?></span>
  50                      </li>
  51                      <li class="akismet-new-snapshot__item">
  52                          <h3 class="akismet-new-snapshot__header"><?php esc_html_e( 'All time', 'akismet' ); ?></h3>
  53                          <span class="akismet-new-snapshot__number"><?php echo number_format( $stat_totals['all']->spam ); ?></span>
  54                          <span class="akismet-new-snapshot__text"><?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['all']->spam, 'akismet' ) ); ?></span>
  55                      </li>
  56                      <li class="akismet-new-snapshot__item">
  57                          <h3 class="akismet-new-snapshot__header"><?php esc_html_e( 'Accuracy', 'akismet' ); ?></h3>
  58                          <span class="akismet-new-snapshot__number"><?php echo floatval( $stat_totals['all']->accuracy ); ?>%</span>
  59                          <span class="akismet-new-snapshot__text">
  60                          <?php
  61                          /* translators: %s: number of spam missed by Akismet */
  62                          echo esc_html( sprintf( _n( '%s missed spam', '%s missed spam', $stat_totals['all']->missed_spam, 'akismet' ), number_format( $stat_totals['all']->missed_spam ) ) ) . ', ';
  63                          /* translators: %s: number of false positive spam flagged by Akismet */
  64                          echo esc_html( sprintf( _n( '%s false positive', '%s false positives', $stat_totals['all']->false_positives, 'akismet' ), number_format( $stat_totals['all']->false_positives ) ) );
  65                          ?>
  66                          </span>
  67                      </li>
  68                  </ul>
  69              </div> <!-- close akismet-new-snapshot -->
  70  
  71          </div> <!-- close akismet-card -->
  72  
  73          <?php if ( $akismet_user ) : ?>
  74              <div class="akismet-card">
  75                  <div class="akismet-section-header">
  76                      <h2 class="akismet-section-header__label">
  77                          <span><?php esc_html_e( 'Settings', 'akismet' ); ?></span>
  78                      </h2>
  79                  </div>
  80  
  81                  <div class="inside">
  82                      <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" autocomplete="off" method="POST" id="akismet-settings-form">
  83  
  84                          <div class="akismet-settings">
  85                              <?php if ( ! Akismet::predefined_api_key() ) : ?>
  86                                  <div class="akismet-settings__row">
  87                                      <h3 class="akismet-settings__row-title">
  88                                          <label class="akismet-settings__row-label" for="key"><?php esc_html_e( 'API key', 'akismet' ); ?></label>
  89                                      </h3>
  90                                      <div class="akismet-settings__row-input">
  91                                          <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>
  92                                      </div>
  93                                  </div>
  94                              <?php endif; ?>
  95  
  96                              <?php
  97                              //phpcs:ignore WordPress.Security.NonceVerification.Recommended
  98                              if ( isset( $_GET['ssl_status'] ) ) :
  99                                  ?>
 100                                  <div class="akismet-settings__row">
 101                                      <div class="akismet-settings__row-text">
 102                                          <h3 class="akismet-settings__row-title"><?php esc_html_e( 'SSL status', 'akismet' ); ?></h3>
 103                                          <div class="akismet-settings__row-description">
 104                                              <?php if ( ! wp_http_supports( array( 'ssl' ) ) ) : ?>
 105                                                  <strong><?php esc_html_e( 'Disabled.', 'akismet' ); ?></strong>
 106                                                  <?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' ); ?>
 107                                              <?php else : ?>
 108                                                  <?php $ssl_disabled = get_option( 'akismet_ssl_disabled' ); ?>
 109  
 110                                                  <?php if ( $ssl_disabled ) : ?>
 111                                                      <strong><?php esc_html_e( 'Temporarily disabled.', 'akismet' ); ?></strong>
 112                                                      <?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' ); ?>
 113                                                  <?php else : ?>
 114                                                      <strong><?php esc_html_e( 'Enabled.', 'akismet' ); ?></strong>
 115                                                      <?php esc_html_e( 'All systems functional.', 'akismet' ); ?>
 116                                                  <?php endif; ?>
 117                                              <?php endif; ?>
 118                                          </div>
 119                                      </div>
 120                                  </div>
 121                              <?php endif; ?>
 122  
 123                              <div class="akismet-settings__row">
 124                                  <div class="akismet-settings__row-text">
 125                                      <h3 class="akismet-settings__row-title"><?php esc_html_e( 'Comments', 'akismet' ); ?></h3>
 126                                  </div>
 127                                  <div class="akismet-settings__row-input">
 128                                      <label class="akismet-settings__row-input-label" for="akismet_show_user_comments_approved">
 129                                          <input
 130                                          name="akismet_show_user_comments_approved"
 131                                          id="akismet_show_user_comments_approved"
 132                                          value="1"
 133                                          type="checkbox"
 134                                          <?php
 135                                          // 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.
 136                                          checked( true, ( in_array( get_option( 'akismet_show_user_comments_approved' ), array( false, '1', 'true' ), true ) ) );
 137                                          ?>
 138                                          />
 139                                          <span class="akismet-settings__row-label-text">
 140                                              <?php esc_html_e( 'Show the number of approved comments beside each comment author.', 'akismet' ); ?>
 141                                          </span>
 142                                      </label>
 143                                  </div>
 144                              </div>
 145  
 146                              <div class="akismet-settings__row is-radio">
 147                                  <div class="akismet-settings__row-text">
 148                                      <h3 class="akismet-settings__row-title"><?php esc_html_e( 'Spam filtering', 'akismet' ); ?></h3>
 149                                  </div>
 150                                  <div class="akismet-settings__row-input">
 151                                      <fieldset>
 152                                          <legend class="screen-reader-text">
 153                                              <span><?php esc_html_e( 'Akismet Anti-spam strictness', 'akismet' ); ?></span>
 154                                          </legend>
 155                                          <div>
 156                                              <label class="akismet-settings__row-input-label" for="akismet_strictness_1">
 157                                                  <input type="radio" name="akismet_strictness" id="akismet_strictness_1" value="1" <?php checked( '1', get_option( 'akismet_strictness' ) ); ?> />
 158                                                  <span class="akismet-settings__row-label-text">
 159                                                      <?php esc_html_e( 'Silently discard the worst and most pervasive spam so I never see it.', 'akismet' ); ?>
 160                                                  </span>
 161                                              </label>
 162                                          </div>
 163                                          <div>
 164                                              <label class="akismet-settings__row-input-label" for="akismet_strictness_0">
 165                                                  <input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked( '0', get_option( 'akismet_strictness' ) ); ?> />
 166                                                  <span class="akismet-settings__row-label-text">
 167                                                      <?php esc_html_e( 'Always put spam in the Spam folder for review.', 'akismet' ); ?>
 168                                                  </span>
 169                                              </label>
 170                                          </div>
 171                                      </fieldset>
 172  
 173                                      <div class="akismet-settings__row-note">
 174                                          <strong><?php esc_html_e( 'Note:', 'akismet' ); ?></strong>
 175                                          <?php
 176                                          $delete_interval = max( 1, intval( apply_filters( 'akismet_delete_comment_interval', 15 ) ) );
 177  
 178                                          $spam_folder_link = sprintf(
 179                                              '<a href="%s">%s</a>',
 180                                              esc_url( admin_url( 'edit-comments.php?comment_status=spam' ) ),
 181                                              esc_html__( 'spam folder', 'akismet' )
 182                                          );
 183  
 184                                          // The _n() needs to be on one line so the i18n tooling can extract the translator comment.
 185                                          /* translators: %1$s: spam folder link, %2$d: delete interval in days */
 186                                          $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' );
 187  
 188                                          printf(
 189                                              wp_kses( $delete_message, $kses_allow_link_href ),
 190                                              wp_kses( $spam_folder_link, $kses_allow_link_href ),
 191                                              esc_html( $delete_interval )
 192                                          );
 193                                          ?>
 194                                      </div>
 195                                  </div>
 196                              </div>
 197  
 198                              <div class="akismet-settings__row is-radio">
 199                                  <div class="akismet-settings__row-text">
 200                                      <h3 class="akismet-settings__row-title"><?php esc_html_e( 'Privacy', 'akismet' ); ?></h3>
 201                                  </div>
 202                                  <div class="akismet-settings__row-input">
 203                                      <fieldset>
 204                                          <legend class="screen-reader-text">
 205                                              <span><?php esc_html_e( 'Akismet privacy notice', 'akismet' ); ?></span>
 206                                          </legend>
 207                                          <div>
 208                                              <label class="akismet-settings__row-input-label" for="akismet_comment_form_privacy_notice_display">
 209                                                  <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' ) ); ?> />
 210                                                  <span class="akismet-settings__row-label-text">
 211                                                      <?php esc_html_e( 'Display a privacy notice under your comment forms.', 'akismet' ); ?>
 212                                                  </span>
 213                                              </label>
 214                                          </div>
 215                                          <div>
 216                                              <label class="akismet-settings__row-input-label" for="akismet_comment_form_privacy_notice_hide">
 217                                                  <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"'; ?> />
 218                                                  <span class="akismet-settings__row-label-text">
 219                                                      <?php esc_html_e( 'Do not display privacy notice.', 'akismet' ); ?>
 220                                                  </span>
 221                                              </label>
 222                                          </div>
 223                                      </fieldset>
 224  
 225                                      <div class="akismet-settings__row-note">
 226                                          <?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' ); ?>
 227                                      </div>
 228                                  </div>
 229                              </div>
 230                          </div>
 231  
 232                          <div class="akismet-card-actions">
 233                              <?php if ( ! Akismet::predefined_api_key() ) : ?>
 234                                  <div id="delete-action" class="akismet-card-actions__secondary-action">
 235                                      <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>
 236                                  </div>
 237                              <?php endif; ?>
 238  
 239                              <?php wp_nonce_field( Akismet_Admin::NONCE ); ?>
 240  
 241                              <div id="publishing-action">
 242                                  <input type="hidden" name="action" value="enter-key">
 243                                  <input type="submit" name="submit" id="submit" class="akismet-button akismet-could-be-primary" value="<?php esc_attr_e( 'Save changes', 'akismet' ); ?>">
 244                              </div>
 245                          </div>
 246                      </form>
 247                  </div>
 248              </div>
 249  
 250              <?php if ( ! Akismet::predefined_api_key() ) : ?>
 251                  <div class="akismet-card">
 252                      <div class="akismet-section-header">
 253                          <h2 class="akismet-section-header__label">
 254                              <span><?php esc_html_e( 'Account', 'akismet' ); ?></span>
 255                          </h2>
 256                      </div>
 257  
 258                      <div class="inside">
 259                          <table class="akismet-account">
 260                              <tbody>
 261                                  <tr>
 262                                      <th scope="row"><?php esc_html_e( 'Subscription type', 'akismet' ); ?></th>
 263                                      <td>
 264                                          <?php echo esc_html( $akismet_user->account_name ); ?>
 265                                      </td>
 266                                  </tr>
 267                                  <tr>
 268                                      <th scope="row"><?php esc_html_e( 'Status', 'akismet' ); ?></th>
 269                                      <td>
 270                                          <?php
 271                                          if ( 'cancelled' === $akismet_user->status ) :
 272                                              esc_html_e( 'Cancelled', 'akismet' );
 273                                          elseif ( 'suspended' === $akismet_user->status ) :
 274                                              esc_html_e( 'Suspended', 'akismet' );
 275                                          elseif ( 'missing' === $akismet_user->status ) :
 276                                              esc_html_e( 'Missing', 'akismet' );
 277                                          elseif ( 'no-sub' === $akismet_user->status ) :
 278                                              esc_html_e( 'No subscription found', 'akismet' );
 279                                          else :
 280                                              esc_html_e( 'Active', 'akismet' );
 281                                          endif;
 282                                          ?>
 283                                      </td>
 284                                  </tr>
 285                                  <?php if ( $akismet_user->next_billing_date ) : ?>
 286                                  <tr>
 287                                      <th scope="row"><?php esc_html_e( 'Next billing date', 'akismet' ); ?></th>
 288                                      <td>
 289                                          <?php echo esc_html( gmdate( 'F j, Y', $akismet_user->next_billing_date ) ); ?>
 290                                      </td>
 291                                  </tr>
 292                                  <?php endif; ?>
 293                              </tbody>
 294                          </table>
 295                          <div class="akismet-card-actions">
 296                              <?php if ( $akismet_user->status === 'active' ) : ?>
 297                                  <div class="akismet-card-actions__secondary-action">
 298                                      <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>
 299                                  </div>
 300                              <?php endif; ?>
 301                              <div id="publishing-action">
 302                                  <?php
 303                                  Akismet::view(
 304                                      'get',
 305                                      array(
 306                                          'text'     => ( $akismet_user->account_type === 'free-api-key' && $akismet_user->status === 'active' ? __( 'Upgrade', 'akismet' ) : __( 'Change', 'akismet' ) ),
 307                                          'redirect' => 'upgrade',
 308                                      )
 309                                  );
 310                                  ?>
 311                              </div>
 312                          </div>
 313                      </div>
 314                  </div>
 315              <?php endif; ?>
 316          <?php endif; ?>
 317      </div>
 318  </div>


Generated : Thu Apr 18 08:20:02 2024 Cross-referenced by PHPXref