akismet
Last commit date
_inc
11 years ago
views
11 years ago
.htaccess
12 years ago
akismet.php
11 years ago
class.akismet-admin.php
11 years ago
class.akismet-widget.php
12 years ago
class.akismet.php
11 years ago
index.php
12 years ago
readme.txt
11 years ago
wrapper.php
11 years ago
wrapper.php
293 lines
| 1 | <?php |
| 2 | |
| 3 | global $wpcom_api_key, $akismet_api_host, $akismet_api_port; |
| 4 | |
| 5 | $wpcom_api_key = defined( 'WPCOM_API_KEY' ) ? constant( 'WPCOM_API_KEY' ) : ''; |
| 6 | $akismet_api_host = Akismet::get_api_key() . '.rest.akismet.com'; |
| 7 | $akismet_api_port = 80; |
| 8 | |
| 9 | function akismet_test_mode() { |
| 10 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::is_test_mode()' ); |
| 11 | |
| 12 | return Akismet::is_test_mode(); |
| 13 | } |
| 14 | |
| 15 | function akismet_http_post( $request, $host, $path, $port = 80, $ip = null ) { |
| 16 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::http_post()' ); |
| 17 | |
| 18 | $path = str_replace( '/1.1/', '', $path ); |
| 19 | |
| 20 | return Akismet::http_post( $request, $path, $ip ); |
| 21 | } |
| 22 | |
| 23 | function akismet_microtime() { |
| 24 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::_get_microtime()' ); |
| 25 | |
| 26 | return Akismet::_get_microtime(); |
| 27 | } |
| 28 | |
| 29 | function akismet_delete_old() { |
| 30 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::delete_old_comments()' ); |
| 31 | |
| 32 | return Akismet::delete_old_comments(); |
| 33 | } |
| 34 | |
| 35 | function akismet_delete_old_metadata() { |
| 36 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::delete_old_comments_meta()' ); |
| 37 | |
| 38 | return Akismet::delete_old_comments_meta(); |
| 39 | } |
| 40 | |
| 41 | function akismet_check_db_comment( $id, $recheck_reason = 'recheck_queue' ) { |
| 42 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::check_db_comment()' ); |
| 43 | |
| 44 | return Akismet::check_db_comment( $id, $recheck_reason ); |
| 45 | } |
| 46 | |
| 47 | function akismet_rightnow() { |
| 48 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::rightnow_stats()' ); |
| 49 | |
| 50 | if ( !class_exists( 'Akismet_Admin' ) ) |
| 51 | return false; |
| 52 | |
| 53 | return Akismet_Admin::rightnow_stats(); |
| 54 | } |
| 55 | |
| 56 | function akismet_admin_init() { |
| 57 | _deprecated_function( __FUNCTION__, '3.0' ); |
| 58 | } |
| 59 | function akismet_version_warning() { |
| 60 | _deprecated_function( __FUNCTION__, '3.0' ); |
| 61 | } |
| 62 | function akismet_load_js_and_css() { |
| 63 | _deprecated_function( __FUNCTION__, '3.0' ); |
| 64 | } |
| 65 | function akismet_nonce_field( $action = -1 ) { |
| 66 | _deprecated_function( __FUNCTION__, '3.0', 'wp_nonce_field' ); |
| 67 | |
| 68 | return wp_nonce_field( $action ); |
| 69 | } |
| 70 | function akismet_plugin_action_links( $links, $file ) { |
| 71 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::plugin_action_links()' ); |
| 72 | |
| 73 | return Akismet_Admin::plugin_action_links( $links, $file ); |
| 74 | } |
| 75 | function akismet_conf() { |
| 76 | _deprecated_function( __FUNCTION__, '3.0' ); |
| 77 | } |
| 78 | function akismet_stats_display() { |
| 79 | _deprecated_function( __FUNCTION__, '3.0' ); |
| 80 | } |
| 81 | function akismet_stats() { |
| 82 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::dashboard_stats()' ); |
| 83 | |
| 84 | return Akismet_Admin::dashboard_stats(); |
| 85 | } |
| 86 | function akismet_admin_warnings() { |
| 87 | _deprecated_function( __FUNCTION__, '3.0' ); |
| 88 | } |
| 89 | function akismet_comment_row_action( $a, $comment ) { |
| 90 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::comment_row_action()' ); |
| 91 | |
| 92 | return Akismet_Admin::comment_row_actions( $a, $comment ); |
| 93 | } |
| 94 | function akismet_comment_status_meta_box( $comment ) { |
| 95 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::comment_status_meta_box()' ); |
| 96 | |
| 97 | return Akismet_Admin::comment_status_meta_box( $comment ); |
| 98 | } |
| 99 | function akismet_comments_columns( $columns ) { |
| 100 | _deprecated_function( __FUNCTION__, '3.0' ); |
| 101 | |
| 102 | return $columns; |
| 103 | } |
| 104 | function akismet_comment_column_row( $column, $comment_id ) { |
| 105 | _deprecated_function( __FUNCTION__, '3.0' ); |
| 106 | } |
| 107 | function akismet_text_add_link_callback( $m ) { |
| 108 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::text_add_link_callback()' ); |
| 109 | |
| 110 | return Akismet_Admin::text_add_link_callback( $m ); |
| 111 | } |
| 112 | function akismet_text_add_link_class( $comment_text ) { |
| 113 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::text_add_link_class()' ); |
| 114 | |
| 115 | return Akismet_Admin::text_add_link_class( $comment_text ); |
| 116 | } |
| 117 | function akismet_check_for_spam_button( $comment_status ) { |
| 118 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::check_for_spam_button()' ); |
| 119 | |
| 120 | return Akismet_Admin::check_for_spam_button( $comment_status ); |
| 121 | } |
| 122 | function akismet_submit_nonspam_comment( $comment_id ) { |
| 123 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::submit_nonspam_comment()' ); |
| 124 | |
| 125 | return Akismet::submit_nonspam_comment( $comment_id ); |
| 126 | } |
| 127 | function akismet_submit_spam_comment( $comment_id ) { |
| 128 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::submit_spam_comment()' ); |
| 129 | |
| 130 | return Akismet::submit_spam_comment( $comment_id ); |
| 131 | } |
| 132 | function akismet_transition_comment_status( $new_status, $old_status, $comment ) { |
| 133 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::transition_comment_status()' ); |
| 134 | |
| 135 | return Akismet::transition_comment_status( $new_status, $old_status, $comment ); |
| 136 | } |
| 137 | function akismet_spam_count( $type = false ) { |
| 138 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::get_spam_count()' ); |
| 139 | |
| 140 | return Akismet_Admin::get_spam_count( $type ); |
| 141 | } |
| 142 | function akismet_recheck_queue() { |
| 143 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::recheck_queue()' ); |
| 144 | |
| 145 | return Akismet_Admin::recheck_queue(); |
| 146 | } |
| 147 | function akismet_remove_comment_author_url() { |
| 148 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::remove_comment_author_url()' ); |
| 149 | |
| 150 | return Akismet_Admin::remove_comment_author_url(); |
| 151 | } |
| 152 | function akismet_add_comment_author_url() { |
| 153 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::add_comment_author_url()' ); |
| 154 | |
| 155 | return Akismet_Admin::add_comment_author_url(); |
| 156 | } |
| 157 | function akismet_check_server_connectivity() { |
| 158 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::check_server_connectivity()' ); |
| 159 | |
| 160 | return Akismet_Admin::check_server_connectivity(); |
| 161 | } |
| 162 | function akismet_get_server_connectivity( $cache_timeout = 86400 ) { |
| 163 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::()' ); |
| 164 | |
| 165 | return Akismet_Admin::get_server_connectivity( $cache_timeout ); |
| 166 | } |
| 167 | function akismet_server_connectivity_ok() { |
| 168 | _deprecated_function( __FUNCTION__, '3.0' ); |
| 169 | |
| 170 | return true; |
| 171 | } |
| 172 | function akismet_admin_menu() { |
| 173 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::admin_menu()' ); |
| 174 | |
| 175 | return Akismet_Admin::admin_menu(); |
| 176 | } |
| 177 | function akismet_load_menu() { |
| 178 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::load_menu()' ); |
| 179 | |
| 180 | return Akismet_Admin::load_menu(); |
| 181 | } |
| 182 | function akismet_init() { |
| 183 | _deprecated_function( __FUNCTION__, '3.0' ); |
| 184 | } |
| 185 | function akismet_get_key() { |
| 186 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::get_api_key()' ); |
| 187 | |
| 188 | return Akismet::get_api_key(); |
| 189 | } |
| 190 | function akismet_check_key_status( $key, $ip = null ) { |
| 191 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::check_key_status()' ); |
| 192 | |
| 193 | return Akismet::check_key_status( $key, $ip ); |
| 194 | } |
| 195 | function akismet_update_alert( $response ) { |
| 196 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::update_alert()' ); |
| 197 | |
| 198 | return Akismet::update_alert( $response ); |
| 199 | } |
| 200 | function akismet_verify_key( $key, $ip = null ) { |
| 201 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::verify_key()' ); |
| 202 | |
| 203 | return Akismet::verify_key( $key, $ip ); |
| 204 | } |
| 205 | function akismet_get_user_roles( $user_id ) { |
| 206 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::get_user_roles()' ); |
| 207 | |
| 208 | return Akismet::get_user_roles( $user_id ); |
| 209 | } |
| 210 | function akismet_result_spam( $approved ) { |
| 211 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::comment_is_spam()' ); |
| 212 | |
| 213 | return Akismet::comment_is_spam( $approved ); |
| 214 | } |
| 215 | function akismet_result_hold( $approved ) { |
| 216 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::comment_needs_moderation()' ); |
| 217 | |
| 218 | return Akismet::comment_needs_moderation( $approved ); |
| 219 | } |
| 220 | function akismet_get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ) { |
| 221 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::get_user_comments_approved()' ); |
| 222 | |
| 223 | return Akismet::get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ); |
| 224 | } |
| 225 | function akismet_update_comment_history( $comment_id, $message, $event = null ) { |
| 226 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::update_comment_history()' ); |
| 227 | |
| 228 | return Akismet::update_comment_history( $comment_id, $message, $event ); |
| 229 | } |
| 230 | function akismet_get_comment_history( $comment_id ) { |
| 231 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::get_comment_history()' ); |
| 232 | |
| 233 | return Akismet::get_comment_history( $comment_id ); |
| 234 | } |
| 235 | function akismet_cmp_time( $a, $b ) { |
| 236 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::_cmp_time()' ); |
| 237 | |
| 238 | return Akismet::_cmp_time( $a, $b ); |
| 239 | } |
| 240 | function akismet_auto_check_update_meta( $id, $comment ) { |
| 241 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::auto_check_update_meta()' ); |
| 242 | |
| 243 | return Akismet::auto_check_update_meta( $id, $comment ); |
| 244 | } |
| 245 | function akismet_auto_check_comment( $commentdata ) { |
| 246 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::auto_check_comment()' ); |
| 247 | |
| 248 | return Akismet::auto_check_comment( $commentdata ); |
| 249 | } |
| 250 | function akismet_get_ip_address() { |
| 251 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::get_ip_address()' ); |
| 252 | |
| 253 | return Akismet::get_ip_address(); |
| 254 | } |
| 255 | function akismet_cron_recheck() { |
| 256 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::cron_recheck()' ); |
| 257 | |
| 258 | return Akismet::cron_recheck(); |
| 259 | } |
| 260 | function akismet_add_comment_nonce() { |
| 261 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::add_comment_nonce()' ); |
| 262 | |
| 263 | return Akismet::add_comment_nonce( $post_id ); |
| 264 | } |
| 265 | function akismet_fix_scheduled_recheck() { |
| 266 | _deprecated_function( __FUNCTION__, '3.0', 'Akismet::fix_scheduled_recheck()' ); |
| 267 | |
| 268 | return Akismet::fix_scheduled_recheck(); |
| 269 | } |
| 270 | function akismet_spam_comments() { |
| 271 | _deprecated_function( __FUNCTION__, '3.0' ); |
| 272 | |
| 273 | return array(); |
| 274 | } |
| 275 | function akismet_spam_totals() { |
| 276 | _deprecated_function( __FUNCTION__, '3.0' ); |
| 277 | |
| 278 | return array(); |
| 279 | } |
| 280 | function akismet_manage_page() { |
| 281 | _deprecated_function( __FUNCTION__, '3.0' ); |
| 282 | } |
| 283 | function akismet_caught() { |
| 284 | _deprecated_function( __FUNCTION__, '3.0' ); |
| 285 | } |
| 286 | function redirect_old_akismet_urls() { |
| 287 | _deprecated_function( __FUNCTION__, '3.0' ); |
| 288 | } |
| 289 | function akismet_kill_proxy_check( $option ) { |
| 290 | _deprecated_function( __FUNCTION__, '3.0' ); |
| 291 | |
| 292 | return 0; |
| 293 | } |