config.php 12 KB

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