✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ server366.web-hosting.com ​🇻​♯➤ 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 67.223.118.204 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.243
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/builxejc/public_html/wp-content/plugins/wordpress-seo/admin//class-yoast-notifications.php
<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Admin\Notifications
 */

/**
 * Class Yoast_Notifications.
 */
class Yoast_Notifications {

	/**
	 * Holds the admin page's ID.
	 *
	 * @var string
	 */
	public const ADMIN_PAGE = 'wpseo_dashboard';

	/**
	 * Total notifications count.
	 *
	 * @var int
	 */
	private static $notification_count = 0;

	/**
	 * All error notifications.
	 *
	 * @var array
	 */
	private static $errors = [];

	/**
	 * Active errors.
	 *
	 * @var array
	 */
	private static $active_errors = [];

	/**
	 * Dismissed errors.
	 *
	 * @var array
	 */
	private static $dismissed_errors = [];

	/**
	 * All warning notifications.
	 *
	 * @var array
	 */
	private static $warnings = [];

	/**
	 * Active warnings.
	 *
	 * @var array
	 */
	private static $active_warnings = [];

	/**
	 * Dismissed warnings.
	 *
	 * @var array
	 */
	private static $dismissed_warnings = [];

	/**
	 * Yoast_Notifications constructor.
	 */
	public function __construct() {

		$this->add_hooks();
	}

	/**
	 * Add hooks
	 *
	 * @return void
	 */
	private function add_hooks() {
		// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
		if ( isset( $_GET['page'] ) && is_string( $_GET['page'] ) ) {
			// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
			$page = sanitize_text_field( wp_unslash( $_GET['page'] ) );
			if ( $page === self::ADMIN_PAGE ) {
				add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );
			}
		}

		// Needed for adminbar and Notifications page.
		add_action( 'admin_init', [ self::class, 'collect_notifications' ], 99 );

		// Add AJAX hooks.
		add_action( 'wp_ajax_yoast_dismiss_notification', [ $this, 'ajax_dismiss_notification' ] );
		add_action( 'wp_ajax_yoast_restore_notification', [ $this, 'ajax_restore_notification' ] );
	}

	/**
	 * Enqueue assets.
	 *
	 * @return void
	 */
	public function enqueue_assets() {
		$asset_manager = new WPSEO_Admin_Asset_Manager();

		$asset_manager->enqueue_style( 'notifications' );
	}

	/**
	 * Handle ajax request to dismiss a notification.
	 *
	 * @return void
	 */
	public function ajax_dismiss_notification() {

		$notification = $this->get_notification_from_ajax_request();
		if ( $notification ) {
			$notification_center = Yoast_Notification_Center::get();
			$notification_center->maybe_dismiss_notification( $notification );

			$this->output_ajax_response( $notification->get_type() );
		}

		wp_die();
	}

	/**
	 * Handle ajax request to restore a notification.
	 *
	 * @return void
	 */
	public function ajax_restore_notification() {

		$notification = $this->get_notification_from_ajax_request();
		if ( $notification ) {
			$notification_center = Yoast_Notification_Center::get();
			$notification_center->restore_notification( $notification );

			$this->output_ajax_response( $notification->get_type() );
		}

		wp_die();
	}

	/**
	 * Create AJAX response data.
	 *
	 * @param string $type Notification type.
	 *
	 * @return void
	 */
	private function output_ajax_response( $type ) {

		$html = $this->get_view_html( $type );
		// phpcs:disable WordPress.Security.EscapeOutput -- Reason: WPSEO_Utils::format_json_encode is safe.
		echo WPSEO_Utils::format_json_encode(
			[
				'html'  => $html,
				'total' => self::get_active_notification_count(),
			],
		);
		// phpcs:enable -- Reason: WPSEO_Utils::format_json_encode is safe.
	}

	/**
	 * Get the HTML to return in the AJAX request.
	 *
	 * @param string $type Notification type.
	 *
	 * @return bool|string
	 */
	private function get_view_html( $type ) {

		switch ( $type ) {
			case 'error':
				$view = 'errors';
				break;

			case 'warning':
			default:
				$view = 'warnings';
				break;
		}

		// Re-collect notifications.
		self::collect_notifications();

		/**
		 * Stops PHPStorm from nagging about this variable being unused. The variable is used in the view.
		 *
		 * @noinspection PhpUnusedLocalVariableInspection
		 */
		$notifications_data = self::get_template_variables();

		ob_start();
		include WPSEO_PATH . 'admin/views/partial-notifications-' . $view . '.php';
		$html = ob_get_clean();

		return $html;
	}

	/**
	 * Extract the Yoast Notification from the AJAX request.
	 *
	 * This function does not handle nonce verification.
	 *
	 * @return Yoast_Notification|null A Yoast_Notification on success, null on failure.
	 */
	private function get_notification_from_ajax_request() {
		// phpcs:ignore WordPress.Security.NonceVerification.Missing -- Reason: This function does not handle nonce verification.
		if ( ! isset( $_POST['notification'] ) || ! is_string( $_POST['notification'] ) ) {
			return null;
		}
		// phpcs:ignore WordPress.Security.NonceVerification.Missing -- Reason: This function does not handle nonce verification.
		$notification_id = sanitize_text_field( wp_unslash( $_POST['notification'] ) );

		if ( empty( $notification_id ) ) {
			return null;
		}
		$notification_center = Yoast_Notification_Center::get();
		return $notification_center->get_notification_by_id( $notification_id );
	}

	/**
	 * Collect the notifications and group them together.
	 *
	 * @return void
	 */
	public static function collect_notifications() {

		$notification_center = Yoast_Notification_Center::get();

		$notifications            = $notification_center->get_sorted_notifications();
		self::$notification_count = count( $notifications );

		self::$errors           = array_filter( $notifications, [ self::class, 'filter_error_notifications' ] );
		self::$dismissed_errors = array_filter( self::$errors, [ self::class, 'filter_dismissed_notifications' ] );
		self::$active_errors    = array_diff( self::$errors, self::$dismissed_errors );

		self::$warnings           = array_filter( $notifications, [ self::class, 'filter_warning_notifications' ] );
		self::$dismissed_warnings = array_filter( self::$warnings, [ self::class, 'filter_dismissed_notifications' ] );
		self::$active_warnings    = array_diff( self::$warnings, self::$dismissed_warnings );
	}

	/**
	 * Get the variables needed in the views.
	 *
	 * @return array
	 */
	public static function get_template_variables() {

		return [
			'metrics'  => [
				'total'    => self::$notification_count,
				'active'   => self::get_active_notification_count(),
				'errors'   => count( self::$errors ),
				'warnings' => count( self::$warnings ),
			],
			'errors'   => [
				'dismissed' => self::$dismissed_errors,
				'active'    => self::$active_errors,
			],
			'warnings' => [
				'dismissed' => self::$dismissed_warnings,
				'active'    => self::$active_warnings,
			],
		];
	}

	/**
	 * Get the number of active notifications.
	 *
	 * @return int
	 */
	public static function get_active_notification_count() {

		return ( count( self::$active_errors ) + count( self::$active_warnings ) );
	}

	/**
	 * Filter out any non-errors.
	 *
	 * @param Yoast_Notification $notification Notification to test.
	 *
	 * @return bool
	 */
	private static function filter_error_notifications( Yoast_Notification $notification ) {

		return $notification->get_type() === 'error';
	}

	/**
	 * Filter out any non-warnings.
	 *
	 * @param Yoast_Notification $notification Notification to test.
	 *
	 * @return bool
	 */
	private static function filter_warning_notifications( Yoast_Notification $notification ) {

		return $notification->get_type() !== 'error';
	}

	/**
	 * Filter out any dismissed notifications.
	 *
	 * @param Yoast_Notification $notification Notification to test.
	 *
	 * @return bool
	 */
	private static function filter_dismissed_notifications( Yoast_Notification $notification ) {

		return Yoast_Notification_Center::is_notification_dismissed( $notification );
	}
}

class_alias( Yoast_Notifications::class, 'Yoast_Alerts' );


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
ajax
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
capabilities
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
endpoints
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
exceptions
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
filters
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
formatter
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
google_search_console
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
import
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
listeners
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
menu
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
metabox
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
notifiers
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
pages
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
roles
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
services
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
statistics
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
taxonomy
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
tracking
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
views
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
watchers
--
9 Jun 2026 8.39 AM
builxejc / builxejc
0755
admin-settings-changed-listener.php
2.388 KB
19 Jan 2024 3.31 PM
builxejc / builxejc
0644
ajax.php
11.161 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-admin-asset-analysis-worker-location.php
1.807 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-admin-asset-dev-server-location.php
1.605 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-admin-asset-location.php
0.477 KB
20 Mar 2018 8.19 PM
builxejc / builxejc
0644
class-admin-asset-manager.php
20.573 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-admin-asset-seo-location.php
2.076 KB
5 Oct 2021 12.07 PM
builxejc / builxejc
0644
class-admin-editor-specific-replace-vars.php
6.347 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-admin-gutenberg-compatibility-notification.php
2.551 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-admin-help-panel.php
2.697 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-admin-init.php
10.717 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-admin-recommended-replace-vars.php
5.984 KB
19 Jan 2024 3.31 PM
builxejc / builxejc
0644
class-admin-user-profile.php
3.058 KB
8 Oct 2025 6.12 PM
builxejc / builxejc
0644
class-admin-utils.php
2.149 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-admin.php
12.73 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-asset.php
4.302 KB
22 Oct 2024 1.45 PM
builxejc / builxejc
0644
class-bulk-description-editor-list-table.php
2.052 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-bulk-editor-list-table.php
29.433 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-bulk-title-editor-list-table.php
2.233 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-collector.php
0.981 KB
7 Apr 2025 1.46 PM
builxejc / builxejc
0644
class-config.php
4.927 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-database-proxy.php
7.508 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-export.php
3.462 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-expose-shortlinks.php
7.085 KB
8 Oct 2025 6.12 PM
builxejc / builxejc
0644
class-gutenberg-compatibility.php
2.47 KB
12 May 2026 4.03 PM
builxejc / builxejc
0644
class-meta-columns.php
27.304 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-my-yoast-proxy.php
6.14 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-option-tab.php
2.215 KB
30 May 2022 3.34 PM
builxejc / builxejc
0644
class-option-tabs-formatter.php
2.838 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-option-tabs.php
2.257 KB
19 Jan 2024 3.31 PM
builxejc / builxejc
0644
class-paper-presenter.php
3.516 KB
18 May 2021 5.42 PM
builxejc / builxejc
0644
class-plugin-availability.php
10.064 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-plugin-conflict.php
4.044 KB
3 Apr 2024 3.08 PM
builxejc / builxejc
0644
class-premium-popup.php
2.808 KB
7 Apr 2025 1.46 PM
builxejc / builxejc
0644
class-premium-upsell-admin-block.php
7.832 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-primary-term-admin.php
7.318 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-product-upsell-notice.php
5.754 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-remote-request.php
3.128 KB
19 Jan 2024 3.31 PM
builxejc / builxejc
0644
class-schema-person-upgrade-notification.php
2.232 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-suggested-plugins.php
4.328 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-wincher-dashboard-widget.php
3.531 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-yoast-columns.php
3.521 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-yoast-dashboard-widget.php
3.928 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-yoast-form.php
35.727 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-yoast-input-validation.php
7.205 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-yoast-network-admin.php
9.972 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-yoast-network-settings-api.php
4.143 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-yoast-notification-center.php
26.023 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-yoast-notification.php
10.098 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-yoast-notifications.php
7.63 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
class-yoast-plugin-conflict.php
10.288 KB
17 Feb 2026 5.17 PM
builxejc / builxejc
0644
index.php
0.037 KB
21 Jul 2015 5.37 PM
builxejc / builxejc
0644
interface-collection.php
0.251 KB
28 Aug 2018 3.09 PM
builxejc / builxejc
0644
interface-installable.php
0.248 KB
20 Mar 2018 8.19 PM
builxejc / builxejc
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF