✘✘ 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-notification.php
<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Admin\Notifications
 * @since   1.5.3
 */

/**
 * Implements individual notification.
 */
class Yoast_Notification {

	/**
	 * Type of capability check.
	 *
	 * @var string
	 */
	public const MATCH_ALL = 'all';

	/**
	 * Type of capability check.
	 *
	 * @var string
	 */
	public const MATCH_ANY = 'any';

	/**
	 * Notification type.
	 *
	 * @var string
	 */
	public const ERROR = 'error';

	/**
	 * Notification type.
	 *
	 * @var string
	 */
	public const WARNING = 'warning';

	/**
	 * Notification type.
	 *
	 * @var string
	 */
	public const UPDATED = 'updated';

	/**
	 * Options of this Notification.
	 *
	 * Contains optional arguments:
	 *
	 * -             type: The notification type, i.e. 'updated' or 'error'
	 * -               id: The ID of the notification
	 * -            nonce: Security nonce to use in case of dismissible notice.
	 * -         priority: From 0 to 1, determines the order of Notifications.
	 * -    dismissal_key: Option name to save dismissal information in, ID will be used if not supplied.
	 * -     capabilities: Capabilities that a user must have for this Notification to show.
	 * - capability_check: How to check capability pass: all or any.
	 * -  wpseo_page_only: Only display on wpseo page or on every page.
	 * -   yoast_branding: Whether to show the Yoast SEO branding in the notification.
	 * -    resolve_nonce: Security nonce to use in case of resolving the notification.
	 *
	 * @var array
	 */
	private $options = [];

	/**
	 * Contains default values for the optional arguments.
	 *
	 * @var array
	 */
	private $defaults = [
		'type'             => self::UPDATED,
		'id'               => '',
		'user_id'          => null,
		'nonce'            => null,
		'priority'         => 0.5,
		'data_json'        => [],
		'dismissal_key'    => null,
		'capabilities'     => [],
		'capability_check' => self::MATCH_ALL,
		'yoast_branding'   => false,
		'resolve_nonce'    => '',
	];

	/**
	 * The message for the notification.
	 *
	 * @var string
	 */
	private $message;

	/**
	 * Notification class constructor.
	 *
	 * @param string $message Message string.
	 * @param array  $options Set of options.
	 */
	public function __construct( $message, $options = [] ) {
		$this->message = $message;
		$this->options = $this->normalize_options( $options );
	}

	/**
	 * Retrieve notification ID string.
	 *
	 * @return string
	 */
	public function get_id() {
		return $this->options['id'];
	}

	/**
	 * Retrieve the user to show the notification for.
	 *
	 * @deprecated 21.6
	 * @codeCoverageIgnore
	 *
	 * @return WP_User|null The user to show this notification for.
	 */
	public function get_user() {
		_deprecated_function( __METHOD__, 'Yoast SEO 21.6' );
		return null;
	}

	/**
	 * Retrieve the id of the user to show the notification for.
	 *
	 * Returns the id of the current user if not user has been sent.
	 *
	 * @return int The user id
	 */
	public function get_user_id() {
		return ( $this->options['user_id'] ?? get_current_user_id() );
	}

	/**
	 * Retrieve nonce identifier.
	 *
	 * @return string|null Nonce for this Notification.
	 */
	public function get_nonce() {
		if ( $this->options['id'] && empty( $this->options['nonce'] ) ) {
			$this->options['nonce'] = wp_create_nonce( $this->options['id'] );
		}

		return $this->options['nonce'];
	}

	/**
	 * Make sure the nonce is up to date.
	 *
	 * @return void
	 */
	public function refresh_nonce() {
		if ( $this->options['id'] ) {
			$this->options['nonce'] = wp_create_nonce( $this->options['id'] );
		}
	}

	/**
	 * Get the type of the notification.
	 *
	 * @return string
	 */
	public function get_type() {
		return $this->options['type'];
	}

	/**
	 * Priority of the notification.
	 *
	 * Relative to the type.
	 *
	 * @return float Returns the priority between 0 and 1.
	 */
	public function get_priority() {
		return $this->options['priority'];
	}

	/**
	 * Get the nonce to resolve the alert.
	 *
	 * @return string
	 */
	public function get_resolve_nonce() {
		return $this->options['resolve_nonce'];
	}

	/**
	 * Get the User Meta key to check for dismissal of notification.
	 *
	 * @return string User Meta Option key that registers dismissal.
	 */
	public function get_dismissal_key() {
		if ( empty( $this->options['dismissal_key'] ) ) {
			return $this->options['id'];
		}

		return $this->options['dismissal_key'];
	}

	/**
	 * Is this Notification persistent.
	 *
	 * @return bool True if persistent, False if fire and forget.
	 */
	public function is_persistent() {
		$id = $this->get_id();

		return ! empty( $id );
	}

	/**
	 * Check if the notification is relevant for the current user.
	 *
	 * @return bool True if a user needs to see this notification, false if not.
	 */
	public function display_for_current_user() {
		// If the notification is for the current page only, always show.
		if ( ! $this->is_persistent() ) {
			return true;
		}

		// If the current user doesn't match capabilities.
		return $this->match_capabilities();
	}

	/**
	 * Does the current user match required capabilities.
	 *
	 * @return bool
	 */
	public function match_capabilities() {
		// Super Admin can do anything.
		if ( is_multisite() && is_super_admin( $this->options['user_id'] ) ) {
			return true;
		}

		/**
		 * Filter capabilities that enable the displaying of this notification.
		 *
		 * @param array              $capabilities The capabilities that must be present for this notification.
		 * @param Yoast_Notification $notification The notification object.
		 *
		 * @return array Array of capabilities or empty for no restrictions.
		 *
		 * @since 3.2
		 */
		$capabilities = apply_filters( 'wpseo_notification_capabilities', $this->options['capabilities'], $this );

		// Should be an array.
		if ( ! is_array( $capabilities ) ) {
			$capabilities = (array) $capabilities;
		}

		/**
		 * Filter capability check to enable all or any capabilities.
		 *
		 * @param string             $capability_check The type of check that will be used to determine if an capability is present.
		 * @param Yoast_Notification $notification     The notification object.
		 *
		 * @return string self::MATCH_ALL or self::MATCH_ANY.
		 *
		 * @since 3.2
		 */
		$capability_check = apply_filters( 'wpseo_notification_capability_check', $this->options['capability_check'], $this );

		if ( ! in_array( $capability_check, [ self::MATCH_ALL, self::MATCH_ANY ], true ) ) {
			$capability_check = self::MATCH_ALL;
		}

		if ( ! empty( $capabilities ) ) {

			$has_capabilities = array_filter( $capabilities, [ $this, 'has_capability' ] );

			switch ( $capability_check ) {
				case self::MATCH_ALL:
					return $has_capabilities === $capabilities;
				case self::MATCH_ANY:
					return ! empty( $has_capabilities );
			}
		}

		return true;
	}

	/**
	 * Array filter function to find matched capabilities.
	 *
	 * @param string $capability Capability to test.
	 *
	 * @return bool
	 */
	private function has_capability( $capability ) {
		$user_id = $this->options['user_id'];
		if ( ! is_numeric( $user_id ) ) {
			return false;
		}
		$user = get_user_by( 'id', $user_id );
		if ( ! $user ) {
			return false;
		}

		return $user->has_cap( $capability );
	}

	/**
	 * Return the object properties as an array.
	 *
	 * @return array
	 */
	public function to_array() {
		return [
			'message' => $this->message,
			'options' => $this->options,
		];
	}

	/**
	 * Adds string (view) behaviour to the notification.
	 *
	 * @return string
	 */
	public function __toString() {
		return $this->render();
	}

	/**
	 * Renders the notification as a string.
	 *
	 * @return string The rendered notification.
	 */
	public function render() {
		$attributes = [];

		// Default notification classes.
		$classes = [
			'yoast-notification',
		];

		// Maintain WordPress visualisation of notifications when they are not persistent.
		if ( ! $this->is_persistent() ) {
			$classes[] = 'notice';
			$classes[] = $this->get_type();
		}

		if ( ! empty( $classes ) ) {
			$attributes['class'] = implode( ' ', $classes );
		}

		// Combined attribute key and value into a string.
		array_walk( $attributes, [ $this, 'parse_attributes' ] );

		$message = null;
		if ( $this->options['yoast_branding'] ) {
			$message = $this->wrap_yoast_seo_icon( $this->message );
		}

		$message ??= wpautop( $this->message );

		// Build the output DIV.
		return '<div ' . implode( ' ', $attributes ) . '>' . $message . '</div>' . PHP_EOL;
	}

	/**
	 * Get the message for the notification.
	 *
	 * @return string The message.
	 */
	public function get_message() {
		return wpautop( $this->message );
	}

	/**
	 * Wraps the message with a Yoast SEO icon.
	 *
	 * @param string $message The message to wrap.
	 *
	 * @return string The wrapped message.
	 */
	private function wrap_yoast_seo_icon( $message ) {
		$out  = sprintf(
			'<img src="%1$s" height="%2$d" width="%3$d" class="yoast-seo-icon" />',
			esc_url( plugin_dir_url( WPSEO_FILE ) . 'packages/js/images/Yoast_SEO_Icon.svg' ),
			60,
			60,
		);
		$out .= '<div class="yoast-seo-icon-wrap">';
		$out .= $message;
		$out .= '</div>';

		return $out;
	}

	/**
	 * Get the JSON if provided.
	 *
	 * @return string|false
	 */
	public function get_json() {
		if ( empty( $this->options['data_json'] ) ) {
			return '';
		}

		return WPSEO_Utils::format_json_encode( $this->options['data_json'] );
	}

	/**
	 * Make sure we only have values that we can work with.
	 *
	 * @param array $options Options to normalize.
	 *
	 * @return array
	 */
	private function normalize_options( $options ) {
		$options = wp_parse_args( $options, $this->defaults );

		// Should not exceed 0 or 1.
		$options['priority'] = min( 1, max( 0, $options['priority'] ) );

		// Set default capabilities when not supplied.
		if ( empty( $options['capabilities'] ) || $options['capabilities'] === [] ) {
			$options['capabilities'] = [ 'wpseo_manage_options' ];
		}

		// Set to the id of the current user if not supplied.
		$options['user_id'] ??= get_current_user_id();

		return $options;
	}

	/**
	 * Format HTML element attributes.
	 *
	 * @param string $value Attribute value.
	 * @param string $key   Attribute name.
	 *
	 * @return void
	 */
	private function parse_attributes( &$value, $key ) {
		$value = sprintf( '%s="%s"', sanitize_key( $key ), esc_attr( $value ) );
	}
}


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