Changeset 3111969
- Timestamp:
- 07/03/2024 10:24:56 PM (21 months ago)
- Location:
- akismet/trunk
- Files:
-
- 4 edited
-
akismet.php (modified) (2 diffs)
-
class.akismet-admin.php (modified) (2 diffs)
-
class.akismet.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
akismet/trunk/akismet.php
r3111933 r3111969 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.3a 89 Version: 5.3.3a9 10 10 Requires at least: 5.8 11 11 Requires PHP: 5.6.20 … … 40 40 } 41 41 42 define( 'AKISMET_VERSION', '5.3.3a 8' );42 define( 'AKISMET_VERSION', '5.3.3a9' ); 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
r3111923 r3111969 534 534 535 535 public static function comment_row_action( $a, $comment ) { 536 $akismet_result = get_comment_meta( $comment->comment_ID, 'akismet_result', true ); 536 $akismet_result = get_comment_meta( $comment->comment_ID, 'akismet_result', true ); 537 if ( ! $akismet_result && get_comment_meta( $comment->comment_ID, 'akismet_skipped', true ) ) { 538 $akismet_result = 'skipped'; // Akismet chose to skip the comment-check request. 539 } 540 537 541 $akismet_error = get_comment_meta( $comment->comment_ID, 'akismet_error', true ); 538 $user_result = get_comment_meta( $comment->comment_ID, 'akismet_user_result', true );542 $user_result = get_comment_meta( $comment->comment_ID, 'akismet_user_result', true ); 539 543 $comment_status = wp_get_comment_status( $comment->comment_ID ); 540 544 $desc = null; … … 679 683 case 'webhook-ham-noaction': 680 684 $message = esc_html( __( 'Akismet cleared this comment during a recheck. It did not update the comment status because it had already been modified by another user or plugin.', 'akismet' ) ); 685 break; 686 case 'akismet-skipped': 687 $message = esc_html( __( 'This comment was not sent to Akismet when it was submitted because it was caught by something else.', 'akismet' ) ); 688 break; 689 case 'akismet-skipped-disallowed': 690 $message = esc_html( __( 'This comment was not sent to Akismet when it was submitted because it was caught by the comment disallowed list.', 'akismet' ) ); 681 691 break; 682 692 default: -
akismet/trunk/class.akismet.php
r3111923 r3111969 225 225 self::$last_comment_result = null; 226 226 227 // Skip the Akismet check if the comment matches the Disallowed Keys list. 228 if ( function_exists( 'wp_check_comment_disallowed_list' ) ) { 229 $comment_author = isset( $commentdata['comment_author'] ) ? $commentdata['comment_author'] : ''; 230 $comment_author_email = isset( $commentdata['comment_author_email'] ) ? $commentdata['comment_author_email'] : ''; 231 $comment_author_url = isset( $commentdata['comment_author_url'] ) ? $commentdata['comment_author_url'] : ''; 232 $comment_content = isset( $commentdata['comment_content'] ) ? $commentdata['comment_content'] : ''; 233 $comment_author_ip = isset( $commentdata['comment_author_IP'] ) ? $commentdata['comment_author_IP'] : ''; 234 $comment_agent = isset( $commentdata['comment_agent'] ) ? $commentdata['comment_agent'] : ''; 235 236 if ( wp_check_comment_disallowed_list( $comment_author, $comment_author_email, $comment_author_url, $comment_content, $comment_author_ip, $comment_agent ) ) { 237 self::set_last_comment( $commentdata ); 238 return $commentdata; 239 } 240 } 241 227 242 $comment = $commentdata; 228 243 … … 428 443 429 444 // normal result: true or false 430 if ( self::$last_comment['akismet_result'] == 'true' ) {445 if ( isset( self::$last_comment['akismet_result'] ) && self::$last_comment['akismet_result'] == 'true' ) { 431 446 update_comment_meta( $comment->comment_ID, 'akismet_result', 'true' ); 432 447 self::update_comment_history( $comment->comment_ID, '', 'check-spam' ); … … 438 453 ); 439 454 } 440 } elseif ( self::$last_comment['akismet_result'] == 'false' ) {455 } elseif ( isset( self::$last_comment['akismet_result'] ) && self::$last_comment['akismet_result'] == 'false' ) { 441 456 update_comment_meta( $comment->comment_ID, 'akismet_result', 'false' ); 442 457 self::update_comment_history( $comment->comment_ID, '', 'check-ham' ); … … 450 465 self::update_comment_history( $comment->comment_ID, '', 'status-changed-' . $comment->comment_approved ); 451 466 } 452 } else if ( function_exists( 'wp_blacklist_check' ) && wp_blacklist_check( $comment->comment_author, $comment->comment_author_email, $comment->comment_author_url, $comment->comment_content, $comment->comment_author_IP, $comment->comment_agent ) ) {453 self::update_comment_history( $comment->comment_ID, '', 'wp-blacklisted' );454 467 } else { 455 468 self::update_comment_history( $comment->comment_ID, '', 'status-changed-' . $comment->comment_approved ); 456 469 } 470 } 471 } elseif ( ! isset( self::$last_comment['akismet_result'] ) ) { 472 // akismet_result isn't set, so the comment wasn't sent to Akismet. 473 update_comment_meta( $comment->comment_ID, 'akismet_skipped', 'true' ); 474 $caught_by_disallowed_list = false; 475 476 if ( function_exists( 'wp_check_comment_disallowed_list' ) ) { 477 $caught_by_disallowed_list = wp_check_comment_disallowed_list( $comment->comment_author, $comment->comment_author_email, $comment->comment_author_url, $comment->comment_content, $comment->comment_author_IP, $comment->comment_agent ); 478 } 479 480 if ( $caught_by_disallowed_list ) { 481 self::update_comment_history( $comment->comment_ID, '', 'wp-disallowed' ); 482 self::update_comment_history( $comment->comment_ID, '', 'akismet-skipped-disallowed' ); 483 } else { 484 // Add a generic skipped history item. 485 self::update_comment_history( $comment->comment_ID, '', 'akismet-skipped' ); 457 486 } 458 487 } else { -
akismet/trunk/readme.txt
r3111915 r3111969 37 37 * Make setup step clearer for new users. 38 38 * Remove the stats section from the configuration page if the site has been revoked from the key. 39 * Skip the Akismet comment check when the comment matches something in the disallowed list. 39 40 40 41 = 5.3.2 =
Note: See TracChangeset
for help on using the changeset viewer.