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

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