|
@@ 1340-1346 (lines=7) @@
|
| 1337 |
|
|
| 1338 |
|
$key_status = Akismet::check_key_status( empty( $api_key ) ? Akismet::get_api_key() : $api_key ); |
| 1339 |
|
|
| 1340 |
|
if ( ! $key_status || 'invalid' === $key_status || 'failed' === $key_status ) { |
| 1341 |
|
return rest_ensure_response( array( |
| 1342 |
|
'validKey' => false, |
| 1343 |
|
'invalidKeyCode' => 'invalid_key', |
| 1344 |
|
'invalidKeyMessage' => esc_html__( 'Invalid Akismet key. Please contact support.', 'jetpack' ), |
| 1345 |
|
) ); |
| 1346 |
|
} |
| 1347 |
|
|
| 1348 |
|
return rest_ensure_response( array( |
| 1349 |
|
'validKey' => isset( $key_status[1] ) && 'valid' === $key_status[1] |
|
@@ 1389-1391 (lines=3) @@
|
| 1386 |
|
require_once WP_PLUGIN_DIR . '/akismet/class.akismet-admin.php'; |
| 1387 |
|
$akismet_key = Akismet::verify_key( Akismet::get_api_key() ); |
| 1388 |
|
|
| 1389 |
|
if ( ! $akismet_key || 'invalid' === $akismet_key || 'failed' === $akismet_key ) { |
| 1390 |
|
return new WP_Error( 'invalid_key', esc_html__( 'Invalid Akismet key. Please contact support.', 'jetpack' ), array( 'status' => 400 ) ); |
| 1391 |
|
} |
| 1392 |
|
|
| 1393 |
|
return true; |
| 1394 |
|
} |