Your IP : 216.73.216.162


Current Path : /home/x/b/o/xbodynamge/namtation/wp-content/
Upload File :
Current File : /home/x/b/o/xbodynamge/namtation/wp-content/notifiers.tar

.htaccess000066600000000424151134163740006353 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>interface-notification-handler.php000066600000000665151134163740013334 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Admin\Notifiers
 */

/**
 * Dictates the required methods for a Notification Handler implementation.
 */
interface WPSEO_Notification_Handler {

	/**
	 * Handles the notification object.
	 *
	 * @param Yoast_Notification_Center $notification_center The notification center object.
	 *
	 * @return void
	 */
	public function handle( Yoast_Notification_Center $notification_center );
}
dismissible-notification.php000066600000005221151134163740012261 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Admin\Notifiers
 */

/**
 * Abstract class representing a dismissible notification.
 */
abstract class WPSEO_Dismissible_Notification implements WPSEO_Listener, WPSEO_Notification_Handler {

	/**
	 * The identifier for the notification.
	 *
	 * @var string
	 */
	protected $notification_identifier = '';

	/**
	 * Retrieves instance of a notification.
	 *
	 * @return Yoast_Notification The notification.
	 */
	abstract protected function get_notification();

	/**
	 * Listens to an argument in the request URL and triggers an action.
	 *
	 * @return void
	 */
	public function listen() {
		if ( $this->get_listener_value() !== $this->notification_identifier ) {
			return;
		}

		$this->dismiss();
	}

	/**
	 * Adds the notification if applicable, otherwise removes it.
	 *
	 * @param Yoast_Notification_Center $notification_center The notification center object.
	 *
	 * @return void
	 */
	public function handle( Yoast_Notification_Center $notification_center ) {
		if ( $this->is_applicable() ) {
			$notification = $this->get_notification();
			$notification_center->add_notification( $notification );

			return;
		}

		$notification_center->remove_notification_by_id( 'wpseo-' . $this->notification_identifier );
	}

	/**
	 * Listens to an argument in the request URL and triggers an action.
	 *
	 * @return void
	 */
	protected function dismiss() {
		$this->set_dismissal_state();
		$this->redirect_to_dashboard();
	}

	/**
	 * Checks if a notice is applicable.
	 *
	 * @return bool Whether a notice should be shown or not.
	 */
	protected function is_applicable() {
		return $this->is_notice_dismissed() === false;
	}

	/**
	 * Checks whether the notification has been dismissed.
	 *
	 * @codeCoverageIgnore
	 *
	 * @return bool True when notification is dismissed.
	 */
	protected function is_notice_dismissed() {
		return get_user_meta( get_current_user_id(), 'wpseo-remove-' . $this->notification_identifier, true ) === '1';
	}

	/**
	 * Retrieves the value where listener is listening for.
	 *
	 * @codeCoverageIgnore
	 *
	 * @return string The listener value.
	 */
	protected function get_listener_value() {
		return filter_input( INPUT_GET, 'yoast_dismiss' );
	}

	/**
	 * Dismisses the notification.
	 *
	 * @codeCoverageIgnore
	 *
	 * @return void
	 */
	protected function set_dismissal_state() {
		update_user_meta( get_current_user_id(), 'wpseo-remove-' . $this->notification_identifier, true );
	}

	/**
	 * Redirects the user back to the dashboard.
	 *
	 * @codeCoverageIgnore
	 *
	 * @return void
	 */
	protected function redirect_to_dashboard() {
		wp_safe_redirect( admin_url( 'admin.php?page=wpseo_dashboard' ) );
		exit;
	}
}
class-post-type-archive-notification-handler.php000066600000001514151140424400016042 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Admin\Notifiers
 */

/**
 * Represents the logic for showing the post type archive notification.
 *
 * @deprecated 14.1
 */
class WPSEO_Post_Type_Archive_Notification_Handler extends WPSEO_Dismissible_Notification {

	/**
	 * Defaults for the title option.
	 *
	 * @var array
	 */
	protected $option_defaults = [];

	/**
	 * Sets the notification identifier.
	 *
	 * @deprecated 14.1
	 * @codeCoverageIgnore
	 */
	public function __construct() {
		_deprecated_function( __METHOD__, 'WPSEO 14.1' );
	}

	/**
	 * Returns the notification.
	 *
	 * @deprecated 14.1
	 * @codeCoverageIgnore
	 *
	 * @return Yoast_Notification|null The notification for the notification center.
	 */
	protected function get_notification() {
		_deprecated_function( __METHOD__, 'WPSEO 14.1' );

		return null;
	}
}