PageRenderTime 47ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://gitlab.com/ngochuynh1991/cuacuon
PHP | 216 lines | 199 code | 17 blank | 0 comment | 24 complexity | 2e481ca3661133b6fb9b8c99fb6fd0de MD5 | raw file
  1. <div class="wrap">
  2. <h2><?php esc_html_e( 'Akismet' , 'akismet');?></h2>
  3. <div class="have-key">
  4. <?php if ( $stat_totals && isset( $stat_totals['all'] ) && (int) $stat_totals['all']->spam > 0 ) : ?>
  5. <div class="new-snapshot stats">
  6. <span style="float:right;margin:10px 15px -5px 0px">
  7. <a href="<?php echo esc_url( Akismet_Admin::get_page_url( 'stats' ) ); ?>" class=""><?php esc_html_e( 'Summaries' , 'akismet');?></a>
  8. </span>
  9. <iframe allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 215px; overflow: hidden;" src="<?php printf( '//akismet.com/web/1.0/snapshot.php?blog=%s&api_key=%s&height=180&locale=%s', urlencode( get_bloginfo('url') ), Akismet::get_api_key(), get_locale() );?>"></iframe>
  10. <ul>
  11. <li>
  12. <h3><?php esc_html_e( 'Past six months' , 'akismet');?></h3>
  13. <span><?php echo number_format( $stat_totals['6-months']->spam );?></span>
  14. <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['6-months']->spam, 'akismet' ) ); ?>
  15. </li>
  16. <li>
  17. <h3><?php esc_html_e( 'All time' , 'akismet');?></h3>
  18. <span><?php echo number_format( $stat_totals['all']->spam );?></span>
  19. <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['all']->spam, 'akismet' ) ); ?>
  20. </li>
  21. <li>
  22. <h3><?php esc_html_e( 'Accuracy' , 'akismet');?></h3>
  23. <span><?php echo $stat_totals['all']->accuracy; ?>%</span>
  24. <?php printf( _n( '%s missed spam', '%s missed spam', $stat_totals['all']->missed_spam, 'akismet' ), number_format( $stat_totals['all']->missed_spam ) ); ?>
  25. |
  26. <?php printf( _n( '%s false positive', '%s false positives', $stat_totals['all']->false_positives, 'akismet' ), number_format( $stat_totals['all']->false_positives ) ); ?>
  27. </li>
  28. </ul>
  29. <div class="clearfix"></div>
  30. </div>
  31. <?php endif;?>
  32. <?php if ( $akismet_user ):?>
  33. <div id="wpcom-stats-meta-box-container" class="metabox-holder"><?php
  34. wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
  35. wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
  36. ?>
  37. <script type="text/javascript">
  38. jQuery(document).ready( function($) {
  39. jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
  40. if(typeof postboxes !== 'undefined')
  41. postboxes.add_postbox_toggles( 'plugins_page_akismet-key-config' );
  42. });
  43. </script>
  44. <div class="postbox-container" style="width: 55%;margin-right: 10px;">
  45. <div id="normal-sortables" class="meta-box-sortables ui-sortable">
  46. <div id="referrers" class="postbox ">
  47. <div class="handlediv" title="Click to toggle"><br></div>
  48. <h3 class="hndle"><span><?php esc_html_e( 'Settings' , 'akismet');?></span></h3>
  49. <form name="akismet_conf" id="akismet-conf" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST">
  50. <div class="inside">
  51. <table cellspacing="0" class="akismet-settings">
  52. <tbody>
  53. <?php if ( !defined( 'WPCOM_API_KEY' ) ):?>
  54. <tr>
  55. <th class="akismet-api-key" width="10%" align="left" scope="row"><?php esc_html_e('API Key', 'akismet');?></th>
  56. <td width="5%"/>
  57. <td align="left">
  58. <span class="api-key"><input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( get_option('wordpress_api_key') ); ?>" class="regular-text code <?php echo $akismet_user->status;?>"></span>
  59. </td>
  60. </tr>
  61. <?php endif; ?>
  62. <?php if ( isset( $_GET['ssl_status'] ) ) { ?>
  63. <tr>
  64. <th align="left" scope="row"><?php esc_html_e( 'SSL Status', 'akismet' ); ?></th>
  65. <td></td>
  66. <td align="left">
  67. <p>
  68. <?php
  69. if ( ! function_exists( 'wp_http_supports' ) ) {
  70. ?><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
  71. }
  72. else if ( ! wp_http_supports( array( 'ssl' ) ) ) {
  73. ?><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
  74. }
  75. else {
  76. $ssl_disabled = get_option( 'akismet_ssl_disabled' );
  77. if ( $ssl_disabled ) {
  78. ?><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
  79. }
  80. else {
  81. ?><b><?php esc_html_e( 'Enabled.', 'akismet' ); ?></b> <?php esc_html_e( 'All systems functional.', 'akismet' ); ?><?php
  82. }
  83. }
  84. ?>
  85. </p>
  86. </td>
  87. </tr>
  88. <?php } ?>
  89. <tr>
  90. <th align="left" scope="row"><?php esc_html_e('Comments', 'akismet');?></th>
  91. <td></td>
  92. <td align="left">
  93. <p>
  94. <label for="akismet_show_user_comments_approved" title="<?php esc_attr_e( 'Show approved comments' , 'akismet'); ?>"><input name="akismet_show_user_comments_approved" id="akismet_show_user_comments_approved" value="1" type="checkbox" <?php checked('1', get_option('akismet_show_user_comments_approved')); ?>> <?php esc_html_e('Show the number of approved comments beside each comment author', 'akismet'); ?></label>
  95. </p>
  96. </td>
  97. </tr>
  98. <tr>
  99. <th class="strictness" align="left" scope="row"><?php esc_html_e('Strictness', 'akismet'); ?></th>
  100. <td></td>
  101. <td align="left">
  102. <fieldset><legend class="screen-reader-text"><span><?php esc_html_e('Akismet anti-spam strictness', 'akismet'); ?></span></legend>
  103. <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>
  104. <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>
  105. </fieldset>
  106. <span class="note"><strong><?php esc_html_e('Note:', 'akismet');?></strong>
  107. <?php
  108. $delete_interval = max( 1, intval( apply_filters( 'akismet_delete_comment_interval', 15 ) ) );
  109. printf(
  110. _n(
  111. 'Spam in the <a href="%1$s">spam folder</a> older than 1 day is deleted automatically.',
  112. 'Spam in the <a href="%1$s">spam folder</a> older than %2$d days is deleted automatically.',
  113. $delete_interval,
  114. 'akismet'
  115. ),
  116. admin_url( 'edit-comments.php?comment_status=spam' ),
  117. $delete_interval
  118. );
  119. ?>
  120. </td>
  121. </tr>
  122. </tbody>
  123. </table>
  124. </div>
  125. <div id="major-publishing-actions">
  126. <?php if ( !defined( 'WPCOM_API_KEY' ) ):?>
  127. <div id="delete-action">
  128. <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>
  129. </div>
  130. <?php endif; ?>
  131. <?php wp_nonce_field(Akismet_Admin::NONCE) ?>
  132. <div id="publishing-action">
  133. <input type="hidden" name="action" value="enter-key">
  134. <input type="submit" name="submit" id="submit" class="button button-primary" value="<?php esc_attr_e('Save Changes', 'akismet');?>">
  135. </div>
  136. <div class="clear"></div>
  137. </div>
  138. </form>
  139. </div>
  140. </div>
  141. </div>
  142. <div class="postbox-container" style="width:44%;">
  143. <div id="normal-sortables" class="meta-box-sortables ui-sortable">
  144. <div id="referrers" class="postbox ">
  145. <div class="handlediv" title="Click to toggle"><br></div>
  146. <h3 class="hndle"><span><?php esc_html_e( 'Account' , 'akismet');?></span></h3>
  147. <div class="inside">
  148. <table cellspacing="0">
  149. <tbody>
  150. <tr>
  151. <th scope="row" align="left"><?php esc_html_e( 'Subscription Type' , 'akismet');?></th>
  152. <td width="5%"/>
  153. <td align="left">
  154. <span><?php echo $akismet_user->account_name; ?></span>
  155. </td>
  156. </tr>
  157. <tr>
  158. <th scope="row" align="left"><?php esc_html_e( 'Status' , 'akismet');?></th>
  159. <td width="5%"/>
  160. <td align="left">
  161. <span><?php
  162. if ( 'cancelled' == $akismet_user->status ) :
  163. esc_html_e( 'Cancelled', 'akismet' );
  164. elseif ( 'suspended' == $akismet_user->status ) :
  165. esc_html_e( 'Suspended', 'akismet' );
  166. elseif ( 'missing' == $akismet_user->status ) :
  167. esc_html_e( 'Missing', 'akismet' );
  168. elseif ( 'no-sub' == $akismet_user->status ) :
  169. esc_html_e( 'No Subscription Found', 'akismet' );
  170. else :
  171. esc_html_e( 'Active', 'akismet' );
  172. endif; ?></span>
  173. </td>
  174. </tr>
  175. <?php if ( $akismet_user->next_billing_date ) : ?>
  176. <tr>
  177. <th scope="row" align="left"><?php esc_html_e( 'Next Billing Date' , 'akismet');?></th>
  178. <td width="5%"/>
  179. <td align="left">
  180. <span><?php echo date( 'F j, Y', $akismet_user->next_billing_date ); ?></span>
  181. </td>
  182. </tr>
  183. <?php endif; ?>
  184. </tbody>
  185. </table>
  186. </div>
  187. <div id="major-publishing-actions">
  188. <div id="publishing-action">
  189. <?php Akismet::view( 'get', array( 'text' => ( $akismet_user->account_type == 'free-api-key' && $akismet_user->status == 'active' ? __( 'Upgrade' , 'akismet') : __( 'Change' , 'akismet') ), 'redirect' => 'upgrade' ) ); ?>
  190. </div>
  191. <div class="clear"></div>
  192. </div>
  193. </div>
  194. </div>
  195. </div>
  196. </div>
  197. <?php endif;?>
  198. </div>
  199. </div>