PageRenderTime 54ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/akismet/wrapper.php

https://gitlab.com/webkod3r/tripolis
PHP | 213 lines | 196 code | 17 blank | 0 comment | 1 complexity | f65ade0e264d0d4cbc42e28745198e23 MD5 | raw file
  1. <?php
  2. global $wpcom_api_key, $akismet_api_host, $akismet_api_port;
  3. $wpcom_api_key = defined( 'WPCOM_API_KEY' ) ? constant( 'WPCOM_API_KEY' ) : '';
  4. $akismet_api_host = Akismet::get_api_key() . '.rest.akismet.com';
  5. $akismet_api_port = 80;
  6. function akismet_test_mode() {
  7. return Akismet::is_test_mode();
  8. }
  9. function akismet_http_post( $request, $host, $path, $port = 80, $ip = null ) {
  10. $path = str_replace( '/1.1/', '', $path );
  11. return Akismet::http_post( $request, $path, $ip );
  12. }
  13. function akismet_microtime() {
  14. return Akismet::_get_microtime();
  15. }
  16. function akismet_delete_old() {
  17. return Akismet::delete_old_comments();
  18. }
  19. function akismet_delete_old_metadata() {
  20. return Akismet::delete_old_comments_meta();
  21. }
  22. function akismet_check_db_comment( $id, $recheck_reason = 'recheck_queue' ) {
  23. return Akismet::check_db_comment( $id, $recheck_reason );
  24. }
  25. function akismet_rightnow() {
  26. if ( !class_exists( 'Akismet_Admin' ) )
  27. return false;
  28. return Akismet_Admin::rightnow_stats();
  29. }
  30. function akismet_admin_init() {
  31. _deprecated_function( __FUNCTION__, '3.0' );
  32. }
  33. function akismet_version_warning() {
  34. _deprecated_function( __FUNCTION__, '3.0' );
  35. }
  36. function akismet_load_js_and_css() {
  37. _deprecated_function( __FUNCTION__, '3.0' );
  38. }
  39. function akismet_nonce_field( $action = -1 ) {
  40. return wp_nonce_field( $action );
  41. }
  42. function akismet_plugin_action_links( $links, $file ) {
  43. return Akismet_Admin::plugin_action_links( $links, $file );
  44. }
  45. function akismet_conf() {
  46. _deprecated_function( __FUNCTION__, '3.0' );
  47. }
  48. function akismet_stats_display() {
  49. _deprecated_function( __FUNCTION__, '3.0' );
  50. }
  51. function akismet_stats() {
  52. return Akismet_Admin::dashboard_stats();
  53. }
  54. function akismet_admin_warnings() {
  55. _deprecated_function( __FUNCTION__, '3.0' );
  56. }
  57. function akismet_comment_row_action( $a, $comment ) {
  58. return Akismet_Admin::comment_row_actions( $a, $comment );
  59. }
  60. function akismet_comment_status_meta_box( $comment ) {
  61. return Akismet_Admin::comment_status_meta_box( $comment );
  62. }
  63. function akismet_comments_columns( $columns ) {
  64. _deprecated_function( __FUNCTION__, '3.0' );
  65. return $columns;
  66. }
  67. function akismet_comment_column_row( $column, $comment_id ) {
  68. _deprecated_function( __FUNCTION__, '3.0' );
  69. }
  70. function akismet_text_add_link_callback( $m ) {
  71. return Akismet_Admin::text_add_link_callback( $m );
  72. }
  73. function akismet_text_add_link_class( $comment_text ) {
  74. return Akismet_Admin::text_add_link_class( $comment_text );
  75. }
  76. function akismet_check_for_spam_button( $comment_status ) {
  77. return Akismet_Admin::check_for_spam_button( $comment_status );
  78. }
  79. function akismet_submit_nonspam_comment( $comment_id ) {
  80. return Akismet::submit_nonspam_comment( $comment_id );
  81. }
  82. function akismet_submit_spam_comment( $comment_id ) {
  83. return Akismet::submit_spam_comment( $comment_id );
  84. }
  85. function akismet_transition_comment_status( $new_status, $old_status, $comment ) {
  86. return Akismet::transition_comment_status( $new_status, $old_status, $comment );
  87. }
  88. function akismet_spam_count( $type = false ) {
  89. return Akismet_Admin::get_spam_count( $type );
  90. }
  91. function akismet_recheck_queue() {
  92. return Akismet_Admin::recheck_queue();
  93. }
  94. function akismet_remove_comment_author_url() {
  95. return Akismet_Admin::remove_comment_author_url();
  96. }
  97. function akismet_add_comment_author_url() {
  98. return Akismet_Admin::add_comment_author_url();
  99. }
  100. function akismet_check_server_connectivity() {
  101. return Akismet_Admin::check_server_connectivity();
  102. }
  103. function akismet_get_server_connectivity( $cache_timeout = 86400 ) {
  104. return Akismet_Admin::get_server_connectivity( $cache_timeout );
  105. }
  106. function akismet_server_connectivity_ok() {
  107. _deprecated_function( __FUNCTION__, '3.0' );
  108. return true;
  109. }
  110. function akismet_admin_menu() {
  111. return Akismet_Admin::admin_menu();
  112. }
  113. function akismet_load_menu() {
  114. return Akismet_Admin::load_menu();
  115. }
  116. function akismet_init() {
  117. _deprecated_function( __FUNCTION__, '3.0' );
  118. }
  119. function akismet_get_key() {
  120. return Akismet::get_api_key();
  121. }
  122. function akismet_check_key_status( $key, $ip = null ) {
  123. return Akismet::check_key_status( $key, $ip );
  124. }
  125. function akismet_update_alert( $response ) {
  126. return Akismet::update_alert( $response );
  127. }
  128. function akismet_verify_key( $key, $ip = null ) {
  129. return Akismet::verify_key( $key, $ip );
  130. }
  131. function akismet_get_user_roles( $user_id ) {
  132. return Akismet::get_user_roles( $user_id );
  133. }
  134. function akismet_result_spam( $approved ) {
  135. return Akismet::comment_is_spam( $approved );
  136. }
  137. function akismet_result_hold( $approved ) {
  138. return Akismet::comment_needs_moderation( $approved );
  139. }
  140. function akismet_get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ) {
  141. return Akismet::get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url );
  142. }
  143. function akismet_update_comment_history( $comment_id, $message, $event = null ) {
  144. return Akismet::update_comment_history( $comment_id, $message, $event );
  145. }
  146. function akismet_get_comment_history( $comment_id ) {
  147. return Akismet::get_comment_history( $comment_id );
  148. }
  149. function akismet_cmp_time( $a, $b ) {
  150. return Akismet::_cmp_time( $a, $b );
  151. }
  152. function akismet_auto_check_update_meta( $id, $comment ) {
  153. return Akismet::auto_check_update_meta( $id, $comment );
  154. }
  155. function akismet_auto_check_comment( $commentdata ) {
  156. return Akismet::auto_check_comment( $commentdata );
  157. }
  158. function akismet_get_ip_address() {
  159. return Akismet::get_ip_address();
  160. }
  161. function akismet_cron_recheck() {
  162. return Akismet::cron_recheck();
  163. }
  164. function akismet_add_comment_nonce() {
  165. return Akismet::add_comment_nonce( $post_id );
  166. }
  167. function akismet_fix_scheduled_recheck() {
  168. return Akismet::fix_scheduled_recheck();
  169. }
  170. function akismet_spam_comments() {
  171. _deprecated_function( __FUNCTION__, '3.0' );
  172. return array();
  173. }
  174. function akismet_spam_totals() {
  175. _deprecated_function( __FUNCTION__, '3.0' );
  176. return array();
  177. }
  178. function akismet_manage_page() {
  179. _deprecated_function( __FUNCTION__, '3.0' );
  180. }
  181. function akismet_caught() {
  182. _deprecated_function( __FUNCTION__, '3.0' );
  183. }
  184. function redirect_old_akismet_urls() {
  185. _deprecated_function( __FUNCTION__, '3.0' );
  186. }
  187. function akismet_kill_proxy_check( $option ) {
  188. _deprecated_function( __FUNCTION__, '3.0' );
  189. return 0;
  190. }
  191. function akismet_pingback_forwarded_for( $r, $url ) {
  192. return Akismet::pingback_forwarded_for( $r, $url );
  193. }
  194. function akismet_pre_check_pingback( $method ) {
  195. return Akismet::pre_check_pingback( $method );
  196. }