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


Generated : Wed May 14 08:20:01 2025 Cross-referenced by PHPXref