PageRenderTime 56ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/akismet/views/config.php

https://gitlab.com/Fullerton/PolitePressCore
PHP | 234 lines | 220 code | 13 blank | 1 comment | 26 complexity | cd27c0b33a7823648d0c4585b405e4c8 MD5 | raw file
  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 ( ! function_exists( 'wp_http_supports' ) ) {
  82. ?><b><?php esc_html_e( 'Disabled.', 'akismet' ); ?></b> <?php printf( esc_html( 'Your WordPress installation does not include the function %s; upgrade to the latest version of WordPress.', 'akismet' ), '<code>wp_http_supports</code>' ); ?><?php
  83. }
  84. else if ( ! wp_http_supports( array( 'ssl' ) ) ) {
  85. ?><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
  86. }
  87. else {
  88. $ssl_disabled = get_option( 'akismet_ssl_disabled' );
  89. if ( $ssl_disabled ) {
  90. ?><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
  91. }
  92. else {
  93. ?><b><?php esc_html_e( 'Enabled.', 'akismet' ); ?></b> <?php esc_html_e( 'All systems functional.', 'akismet' ); ?><?php
  94. }
  95. }
  96. ?>
  97. </p>
  98. </td>
  99. </tr>
  100. <?php } ?>
  101. <tr>
  102. <th align="left" scope="row"><?php esc_html_e('Comments', 'akismet');?></th>
  103. <td></td>
  104. <td align="left">
  105. <p>
  106. <label for="akismet_show_user_comments_approved" title="<?php esc_attr_e( 'Show approved comments' , 'akismet'); ?>">
  107. <input
  108. name="akismet_show_user_comments_approved"
  109. id="akismet_show_user_comments_approved"
  110. value="1"
  111. type="checkbox"
  112. <?php
  113. // 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.
  114. checked( true, ( in_array( get_option( 'akismet_show_user_comments_approved' ), array( false, '1', 'true' ), true ) ) );
  115. ?>
  116. />
  117. <?php esc_html_e( 'Show the number of approved comments beside each comment author', 'akismet' ); ?>
  118. </label>
  119. </p>
  120. </td>
  121. </tr>
  122. <tr>
  123. <th class="strictness" align="left" scope="row"><?php esc_html_e('Strictness', 'akismet'); ?></th>
  124. <td></td>
  125. <td align="left">
  126. <fieldset><legend class="screen-reader-text"><span><?php esc_html_e('Akismet anti-spam strictness', 'akismet'); ?></span></legend>
  127. <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>
  128. <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>
  129. </fieldset>
  130. <span class="akismet-note"><strong><?php esc_html_e('Note:', 'akismet');?></strong>
  131. <?php
  132. $delete_interval = max( 1, intval( apply_filters( 'akismet_delete_comment_interval', 15 ) ) );
  133. printf(
  134. _n(
  135. 'Spam in the <a href="%1$s">spam folder</a> older than 1 day is deleted automatically.',
  136. 'Spam in the <a href="%1$s">spam folder</a> older than %2$d days is deleted automatically.',
  137. $delete_interval,
  138. 'akismet'
  139. ),
  140. admin_url( 'edit-comments.php?comment_status=spam' ),
  141. $delete_interval
  142. );
  143. ?>
  144. </td>
  145. </tr>
  146. </tbody>
  147. </table>
  148. <div class="akismet-card-actions">
  149. <?php if ( ! Akismet::predefined_api_key() ) { ?>
  150. <div id="delete-action">
  151. <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>
  152. </div>
  153. <?php } ?>
  154. <?php wp_nonce_field(Akismet_Admin::NONCE) ?>
  155. <div id="publishing-action">
  156. <input type="hidden" name="action" value="enter-key">
  157. <input type="submit" name="submit" id="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e('Save Changes', 'akismet');?>">
  158. </div>
  159. <div class="clear"></div>
  160. </div>
  161. </form>
  162. </div>
  163. </div>
  164. <?php if ( ! Akismet::predefined_api_key() ) { ?>
  165. <div class="akismet-card">
  166. <div class="akismet-section-header">
  167. <div class="akismet-section-header__label">
  168. <span><?php esc_html_e( 'Account' , 'akismet'); ?></span>
  169. </div>
  170. </div>
  171. <div class="inside">
  172. <table cellspacing="0" border="0" class="akismet-settings">
  173. <tbody>
  174. <tr>
  175. <th scope="row" align="left"><?php esc_html_e( 'Subscription Type' , 'akismet');?></th>
  176. <td width="5%"/>
  177. <td align="left">
  178. <p><?php echo esc_html( $akismet_user->account_name ); ?></p>
  179. </td>
  180. </tr>
  181. <tr>
  182. <th scope="row" align="left"><?php esc_html_e( 'Status' , 'akismet');?></th>
  183. <td width="5%"/>
  184. <td align="left">
  185. <p><?php
  186. if ( 'cancelled' == $akismet_user->status ) :
  187. esc_html_e( 'Cancelled', 'akismet' );
  188. elseif ( 'suspended' == $akismet_user->status ) :
  189. esc_html_e( 'Suspended', 'akismet' );
  190. elseif ( 'missing' == $akismet_user->status ) :
  191. esc_html_e( 'Missing', 'akismet' );
  192. elseif ( 'no-sub' == $akismet_user->status ) :
  193. esc_html_e( 'No Subscription Found', 'akismet' );
  194. else :
  195. esc_html_e( 'Active', 'akismet' );
  196. endif; ?></p>
  197. </td>
  198. </tr>
  199. <?php if ( $akismet_user->next_billing_date ) : ?>
  200. <tr>
  201. <th scope="row" align="left"><?php esc_html_e( 'Next Billing Date' , 'akismet');?></th>
  202. <td width="5%"/>
  203. <td align="left">
  204. <p><?php echo date( 'F j, Y', $akismet_user->next_billing_date ); ?></p>
  205. </td>
  206. </tr>
  207. <?php endif; ?>
  208. </tbody>
  209. </table>
  210. <div class="akismet-card-actions">
  211. <div id="publishing-action">
  212. <?php Akismet::view( 'get', array( 'text' => ( $akismet_user->account_type == 'free-api-key' && $akismet_user->status == 'active' ? __( 'Upgrade' , 'akismet') : __( 'Change' , 'akismet') ), 'redirect' => 'upgrade' ) ); ?>
  213. </div>
  214. <div class="clear"></div>
  215. </div>
  216. </div>
  217. </div>
  218. <?php } ?>
  219. <?php endif;?>
  220. </div>
  221. </div>