PageRenderTime 43ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

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

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