HEX
Server: Apache/2.4.54 (Debian)
System: Linux a5825d2beacc 4.15.0-197-generic #208-Ubuntu SMP Tue Nov 1 17:23:37 UTC 2022 x86_64
User: root (0)
PHP: 8.1.14
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/wordpress-seo/admin/ajax/class-yoast-onpage-ajax.php
<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Admin\Ajax
 */

/**
 * Class Yoast_OnPage_Ajax
 *
 * This class will catch the request to dismiss the Ryte notice and will store
 * the dismiss status as an user meta in the database.
 */
class Yoast_OnPage_Ajax {

	/**
	 * Initialize the hooks for the AJAX request
	 */
	public function __construct() {
		add_action( 'wp_ajax_wpseo_dismiss_onpageorg', array( $this, 'dismiss_notice' ) );
	}

	/**
	 * Handles the dismiss notice request
	 */
	public function dismiss_notice() {
		check_ajax_referer( 'wpseo-dismiss-onpageorg' );

		$this->save_dismissed();

		wp_die( 'true' );
	}

	/**
	 * Storing the dismissed value as an user option in the database
	 */
	private function save_dismissed() {
		update_user_meta( get_current_user_id(), WPSEO_OnPage::USER_META_KEY, 1 );
	}
}