|
@@ 1433-1439 (lines=7) @@
|
| 1430 |
|
|
| 1431 |
|
$key_status = Akismet::check_key_status( empty( $api_key ) ? Akismet::get_api_key() : $api_key ); |
| 1432 |
|
|
| 1433 |
|
if ( ! $key_status || 'invalid' === $key_status || 'failed' === $key_status ) { |
| 1434 |
|
return rest_ensure_response( array( |
| 1435 |
|
'validKey' => false, |
| 1436 |
|
'invalidKeyCode' => 'invalid_key', |
| 1437 |
|
'invalidKeyMessage' => esc_html__( 'Invalid Akismet key. Please contact support.', 'jetpack' ), |
| 1438 |
|
) ); |
| 1439 |
|
} |
| 1440 |
|
|
| 1441 |
|
return rest_ensure_response( array( |
| 1442 |
|
'validKey' => isset( $key_status[1] ) && 'valid' === $key_status[1] |
|
@@ 1482-1484 (lines=3) @@
|
| 1479 |
|
require_once WP_PLUGIN_DIR . '/akismet/class.akismet-admin.php'; |
| 1480 |
|
$akismet_key = Akismet::verify_key( Akismet::get_api_key() ); |
| 1481 |
|
|
| 1482 |
|
if ( ! $akismet_key || 'invalid' === $akismet_key || 'failed' === $akismet_key ) { |
| 1483 |
|
return new WP_Error( 'invalid_key', esc_html__( 'Invalid Akismet key. Please contact support.', 'jetpack' ), array( 'status' => 400 ) ); |
| 1484 |
|
} |
| 1485 |
|
|
| 1486 |
|
return true; |
| 1487 |
|
} |