Changeset 3016639
- Timestamp:
- 01/02/2024 08:12:09 PM (7 months ago)
- Location:
- akismet/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
akismet/trunk/akismet.php
r3014492 r3016639 7 7 Plugin URI: https://akismet.com/ 8 8 Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. Akismet Anti-spam keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key. 9 Version: 5.3.1a 59 Version: 5.3.1a 10 10 Requires at least: 5.8 11 11 Requires PHP: 5.6.20 … … 40 40 } 41 41 42 define( 'AKISMET_VERSION', '5.3.1a 5' );42 define( 'AKISMET_VERSION', '5.3.1a' ); 43 43 define( 'AKISMET__MINIMUM_WP_VERSION', '5.8' ); 44 44 define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); -
akismet/trunk/class.akismet-admin.php
r3003470 r3016639 853 853 $akismet_user = false; 854 854 855 $subscription_verification = Akismet::http_post( Akismet::build_query( array( 'key' => $api_key, 'blog' => get_option( 'home' ) ) ), 'get-subscription' ); 855 $request_args = array( 856 'key' => $api_key, 857 'blog' => get_option( 'home' ), 858 ); 859 860 $request_args = apply_filters( 'akismet_request_args', $request_args, 'get-subscription' ); 861 862 $subscription_verification = Akismet::http_post( Akismet::build_query( $request_args ), 'get-subscription' ); 856 863 857 864 if ( ! empty( $subscription_verification[1] ) ) { … … 868 875 869 876 foreach( array( '6-months', 'all' ) as $interval ) { 870 $response = Akismet::http_post( Akismet::build_query( array( 'blog' => get_option( 'home' ), 'key' => $api_key, 'from' => $interval ) ), 'get-stats' ); 877 $request_args = array( 878 'blog' => get_option( 'home' ), 879 'key' => $api_key, 880 'from' => $interval, 881 ); 882 883 $request_args = apply_filters( 'akismet_request_args', $request_args, 'get-stats' ); 884 885 $response = Akismet::http_post( Akismet::build_query( $request_args ), 'get-stats' ); 871 886 872 887 if ( ! empty( $response[1] ) ) { … … 879 894 880 895 public static function verify_wpcom_key( $api_key, $user_id, $extra = array() ) { 881 $akismet_account = Akismet::http_post( Akismet::build_query( array_merge( array( 882 'user_id' => $user_id, 883 'api_key' => $api_key, 884 'get_account_type' => 'true' 885 ), $extra ) ), 'verify-wpcom-key' ); 896 $request_args = array_merge( 897 array( 898 'user_id' => $user_id, 899 'api_key' => $api_key, 900 'get_account_type' => 'true', 901 ), 902 $extra 903 ); 904 905 $request_args = apply_filters( 'akismet_request_args', $request_args, 'verify-wpcom-key' ); 906 907 $akismet_account = Akismet::http_post( Akismet::build_query( $request_args ), 'verify-wpcom-key' ); 886 908 887 909 if ( ! empty( $akismet_account[1] ) ) -
akismet/trunk/class.akismet-cli.php
r1900374 r3016639 147 147 } 148 148 149 $response = Akismet::http_post( 150 Akismet::build_query( array( 151 'blog' => get_option( 'home' ), 152 'key' => $api_key, 153 'from' => $interval, 154 ) ), 155 'get-stats' 149 $request_args = array( 150 'blog' => get_option( 'home' ), 151 'key' => $api_key, 152 'from' => $interval, 156 153 ); 157 154 155 156 157 158 158 159 if ( empty( $response[1] ) ) { 159 160 WP_CLI::error( __( 'Currently unable to fetch stats. Please try again.', 'akismet' ) ); -
akismet/trunk/class.akismet-rest-api.php
r1965973 r3016639 265 265 $stat_totals = array(); 266 266 267 $response = Akismet::http_post( Akismet::build_query( array( 'blog' => get_option( 'home' ), 'key' => $api_key, 'from' => $interval ) ), 'get-stats' ); 267 $request_args = array( 268 'blog' => get_option( 'home' ), 269 'key' => $api_key, 270 'from' => $interval, 271 ); 272 273 $request_args = apply_filters( 'akismet_request_args', $request_args, 'get-stats' ); 274 275 $response = Akismet::http_post( Akismet::build_query( $request_args ), 'get-stats' ); 268 276 269 277 if ( ! empty( $response[1] ) ) { … … 319 327 320 328 private static function key_is_valid( $key ) { 321 $response = Akismet::http_post( 322 Akismet::build_query( 323 array( 324 'key' => $key, 325 'blog' => get_option( 'home' ) 326 ) 327 ), 328 'verify-key' 329 $request_args = array( 330 'key' => $key, 331 'blog' => get_option( 'home' ), 329 332 ); 333 334 335 336 330 337 331 338 if ( $response[1] == 'valid' ) { -
akismet/trunk/class.akismet.php
r2966139 r3016639 109 109 110 110 if ( is_null( $access_token ) ) { 111 $response = self::http_post( self::build_query( array( 'api_key' => self::get_api_key() ) ), 'token' ); 111 $request_args = array( 'api_key' => self::get_api_key() ); 112 113 $request_args = apply_filters( 'akismet_request_args', $request_args, 'token' ); 114 115 $response = self::http_post( self::build_query( $request_args ), 'token' ); 112 116 113 117 $access_token = $response[1]; … … 118 122 119 123 public static function check_key_status( $key, $ip = null ) { 120 return self::http_post( Akismet::build_query( array( 'key' => $key, 'blog' => get_option( 'home' ) ) ), 'verify-key', $ip ); 124 $request_args = array( 125 'key' => $key, 126 'blog' => get_option( 'home' ), 127 ); 128 129 $request_args = apply_filters( 'akismet_request_args', $request_args, 'verify-key' ); 130 131 return self::http_post( self::build_query( $request_args ), 'verify-key', $ip ); 121 132 } 122 133 … … 136 147 137 148 public static function deactivate_key( $key ) { 138 $response = self::http_post( Akismet::build_query( array( 'key' => $key, 'blog' => get_option( 'home' ) ) ), 'deactivate' ); 149 $request_args = array( 150 'key' => $key, 151 'blog' => get_option( 'home' ), 152 ); 153 154 $request_args = apply_filters( 'akismet_request_args', $request_args, 'deactivate' ); 155 156 $response = self::http_post( self::build_query( $request_args ), 'deactivate' ); 139 157 140 158 if ( $response[1] != 'deactivated' ) … … 284 302 } 285 303 286 $response = self::http_post( Akismet::build_query( $comment ), 'comment-check' ); 304 /** 305 * Filter the data that is used to generate the request body for the API call. 306 * 307 * @since 5.3.1 308 * 309 * @param array $comment An array of request data. 310 * @param string $endpoint The API endpoint being requested. 311 */ 312 $comment = apply_filters( 'akismet_request_args', $comment, 'comment-check' ); 313 314 $response = self::http_post( self::build_query( $comment ), 'comment-check' ); 287 315 288 316 do_action( 'akismet_comment_check_response', $response ); … … 301 329 if ( isset( $response[0]['x-akismet-pro-tip'] ) ) 302 330 $commentdata['akismet_pro_tip'] = $response[0]['x-akismet-pro-tip']; 331 332 333 334 303 335 304 336 if ( isset( $response[0]['x-akismet-error'] ) ) { … … 443 475 update_comment_meta( $comment->comment_ID, 'akismet_pro_tip', self::$last_comment['akismet_pro_tip'] ); 444 476 } 477 478 479 480 445 481 } 446 482 } … … 712 748 $c['is_test'] = 'true'; 713 749 714 $response = self::http_post( Akismet::build_query( $c ), 'comment-check' ); 750 $c = apply_filters( 'akismet_request_args', $c, 'comment-check' ); 751 752 $response = self::http_post( self::build_query( $c ), 'comment-check' ); 715 753 716 754 if ( ! empty( $response[1] ) ) { … … 874 912 } 875 913 876 $response = Akismet::http_post( Akismet::build_query( $comment ), 'submit-spam' ); 914 $comment = apply_filters( 'akismet_request_args', $comment, 'submit-spam' ); 915 916 $response = self::http_post( self::build_query( $comment ), 'submit-spam' ); 877 917 878 918 update_comment_meta( $comment_id, 'akismet_user_result', 'true' ); … … 932 972 } 933 973 934 $response = self::http_post( Akismet::build_query( $comment ), 'submit-ham' ); 974 $comment = apply_filters( 'akismet_request_args', $comment, 'submit-ham' ); 975 976 $response = self::http_post( self::build_query( $comment ), 'submit-ham' ); 935 977 936 978 update_comment_meta( $comment_id, 'akismet_user_result', 'false' ); -
akismet/trunk/readme.txt
r3003470 r3016639 39 39 * Add a link to the 'Account overview' page on akismet.com. 40 40 * Fix a minor error that occurs when another plugin removes all comment actions from the dashboard. 41 41 42 42 43 = 5.3 =
Note: See TracChangeset
for help on using the changeset viewer.