PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.6
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.6
28.6 28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 All 130 releases
← All changes | admin/ajax.php +30 -0 trunk → 28.6 View file →
@@ -406,4 +406,34 @@
406 406
407 407 new WPSEO_Shortcode_Filter();
408 408
409 409 new WPSEO_Taxonomy_Columns();
410 +
411 +/* ********************* DEPRECATED FUNCTIONS ********************* */
412 +
413 +/**
414 + * Retrieves the keyword for the keyword doubles.
415 + *
416 + * @return void
417 + */
418 +function ajax_get_keyword_usage() {
419 + _deprecated_function( __METHOD__, 'WPSEO 20.4' );
420 + check_ajax_referer( 'wpseo-keyword-usage', 'nonce' );
421 +
422 + if ( ! isset( $_POST['post_id'], $_POST['keyword'] ) || ! is_string( $_POST['keyword'] ) ) {
423 + exit( '-1' );
424 + }
425 +
426 + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- We are casting to an integer.
427 + $post_id = (int) wp_unslash( $_POST['post_id'] );
428 +
429 + if ( $post_id === 0 || ! current_user_can( 'edit_post', $post_id ) ) {
430 + exit( '-1' );
431 + }
432 +
433 + $keyword = sanitize_text_field( wp_unslash( $_POST['keyword'] ) );
434 +
435 + wp_die(
436 + // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: WPSEO_Utils::format_json_encode is safe.
437 + WPSEO_Utils::format_json_encode( WPSEO_Meta::keyword_usage( $keyword, $post_id ) ),
438 + );
439 +}