[ Index ]

PHP Cross Reference of WordPress

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  
   6  ?>
   7  <div id="akismet-plugin-container">
   8      <div class="akismet-masthead">
   9          <div class="akismet-masthead__inside-container">
  10              <div class="akismet-masthead__logo-container">
  11                  <img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>" alt="Akismet" />
  12              </div>
  13          </div>
  14      </div>
  15      <div class="akismet-lower">
  16          <?php if ( Akismet::get_api_key() ) { ?>
  17              <?php Akismet_Admin::display_status(); ?>
  18          <?php } ?>
  19          <?php if ( ! empty( $notices ) ) { ?>
  20              <?php foreach ( $notices as $notice ) { ?>
  21                  <?php Akismet::view( 'notice', $notice ); ?>
  22              <?php } ?>
  23          <?php } ?>
  24          <?php if ( $stat_totals && isset( $stat_totals['all'] ) && (int) $stat_totals['all']->spam > 0 ) : ?>
  25              <div class="akismet-card">
  26                  <div class="akismet-section-header">
  27                      <div class="akismet-section-header__label">
  28                          <span><?php esc_html_e( 'Statistics' , 'akismet'); ?></span>
  29                      </div>
  30                      <div class="akismet-section-header__actions">
  31                          <a href="<?php echo esc_url( Akismet_Admin::get_page_url( 'stats' ) ); ?>">
  32                              <?php esc_html_e( 'Detailed Stats' , 'akismet');?>
  33                          </a>
  34                      </div>
  35                  </div>
  36                  
  37                  <div class="akismet-new-snapshot">
  38                      <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&api_key=%s&height=200&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() ) ); ?>"></iframe>
  39                      <ul>
  40                          <li>
  41                              <h3><?php esc_html_e( 'Past six months' , 'akismet');?></h3>
  42                              <span><?php echo number_format( $stat_totals['6-months']->spam );?></span>
  43                              <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['6-months']->spam, 'akismet' ) ); ?>
  44                          </li>
  45                          <li>
  46                              <h3><?php esc_html_e( 'All time' , 'akismet');?></h3>
  47                              <span><?php echo number_format( $stat_totals['all']->spam );?></span>
  48                              <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['all']->spam, 'akismet' ) ); ?>
  49                          </li>
  50                          <li>
  51                              <h3><?php esc_html_e( 'Accuracy' , 'akismet');?></h3>
  52                              <span><?php echo floatval( $stat_totals['all']->accuracy ); ?>%</span>
  53                              <?php printf( _n( '%s missed spam', '%s missed spam', $stat_totals['all']->missed_spam, 'akismet' ), number_format( $stat_totals['all']->missed_spam ) ); ?>
  54                              |
  55                              <?php printf( _n( '%s false positive', '%s false positives', $stat_totals['all']->false_positives, 'akismet' ), number_format( $stat_totals['all']->false_positives ) ); ?>
  56                          </li>
  57                      </ul>
  58                  </div>
  59              </div>
  60          <?php endif;?>
  61  
  62          <?php if ( $akismet_user ) : ?>
  63              <div class="akismet-card">
  64                  <div class="akismet-section-header">
  65                      <div class="akismet-section-header__label">
  66                          <span><?php esc_html_e( 'Settings' , 'akismet'); ?></span>
  67                      </div>
  68                  </div>
  69  
  70                  <div class="inside">
  71                      <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST">
  72                          <table cellspacing="0" class="akismet-settings">
  73                              <tbody>
  74                                  <?php if ( ! Akismet::predefined_api_key() ) { ?>
  75                                  <tr>
  76                                      <th class="akismet-api-key" width="10%" align="left" scope="row">
  77                                          <label for="key"><?php esc_html_e( 'API Key', 'akismet' ); ?></label>
  78                                      </th>
  79                                      <td width="5%"/>
  80                                      <td align="left">
  81                                          <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>
  82                                      </td>
  83                                  </tr>
  84                                  <?php } ?>
  85                                  <?php if ( isset( $_GET['ssl_status'] ) ) { ?>
  86                                      <tr>
  87                                          <th align="left" scope="row"><?php esc_html_e( 'SSL Status', 'akismet' ); ?></th>
  88                                          <td></td>
  89                                          <td align="left">
  90                                              <p>
  91                                                  <?php
  92  
  93                                                  if ( ! wp_http_supports( array( 'ssl' ) ) ) {
  94                                                      ?><b><?php esc_html_e( 'Disabled.', 'akismet' ); ?></b> <?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' ); ?><?php
  95                                                  }
  96                                                  else {
  97                                                      $ssl_disabled = get_option( 'akismet_ssl_disabled' );
  98  
  99                                                      if ( $ssl_disabled ) {
 100                                                          ?><b><?php esc_html_e( 'Temporarily disabled.', 'akismet' ); ?></b> <?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' ); ?><?php
 101                                                      }
 102                                                      else {
 103                                                          ?><b><?php esc_html_e( 'Enabled.', 'akismet' ); ?></b> <?php esc_html_e( 'All systems functional.', 'akismet' ); ?><?php
 104                                                      }
 105                                                  }
 106  
 107                                                  ?>
 108                                              </p>
 109                                          </td>
 110                                      </tr>
 111                                  <?php } ?>
 112                                  <tr>
 113                                      <th align="left" scope="row"><?php esc_html_e('Comments', 'akismet');?></th>
 114                                      <td></td>
 115                                      <td align="left">
 116                                          <p>
 117                                              <label for="akismet_show_user_comments_approved" title="<?php esc_attr_e( 'Show approved comments' , 'akismet'); ?>">
 118                                                  <input
 119                                                      name="akismet_show_user_comments_approved"
 120                                                      id="akismet_show_user_comments_approved"
 121                                                      value="1"
 122                                                      type="checkbox"
 123                                                      <?php
 124                                                      
 125                                                      // 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.
 126                                                      checked( true, ( in_array( get_option( 'akismet_show_user_comments_approved' ), array( false, '1', 'true' ), true ) ) );
 127                                                      
 128                                                      ?>
 129                                                      />
 130                                                  <?php esc_html_e( 'Show the number of approved comments beside each comment author', 'akismet' ); ?>
 131                                              </label>
 132                                          </p>
 133                                      </td>
 134                                  </tr>
 135                                  <tr>
 136                                      <th class="strictness" align="left" scope="row"><?php esc_html_e('Strictness', 'akismet'); ?></th>
 137                                      <td></td>
 138                                      <td align="left">
 139                                          <fieldset><legend class="screen-reader-text"><span><?php esc_html_e('Akismet anti-spam strictness', 'akismet'); ?></span></legend>
 140                                          <p><label for="akismet_strictness_1"><input type="radio" name="akismet_strictness" id="akismet_strictness_1" value="1" <?php checked('1', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Silently discard the worst and most pervasive spam so I never see it.', 'akismet'); ?></label></p>
 141                                          <p><label for="akismet_strictness_0"><input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked('0', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Always put spam in the Spam folder for review.', 'akismet'); ?></label></p>
 142                                          </fieldset>
 143                                          <span class="akismet-note"><strong><?php esc_html_e('Note:', 'akismet');?></strong>
 144                                          <?php
 145                                      
 146                                          $delete_interval = max( 1, intval( apply_filters( 'akismet_delete_comment_interval', 15 ) ) );
 147                                      
 148                                          printf(
 149                                              _n(
 150                                                  'Spam in the <a href="%1$s">spam folder</a> older than 1 day is deleted automatically.',
 151                                                  'Spam in the <a href="%1$s">spam folder</a> older than %2$d days is deleted automatically.',
 152                                                  $delete_interval,
 153                                                  'akismet'
 154                                              ),
 155                                              admin_url( 'edit-comments.php?comment_status=spam' ),
 156                                              $delete_interval
 157                                          );
 158                                      
 159                                          ?>
 160                                      </td>
 161                                  </tr>
 162                                  <tr>
 163                                      <th class="comment-form-privacy-notice" align="left" scope="row"><?php esc_html_e('Privacy', 'akismet'); ?></th>
 164                                      <td></td>
 165                                      <td align="left">
 166                                          <fieldset><legend class="screen-reader-text"><span><?php esc_html_e('Akismet privacy notice', 'akismet'); ?></span></legend>
 167                                          <p><label for="akismet_comment_form_privacy_notice_display"><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')); ?> /> <?php esc_html_e('Display a privacy notice under your comment forms.', 'akismet'); ?></label></p>
 168                                          <p><label for="akismet_comment_form_privacy_notice_hide"><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') ) ? checked('hide', get_option('akismet_comment_form_privacy_notice'), false) : 'checked="checked"'; ?> /> <?php esc_html_e('Do not display privacy notice.', 'akismet'); ?></label></p>
 169                                          </fieldset>
 170                                          <span class="akismet-note"><?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. This feature is disabled by default, however, you can turn it on above.', 'akismet' );?></span>
 171                                      </td>
 172                                  </tr>
 173                              </tbody>
 174                          </table>
 175                          <div class="akismet-card-actions">
 176                              <?php if ( ! Akismet::predefined_api_key() ) { ?>
 177                              <div id="delete-action">
 178                                  <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>
 179                              </div>
 180                              <?php } ?>
 181                              <?php wp_nonce_field(Akismet_Admin::NONCE) ?>
 182                              <div id="publishing-action">
 183                                  <input type="hidden" name="action" value="enter-key">
 184                                  <input type="submit" name="submit" id="submit" class="akismet-button akismet-could-be-primary" value="<?php esc_attr_e('Save Changes', 'akismet');?>">
 185                              </div>
 186                              <div class="clear"></div>
 187                          </div>
 188                      </form>
 189                  </div>
 190              </div>
 191              
 192              <?php if ( ! Akismet::predefined_api_key() ) { ?>
 193                  <div class="akismet-card">
 194                      <div class="akismet-section-header">
 195                          <div class="akismet-section-header__label">
 196                              <span><?php esc_html_e( 'Account' , 'akismet'); ?></span>
 197                          </div>
 198                      </div>
 199                  
 200                      <div class="inside">
 201                          <table cellspacing="0" border="0" class="akismet-settings">
 202                              <tbody>
 203                                  <tr>
 204                                      <th scope="row" align="left"><?php esc_html_e( 'Subscription Type' , 'akismet');?></th>
 205                                      <td width="5%"/>
 206                                      <td align="left">
 207                                          <p><?php echo esc_html( $akismet_user->account_name ); ?></p>
 208                                      </td>
 209                                  </tr>
 210                                  <tr>
 211                                      <th scope="row" align="left"><?php esc_html_e( 'Status' , 'akismet');?></th>
 212                                      <td width="5%"/>
 213                                      <td align="left">
 214                                          <p><?php 
 215                                              if ( 'cancelled' == $akismet_user->status ) :
 216                                                  esc_html_e( 'Cancelled', 'akismet' ); 
 217                                              elseif ( 'suspended' == $akismet_user->status ) :
 218                                                  esc_html_e( 'Suspended', 'akismet' );
 219                                              elseif ( 'missing' == $akismet_user->status ) :
 220                                                  esc_html_e( 'Missing', 'akismet' ); 
 221                                              elseif ( 'no-sub' == $akismet_user->status ) :
 222                                                  esc_html_e( 'No Subscription Found', 'akismet' );
 223                                              else :
 224                                                  esc_html_e( 'Active', 'akismet' );  
 225                                              endif; ?></p>
 226                                      </td>
 227                                  </tr>
 228                                  <?php if ( $akismet_user->next_billing_date ) : ?>
 229                                  <tr>
 230                                      <th scope="row" align="left"><?php esc_html_e( 'Next Billing Date' , 'akismet');?></th>
 231                                      <td width="5%"/>
 232                                      <td align="left">
 233                                          <p><?php echo date( 'F j, Y', $akismet_user->next_billing_date ); ?></p>
 234                                      </td>
 235                                  </tr>
 236                                  <?php endif; ?>
 237                              </tbody>
 238                          </table>
 239                          <div class="akismet-card-actions">
 240                              <div id="publishing-action">
 241                                  <?php Akismet::view( 'get', array( 'text' => ( $akismet_user->account_type == 'free-api-key' && $akismet_user->status == 'active' ? __( 'Upgrade' , 'akismet') : __( 'Change' , 'akismet') ), 'redirect' => 'upgrade' ) ); ?>
 242                              </div>
 243                              <div class="clear"></div>
 244                          </div>
 245                      </div>
 246                  </div>
 247              <?php } ?>
 248          <?php endif;?>
 249      </div>
 250  </div>


Generated: Tue Apr 16 01:00:02 2024 Cross-referenced by PHPXref 0.7.1