diff --git a/composer.json b/composer.json index 06cbe40..f127ec6 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "php-stubs/wordpress-stubs": "^5.3.0 || ^6.0" }, "require-dev": { - "php": "~7.1", + "php": ">=8.1", "php-stubs/generator": "^0.8" }, "suggest": { diff --git a/finder.php b/finder.php index fc91c96..ad10987 100644 --- a/finder.php +++ b/finder.php @@ -28,22 +28,40 @@ ) ->append( \StubsGenerator\Finder::create() - ->in(['source/wordpress-seo/vendor_prefixed/wordproof/wordpress-sdk/app/']) + ->in(['source/wordpress-seo/vendor_prefixed/symfony/dependency-injection/']) ->files() ) ->append( \StubsGenerator\Finder::create() - ->in(['source/wordpress-seo/vendor_prefixed/symfony/dependency-injection/']) + ->in(['source/wordpress-seo/vendor_prefixed/psr/container/src/']) ->files() ) ->append( \StubsGenerator\Finder::create() - ->in(['source/wordpress-seo/vendor_prefixed/psr/container/src/']) + ->in(['source/wordpress-seo/vendor_prefixed/psr/log/Psr/Log/']) ->files() ) + // New in Yoast SEO 24.6 - PSR HTTP interfaces ->append( \StubsGenerator\Finder::create() - ->in(['source/wordpress-seo/vendor_prefixed/psr/log/Psr/Log/']) + ->in(['source/wordpress-seo/vendor_prefixed/psr/http-client/src/']) + ->files() + ) + ->append( + \StubsGenerator\Finder::create() + ->in(['source/wordpress-seo/vendor_prefixed/psr/http-factory/src/']) + ->files() + ) + // New in Yoast SEO 24.6 - Symfony deprecation contracts + ->append( + \StubsGenerator\Finder::create() + ->in(['source/wordpress-seo/vendor_prefixed/symfony/deprecation-contracts/']) + ->files() + ) + // Required dependency - Yoast WHIP for PHP version checking + ->append( + \StubsGenerator\Finder::create() + ->in(['source/vendor/yoast/whip/src/']) ->files() ) ->sortByName() diff --git a/generate.sh b/generate.sh index d10ecc1..693c3b3 100755 --- a/generate.sh +++ b/generate.sh @@ -23,8 +23,8 @@ test -d "source/wordpress-seo" # Tame wild beasts # https://github.com/Yoast/wordpress-seo/pull/20190 -sed -i -e 's#^\(\s*\*\)\s\+.*$#\1#' "$FILE" +sed -i '' -e 's#^\(\s*\*\)\s\+.*$#\1#' "$FILE" printf '\nnamespace Yoast\\WP\\Free\\Loggers { class Migration_Logger {} }\n' >>"$FILE" diff --git a/source/composer.json b/source/composer.json index 0d8fb7f..b41d38c 100644 --- a/source/composer.json +++ b/source/composer.json @@ -1,7 +1,7 @@ { "require": { - "php": "~7.0", - "yoast/wordpress-seo": "20.5" + "php": ">=8.1", + "yoast/wordpress-seo": "24.6" }, "minimum-stability": "stable", "extra": { diff --git a/wordpress-seo-stubs.php b/wordpress-seo-stubs.php index 3297f5f..b926161 100644 --- a/wordpress-seo-stubs.php +++ b/wordpress-seo-stubs.php @@ -5,1070 +5,988 @@ * @see https://github.com/php-stubs/wordpress-seo-stubs */ -namespace { +namespace Yoast\WHIPv2 { /** - * An interface for registering integrations with WordPress. + * Class Configuration. */ - interface WPSEO_WordPress_Integration + class Configuration { /** - * Registers all hooks to WordPress. + * The configuration to use. * - * @return void + * @var array */ - public function register_hooks(); - } - /** - * WPSEO plugin file. - * - * @package WPSEO\Admin - */ - /** - * A WordPress integration that listens for whether the SEO changes have been saved successfully. - */ - class WPSEO_Admin_Settings_Changed_Listener implements \WPSEO_WordPress_Integration - { + private $configuration; /** - * Have the Yoast SEO settings been saved. + * Configuration constructor. * - * @var bool - */ - private static $settings_saved = \false; - /** - * Registers all hooks to WordPress. + * @param array $configuration The configuration to use. * - * @return void + * @throws InvalidType When the $configuration parameter is not of the expected type. */ - public function register_hooks() + public function __construct($configuration = array()) { } /** - * Checks and overwrites the wp_settings_errors global to determine whether the Yoast SEO settings have been saved. + * Retrieves the configured version of a particular requirement. + * + * @param Requirement $requirement The requirement to check. + * + * @return string|int The version of the passed requirement that was detected as a string. + * If the requirement does not exist, this returns int -1. */ - public function intercept_save_update_notification() + public function configuredVersion(\Yoast\WHIPv2\Interfaces\Requirement $requirement) { } /** - * Checks whether the settings notification is a settings_updated notification. + * Determines whether the passed requirement is present in the configuration. * - * @param array $wp_settings_error The settings object. + * @param Requirement $requirement The requirement to check. * - * @return bool Whether this is a settings updated settings notification. + * @return bool Whether or not the requirement is present in the configuration. */ - public function is_settings_updated_notification($wp_settings_error) + public function hasRequirementConfigured(\Yoast\WHIPv2\Interfaces\Requirement $requirement) { } + } +} +namespace Yoast\WHIPv2\Exceptions { + /** + * Class EmptyProperty. + */ + class EmptyProperty extends \Exception + { /** - * Get whether the settings have successfully been saved + * EmptyProperty constructor. * - * @return bool Whether the settings have successfully been saved. + * @param string $property Property name. */ - public function have_settings_been_saved() + public function __construct($property) { } + } + /** + * Class InvalidOperatorType. + */ + class InvalidOperatorType extends \Exception + { /** - * Renders a success message if the Yoast SEO settings have been saved. + * InvalidOperatorType constructor. + * + * @param string $value Invalid operator. + * @param string[] $validOperators Valid operators. */ - public function show_success_message() + public function __construct($value, $validOperators = array('=', '==', '===', '<', '>', '<=', '>=')) { } } /** - * WPSEO plugin file. - * - * @package WPSEO\Admin\Ajax - */ - /** - * Class WPSEO_Shortcode_Filter. - * - * Used for parsing WP shortcodes with AJAX. + * Class InvalidType. */ - class WPSEO_Shortcode_Filter + class InvalidType extends \Exception { /** - * Initialize the AJAX hooks. + * InvalidType constructor. + * + * @param string $property Property name. + * @param string $value Property value. + * @param string $expectedType Expected property type. */ - public function __construct() + public function __construct($property, $value, $expectedType) { } + } + /** + * Exception for an invalid version comparison string. + * + * @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded -- Name should be descriptive and was historically (before namespacing) already set to this. + */ + class InvalidVersionComparisonString extends \Exception + { /** - * Parse the shortcodes. + * InvalidVersionComparisonString constructor. + * + * @param string $value The passed version comparison string. */ - public function do_filter() + public function __construct($value) { } } +} +namespace Yoast\WHIPv2 { /** - * WPSEO plugin file. - * - * @package WPSEO\Admin\Ajax - */ - /** - * This class will catch the request to dismiss the target notice (set by notice_name) - * and will store the dismiss status as an user meta in the database. + * Represents a host. */ - class Yoast_Dismissable_Notice_Ajax + class Host { /** - * Notice type toggle value for user notices. + * Key to an environment variable which should be set to the name of the host. * * @var string */ - const FOR_USER = 'user_meta'; + const HOST_NAME_KEY = 'WHIP_NAME_OF_HOST'; /** - * Notice type toggle value for network notices. + * Filter name for the filter which allows for pointing to the WP hosting page instead of the Yoast version. * * @var string */ - const FOR_NETWORK = 'site_option'; + const HOSTING_PAGE_FILTER_KEY = 'whip_hosting_page_url_wordpress'; /** - * Notice type toggle value for site notices. + * Retrieves the name of the host if set. * - * @var string + * @return string The name of the host. */ - const FOR_SITE = 'option'; + public static function name() + { + } /** - * Name of the notice that will be dismissed. + * Filters the name if we are in a WordPress context. + * In a non-WordPress content this function just returns the passed name. * - * @var string + * @param string $name The current name of the host. + * + * @return string The filtered name of the host. */ - private $notice_name; + private static function filterName($name) + { + } /** - * The type of the current notice. + * Retrieves the message from the host if set. * - * @var string + * @param string $messageKey The key to use as the environment variable. + * + * @return string The message as set by the host. */ - private $notice_type; + public static function message($messageKey) + { + } /** - * Initialize the hooks for the AJAX request. + * Filters the message if we are in a WordPress context. + * In a non-WordPress content this function just returns the passed message. * - * @param string $notice_name The name for the hook to catch the notice. - * @param string $notice_type The notice type. + * @param string $messageKey The key used for the environment variable. + * @param string $message The current message from the host. + * + * @return string */ - public function __construct($notice_name, $notice_type = self::FOR_USER) + private static function filterMessage($messageKey, $message) { } /** - * Handles the dismiss notice request. + * Returns the URL for the hosting page. + * + * @return string The URL to the hosting overview page. */ - public function dismiss_notice() + public static function hostingPageUrl() { } /** - * Storing the dismissed value in the database. The target location is based on the set notification type. + * Filters the hosting page url if we are in a WordPress context. + * In a non-WordPress context this function just returns a link to the Yoast hosting page. + * + * @param string $url The previous URL. + * + * @return string The new URL to the hosting overview page. */ - private function save_dismissed() + private static function filterHostingPageUrl($url) { } } +} +namespace Yoast\WHIPv2\Interfaces { /** - * WPSEO plugin file. - * - * @package WPSEO\Admin\Ajax - */ - /** - * Class Yoast_Plugin_Conflict_Ajax. + * Interface DismissStorage. */ - class Yoast_Plugin_Conflict_Ajax + interface DismissStorage { /** - * Option identifier where dismissed conflicts are stored. + * Saves the value. * - * @var string - */ - private $option_name = 'wpseo_dismissed_conflicts'; - /** - * List of notification identifiers that have been dismissed. + * @param int $dismissedValue The value to save. * - * @var array + * @return bool True when successful. */ - private $dismissed_conflicts = []; + public function set($dismissedValue); /** - * Initialize the hooks for the AJAX request. + * Returns the value. + * + * @return int The stored value. */ - public function __construct() - { - } + public function get(); + } + /** + * Interface Listener. + */ + interface Listener + { /** - * Handles the dismiss notice request. + * Method that should implement the listen functionality. + * + * @return void */ - public function dismiss_notice() - { - } + public function listen(); + } + /** + * Interface Message. + */ + interface Message + { /** - * Getting the user option from the database. + * Retrieves the message body. * - * @return bool|array + * @return string Message. */ - private function get_dismissed_option() - { - } + public function body(); + } + /** + * Interface MessagePresenter. + */ + interface MessagePresenter + { /** - * Getting the dismissed conflicts from the database + * Renders the message. * - * @param string $plugin_section Type of conflict group (such as Open Graph or sitemap). - * - * @return array + * @return void */ - private function get_dismissed_conflicts($plugin_section) - { - } + public function renderMessage(); + } + /** + * Interface Requirement. + */ + interface Requirement + { /** - * Storing the conflicting plugins as an user option in the database. + * Retrieves the component name defined for the requirement. * - * @param string $plugin_section Plugin conflict type (such as Open Graph or sitemap). + * @return string The component name. */ - private function save_dismissed_conflicts($plugin_section) - { - } + public function component(); /** - * Loop through the plugins to compare them with the already stored dismissed plugin conflicts. + * Gets the components version defined for the requirement. * - * @param array $posted_plugins Plugin set to check. + * @return string */ - public function compare_plugins(array $posted_plugins) - { - } + public function version(); /** - * Check if plugin is already dismissed, if not store it in the array that will be saved later. + * Gets the operator to use when comparing version numbers. * - * @param string $posted_plugin Plugin to check against dismissed conflicts. + * @return string The comparison operator. */ - private function compare_plugin($posted_plugin) - { - } + public function operator(); } /** - * WPSEO plugin file. - * - * @package WPSEO\Admin\Capabilities - */ - /** - * Capability Manager interface. + * An interface that represents a version detector and message. */ - interface WPSEO_Capability_Manager + interface VersionDetector { /** - * Registers a capability. + * Detects the version of the installed software. * - * @param string $capability Capability to register. - * @param array $roles Roles to add the capability to. - * @param bool $overwrite Optional. Use add or overwrite as registration method. - */ - public function register($capability, array $roles, $overwrite = \false); - /** - * Adds the registerd capabilities to the system. - */ - public function add(); - /** - * Removes the registered capabilities from the system. + * @return string */ - public function remove(); + public function detect(); /** - * Returns the list of registered capabilities. + * Returns the message that should be shown if a version is not deemed appropriate by the implementation. * - * @return string[] List of registered capabilities. + * @return string */ - public function get_capabilities(); + public function getMessage(); } +} +namespace Yoast\WHIPv2 { /** - * WPSEO plugin file. - * - * @package WPSEO\Admin\Capabilities - */ - /** - * Abstract Capability Manager shared code. + * A class to dismiss messages. */ - abstract class WPSEO_Abstract_Capability_Manager implements \WPSEO_Capability_Manager + class MessageDismisser { /** - * Registered capabilities. + * Storage object to manage the dismissal state. * - * @var array + * @var DismissStorage */ - protected $capabilities = []; + protected $storage; /** - * Registers a capability. + * The current time. * - * @param string $capability Capability to register. - * @param array $roles Roles to add the capability to. - * @param bool $overwrite Optional. Use add or overwrite as registration method. + * @var int */ - public function register($capability, array $roles, $overwrite = \false) + protected $currentTime; + /** + * The number of seconds the message will be dismissed. + * + * @var int + */ + protected $threshold; + /** + * MessageDismisser constructor. + * + * @param int $currentTime The current time. + * @param int $threshold The number of seconds the message will be dismissed. + * @param DismissStorage $storage Storage object to manage the dismissal state. + */ + public function __construct($currentTime, $threshold, \Yoast\WHIPv2\Interfaces\DismissStorage $storage) { } /** - * Returns the list of registered capabilitities. + * Saves the version number to the storage to indicate the message as being dismissed. * - * @return string[] Registered capabilities. + * @return void */ - public function get_capabilities() + public function dismiss() { } /** - * Returns a list of WP_Role roles. - * - * The string array of role names are converted to actual WP_Role objects. - * These are needed to be able to use the API on them. - * - * @param array $roles Roles to retrieve the objects for. + * Checks if the current time is lower than the stored time extended by the threshold. * - * @return WP_Role[] List of WP_Role objects. + * @return bool True when current time is lower than stored value + threshold. */ - protected function get_wp_roles(array $roles) + public function isDismissed() { } /** - * Filter capability roles. + * Checks the nonce. * - * @param string $capability Capability to filter roles for. - * @param array $roles List of roles which can be filtered. + * @param string $nonce The nonce to check. + * @param string $action The action to check. * - * @return array Filtered list of roles for the capability. + * @return bool True when the nonce is valid. */ - protected function filter_roles($capability, array $roles) + public function verifyNonce($nonce, $action) { } } /** - * WPSEO plugin file. - * - * @package WPSEO\Admin\Capabilities - */ - /** - * Capability Manager Factory. + * A helper class to format messages. */ - class WPSEO_Capability_Manager_Factory + final class MessageFormatter { /** - * Returns the Manager to use. + * Wraps a piece of text in HTML strong tags. * - * @param string $plugin_type Whether it's Free or Premium. + * @param string $toWrap The text to wrap. * - * @return WPSEO_Capability_Manager Manager to use. + * @return string The wrapped text. */ - public static function get($plugin_type = 'free') + public static function strong($toWrap) { } - } - /** - * WPSEO plugin file. - * - * @package WPSEO\Admin\Capabilities - */ - /** - * Integrates Yoast SEO capabilities with third party role manager plugins. - * - * Integrates with: Members - * Integrates with: User Role Editor - */ - class WPSEO_Capability_Manager_Integration implements \WPSEO_WordPress_Integration - { /** - * Capability manager to use. + * Wraps a piece of text in HTML p tags. * - * @var WPSEO_Capability_Manager - */ - public $manager; - /** - * WPSEO_Capability_Manager_Integration constructor. + * @param string $toWrap The text to wrap. * - * @param WPSEO_Capability_Manager $manager The capability manager to use. + * @return string The wrapped text. */ - public function __construct(\WPSEO_Capability_Manager $manager) + public static function paragraph($toWrap) { } /** - * Registers the hooks. + * Wraps a piece of text in HTML p and strong tags. * - * @return void + * @param string $toWrap The text to wrap. + * + * @return string The wrapped text. */ - public function register_hooks() + public static function strongParagraph($toWrap) { } + } +} +namespace Yoast\WHIPv2\Messages { + /** + * Class BasicMessage. + */ + class BasicMessage implements \Yoast\WHIPv2\Interfaces\Message + { /** - * Get the Yoast SEO capabilities. - * Optionally append them to an existing array. + * Message body. * - * @param array $caps Optional existing capability list. - * @return array + * @var string */ - public function get_capabilities(array $caps = []) - { - } + private $body; /** - * Add capabilities to its own group in the Members plugin. + * Message constructor. * - * @see members_register_cap_group() + * @param string $body Message body. */ - public function action_members_register_cap_group() + public function __construct($body) { } /** - * Adds Yoast SEO capability group in the User Role Editor plugin. + * Retrieves the message body. * - * @see URE_Capabilities_Groups_Manager::get_groups_tree() - * - * @param array $groups Current groups. - * - * @return array Filtered list of capabilty groups. + * @return string Message. */ - public function filter_ure_capabilities_groups_tree($groups = []) + public function body() { } /** - * Adds capabilities to the Yoast SEO group in the User Role Editor plugin. + * Validates the parameters passed to the constructor of this class. * - * @see URE_Capabilities_Groups_Manager::get_cap_groups() + * @param string $body Message body. * - * @param array $groups Current capability groups. - * @param string $cap_id Capability identifier. + * @return void * - * @return array List of filtered groups. + * @throws EmptyProperty When the $body parameter is empty. + * @throws InvalidType When the $body parameter is not of the expected type. */ - public function filter_ure_custom_capability_groups($groups = [], $cap_id = '') + private function validateParameters($body) { } } /** - * WPSEO plugin file. - * - * @package WPSEO\Admin\Capabilities - */ - /** - * VIP implementation of the Capability Manager. + * Class HostMessage. */ - final class WPSEO_Capability_Manager_VIP extends \WPSEO_Abstract_Capability_Manager + class HostMessage implements \Yoast\WHIPv2\Interfaces\Message { /** - * Adds the registered capabilities to the system. + * Text domain to use for translations. * - * @return void + * @var string */ - public function add() + private $textdomain; + /** + * The environment key to use to retrieve the message from. + * + * @var string + */ + private $messageKey; + /** + * Message constructor. + * + * @param string $messageKey The environment key to use to retrieve the message from. + * @param string $textdomain The text domain to use for translations. + */ + public function __construct($messageKey, $textdomain) { } /** - * Removes the registered capabilities from the system + * Retrieves the message body. * - * @return void + * @return string The message body. */ - public function remove() + public function body() { } /** - * Returns the roles which the capability is registered on. - * - * @param array $role_capabilities List of all roles with their capabilities. - * @param string $capability Capability to filter roles for. - * @param array $roles List of default roles. + * Renders the message title. * - * @return array List of capabilities. + * @return string The message title. */ - protected function get_role_capabilities($role_capabilities, $capability, $roles) + public function title() { } } /** - * WPSEO plugin file. + * Class Whip_InvalidVersionMessage. * - * @package WPSEO\Admin\Capabilities - */ - /** - * Default WordPress capability manager implementation. + * @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded -- Name should be descriptive and was historically (before namespacing) already set to this. */ - final class WPSEO_Capability_Manager_WP extends \WPSEO_Abstract_Capability_Manager + class InvalidVersionRequirementMessage implements \Yoast\WHIPv2\Interfaces\Message { /** - * Adds the capabilities to the roles. + * Object containing the version requirement for a component. * - * @return void + * @var VersionRequirement */ - public function add() + private $requirement; + /** + * Detected version requirement or -1 if not found. + * + * @var string|int + */ + private $detected; + /** + * InvalidVersionRequirementMessage constructor. + * + * @param VersionRequirement $requirement Object containing the version requirement for a component. + * @param string|int $detected Detected version requirement or -1 if not found. + */ + public function __construct(\Yoast\WHIPv2\VersionRequirement $requirement, $detected) { } /** - * Unregisters the capabilities from the system. + * Retrieves the message body. * - * @return void + * @return string Message. */ - public function remove() + public function body() { } } /** - * WPSEO plugin file. - * - * @package WPSEO\Admin\Capabilities + * Class NullMessage. */ + class NullMessage implements \Yoast\WHIPv2\Interfaces\Message + { + /** + * Retrieves the message body. + * + * @return string Message. + */ + public function body() + { + } + } /** - * Capability Utils collection. + * Class UpgradePhpMessage */ - class WPSEO_Capability_Utils + class UpgradePhpMessage implements \Yoast\WHIPv2\Interfaces\Message { /** - * Checks if the user has the proper capabilities. + * The text domain to use for the translations. * - * @param string $capability Capability to check. + * @var string + */ + private $textdomain; + /** + * UpgradePhpMessage constructor. * - * @return bool True if the user has the proper rights. + * @param string $textdomain The text domain to use for the translations. */ - public static function current_user_can($capability) + public function __construct($textdomain) { } /** - * Retrieves the users that have the specified capability. - * - * @param string $capability The name of the capability. + * Retrieves the message body to display. * - * @return array The users that have the capability. + * @return string The message to display. */ - public static function get_applicable_users($capability) + public function body() { } + } +} +namespace Yoast\WHIPv2 { + /** + * Manages messages using a global to prevent duplicate messages. + */ + class MessagesManager + { /** - * Retrieves the roles that have the specified capability. - * - * @param string $capability The name of the capability. - * - * @return array The names of the roles that have the capability. + * MessagesManager constructor. */ - public static function get_applicable_roles($capability) + public function __construct() { } /** - * Checks if the current user has at least one of the supplied capabilities. + * Adds a message to the Messages Manager. * - * @param array $capabilities Capabilities to check against. + * @param Message $message The message to add. * - * @return bool True if the user has at least one capability. + * @return void */ - protected static function has_any(array $capabilities) + public function addMessage(\Yoast\WHIPv2\Interfaces\Message $message) { } /** - * Checks if the user has a certain capability. - * - * @param string $capability Capability to check against. + * Determines whether or not there are messages available. * - * @return bool True if the user has the capability. + * @return bool Whether or not there are messages available. */ - protected static function has($capability) + public function hasMessages() { } - } - /** - * WPSEO plugin file. - * - * @package WPSEO\Admin\Capabilities - */ - /** - * Capabilities registration class. - */ - class WPSEO_Register_Capabilities implements \WPSEO_WordPress_Integration - { /** - * Registers the hooks. + * Lists the messages that are currently available. * - * @return void + * @return array The messages that are currently set. */ - public function register_hooks() + public function listMessages() { } /** - * Registers the capabilities. + * Deletes all messages. * * @return void */ - public function register() + public function deleteMessages() { } /** - * Revokes the 'wpseo_manage_options' capability from administrator users if it should - * only be granted to network administrators. - * - * @param array $allcaps An array of all the user's capabilities. - * @param array $caps Actual capabilities being checked. - * @param array $args Optional parameters passed to has_cap(), typically object ID. - * @param WP_User $user The user object. + * Gets the latest message. * - * @return array Possibly modified array of the user's capabilities. + * @return Message The message. Returns a NullMessage if none is found. */ - public function filter_user_has_wpseo_manage_options_cap($allcaps, $caps, $args, $user) + public function getLatestMessage() { } /** - * Maybe add manage_privacy_options capability for wpseo_manager user role. + * Sorts the list of messages based on the version number. * - * @param string[] $caps Primitive capabilities required of the user. - * @param string[] $cap Capability being checked. + * @param array $messages The list of messages to sort. * - * @return string[] Filtered primitive capabilities required of the user. + * @return array The sorted list of messages. */ - public function map_meta_cap_for_seo_manager($caps, $cap) + private function sortByVersion(array $messages) { } } +} +namespace Yoast\WHIPv2\Presenters { /** - * WPSEO plugin file. + * A message presenter to show a WordPress notice. * - * @package WPSEO\Admin - */ - /** - * Represents a way to determine an assets location. + * @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded -- Sniff does not count acronyms correctly. */ - interface WPSEO_Admin_Asset_Location + class WPMessagePresenter implements \Yoast\WHIPv2\Interfaces\MessagePresenter { /** - * Determines the URL of the asset on the dev server. + * The string to show to dismiss the message. * - * @param WPSEO_Admin_Asset $asset The asset to determine the URL for. - * @param string $type The type of asset. Usually JS or CSS. + * @var string + */ + private $dismissMessage; + /** + * The message to be displayed. * - * @return string The URL of the asset. + * @var Message */ - public function get_url(\WPSEO_Admin_Asset $asset, $type); - } - /** - * WPSEO plugin file. - * - * @package WPSEO\Admin - */ - /** - * Represents a way to determine the analysis worker asset location. - */ - final class WPSEO_Admin_Asset_Analysis_Worker_Location implements \WPSEO_Admin_Asset_Location - { + private $message; /** - * Holds the asset's location. + * Dismisser object. * - * @var WPSEO_Admin_Asset_Location + * @var MessageDismisser */ - private $asset_location; + private $dismisser; /** - * Holds the asset itself. + * WPMessagePresenter constructor. * - * @var WPSEO_Admin_Asset + * @param Message $message The message to use in the presenter. + * @param MessageDismisser $dismisser Dismisser object. + * @param string $dismissMessage The copy to show to dismiss the message. */ - private $asset; + public function __construct(\Yoast\WHIPv2\Interfaces\Message $message, \Yoast\WHIPv2\MessageDismisser $dismisser, $dismissMessage) + { + } /** - * Constructs the location of the analysis worker asset. + * Registers hooks to WordPress. * - * @param string $flat_version The flat version of the asset. - * @param string $name The name of the analysis worker asset. + * This is a separate function so you can control when the hooks are registered. + * + * @return void */ - public function __construct($flat_version = '', $name = 'analysis-worker') + public function registerHooks() { } /** - * Retrieves the analysis worker asset. + * Renders the messages present in the global to notices. * - * @return WPSEO_Admin_Asset The analysis worker asset. + * @return void */ - public function get_asset() + public function renderMessage() { } /** - * Determines the URL of the asset on the dev server. + * Removes content from the message that we don't want to show. * - * @param WPSEO_Admin_Asset $asset The asset to determine the URL for. - * @param string $type The type of asset. Usually JS or CSS. + * @param string $message The message to clean. * - * @return string The URL of the asset. + * @return string The cleaned message. */ - public function get_url(\WPSEO_Admin_Asset $asset, $type) + public function kses($message) { } } +} +namespace Yoast\WHIPv2 { /** - * WPSEO plugin file. - * - * @package WPSEO\Admin - */ - /** - * Changes the asset paths to dev server paths. + * Main controller class to require a certain version of software. */ - final class WPSEO_Admin_Asset_Dev_Server_Location implements \WPSEO_Admin_Asset_Location + class RequirementsChecker { /** - * Holds the dev server's default URL. + * Requirements the environment should comply with. * - * @var string + * @var array */ - const DEFAULT_URL = 'http://localhost:8080'; + private $requirements; /** - * Holds the url where the server is located. + * The configuration to check. + * + * @var Configuration + */ + private $configuration; + /** + * Message Manager. + * + * @var MessagesManager + */ + private $messageManager; + /** + * The text domain to use for translations. * * @var string */ - private $url; + private $textdomain; /** - * Class constructor. + * RequirementsChecker constructor. * - * @param string|null $url Where the dev server is located. + * @param array $configuration The configuration to check. + * @param string $textdomain The text domain to use for translations. + * + * @throws InvalidType When the $configuration parameter is not of the expected type. */ - public function __construct($url = \null) + public function __construct($configuration = array(), $textdomain = 'default') { } /** - * Determines the URL of the asset on the dev server. + * Adds a requirement to the list of requirements if it doesn't already exist. * - * @param WPSEO_Admin_Asset $asset The asset to determine the URL for. - * @param string $type The type of asset. Usually JS or CSS. + * @param Requirement $requirement The requirement to add. * - * @return string The URL of the asset. + * @return void */ - public function get_url(\WPSEO_Admin_Asset $asset, $type) + public function addRequirement(\Yoast\WHIPv2\Interfaces\Requirement $requirement) { } /** - * Determines the URL of the asset not using the dev server. - * - * @param WPSEO_Admin_Asset $asset The asset to determine the URL for. - * @param string $type The type of asset. + * Determines whether or not there are requirements available. * - * @return string The URL of the asset file. + * @return bool Whether or not there are requirements. */ - public function get_default_url(\WPSEO_Admin_Asset $asset, $type) + public function hasRequirements() { } - } - /** - * WPSEO plugin file. - * - * @package WPSEO\Admin - */ - /** - * This class registers all the necessary styles and scripts. - * - * Also has methods for the enqueing of scripts and styles. - * It automatically adds a prefix to the handle. - */ - class WPSEO_Admin_Asset_Manager - { - /** - * Prefix for naming the assets. - * - * @var string - */ - const PREFIX = 'yoast-seo-'; - /** - * Class that manages the assets' location. - * - * @var WPSEO_Admin_Asset_Location - */ - protected $asset_location; - /** - * Prefix for naming the assets. - * - * @var string - */ - private $prefix; /** - * Constructs a manager of assets. Needs a location to know where to register assets at. + * Gets the total amount of requirements. * - * @param WPSEO_Admin_Asset_Location|null $asset_location The provider of the asset location. - * @param string $prefix The prefix for naming assets. + * @return int The total amount of requirements. */ - public function __construct(\WPSEO_Admin_Asset_Location $asset_location = \null, $prefix = self::PREFIX) + public function totalRequirements() { } /** - * Enqueues scripts. + * Determines whether or not a requirement exists for a particular component. * - * @param string $script The name of the script to enqueue. - */ - public function enqueue_script($script) - { - } - /** - * Enqueues styles. + * @param string $component The component to check for. * - * @param string $style The name of the style to enqueue. + * @return bool Whether or not the component has a requirement defined. */ - public function enqueue_style($style) + public function requirementExistsForComponent($component) { } /** - * Enqueues the appropriate language for the user. + * Determines whether a requirement has been fulfilled. + * + * @param Requirement $requirement The requirement to check. + * + * @return bool Whether or not the requirement is fulfilled. */ - public function enqueue_user_language_script() + private function requirementIsFulfilled(\Yoast\WHIPv2\Interfaces\Requirement $requirement) { } /** - * Registers scripts based on it's parameters. + * Checks if all requirements are fulfilled and adds a message to the message manager if necessary. * - * @param WPSEO_Admin_Asset $script The script to register. + * @return void */ - public function register_script(\WPSEO_Admin_Asset $script) + public function check() { } /** - * Registers styles based on it's parameters. + * Adds a message to the message manager for requirements that cannot be fulfilled. * - * @param WPSEO_Admin_Asset $style The style to register. + * @param Requirement $requirement The requirement that cannot be fulfilled. + * + * @return void */ - public function register_style(\WPSEO_Admin_Asset $style) + private function addMissingRequirementMessage(\Yoast\WHIPv2\Interfaces\Requirement $requirement) { } /** - * Calls the functions that register scripts and styles with the scripts and styles to be registered as arguments. + * Determines whether or not there are messages available. + * + * @return bool Whether or not there are messages to display. */ - public function register_assets() + public function hasMessages() { } /** - * Registers all the scripts passed to it. + * Gets the most recent message from the message manager. * - * @param array $scripts The scripts passed to it. + * @return Message The latest message. */ - public function register_scripts($scripts) + public function getMostRecentMessage() { } + } + /** + * A value object containing a version requirement for a component version. + */ + class VersionRequirement implements \Yoast\WHIPv2\Interfaces\Requirement + { /** - * Registers all the styles it receives. + * The component name. * - * @param array $styles Styles that need to be registered. + * @var string */ - public function register_styles($styles) - { - } + private $component; /** - * Localizes the script. + * The component version. * - * @param string $handle The script handle. - * @param string $object_name The object name. - * @param array $data The l10n data. + * @var string */ - public function localize_script($handle, $object_name, $data) - { - } + private $version; /** - * Adds an inline script. + * The operator to use when comparing version. * - * @param string $handle The script handle. - * @param string $data The l10n data. - * @param string $position Optional. Whether to add the inline script before the handle or after. + * @var string */ - public function add_inline_script($handle, $data, $position = 'after') - { - } + private $operator; /** - * A list of styles that shouldn't be registered but are needed in other locations in the plugin. + * Requirement constructor. * - * @return array + * @param string $component The component name. + * @param string $version The component version. + * @param string $operator The operator to use when comparing version. */ - public function special_styles() + public function __construct($component, $version, $operator = '=') { } /** - * Flattens a version number for use in a filename. - * - * @param string $version The original version number. + * Retrieves the component name defined for the requirement. * - * @return string The flattened version number. + * @return string The component name. */ - public function flatten_version($version) + public function component() { } /** - * Creates a default location object for use in the admin asset manager. + * Gets the components version defined for the requirement. * - * @return WPSEO_Admin_Asset_Location The location to use in the asset manager. + * @return string */ - public static function create_default_location() + public function version() { } /** - * Checks if the given script is enqueued. - * - * @param string $script The script to check. + * Gets the operator to use when comparing version numbers. * - * @return bool True when the script is enqueued. + * @return string The comparison operator. */ - public function is_script_enqueued($script) + public function operator() { } /** - * Returns the scripts that need to be registered. + * Creates a new version requirement from a comparison string. * - * @todo Data format is not self-documenting. Needs explanation inline. R. + * @param string $component The component for this version requirement. + * @param string $comparisonString The comparison string for this version requirement. * - * @return array The scripts that need to be registered. + * @return VersionRequirement The parsed version requirement. + * + * @throws InvalidVersionComparisonString When an invalid version comparison string is passed. */ - protected function scripts_to_be_registered() + public static function fromCompareString($component, $comparisonString) { } /** - * Loads a generated asset file. + * Validates the parameters passed to the requirement. * - * @param array $args { - * The arguments. - * - * @type string $asset_file The asset file to load. - * @type int $ext_length The length of the extension, including suffix, of the filename. - * @type string $suffix Optional. The suffix of the asset name. - * @type array $additional_deps Optional. The additional dependencies assets may have. - * @type string $base_dir Optional. The base directory of the asset. - * @type string[] $header_scripts Optional. The script names that should be in the header. - * } + * @param string $component The component name. + * @param string $version The component version. + * @param string $operator The operator to use when comparing version. * - * @return array { - * The scripts to be registered. + * @return void * - * @type string $name The name of the asset. - * @type string $src The src of the asset. - * @type string[] $deps The dependenies of the asset. - * @type bool $in_footer Whether or not the asset should be in the footer. - * } + * @throws EmptyProperty When any of the parameters is empty. + * @throws InvalidOperatorType When the $operator parameter is invalid. + * @throws InvalidType When any of the parameters is not of the expected type. */ - protected function load_generated_asset_file($args) + private function validateParameters($component, $version, $operator) { } + } + /** + * Represents the WordPress option for saving the dismissed messages. + * + * @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded -- Sniff does not count acronyms correctly. + */ + class WPDismissOption implements \Yoast\WHIPv2\Interfaces\DismissStorage + { /** - * Loads the scripts that should be renamed for BC. - * - * @return array { - * The scripts to be registered. + * WordPress option name. * - * @type string $name The name of the asset. - * @type string $src The src of the asset. - * @type string[] $deps The dependenies of the asset. - * @type bool $in_footer Whether or not the asset should be in the footer. - * } + * @var string */ - protected function load_renamed_scripts() - { - } + protected $optionName = 'whip_dismiss_timestamp'; /** - * Returns the styles that need to be registered. + * Saves the value to the options. * - * @todo Data format is not self-documenting. Needs explanation inline. R. + * @param int $dismissedValue The value to save. * - * @return array Styles that need to be registered. + * @return bool True when successful. */ - protected function styles_to_be_registered() + public function set($dismissedValue) { } /** - * Determines the URL of the asset. - * - * @param WPSEO_Admin_Asset $asset The asset to determine the URL for. - * @param string $type The type of asset. Usually JS or CSS. + * Returns the value of the whip_dismissed option. * - * @return string The URL of the asset. + * @return int Returns the value of the option or an empty string when not set. */ - protected function get_url(\WPSEO_Admin_Asset $asset, $type) + public function get() { } } /** - * WPSEO plugin file. + * Listener for dismissing a message. * - * @package WPSEO\Admin - */ - /** - * Determines the location of an asset within the SEO plugin. + * @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded -- Sniff does not count acronyms correctly. */ - final class WPSEO_Admin_Asset_SEO_Location implements \WPSEO_Admin_Asset_Location + class WPMessageDismissListener implements \Yoast\WHIPv2\Interfaces\Listener { /** - * Path to the plugin file. + * The name of the dismiss action expected to be passed via $_GET. * * @var string */ - protected $plugin_file; + const ACTION_NAME = 'whip_dismiss'; /** - * Whether or not to add the file suffix to the asset. + * The object for dismissing a message. * - * @var bool + * @var MessageDismisser */ - protected $add_suffix = \true; + protected $dismisser; /** - * The plugin file to base the asset location upon. + * Sets the dismisser attribute. * - * @param string $plugin_file The plugin file string. - * @param bool $add_suffix Optional. Whether or not a file suffix should be added. + * @param MessageDismisser $dismisser The object for dismissing a message. */ - public function __construct($plugin_file, $add_suffix = \true) + public function __construct(\Yoast\WHIPv2\MessageDismisser $dismisser) { } /** - * Determines the URL of the asset on the dev server. + * Listens to a GET request to fetch the required attributes. * - * @param WPSEO_Admin_Asset $asset The asset to determine the URL for. - * @param string $type The type of asset. Usually JS or CSS. - * - * @return string The URL of the asset. + * @return void */ - public function get_url(\WPSEO_Admin_Asset $asset, $type) + public function listen() { } /** - * Determines the path relative to the plugin folder of an asset. + * Creates an url for dismissing the notice. * - * @param WPSEO_Admin_Asset $asset The asset to determine the path for. - * @param string $type The type of asset. - * - * @return string The path to the asset file. + * @return string The url for dismissing the message. */ - protected function get_path(\WPSEO_Admin_Asset $asset, $type) + public function getDismissURL() { } } +} +namespace { /** - * WPSEO plugin file. - * - * @package WPSEO\Admin - */ - /** - * Localizes JavaScript files. - * - * @codeCoverageIgnore - * @deprecated 18.0 + * An interface for registering integrations with WordPress. */ - final class WPSEO_Admin_Asset_Yoast_Components_L10n + interface WPSEO_WordPress_Integration { /** - * Represents the asset manager. - * - * @var WPSEO_Admin_Asset_Manager - */ - protected $asset_manager; - /** - * WPSEO_Admin_Asset_Yoast_Components_L10n constructor. - * - * @codeCoverageIgnore - * @deprecated 18.0 - */ - public function __construct() - { - } - /** - * Localizes the given script with the JavaScript translations. - * - * @codeCoverageIgnore - * @deprecated 18.0 - * - * @param string $script_handle The script handle to localize for. + * Registers all hooks to WordPress. * * @return void */ - public function localize_script($script_handle) - { - } - /** - * Returns translations necessary for JS files. - * - * @codeCoverageIgnore - * @deprecated 18.0 - * - * @param string $component The component to retrieve the translations for. - * @return object|null The translations in a Jed format for JS files. - */ - protected function get_translations($component) - { - } + public function register_hooks(); } /** * WPSEO plugin file. @@ -1076,779 +994,681 @@ protected function get_translations($component) * @package WPSEO\Admin */ /** - * Determines the editor specific replacement variables. + * A WordPress integration that listens for whether the SEO changes have been saved successfully. */ - class WPSEO_Admin_Editor_Specific_Replace_Vars + class WPSEO_Admin_Settings_Changed_Listener implements \WPSEO_WordPress_Integration { /** - * Holds the editor specific replacements variables. - * - * @var array The editor specific replacement variables. - */ - protected $replacement_variables = [ - // Posts types. - 'page' => ['id', 'pt_single', 'pt_plural', 'parent_title'], - 'post' => ['id', 'term404', 'pt_single', 'pt_plural'], - // Custom post type. - 'custom_post_type' => ['id', 'term404', 'pt_single', 'pt_plural', 'parent_title'], - // Settings - archive pages. - 'custom-post-type_archive' => ['pt_single', 'pt_plural'], - // Taxonomies. - 'category' => ['term_title', 'term_description', 'category_description', 'parent_title', 'term_hierarchy'], - 'post_tag' => ['term_title', 'term_description', 'tag_description'], - 'post_format' => ['term_title'], - // Custom taxonomy. - 'term-in-custom-taxonomy' => ['term_title', 'term_description', 'category_description', 'parent_title', 'term_hierarchy'], - // Settings - special pages. - 'search' => ['searchphrase'], - ]; - /** - * WPSEO_Admin_Editor_Specific_Replace_Vars constructor. - */ - public function __construct() - { - } - /** - * Retrieves the editor specific replacement variables. - * - * @return array The editor specific replacement variables. - */ - public function get() - { - } - /** - * Retrieves the generic replacement variable names. - * - * Which are the replacement variables without the editor specific ones. - * - * @param array $replacement_variables Possibly generic replacement variables. - * - * @return array The generic replacement variable names. - */ - public function get_generic($replacement_variables) - { - } - /** - * Determines the page type of the current term. - * - * @param string $taxonomy The taxonomy name. - * - * @return string The page type. - */ - public function determine_for_term($taxonomy) - { - } - /** - * Determines the page type of the current post. - * - * @param WP_Post $post A WordPress post instance. - * - * @return string The page type. - */ - public function determine_for_post($post) - { - } - /** - * Determines the page type for a post type. - * - * @param string $post_type The name of the post_type. - * @param string $fallback The page type to fall back to. + * Have the Yoast SEO settings been saved. * - * @return string The page type. + * @var bool */ - public function determine_for_post_type($post_type, $fallback = 'custom_post_type') - { - } + private static $settings_saved = \false; /** - * Determines the page type for an archive page. - * - * @param string $name The name of the archive. - * @param string $fallback The page type to fall back to. + * Registers all hooks to WordPress. * - * @return string The page type. + * @return void */ - public function determine_for_archive($name, $fallback = 'custom-post-type_archive') + public function register_hooks() { } /** - * Adds the replavement variables for the given page types. - * - * @param array $page_types Page types to add variables for. - * @param array $replacement_variables_to_add The variables to add. + * Checks and overwrites the wp_settings_errors global to determine whether the Yoast SEO settings have been saved. * * @return void */ - protected function add_for_page_types(array $page_types, array $replacement_variables_to_add) + public function intercept_save_update_notification() { } /** - * Extracts the names from the given replacements variables. + * Checks whether the settings notification is a settings_updated notification. * - * @param array $replacement_variables Replacement variables to extract the name from. + * @param array $wp_settings_error The settings object. * - * @return array Extracted names. + * @return bool Whether this is a settings updated settings notification. */ - protected function extract_names($replacement_variables) + public function is_settings_updated_notification($wp_settings_error) { } /** - * Returns whether the given page type has editor specific replace vars. - * - * @param string $page_type The page type to check. + * Get whether the settings have successfully been saved * - * @return bool True if there are associated editor specific replace vars. + * @return bool Whether the settings have successfully been saved. */ - protected function has_for_page_type($page_type) + public function have_settings_been_saved() { } /** - * Merges all editor specific replacement variables into one array and removes duplicates. + * Renders a success message if the Yoast SEO settings have been saved. * - * @return array The list of unique editor specific replacement variables. + * @return void */ - protected function get_unique_replacement_variables() + public function show_success_message() { } } /** * WPSEO plugin file. * - * @package WPSEO\Admin + * @package WPSEO\Admin\Ajax */ /** - * Handles the Gutenberg Compatibility notification showing and hiding. + * Class WPSEO_Shortcode_Filter. + * + * Used for parsing WP shortcodes with AJAX. */ - class WPSEO_Admin_Gutenberg_Compatibility_Notification implements \WPSEO_WordPress_Integration + class WPSEO_Shortcode_Filter { /** - * Notification ID to use. - * - * @var string - */ - private $notification_id = 'wpseo-outdated-gutenberg-plugin'; - /** - * Instance of gutenberg compatibility checker. - * - * @var WPSEO_Gutenberg_Compatibility - */ - protected $compatibility_checker; - /** - * Instance of Yoast Notification Center. - * - * @var Yoast_Notification_Center - */ - protected $notification_center; - /** - * WPSEO_Admin_Gutenberg_Compatibility_Notification constructor. + * Initialize the AJAX hooks. */ public function __construct() { } /** - * Registers all hooks to WordPress. - * - * @return void - */ - public function register_hooks() - { - } - /** - * Manages if the notification should be shown or removed. - * - * @return void - */ - public function manage_notification() - { - } - /** - * Adds the notification to the notificaton center. + * Parse the shortcodes. * * @return void */ - protected function add_notification() + public function do_filter() { } } /** * WPSEO plugin file. * - * @package WPSEO\Admin + * @package WPSEO\Admin\Ajax */ /** - * Generates the HTML for an inline Help Button and Panel. + * This class will catch the request to dismiss the target notice (set by notice_name) + * and will store the dismiss status as an user meta in the database. */ - class WPSEO_Admin_Help_Panel + class Yoast_Dismissable_Notice_Ajax { /** - * Unique identifier of the element the inline help refers to, used as an identifier in the html. + * Notice type toggle value for user notices. * * @var string */ - private $id; + public const FOR_USER = 'user_meta'; /** - * The Help Button text. Needs a properly escaped string. + * Notice type toggle value for network notices. * * @var string */ - private $help_button_text; + public const FOR_NETWORK = 'site_option'; /** - * The Help Panel content. Needs a properly escaped string (might contain HTML). + * Notice type toggle value for site notices. * * @var string */ - private $help_content; + public const FOR_SITE = 'option'; /** - * Optional Whether to print out a container div element for the Help Panel, used for styling. + * Name of the notice that will be dismissed. * * @var string */ - private $wrapper; + private $notice_name; /** - * Constructor. + * The type of the current notice. * - * @param string $id Unique identifier of the element the inline help refers to, used as - * an identifier in the html. - * @param string $help_button_text The Help Button text. Needs a properly escaped string. - * @param string $help_content The Help Panel content. Needs a properly escaped string (might contain HTML). - * @param string $wrapper Optional Whether to print out a container div element for the Help Panel, - * used for styling. - * Pass a `has-wrapper` value to print out the container. Default: no container. + * @var string */ - public function __construct($id, $help_button_text, $help_content, $wrapper = '') + private $notice_type; + /** + * Initialize the hooks for the AJAX request. + * + * @param string $notice_name The name for the hook to catch the notice. + * @param string $notice_type The notice type. + */ + public function __construct($notice_name, $notice_type = self::FOR_USER) { } /** - * Returns the html for the Help Button. + * Handles the dismiss notice request. * - * @return string + * @return void */ - public function get_button_html() + public function dismiss_notice() { } /** - * Returns the html for the Help Panel. + * Storing the dismissed value in the database. The target location is based on the set notification type. * - * @return string + * @return void */ - public function get_panel_html() + private function save_dismissed() { } } /** * WPSEO plugin file. * - * @package WPSEO\Admin + * @package WPSEO\Admin\Ajax */ /** - * Performs the load on admin side. + * Class Yoast_Plugin_Conflict_Ajax. */ - class WPSEO_Admin_Init + class Yoast_Plugin_Conflict_Ajax { /** - * Holds the global `$pagenow` variable's value. + * Option identifier where dismissed conflicts are stored. * * @var string */ - private $pagenow; + private $option_name = 'wpseo_dismissed_conflicts'; /** - * Holds the asset manager. + * List of notification identifiers that have been dismissed. * - * @var WPSEO_Admin_Asset_Manager + * @var array */ - private $asset_manager; + private $dismissed_conflicts = []; /** - * Class constructor. + * Initialize the hooks for the AJAX request. */ public function __construct() { } /** - * Enqueue our styling for dismissible yoast notifications. + * Handles the dismiss notice request. + * + * @return void */ - public function enqueue_dismissible() + public function dismiss_notice() { } /** - * Removes any notification for incomplete translations. + * Getting the user option from the database. * - * @return void + * @return bool|array */ - public function remove_translations_notification() + private function get_dismissed_option() { } /** - * Creates an unsupported PHP version notification in the notification center. + * Getting the dismissed conflicts from the database * - * @return void + * @param string $plugin_section Type of conflict group (such as Open Graph or sitemap). + * + * @return array */ - public function unsupported_php_notice() + private function get_dismissed_conflicts($plugin_section) { } /** - * Gets the latest released major WordPress version from the WordPress stable-check api. + * Storing the conflicting plugins as an user option in the database. * - * @return float|int The latest released major WordPress version. 0 when the stable-check API doesn't respond. + * @param string $plugin_section Plugin conflict type (such as Open Graph or sitemap). + * + * @return void */ - private function get_latest_major_wordpress_version() + private function save_dismissed_conflicts($plugin_section) { } /** - * Helper to verify if the user is currently visiting one of our admin pages. + * Loop through the plugins to compare them with the already stored dismissed plugin conflicts. * - * @return bool + * @param array $posted_plugins Plugin set to check. + * + * @return void */ - private function on_wpseo_admin_page() + public function compare_plugins(array $posted_plugins) { } /** - * Whether we should load the meta box classes. + * Check if plugin is already dismissed, if not store it in the array that will be saved later. * - * @return bool true if we should load the meta box classes, false otherwise. + * @param string $posted_plugin Plugin to check against dismissed conflicts. + * + * @return void */ - private function should_load_meta_boxes() + private function compare_plugin($posted_plugin) { } + } + /** + * WPSEO plugin file. + * + * @package WPSEO\Admin\Capabilities + */ + /** + * Capability Manager interface. + */ + interface WPSEO_Capability_Manager + { /** - * Determine whether we should load the meta box class and if so, load it. + * Registers a capability. + * + * @param string $capability Capability to register. + * @param array $roles Roles to add the capability to. + * @param bool $overwrite Optional. Use add or overwrite as registration method. */ - private function load_meta_boxes() - { - } + public function register($capability, array $roles, $overwrite = \false); /** - * Determine if we should load our taxonomy edit class and if so, load it. + * Adds the registerd capabilities to the system. */ - private function load_taxonomy_class() - { - } + public function add(); /** - * Determine if we should load our admin pages class and if so, load it. - * - * Loads admin page class for all admin pages starting with `wpseo_`. + * Removes the registered capabilities from the system. */ - private function load_admin_user_class() - { - } + public function remove(); /** - * Determine if we should load our admin pages class and if so, load it. + * Returns the list of registered capabilities. * - * Loads admin page class for all admin pages starting with `wpseo_`. + * @return string[] List of registered capabilities. */ - private function load_admin_page_class() - { - } + public function get_capabilities(); + } + /** + * WPSEO plugin file. + * + * @package WPSEO\Admin\Capabilities + */ + /** + * Abstract Capability Manager shared code. + */ + abstract class WPSEO_Abstract_Capability_Manager implements \WPSEO_Capability_Manager + { /** - * Loads the plugin suggestions. + * Registered capabilities. + * + * @var array */ - private function load_plugin_suggestions() - { - } + protected $capabilities = []; /** - * Registers the Premium Upsell Admin Block. + * Registers a capability. + * + * @param string $capability Capability to register. + * @param array $roles Roles to add the capability to. + * @param bool $overwrite Optional. Use add or overwrite as registration method. * * @return void */ - private function register_premium_upsell_admin_block() - { - } - /** - * See if we should start our XML Sitemaps Admin class. - */ - private function load_xml_sitemaps_admin() + public function register($capability, array $roles, $overwrite = \false) { } /** - * Shows deprecation warnings to the user if a plugin has registered a filter we have deprecated. + * Returns the list of registered capabilitities. + * + * @return string[] Registered capabilities. */ - public function show_hook_deprecation_warnings() + public function get_capabilities() { } /** - * Check if the permalink uses %postname%. + * Returns a list of WP_Role roles. * - * @return bool + * The string array of role names are converted to actual WP_Role objects. + * These are needed to be able to use the API on them. + * + * @param array $roles Roles to retrieve the objects for. + * + * @return WP_Role[] List of WP_Role objects. */ - private function has_postname_in_permalink() + protected function get_wp_roles(array $roles) { } /** - * Shows a notice on the permalink settings page. + * Filter capability roles. + * + * @param string $capability Capability to filter roles for. + * @param array $roles List of roles which can be filtered. + * + * @return array Filtered list of roles for the capability. */ - public function permalink_settings_notice() + protected function filter_roles($capability, array $roles) { } + } + /** + * WPSEO plugin file. + * + * @package WPSEO\Admin\Capabilities + */ + /** + * Capability Manager Factory. + */ + class WPSEO_Capability_Manager_Factory + { /** - * Adds a custom Yoast section within the Classic Editor publish box. + * Returns the Manager to use. * - * @param \WP_Post $post The current post object. + * @param string $plugin_type Whether it's Free or Premium. * - * @return void + * @return WPSEO_Capability_Manager Manager to use. */ - public function add_publish_box_section($post) + public static function get($plugin_type = 'free') { } } /** * WPSEO plugin file. * - * @package WPSEO\Admin + * @package WPSEO\Admin\Capabilities */ /** - * Determines the recommended replacement variables based on the context. + * Integrates Yoast SEO capabilities with third party role manager plugins. + * + * Integrates with: Members + * Integrates with: User Role Editor */ - class WPSEO_Admin_Recommended_Replace_Vars + class WPSEO_Capability_Manager_Integration implements \WPSEO_WordPress_Integration { /** - * The recommended replacement variables. + * Capability manager to use. * - * @var array + * @var WPSEO_Capability_Manager */ - protected $recommended_replace_vars = [ - // Posts types. - 'page' => ['sitename', 'title', 'sep', 'primary_category'], - 'post' => ['sitename', 'title', 'sep', 'primary_category'], - // Homepage. - 'homepage' => ['sitename', 'sitedesc', 'sep'], - // Custom post type. - 'custom_post_type' => ['sitename', 'title', 'sep'], - // Taxonomies. - 'category' => ['sitename', 'term_title', 'sep', 'term_hierarchy'], - 'post_tag' => ['sitename', 'term_title', 'sep'], - 'post_format' => ['sitename', 'term_title', 'sep', 'page'], - // Custom taxonomy. - 'term-in-custom-taxonomy' => ['sitename', 'term_title', 'sep', 'term_hierarchy'], - // Settings - archive pages. - 'author_archive' => ['sitename', 'title', 'sep', 'page'], - 'date_archive' => ['sitename', 'sep', 'date', 'page'], - 'custom-post-type_archive' => ['sitename', 'title', 'sep', 'page'], - // Settings - special pages. - 'search' => ['sitename', 'searchphrase', 'sep', 'page'], - '404' => ['sitename', 'sep'], - ]; + public $manager; /** - * Determines the page type of the current term. - * - * @param string $taxonomy The taxonomy name. + * WPSEO_Capability_Manager_Integration constructor. * - * @return string The page type. + * @param WPSEO_Capability_Manager $manager The capability manager to use. */ - public function determine_for_term($taxonomy) + public function __construct(\WPSEO_Capability_Manager $manager) { } /** - * Determines the page type of the current post. - * - * @param WP_Post $post A WordPress post instance. + * Registers the hooks. * - * @return string The page type. + * @return void */ - public function determine_for_post($post) + public function register_hooks() { } /** - * Determines the page type for a post type. - * - * @param string $post_type The name of the post_type. - * @param string $fallback The page type to fall back to. + * Get the Yoast SEO capabilities. + * Optionally append them to an existing array. * - * @return string The page type. + * @param array $caps Optional existing capability list. + * @return array */ - public function determine_for_post_type($post_type, $fallback = 'custom_post_type') + public function get_capabilities(array $caps = []) { } /** - * Determines the page type for an archive page. + * Add capabilities to its own group in the Members plugin. * - * @param string $name The name of the archive. - * @param string $fallback The page type to fall back to. + * @see members_register_cap_group() * - * @return string The page type. + * @return void */ - public function determine_for_archive($name, $fallback = 'custom-post-type_archive') + public function action_members_register_cap_group() { } /** - * Retrieves the recommended replacement variables for the given page type. + * Adds Yoast SEO capability group in the User Role Editor plugin. * - * @param string $page_type The page type. + * @see URE_Capabilities_Groups_Manager::get_groups_tree() * - * @return array The recommended replacement variables. - */ - public function get_recommended_replacevars_for($page_type) - { - } - /** - * Retrieves the recommended replacement variables. + * @param array $groups Current groups. * - * @return array The recommended replacement variables. + * @return array Filtered list of capabilty groups. */ - public function get_recommended_replacevars() + public function filter_ure_capabilities_groups_tree($groups = []) { } /** - * Returns whether the given page type has recommended replace vars. - * - * @param array $recommended_replace_vars The recommended replace vars - * to check in. - * @param string $page_type The page type to check. + * Adds capabilities to the Yoast SEO group in the User Role Editor plugin. * - * @return bool True if there are associated recommended replace vars. - */ - private function has_recommended_replace_vars($recommended_replace_vars, $page_type) - { - } - /** - * Determines whether or not a post is the homepage. + * @see URE_Capabilities_Groups_Manager::get_cap_groups() * - * @param WP_Post $post The WordPress global post object. + * @param array $groups Current capability groups. + * @param string $cap_id Capability identifier. * - * @return bool True if the given post is the homepage. + * @return array List of filtered groups. */ - private function is_homepage($post) + public function filter_ure_custom_capability_groups($groups = [], $cap_id = '') { } } /** * WPSEO plugin file. * - * @package WPSEO\Admin - * @since 1.8.0 + * @package WPSEO\Admin\Capabilities */ /** - * Customizes user profile. + * VIP implementation of the Capability Manager. */ - class WPSEO_Admin_User_Profile + final class WPSEO_Capability_Manager_VIP extends \WPSEO_Abstract_Capability_Manager { /** - * Class constructor. - */ - public function __construct() - { - } - /** - * Clear author sitemap cache when settings are changed. - * - * @since 3.1 + * Adds the registered capabilities to the system. * - * @param int $meta_id The ID of the meta option changed. - * @param int $object_id The ID of the user. - * @param string $meta_key The key of the meta field changed. + * @return void */ - public function clear_author_sitemap_cache($meta_id, $object_id, $meta_key) + public function add() { } /** - * Updates the user metas that (might) have been set on the user profile page. + * Removes the registered capabilities from the system * - * @param int $user_id User ID of the updated user. + * @return void */ - public function process_user_option_update($user_id) + public function remove() { } /** - * Add the inputs needed for SEO values to the User Profile page. + * Returns the roles which the capability is registered on. * - * @param WP_User $user User instance to output for. + * @param array $role_capabilities List of all roles with their capabilities. + * @param string $capability Capability to filter roles for. + * @param array $roles List of default roles. + * + * @return array List of capabilities. */ - public function user_profile($user) + protected function get_role_capabilities($role_capabilities, $capability, $roles) { } } /** * WPSEO plugin file. * - * @package WPSEO\Admin + * @package WPSEO\Admin\Capabilities */ /** - * Represents the utils for the admin. + * Default WordPress capability manager implementation. */ - class WPSEO_Admin_Utils + final class WPSEO_Capability_Manager_WP extends \WPSEO_Abstract_Capability_Manager { /** - * Gets the install URL for the passed plugin slug. - * - * @param string $slug The slug to create an install link for. - * - * @return string The install URL. Empty string if the current user doesn't have the proper capabilities. - */ - public static function get_install_url($slug) - { - } - /** - * Gets the activation URL for the passed plugin slug. - * - * @param string $slug The slug to create an activation link for. - * - * @return string The activation URL. Empty string if the current user doesn't have the proper capabilities. - */ - public static function get_activation_url($slug) - { - } - /** - * Creates a link if the passed plugin is deemend a directly-installable plugin. - * - * @param array $plugin The plugin to create the link for. + * Adds the capabilities to the roles. * - * @return string The link to the plugin install. Returns the title if the plugin is deemed a Premium product. + * @return void */ - public static function get_install_link($plugin) + public function add() { } /** - * Gets a visually hidden accessible message for links that open in a new browser tab. + * Unregisters the capabilities from the system. * - * @return string The visually hidden accessible message. + * @return void */ - public static function get_new_tab_message() + public function remove() { } } /** - * Class that holds most of the admin functionality for Yoast SEO. + * WPSEO plugin file. + * + * @package WPSEO\Admin\Capabilities */ - class WPSEO_Admin + /** + * Capability Utils collection. + */ + class WPSEO_Capability_Utils { /** - * The page identifier used in WordPress to register the admin page. - * - * !DO NOT CHANGE THIS! + * Checks if the user has the proper capabilities. * - * @var string - */ - const PAGE_IDENTIFIER = 'wpseo_dashboard'; - /** - * Array of classes that add admin functionality. + * @param string $capability Capability to check. * - * @var array - */ - protected $admin_features; - /** - * Class constructor. + * @return bool True if the user has the proper rights. */ - public function __construct() + public static function current_user_can($capability) { } /** - * Schedules a rewrite flush to happen at shutdown. + * Retrieves the users that have the specified capability. + * + * @param string $capability The name of the capability. + * + * @return array The users that have the capability. */ - public function schedule_rewrite_flush() + public static function get_applicable_users($capability) { } /** - * Returns all the classes for the admin features. + * Retrieves the roles that have the specified capability. * - * @return array + * @param string $capability The name of the capability. + * + * @return array The names of the roles that have the capability. */ - public function get_admin_features() + public static function get_applicable_roles($capability) { } /** - * Register assets needed on admin pages. + * Checks if the current user has at least one of the supplied capabilities. + * + * @param array $capabilities Capabilities to check against. + * + * @return bool True if the user has at least one capability. */ - public function enqueue_assets() + protected static function has_any(array $capabilities) { } /** - * Returns the manage_options capability. + * Checks if the user has a certain capability. * - * @return string The capability to use. + * @param string $capability Capability to check against. + * + * @return bool True if the user has the capability. */ - public function get_manage_options_cap() + protected static function has($capability) { } + } + /** + * WPSEO plugin file. + * + * @package WPSEO\Admin\Capabilities + */ + /** + * Capabilities registration class. + */ + class WPSEO_Register_Capabilities implements \WPSEO_WordPress_Integration + { /** - * Maps the manage_options cap on saving an options page to wpseo_manage_options. + * Registers the hooks. + * + * @return void */ - public function map_manage_options_cap() + public function register_hooks() { } /** - * Adds the ability to choose how many posts are displayed per page - * on the bulk edit pages. + * Registers the capabilities. + * + * @return void */ - public function bulk_edit_options() + public function register() { } /** - * Saves the posts per page limit for bulk edit pages. + * Revokes the 'wpseo_manage_options' capability from administrator users if it should + * only be granted to network administrators. * - * @param int $status Status value to pass through. - * @param string $option Option name. - * @param int $value Count value to check. + * @param array $allcaps An array of all the user's capabilities. + * @param array $caps Actual capabilities being checked. + * @param array $args Optional parameters passed to has_cap(), typically object ID. + * @param WP_User $user The user object. * - * @return int + * @return array Possibly modified array of the user's capabilities. */ - public function save_bulk_edit_options($status, $option, $value) + public function filter_user_has_wpseo_manage_options_cap($allcaps, $caps, $args, $user) { } /** - * Adds links to Premium Support and FAQ under the plugin in the plugin overview page. + * Maybe add manage_privacy_options capability for wpseo_manager user role. * - * @param array $links Array of links for the plugins, adapted when the current plugin is found. - * @param string $file The filename for the current plugin, which the filter loops through. + * @param string[] $caps Primitive capabilities required of the user. + * @param string[] $cap Capability being checked. * - * @return array - */ - public function add_action_link($links, $file) - { - } - /** - * Enqueues the (tiny) global JS needed for the plugin. - */ - public function config_page_scripts() - { - } - /** - * Enqueues the (tiny) global stylesheet needed for the plugin. + * @return string[] Filtered primitive capabilities required of the user. */ - public function enqueue_global_style() + public function map_meta_cap_for_seo_manager($caps, $cap) { } + } + /** + * WPSEO plugin file. + * + * @package WPSEO\Admin + */ + /** + * Represents a way to determine an assets location. + */ + interface WPSEO_Admin_Asset_Location + { /** - * Filter the $contactmethods array and add a set of social profiles. - * - * These are used with the Facebook author, rel="author" and Twitter cards implementation. + * Determines the URL of the asset on the dev server. * - * @param array $contactmethods Currently set contactmethods. + * @param WPSEO_Admin_Asset $asset The asset to determine the URL for. + * @param string $type The type of asset. Usually JS or CSS. * - * @return array Contactmethods with added contactmethods. + * @return string The URL of the asset. */ - public function update_contactmethods($contactmethods) - { - } + public function get_url(\WPSEO_Admin_Asset $asset, $type); + } + /** + * WPSEO plugin file. + * + * @package WPSEO\Admin + */ + /** + * Represents a way to determine the analysis worker asset location. + */ + final class WPSEO_Admin_Asset_Analysis_Worker_Location implements \WPSEO_Admin_Asset_Location + { /** - * Log the updated timestamp for user profiles when theme is changed. + * Holds the asset's location. + * + * @var WPSEO_Admin_Asset_Location */ - public function switch_theme() - { - } + private $asset_location; /** - * Localization for the dismiss urls. + * Holds the asset itself. * - * @return array + * @var WPSEO_Admin_Asset */ - private function localize_admin_global_script() - { - } + private $asset; /** - * Sets the upsell notice. + * Constructs the location of the analysis worker asset. + * + * @param string $flat_version The flat version of the asset. + * @param string $name The name of the analysis worker asset. */ - protected function set_upsell_notice() + public function __construct($flat_version = '', $name = 'analysis-worker') { } /** - * Whether we are on the admin dashboard page. + * Retrieves the analysis worker asset. * - * @return bool + * @return WPSEO_Admin_Asset The analysis worker asset. */ - protected function on_dashboard_page() + public function get_asset() { } /** - * Loads the cornerstone filter. + * Determines the URL of the asset on the dev server. * - * @return WPSEO_WordPress_Integration[] The integrations to initialize. + * @param WPSEO_Admin_Asset $asset The asset to determine the URL for. + * @param string $type The type of asset. Usually JS or CSS. + * + * @return string The URL of the asset. */ - protected function initialize_cornerstone_content() + public function get_url(\WPSEO_Admin_Asset $asset, $type) { } } @@ -1858,900 +1678,1176 @@ protected function initialize_cornerstone_content() * @package WPSEO\Admin */ /** - * Represents a WPSEO asset + * Changes the asset paths to dev server paths. */ - class WPSEO_Admin_Asset + final class WPSEO_Admin_Asset_Dev_Server_Location implements \WPSEO_Admin_Asset_Location { /** - * Constant used to identify file type as a JS file. + * Holds the dev server's default URL. * * @var string */ - const TYPE_JS = 'js'; + public const DEFAULT_URL = 'http://localhost:8080'; /** - * Constant used to identify file type as a CSS file. + * Holds the url where the server is located. * * @var string */ - const TYPE_CSS = 'css'; + private $url; /** - * The name option identifier. + * Class constructor. * - * @var string + * @param string|null $url Where the dev server is located. */ - const NAME = 'name'; + public function __construct($url = \null) + { + } /** - * The source option identifier. + * Determines the URL of the asset on the dev server. * - * @var string + * @param WPSEO_Admin_Asset $asset The asset to determine the URL for. + * @param string $type The type of asset. Usually JS or CSS. + * + * @return string The URL of the asset. */ - const SRC = 'src'; + public function get_url(\WPSEO_Admin_Asset $asset, $type) + { + } /** - * The dependencies option identifier. + * Determines the URL of the asset not using the dev server. * - * @var string + * @param WPSEO_Admin_Asset $asset The asset to determine the URL for. + * @param string $type The type of asset. + * + * @return string The URL of the asset file. */ - const DEPS = 'deps'; + public function get_default_url(\WPSEO_Admin_Asset $asset, $type) + { + } + } + /** + * WPSEO plugin file. + * + * @package WPSEO\Admin + */ + /** + * This class registers all the necessary styles and scripts. + * + * Also has methods for the enqueing of scripts and styles. + * It automatically adds a prefix to the handle. + */ + class WPSEO_Admin_Asset_Manager + { /** - * The version option identifier. + * Prefix for naming the assets. * * @var string */ - const VERSION = 'version'; - /* Style specific. */ + public const PREFIX = 'yoast-seo-'; /** - * The media option identifier. + * Class that manages the assets' location. * - * @var string + * @var WPSEO_Admin_Asset_Location */ - const MEDIA = 'media'; + protected $asset_location; /** - * The rtl option identifier. + * Prefix for naming the assets. * * @var string */ - const RTL = 'rtl'; - /* Script specific. */ + private $prefix; /** - * The "in footer" option identifier. + * Constructs a manager of assets. Needs a location to know where to register assets at. * - * @var string + * @param WPSEO_Admin_Asset_Location|null $asset_location The provider of the asset location. + * @param string $prefix The prefix for naming assets. */ - const IN_FOOTER = 'in_footer'; + public function __construct(?\WPSEO_Admin_Asset_Location $asset_location = \null, $prefix = self::PREFIX) + { + } /** - * Asset identifier. + * Enqueues scripts. * - * @var string + * @param string $script The name of the script to enqueue. + * + * @return void */ - protected $name; + public function enqueue_script($script) + { + } /** - * Path to the asset. + * Enqueues styles. * - * @var string + * @param string $style The name of the style to enqueue. + * + * @return void */ - protected $src; + public function enqueue_style($style) + { + } /** - * Asset dependencies. + * Enqueues the appropriate language for the user. * - * @var string|array + * @return void */ - protected $deps; + public function enqueue_user_language_script() + { + } /** - * Asset version. + * Registers scripts based on it's parameters. * - * @var string + * @param WPSEO_Admin_Asset $script The script to register. + * + * @return void */ - protected $version; + public function register_script(\WPSEO_Admin_Asset $script) + { + } /** - * For CSS Assets. The type of media for which this stylesheet has been defined. + * Registers styles based on it's parameters. * - * See https://www.w3.org/TR/CSS2/media.html#media-types. + * @param WPSEO_Admin_Asset $style The style to register. * - * @var string + * @return void */ - protected $media; + public function register_style(\WPSEO_Admin_Asset $style) + { + } /** - * For JS Assets. Whether or not the script should be loaded in the footer. + * Calls the functions that register scripts and styles with the scripts and styles to be registered as arguments. * - * @var bool + * @return void */ - protected $in_footer; + public function register_assets() + { + } /** - * For CSS Assets. Whether this stylesheet is a right-to-left stylesheet. + * Registers all the scripts passed to it. * - * @var bool + * @param array $scripts The scripts passed to it. + * + * @return void */ - protected $rtl; + public function register_scripts($scripts) + { + } /** - * File suffix. + * Registers all the styles it receives. * - * @var string + * @param array $styles Styles that need to be registered. + * + * @return void */ - protected $suffix; + public function register_styles($styles) + { + } /** - * Default asset arguments. + * Localizes the script. * - * @var array + * @param string $handle The script handle. + * @param string $object_name The object name. + * @param array $data The l10n data. + * + * @return void */ - private $defaults = ['deps' => [], 'in_footer' => \true, 'rtl' => \true, 'media' => 'all', 'version' => '', 'suffix' => '']; + public function localize_script($handle, $object_name, $data) + { + } /** - * Constructs an instance of the WPSEO_Admin_Asset class. + * Adds an inline script. * - * @param array $args The arguments for this asset. + * @param string $handle The script handle. + * @param string $data The l10n data. + * @param string $position Optional. Whether to add the inline script before the handle or after. * - * @throws InvalidArgumentException Throws when no name or src has been provided. + * @return void */ - public function __construct(array $args) + public function add_inline_script($handle, $data, $position = 'after') { } /** - * Returns the asset identifier. + * A list of styles that shouldn't be registered but are needed in other locations in the plugin. * - * @return string + * @return array */ - public function get_name() + public function special_styles() { } /** - * Returns the path to the asset. + * Flattens a version number for use in a filename. * - * @return string + * @param string $version The original version number. + * + * @return string The flattened version number. */ - public function get_src() + public function flatten_version($version) { } /** - * Returns the asset dependencies. + * Creates a default location object for use in the admin asset manager. * - * @return array|string + * @return WPSEO_Admin_Asset_Location The location to use in the asset manager. */ - public function get_deps() + public static function create_default_location() { } /** - * Returns the asset version. + * Checks if the given script is enqueued. * - * @return string|null + * @param string $script The script to check. + * + * @return bool True when the script is enqueued. */ - public function get_version() + public function is_script_enqueued($script) { } /** - * Returns the media type for CSS assets. + * Returns the scripts that need to be registered. * - * @return string + * @todo Data format is not self-documenting. Needs explanation inline. R. + * + * @return array The scripts that need to be registered. */ - public function get_media() + protected function scripts_to_be_registered() { } /** - * Returns whether a script asset should be loaded in the footer of the page. + * Loads a generated asset file. * - * @return bool + * @param array $args { + * The arguments. + * + * @type string $asset_file The asset file to load. + * @type int $ext_length The length of the extension, including suffix, of the filename. + * @type string $suffix Optional. The suffix of the asset name. + * @type array $additional_deps Optional. The additional dependencies assets may have. + * @type string $base_dir Optional. The base directory of the asset. + * @type string[] $header_scripts Optional. The script names that should be in the header. + * } + * + * @return array { + * The scripts to be registered. + * + * @type string $name The name of the asset. + * @type string $src The src of the asset. + * @type string[] $deps The dependenies of the asset. + * @type bool $in_footer Whether or not the asset should be in the footer. + * } */ - public function is_in_footer() + protected function load_generated_asset_file($args) { } /** - * Returns whether this CSS has a RTL counterpart. + * Loads the scripts that should be renamed for BC. * - * @return bool + * @return array { + * The scripts to be registered. + * + * @type string $name The name of the asset. + * @type string $src The src of the asset. + * @type string[] $deps The dependenies of the asset. + * @type bool $in_footer Whether or not the asset should be in the footer. + * } */ - public function has_rtl() + protected function load_renamed_scripts() { } /** - * Returns the file suffix. + * Returns the styles that need to be registered. * - * @return string + * @todo Data format is not self-documenting. Needs explanation inline. R. + * + * @return array Styles that need to be registered. */ - public function get_suffix() + protected function styles_to_be_registered() + { + } + /** + * Determines the URL of the asset. + * + * @param WPSEO_Admin_Asset $asset The asset to determine the URL for. + * @param string $type The type of asset. Usually JS or CSS. + * + * @return string The URL of the asset. + */ + protected function get_url(\WPSEO_Admin_Asset $asset, $type) { } } /** * WPSEO plugin file. * - * @package WPSEO\Admin\Bulk Editor - * @since 1.5.0 + * @package WPSEO\Admin */ /** - * Implements table for bulk editing. + * Determines the location of an asset within the SEO plugin. */ - class WPSEO_Bulk_List_Table extends \WP_List_Table + final class WPSEO_Admin_Asset_SEO_Location implements \WPSEO_Admin_Asset_Location { /** - * The nonce that was passed with the request. + * Path to the plugin file. * * @var string */ - private $nonce; + protected $plugin_file; /** - * Array of post types for which the current user has `edit_others_posts` capabilities. + * Whether or not to add the file suffix to the asset. * - * @var array + * @var bool */ - private $all_posts; + protected $add_suffix = \true; /** - * Array of post types for which the current user has `edit_posts` capabilities, but not `edit_others_posts`. + * The plugin file to base the asset location upon. * - * @var array + * @param string $plugin_file The plugin file string. + * @param bool $add_suffix Optional. Whether or not a file suffix should be added. */ - private $own_posts; + public function __construct($plugin_file, $add_suffix = \true) + { + } /** - * Saves all the metadata into this array. + * Determines the URL of the asset on the dev server. * - * @var array - */ - protected $meta_data = []; - /** - * The current requested page_url. + * @param WPSEO_Admin_Asset $asset The asset to determine the URL for. + * @param string $type The type of asset. Usually JS or CSS. * - * @var string + * @return string The URL of the asset. */ - private $request_url = ''; + public function get_url(\WPSEO_Admin_Asset $asset, $type) + { + } /** - * The current page (depending on $_GET['paged']) if current tab is for current page_type, else it will be 1. + * Determines the path relative to the plugin folder of an asset. * - * @var int - */ - private $current_page; - /** - * The current post filter, if is used (depending on $_GET['post_type_filter']). + * @param WPSEO_Admin_Asset $asset The asset to determine the path for. + * @param string $type The type of asset. * - * @var string + * @return string The path to the asset file. */ - private $current_filter; + protected function get_path(\WPSEO_Admin_Asset $asset, $type) + { + } + } + /** + * WPSEO plugin file. + * + * @package WPSEO\Admin + */ + /** + * Determines the editor specific replacement variables. + */ + class WPSEO_Admin_Editor_Specific_Replace_Vars + { /** - * The current post status, if is used (depending on $_GET['post_status']). + * Holds the editor specific replacements variables. * - * @var string + * @var array The editor specific replacement variables. */ - private $current_status; + protected $replacement_variables = [ + // Posts types. + 'page' => ['id', 'pt_single', 'pt_plural', 'parent_title'], + 'post' => ['id', 'term404', 'pt_single', 'pt_plural'], + // Custom post type. + 'custom_post_type' => ['id', 'term404', 'pt_single', 'pt_plural', 'parent_title'], + // Settings - archive pages. + 'custom-post-type_archive' => ['pt_single', 'pt_plural'], + // Taxonomies. + 'category' => ['term_title', 'term_description', 'category_description', 'parent_title', 'term_hierarchy'], + 'post_tag' => ['term_title', 'term_description', 'tag_description'], + 'post_format' => ['term_title'], + // Custom taxonomy. + 'term-in-custom-taxonomy' => ['term_title', 'term_description', 'category_description', 'parent_title', 'term_hierarchy'], + // Settings - special pages. + 'search' => ['searchphrase'], + ]; /** - * The current sorting, if used (depending on $_GET['order'] and $_GET['orderby']). - * - * @var string + * WPSEO_Admin_Editor_Specific_Replace_Vars constructor. */ - private $current_order; + public function __construct() + { + } /** - * The page_type for current class instance (for example: title / description). + * Retrieves the editor specific replacement variables. * - * @var string + * @return array The editor specific replacement variables. */ - protected $page_type; + public function get() + { + } /** - * Based on the page_type ($this->page_type) there will be constructed an url part, for subpages and - * navigation. + * Retrieves the generic replacement variable names. * - * @var string - */ - protected $page_url; - /** - * The settings which will be used in the __construct. + * Which are the replacement variables without the editor specific ones. * - * @var array - */ - protected $settings; - /** - * Holds the pagination config. + * @param array $replacement_variables Possibly generic replacement variables. * - * @var array + * @return array The generic replacement variable names. */ - protected $pagination = []; + public function get_generic($replacement_variables) + { + } /** - * Holds the sanitized data from the user input. + * Determines the page type of the current term. * - * @var array - */ - protected $input_fields = []; - /** - * Class constructor. + * @param string $taxonomy The taxonomy name. * - * @param array $args The arguments. + * @return string The page type. */ - public function __construct($args = []) + public function determine_for_term($taxonomy) { } /** - * Prepares the data and renders the page. + * Determines the page type of the current post. + * + * @param WP_Post $post A WordPress post instance. + * + * @return string The page type. */ - public function show_page() + public function determine_for_post($post) { } /** - * Used in the constructor to build a reference list of post types the current user can edit. + * Determines the page type for a post type. + * + * @param string $post_type The name of the post_type. + * @param string $fallback The page type to fall back to. + * + * @return string The page type. */ - protected function populate_editable_post_types() + public function determine_for_post_type($post_type, $fallback = 'custom_post_type') { } /** - * Will show the navigation for the table like page navigation and page filter. + * Determines the page type for an archive page. * - * @param string $which Table nav location (such as top). + * @param string $name The name of the archive. + * @param string $fallback The page type to fall back to. + * + * @return string The page type. */ - public function display_tablenav($which) + public function determine_for_archive($name, $fallback = 'custom-post-type_archive') { } /** - * This function builds the base sql subquery used in this class. + * Adds the replavement variables for the given page types. * - * This function takes into account the post types in which the current user can - * edit all posts, and the ones the current user can only edit his/her own. + * @param array $page_types Page types to add variables for. + * @param array $replacement_variables_to_add The variables to add. * - * @return string The subquery, which should always be used in $wpdb->prepare(), - * passing the current user_id in as the first parameter. + * @return void */ - public function get_base_subquery() + protected function add_for_page_types(array $page_types, array $replacement_variables_to_add) { } /** - * Gets the views. + * Extracts the names from the given replacements variables. * - * @return array The views. + * @param array $replacement_variables Replacement variables to extract the name from. + * + * @return array Extracted names. */ - public function get_views() + protected function extract_names($replacement_variables) { } /** - * Outputs extra table navigation. + * Returns whether the given page type has editor specific replace vars. * - * @param string $which Table nav location (such as top). + * @param string $page_type The page type to check. + * + * @return bool True if there are associated editor specific replace vars. */ - public function extra_tablenav($which) + protected function has_for_page_type($page_type) { } /** - * Gets a list of sortable columns. - * - * The format is: 'internal-name' => array( 'orderby', bool ). + * Merges all editor specific replacement variables into one array and removes duplicates. * - * @return array + * @return array The list of unique editor specific replacement variables. */ - public function get_sortable_columns() + protected function get_unique_replacement_variables() { } + } + /** + * WPSEO plugin file. + * + * @package WPSEO\Admin + */ + /** + * Handles the Gutenberg Compatibility notification showing and hiding. + */ + class WPSEO_Admin_Gutenberg_Compatibility_Notification implements \WPSEO_WordPress_Integration + { /** - * Sets the correct pagenumber and pageurl for the navigation. + * Notification ID to use. + * + * @var string */ - public function prepare_page_navigation() - { - } + private $notification_id = 'wpseo-outdated-gutenberg-plugin'; /** - * Preparing the requested pagerows and setting the needed variables. + * Instance of gutenberg compatibility checker. + * + * @var WPSEO_Gutenberg_Compatibility */ - public function prepare_items() - { - } + protected $compatibility_checker; /** - * Getting the columns for first row. + * Instance of Yoast Notification Center. * - * @return array + * @var Yoast_Notification_Center */ - public function get_columns() - { - } + protected $notification_center; /** - * Setting the column headers. + * WPSEO_Admin_Gutenberg_Compatibility_Notification constructor. */ - protected function set_column_headers() + public function __construct() { } /** - * Counting total items. - * - * @param string $subquery SQL FROM part. - * @param string $all_states SQL IN part. - * @param string $post_type_clause SQL post type part. + * Registers all hooks to WordPress. * - * @return mixed + * @return void */ - protected function count_items($subquery, $all_states, $post_type_clause) + public function register_hooks() { } /** - * Getting the post_type_clause filter. + * Manages if the notification should be shown or removed. * - * @return string + * @return void */ - protected function get_post_type_clause() + public function manage_notification() { } /** - * Setting the pagination. - * - * Total items is the number of all visible items. + * Adds the notification to the notificaton center. * - * @param int $total_items Total items counts. + * @return void */ - protected function set_pagination($total_items) + protected function add_notification() { } - /** - * Parse the query to get items from database. + } + /** + * WPSEO plugin file. + * + * @package WPSEO\Admin + */ + /** + * Generates the HTML for an inline Help Button and Panel. + */ + class WPSEO_Admin_Help_Panel + { + /** + * Unique identifier of the element the inline help refers to, used as an identifier in the html. * - * Based on given parameters there will be parse a query which will get all the pages/posts and other post_types - * from the database. + * @var string + */ + private $id; + /** + * The Help Button text. Needs a properly escaped string. * - * @param string $subquery SQL FROM part. - * @param string $all_states SQL IN part. - * @param string $post_type_clause SQL post type part. + * @var string + */ + private $help_button_text; + /** + * The Help Panel content. Needs a properly escaped string (might contain HTML). * - * @return string + * @var string */ - protected function parse_item_query($subquery, $all_states, $post_type_clause) + private $help_content; + /** + * Optional Whether to print out a container div element for the Help Panel, used for styling. + * + * @var string + */ + private $wrapper; + /** + * Constructor. + * + * @param string $id Unique identifier of the element the inline help refers to, used as + * an identifier in the html. + * @param string $help_button_text The Help Button text. Needs a properly escaped string. + * @param string $help_content The Help Panel content. Needs a properly escaped string (might contain HTML). + * @param string $wrapper Optional Whether to print out a container div element for the Help Panel, + * used for styling. + * Pass a `has-wrapper` value to print out the container. Default: no container. + */ + public function __construct($id, $help_button_text, $help_content, $wrapper = '') { } /** - * Heavily restricts the possible columns by which a user can order the table - * in the bulk editor, thereby preventing a possible CSRF vulnerability. + * Returns the html for the Help Button. * - * @param string $orderby The column by which we want to order. + * @return string + */ + public function get_button_html() + { + } + /** + * Returns the html for the Help Panel. * * @return string */ - protected function sanitize_orderby($orderby) + public function get_panel_html() { } + } + /** + * WPSEO plugin file. + * + * @package WPSEO\Admin + */ + /** + * Performs the load on admin side. + */ + class WPSEO_Admin_Init + { /** - * Makes sure the order clause is always ASC or DESC for the bulk editor table, - * thereby preventing a possible CSRF vulnerability. + * Holds the global `$pagenow` variable's value. * - * @param string $order Whether we want to sort ascending or descending. + * @var string + */ + private $pagenow; + /** + * Holds the asset manager. * - * @return string SQL order string (ASC, DESC). + * @var WPSEO_Admin_Asset_Manager */ - protected function sanitize_order($order) + private $asset_manager; + /** + * Class constructor. + */ + public function __construct() { } /** - * Getting all the items. + * Enqueue our styling for dismissible yoast notifications. * - * @param string $query SQL query to use. + * @return void */ - protected function get_items($query) + public function enqueue_dismissible() { } /** - * Getting all the states. + * Removes any notification for incomplete translations. * - * @return string + * @return void */ - protected function get_all_states() + public function remove_translations_notification() { } /** - * Based on $this->items and the defined columns, the table rows will be displayed. + * Creates an unsupported PHP version notification in the notification center. + * + * @return void */ - public function display_rows() + public function unsupported_php_notice() { } /** - * Getting the attributes for each table cell. - * - * @param string $column_name Column name string. - * @param array $hidden Set of hidden columns. - * @param string $classes Additional CSS classes. - * @param string $column_display_name Column display name string. + * Gets the latest released major WordPress version from the WordPress stable-check api. * - * @return string + * @return float|int The latest released major WordPress version. 0 when the stable-check API doesn't respond. */ - protected function column_attributes($column_name, $hidden, $classes, $column_display_name) + private function get_latest_major_wordpress_version() { } /** - * Parsing the title. - * - * @param WP_Post $rec Post object. + * Helper to verify if the user is currently visiting one of our admin pages. * - * @return string + * @return bool */ - protected function parse_page_title_column($rec) + private function on_wpseo_admin_page() { } /** - * Parsing the column based on the $column_name. - * - * @param string $column_name Column name. - * @param WP_Post $rec Post object. + * Whether we should load the meta box classes. * - * @return string + * @return bool true if we should load the meta box classes, false otherwise. */ - protected function parse_column($column_name, $rec) + private function should_load_meta_boxes() { } /** - * Parse the field where the existing meta-data value is displayed. - * - * @param int $record_id Record ID. - * @param string $attributes HTML attributes. - * @param bool|array $values Optional values data array. + * Determine whether we should load the meta box class and if so, load it. * - * @return string + * @return void */ - protected function parse_meta_data_field($record_id, $attributes, $values = \false) + private function load_meta_boxes() { } /** - * Method for setting the meta data, which belongs to the records that will be shown on the current page. + * Determine if we should load our taxonomy edit class and if so, load it. * - * This method will loop through the current items ($this->items) for getting the post_id. With this data - * ($needed_ids) the method will query the meta-data table for getting the title. + * @return void */ - protected function get_meta_data() + private function load_taxonomy_class() { } /** - * Getting all post_ids from to $this->items. + * Determine if we should load our admin pages class and if so, load it. * - * @return array + * Loads admin page class for all admin pages starting with `wpseo_`. + * + * @return void */ - protected function get_post_ids() + private function load_admin_user_class() { } /** - * Getting the meta_data from database. + * Determine if we should load our admin pages class and if so, load it. * - * @param array $post_ids Post IDs for SQL IN part. + * Loads admin page class for all admin pages starting with `wpseo_`. * - * @return mixed + * @return void */ - protected function get_meta_data_result(array $post_ids) + private function load_admin_page_class() { } /** - * Setting $this->meta_data. + * Loads the plugin suggestions. * - * @param array $meta_data Meta data set. + * @return void */ - protected function parse_meta_data($meta_data) + private function load_plugin_suggestions() { } /** - * This method will merge general array with given parameter $columns. - * - * @param array $columns Optional columns set. + * Registers the Premium Upsell Admin Block. * - * @return array + * @return void */ - protected function merge_columns($columns = []) + private function register_premium_upsell_admin_block() { } - } - /** - * WPSEO plugin file. - * - * @package WPSEO\Admin\Bulk Editor - * @since 1.5.0 - */ - /** - * Implements table for bulk description editing. - */ - class WPSEO_Bulk_Description_List_Table extends \WPSEO_Bulk_List_Table - { /** - * Current type for this class will be (meta) description. + * See if we should start our XML Sitemaps Admin class. * - * @var string + * @return void */ - protected $page_type = 'description'; + private function load_xml_sitemaps_admin() + { + } /** - * Settings with are used in __construct. + * Shows deprecation warnings to the user if a plugin has registered a filter we have deprecated. * - * @var array + * @return void */ - protected $settings = ['singular' => 'wpseo_bulk_description', 'plural' => 'wpseo_bulk_descriptions', 'ajax' => \true]; + public function show_hook_deprecation_warnings() + { + } /** - * The field in the database where meta field is saved. + * Check if the permalink uses %postname%. * - * @var string + * @return bool */ - protected $target_db_field = 'metadesc'; + private function has_postname_in_permalink() + { + } /** - * The columns shown on the table. + * Shows a notice on the permalink settings page. * - * @return array + * @return void */ - public function get_columns() + public function permalink_settings_notice() { } /** - * Parse the metadescription. + * Adds a custom Yoast section within the Classic Editor publish box. * - * @param string $column_name Column name. - * @param object $record Data object. - * @param string $attributes HTML attributes. + * @param WP_Post $post The current post object. * - * @return string + * @return void */ - protected function parse_page_specific_column($column_name, $record, $attributes) + public function add_publish_box_section($post) { } } /** * WPSEO plugin file. * - * @package WPSEO\Admin\Bulk Editor - * @since 1.5.0 + * @package WPSEO\Admin */ /** - * Implements table for bulk title editing. + * Determines the recommended replacement variables based on the context. */ - class WPSEO_Bulk_Title_Editor_List_Table extends \WPSEO_Bulk_List_Table + class WPSEO_Admin_Recommended_Replace_Vars { /** - * Current type for this class will be title. + * The recommended replacement variables. * - * @var string + * @var array */ - protected $page_type = 'title'; + protected $recommended_replace_vars = [ + // Posts types. + 'page' => ['sitename', 'title', 'sep', 'primary_category'], + 'post' => ['sitename', 'title', 'sep', 'primary_category'], + // Homepage. + 'homepage' => ['sitename', 'sitedesc', 'sep'], + // Custom post type. + 'custom_post_type' => ['sitename', 'title', 'sep'], + // Taxonomies. + 'category' => ['sitename', 'term_title', 'sep', 'term_hierarchy'], + 'post_tag' => ['sitename', 'term_title', 'sep'], + 'post_format' => ['sitename', 'term_title', 'sep', 'page'], + // Custom taxonomy. + 'term-in-custom-taxonomy' => ['sitename', 'term_title', 'sep', 'term_hierarchy'], + // Settings - archive pages. + 'author_archive' => ['sitename', 'title', 'sep', 'page'], + 'date_archive' => ['sitename', 'sep', 'date', 'page'], + 'custom-post-type_archive' => ['sitename', 'title', 'sep', 'page'], + // Settings - special pages. + 'search' => ['sitename', 'searchphrase', 'sep', 'page'], + '404' => ['sitename', 'sep'], + ]; /** - * Settings with are used in __construct. + * Determines the page type of the current term. * - * @var array + * @param string $taxonomy The taxonomy name. + * + * @return string The page type. */ - protected $settings = ['singular' => 'wpseo_bulk_title', 'plural' => 'wpseo_bulk_titles', 'ajax' => \true]; + public function determine_for_term($taxonomy) + { + } /** - * The field in the database where meta field is saved. + * Determines the page type of the current post. * - * @var string + * @param WP_Post $post A WordPress post instance. + * + * @return string The page type. */ - protected $target_db_field = 'title'; + public function determine_for_post($post) + { + } /** - * The columns shown on the table. + * Determines the page type for a post type. * - * @return array + * @param string $post_type The name of the post_type. + * @param string $fallback The page type to fall back to. + * + * @return string The page type. */ - public function get_columns() + public function determine_for_post_type($post_type, $fallback = 'custom_post_type') { } /** - * Parse the title columns. + * Determines the page type for an archive page. * - * @param string $column_name Column name. - * @param object $record Data object. - * @param string $attributes HTML attributes. + * @param string $name The name of the archive. + * @param string $fallback The page type to fall back to. * - * @return string + * @return string The page type. */ - protected function parse_page_specific_column($column_name, $record, $attributes) + public function determine_for_archive($name, $fallback = 'custom-post-type_archive') { } - } - /** - * WPSEO plugin file. - * - * @package WPSEO\Admin - */ - /** - * Collects the data from the added collection objects. - */ - class WPSEO_Collector - { /** - * Holds the collections. + * Retrieves the recommended replacement variables for the given page type. * - * @var WPSEO_Collection[] + * @param string $page_type The page type. + * + * @return array The recommended replacement variables. */ - protected $collections = []; + public function get_recommended_replacevars_for($page_type) + { + } /** - * Adds a collection object to the collections. + * Retrieves the recommended replacement variables. * - * @param WPSEO_Collection $collection The collection object to add. + * @return array The recommended replacement variables. */ - public function add_collection(\WPSEO_Collection $collection) + public function get_recommended_replacevars() { } /** - * Collects the data from the collection objects. + * Returns whether the given page type has recommended replace vars. * - * @return array The collected data. + * @param array $recommended_replace_vars The recommended replace vars + * to check in. + * @param string $page_type The page type to check. + * + * @return bool True if there are associated recommended replace vars. */ - public function collect() + private function has_recommended_replace_vars($recommended_replace_vars, $page_type) { } /** - * Returns the collected data as a JSON encoded string. + * Determines whether or not a post is the homepage. * - * @return false|string The encode string. + * @param WP_Post $post The WordPress global post object. + * + * @return bool True if the given post is the homepage. */ - public function get_as_json() + private function is_homepage($post) { } } /** - * Class WPSEO_Admin_Pages. + * WPSEO plugin file. * - * Class with functionality for the Yoast SEO admin pages. + * @package WPSEO\Admin + * @since 1.8.0 */ - class WPSEO_Admin_Pages + /** + * Customizes user profile. + */ + class WPSEO_Admin_User_Profile { /** - * The option in use for the current admin page. - * - * @var string + * Class constructor. */ - public $currentoption = 'wpseo'; + public function __construct() + { + } /** - * Holds the asset manager. + * Clear author sitemap cache when settings are changed. * - * @var WPSEO_Admin_Asset_Manager - */ - private $asset_manager; - /** - * Class constructor, which basically only hooks the init function on the init hook. + * @since 3.1 + * + * @param int $meta_id The ID of the meta option changed. + * @param int $object_id The ID of the user. + * @param string $meta_key The key of the meta field changed. + * + * @return void */ - public function __construct() + public function clear_author_sitemap_cache($meta_id, $object_id, $meta_key) { } /** - * Make sure the needed scripts are loaded for admin pages. + * Updates the user metas that (might) have been set on the user profile page. + * + * @deprecated 22.6 + * @codeCoverageIgnore + * + * @param int $user_id User ID of the updated user. + * + * @return void */ - public function init() + public function process_user_option_update($user_id) { } /** - * Loads the required styles for the config page. + * Add the inputs needed for SEO values to the User Profile page. + * + * @deprecated 23.4 + * @codeCoverageIgnore + * + * @param WP_User $user User instance to output for. + * + * @return void */ - public function config_page_styles() + public function user_profile($user) { } + } + /** + * WPSEO plugin file. + * + * @package WPSEO\Admin + */ + /** + * Represents the utils for the admin. + */ + class WPSEO_Admin_Utils + { /** - * Loads the required scripts for the config page. + * Gets the install URL for the passed plugin slug. + * + * @param string $slug The slug to create an install link for. + * + * @return string The install URL. Empty string if the current user doesn't have the proper capabilities. */ - public function config_page_scripts() + public static function get_install_url($slug) { } /** - * Retrieves some variables that are needed for replacing variables in JS. + * Gets the activation URL for the passed plugin slug. * - * @deprecated 20.3 - * @codeCoverageIgnore + * @param string $slug The slug to create an activation link for. * - * @return array The replacement and recommended replacement variables. + * @return string The activation URL. Empty string if the current user doesn't have the proper capabilities. */ - public function get_replace_vars_script_data() + public static function get_activation_url($slug) { } /** - * Enqueues and handles all the tool dependencies. + * Creates a link if the passed plugin is deemend a directly-installable plugin. + * + * @param array $plugin The plugin to create the link for. + * + * @return string The link to the plugin install. Returns the title if the plugin is deemed a Premium product. */ - private function enqueue_tools_scripts() + public static function get_install_link($plugin) { } /** - * Returns the appropriate shortlink for the Webinar. + * Gets a visually hidden accessible message for links that open in a new browser tab. * - * @return string The shortlink for the Webinar. + * @return string The visually hidden accessible message. */ - private function get_webinar_shortlink() + public static function get_new_tab_message() { } } /** - * WPSEO plugin file. - * - * @package WPSEO\Admin\Customizer - */ - /** - * Class with functionality to support WP SEO settings in WordPress Customizer. + * Class that holds most of the admin functionality for Yoast SEO. */ - class WPSEO_Customizer + class WPSEO_Admin { /** - * Holds the customize manager. + * The page identifier used in WordPress to register the admin page. * - * @var WP_Customize_Manager - */ - protected $wp_customize; - /** - * Template for the setting IDs used for the customizer. + * !DO NOT CHANGE THIS! * * @var string */ - private $setting_template = 'wpseo_titles[%s]'; - /** - * Default arguments for the breadcrumbs customizer settings object. - * - * @var array - */ - private $default_setting_args = ['default' => '', 'type' => 'option', 'transport' => 'refresh']; + public const PAGE_IDENTIFIER = 'wpseo_dashboard'; /** - * Default arguments for the breadcrumbs customizer control object. + * Array of classes that add admin functionality. * * @var array */ - private $default_control_args = ['label' => '', 'type' => 'text', 'section' => 'wpseo_breadcrumbs_customizer_section', 'settings' => '', 'context' => '']; + protected $admin_features; /** - * Construct Method. + * Class constructor. */ public function __construct() { } /** - * Function to support WordPress Customizer. + * Schedules a rewrite flush to happen at shutdown. * - * @param WP_Customize_Manager $wp_customize Manager class instance. + * @return void */ - public function wpseo_customize_register($wp_customize) + public function schedule_rewrite_flush() { } /** - * Add the breadcrumbs section to the customizer. + * Returns all the classes for the admin features. + * + * @return array */ - private function breadcrumbs_section() + public function get_admin_features() { } /** - * Returns whether or not the breadcrumbs are active. + * Register assets needed on admin pages. * - * @return bool + * @return void */ - public function breadcrumbs_active_callback() + public function enqueue_assets() { } /** - * Adds the breadcrumbs show blog checkbox. + * Returns the manage_options capability. + * + * @return string The capability to use. */ - private function breadcrumbs_blog_show_setting() + public function get_manage_options_cap() { } /** - * Returns whether or not to show the breadcrumbs blog show option. + * Maps the manage_options cap on saving an options page to wpseo_manage_options. * - * @return bool + * @return void */ - public function breadcrumbs_blog_show_active_cb() + public function map_manage_options_cap() { } /** - * Adds the breadcrumbs separator text field. + * Adds the ability to choose how many posts are displayed per page + * on the bulk edit pages. + * + * @return void */ - private function breadcrumbs_separator_setting() + public function bulk_edit_options() { } /** - * Adds the breadcrumbs home anchor text field. + * Saves the posts per page limit for bulk edit pages. + * + * @param int $status Status value to pass through. + * @param string $option Option name. + * @param int $value Count value to check. + * + * @return int */ - private function breadcrumbs_home_setting() + public function save_bulk_edit_options($status, $option, $value) { } /** - * Adds the breadcrumbs prefix text field. + * Adds links to Premium Support and FAQ under the plugin in the plugin overview page. + * + * @param array $links Array of links for the plugins, adapted when the current plugin is found. + * @param string $file The filename for the current plugin, which the filter loops through. + * + * @return array */ - private function breadcrumbs_prefix_setting() + public function add_action_link($links, $file) { } /** - * Adds the breadcrumbs archive prefix text field. + * Enqueues the (tiny) global JS needed for the plugin. + * + * @return void */ - private function breadcrumbs_archiveprefix_setting() + public function config_page_scripts() { } /** - * Adds the breadcrumbs search prefix text field. + * Enqueues the (tiny) global stylesheet needed for the plugin. + * + * @return void */ - private function breadcrumbs_searchprefix_setting() + public function enqueue_global_style() { } /** - * Adds the breadcrumb 404 prefix text field. - */ - private function breadcrumbs_404_setting() + * Filter the $contactmethods array and add a set of social profiles. + * + * These are used with the Facebook author, rel="author" and Twitter cards implementation. + * + * @deprecated 22.6 + * @codeCoverageIgnore + * + * @param array $contactmethods Currently set contactmethods. + * + * @return array Contactmethods with added contactmethods. + */ + public function update_contactmethods($contactmethods) + { + } + /** + * Log the updated timestamp for user profiles when theme is changed. + * + * @return void + */ + public function switch_theme() + { + } + /** + * Localization for the dismiss urls. + * + * @return array + */ + private function localize_admin_global_script() + { + } + /** + * Whether we are on the admin dashboard page. + * + * @return bool + */ + protected function on_dashboard_page() { } /** - * Adds the customizer setting and control. + * Loads the cornerstone filter. * - * @param string $index Array key index to use for the customizer setting. - * @param array $control_args Customizer control object arguments. - * Only those different from the default need to be passed. - * @param string|null $id Optional. Customizer control object ID. - * Will default to 'wpseo-' . $index. - * @param array $custom_settings Optional. Customizer setting arguments. - * Only those different from the default need to be passed. + * @return WPSEO_WordPress_Integration[] The integrations to initialize. */ - private function add_setting_and_control($index, $control_args, $id = \null, $custom_settings = []) + protected function initialize_cornerstone_content() { } } @@ -2761,752 +2857,709 @@ private function add_setting_and_control($index, $control_args, $id = \null, $cu * @package WPSEO\Admin */ /** - * Represents the proxy for communicating with the database. + * Represents a WPSEO asset */ - class WPSEO_Database_Proxy + class WPSEO_Admin_Asset { /** - * Holds the table name. + * Constant used to identify file type as a JS file. * * @var string */ - protected $table_name; + public const TYPE_JS = 'js'; /** - * Determines whether to suppress errors or not. + * Constant used to identify file type as a CSS file. * - * @var bool + * @var string */ - protected $suppress_errors = \true; + public const TYPE_CSS = 'css'; /** - * Determines if this table is multisite. + * The name option identifier. * - * @var bool + * @var string */ - protected $is_multisite_table = \false; + public const NAME = 'name'; /** - * Holds the last suppressed state. + * The source option identifier. * - * @var bool + * @var string */ - protected $last_suppressed_state; + public const SRC = 'src'; /** - * Holds the WordPress database object. + * The dependencies option identifier. * - * @var wpdb + * @var string */ - protected $database; + public const DEPS = 'deps'; /** - * Sets the class attributes and registers the table. + * The version option identifier. * - * @param wpdb $database The database object. - * @param string $table_name The table name that is represented. - * @param bool $suppress_errors Should the errors be suppressed. - * @param bool $is_multisite_table Should the table be global in multisite. + * @var string */ - public function __construct($database, $table_name, $suppress_errors = \true, $is_multisite_table = \false) - { - } + public const VERSION = 'version'; + /* Style specific. */ /** - * Inserts data into the database. - * - * @param array $data Data to insert. - * @param array|string|null $format Formats for the data. + * The media option identifier. * - * @return false|int Total amount of inserted rows or false on error. + * @var string */ - public function insert(array $data, $format = \null) - { - } + public const MEDIA = 'media'; /** - * Updates data in the database. - * - * @param array $data Data to update on the table. - * @param array $where Where condition as key => value array. - * @param array|string|null $format Optional. Data prepare format. - * @param array|string|null $where_format Optional. Where prepare format. + * The rtl option identifier. * - * @return false|int False when the update request is invalid, int on number of rows changed. + * @var string */ - public function update(array $data, array $where, $format = \null, $where_format = \null) - { - } + public const RTL = 'rtl'; + /* Script specific. */ /** - * Upserts data in the database. - * - * Performs an insert into and if key is duplicate it will update the existing record. - * - * @param array $data Data to update on the table. - * @param array|null $where Unused. Where condition as key => value array. - * @param array|string|null $format Optional. Data prepare format. - * @param array|string|null $where_format Optional. Where prepare format. + * The "in footer" option identifier. * - * @return false|int False when the upsert request is invalid, int on number of rows changed. + * @var string */ - public function upsert(array $data, array $where = \null, $format = \null, $where_format = \null) - { - } + public const IN_FOOTER = 'in_footer'; /** - * Deletes a record from the database. - * - * @param array $where Where clauses for the query. - * @param array|string|null $format Formats for the data. + * Asset identifier. * - * @return false|int + * @var string */ - public function delete(array $where, $format = \null) - { - } + protected $name; /** - * Executes the given query and returns the results. - * - * @param string $query The query to execute. + * Path to the asset. * - * @return array|object|null The resultset + * @var string */ - public function get_results($query) - { - } + protected $src; /** - * Creates a table to the database. - * - * @param array $columns The columns to create. - * @param array $indexes The indexes to use. + * Asset dependencies. * - * @return bool True when creation is successful. + * @var string|array */ - public function create_table(array $columns, array $indexes = []) - { - } + protected $deps; /** - * Checks if there is an error. + * Asset version. * - * @return bool Returns true when there is an error. - */ - public function has_error() - { - } - /** - * Executed before a query will be ran. - */ - protected function pre_execution() - { - } - /** - * Executed after a query has been ran. + * @var string */ - protected function post_execution() - { - } + protected $version; /** - * Returns the full table name. + * For CSS Assets. The type of media for which this stylesheet has been defined. * - * @return string Full table name including prefix. - */ - public function get_table_name() - { - } - /** - * Returns the prefix to use for the table. + * See https://www.w3.org/TR/CSS2/media.html#media-types. * - * @return string The table prefix depending on the database context. + * @var string */ - protected function get_table_prefix() - { - } + protected $media; /** - * Registers the table with WordPress. + * For JS Assets. Whether or not the script should be loaded in the footer. * - * @return void + * @var bool */ - protected function register_table() - { - } + protected $in_footer; /** - * Checks if the table has been registered with WordPress. + * For JS Assets. The script's async/defer strategy. * - * @return bool True if the table is registered, false otherwise. + * @var string */ - protected function is_table_registered() - { - } - } - /** - * WPSEO plugin file. - * - * @package WPSEO\Admin\Export - */ - /** - * Class WPSEO_Export. - * - * Class with functionality to export the WP SEO settings. - */ - class WPSEO_Export - { + protected $strategy; /** - * Holds the nonce action. + * For CSS Assets. Whether this stylesheet is a right-to-left stylesheet. * - * @var string + * @var bool */ - const NONCE_ACTION = 'wpseo_export'; + protected $rtl; /** - * Holds the export data. + * File suffix. * * @var string */ - private $export = ''; + protected $suffix; /** - * Holds whether the export was a success. + * Default asset arguments. * - * @var bool - */ - public $success; - /** - * Handles the export request. + * @var array */ - public function export() - { - } + private $defaults = ['deps' => [], 'in_footer' => \true, 'rtl' => \true, 'media' => 'all', 'version' => '', 'suffix' => '', 'strategy' => '']; /** - * Outputs the export. + * Constructs an instance of the WPSEO_Admin_Asset class. + * + * @param array $args The arguments for this asset. + * + * @throws InvalidArgumentException Throws when no name or src has been provided. */ - public function output() + public function __construct(array $args) { } /** - * Exports the current site's WP SEO settings. + * Returns the asset identifier. + * + * @return string */ - private function export_settings() + public function get_name() { } /** - * Writes the header of the export. + * Returns the path to the asset. + * + * @return string */ - private function export_header() + public function get_src() { } /** - * Writes a line to the export. + * Returns the asset dependencies. * - * @param string $line Line string. - * @param bool $newline_first Boolean flag whether to prepend with new line. + * @return array|string */ - private function write_line($line, $newline_first = \false) + public function get_deps() { } /** - * Writes an entire option group to the export. + * Returns the asset version. * - * @param string $opt_group Option group name. + * @return string|null */ - private function write_opt_group($opt_group) + public function get_version() { } /** - * Writes a settings line to the export. + * Returns the media type for CSS assets. * - * @param string $key Key string. - * @param string $val Value string. + * @return string */ - private function write_setting($key, $val) + public function get_media() { } - } - /** - * WPSEO plugin file. - * - * @package WPSEO\Admin - */ - /** - * Exposes shortlinks in a global, so that we can pass them to our Javascript components. - */ - class WPSEO_Expose_Shortlinks implements \WPSEO_WordPress_Integration - { - /** - * Array containing the keys and shortlinks. - * - * @var array - */ - private $shortlinks = ['shortlinks.advanced.allow_search_engines' => 'https://yoa.st/allow-search-engines', 'shortlinks.advanced.follow_links' => 'https://yoa.st/follow-links', 'shortlinks.advanced.meta_robots' => 'https://yoa.st/meta-robots-advanced', 'shortlinks.advanced.breadcrumbs_title' => 'https://yoa.st/breadcrumbs-title', 'shortlinks.metabox.schema.explanation' => 'https://yoa.st/400', 'shortlinks.metabox.schema.page_type' => 'https://yoa.st/402', 'shortlinks.sidebar.schema.explanation' => 'https://yoa.st/401', 'shortlinks.sidebar.schema.page_type' => 'https://yoa.st/403', 'shortlinks.focus_keyword_info' => 'https://yoa.st/focus-keyword', 'shortlinks.nofollow_sponsored' => 'https://yoa.st/nofollow-sponsored', 'shortlinks.snippet_preview_info' => 'https://yoa.st/snippet-preview', 'shortlinks.cornerstone_content_info' => 'https://yoa.st/1i9', 'shortlinks.upsell.social_preview.facebook' => 'https://yoa.st/social-preview-facebook', 'shortlinks.upsell.social_preview.twitter' => 'https://yoa.st/social-preview-twitter', 'shortlinks.upsell.sidebar.news' => 'https://yoa.st/get-news-sidebar', 'shortlinks.upsell.sidebar.focus_keyword_synonyms_link' => 'https://yoa.st/textlink-synonyms-popup-sidebar', 'shortlinks.upsell.sidebar.focus_keyword_synonyms_button' => 'https://yoa.st/keyword-synonyms-popup-sidebar', 'shortlinks.upsell.sidebar.premium_seo_analysis_button' => 'https://yoa.st/premium-seo-analysis-sidebar', 'shortlinks.upsell.sidebar.focus_keyword_additional_link' => 'https://yoa.st/textlink-keywords-popup-sidebar', 'shortlinks.upsell.sidebar.focus_keyword_additional_button' => 'https://yoa.st/add-keywords-popup-sidebar', 'shortlinks.upsell.sidebar.additional_link' => 'https://yoa.st/textlink-keywords-sidebar', 'shortlinks.upsell.sidebar.additional_button' => 'https://yoa.st/add-keywords-sidebar', 'shortlinks.upsell.sidebar.keyphrase_distribution' => 'https://yoa.st/keyphrase-distribution-sidebar', 'shortlinks.upsell.sidebar.word_complexity' => 'https://yoa.st/word-complexity-sidebar', 'shortlinks.upsell.metabox.news' => 'https://yoa.st/get-news-metabox', 'shortlinks.upsell.metabox.go_premium' => 'https://yoa.st/pe-premium-page', 'shortlinks.upsell.metabox.focus_keyword_synonyms_link' => 'https://yoa.st/textlink-synonyms-popup-metabox', 'shortlinks.upsell.metabox.focus_keyword_synonyms_button' => 'https://yoa.st/keyword-synonyms-popup', 'shortlinks.upsell.metabox.premium_seo_analysis_button' => 'https://yoa.st/premium-seo-analysis-metabox', 'shortlinks.upsell.metabox.focus_keyword_additional_link' => 'https://yoa.st/textlink-keywords-popup-metabox', 'shortlinks.upsell.metabox.focus_keyword_additional_button' => 'https://yoa.st/add-keywords-popup', 'shortlinks.upsell.metabox.additional_link' => 'https://yoa.st/textlink-keywords-metabox', 'shortlinks.upsell.metabox.additional_button' => 'https://yoa.st/add-keywords-metabox', 'shortlinks.upsell.metabox.keyphrase_distribution' => 'https://yoa.st/keyphrase-distribution-metabox', 'shortlinks.upsell.metabox.word_complexity' => 'https://yoa.st/word-complexity-metabox', 'shortlinks.upsell.gsc.create_redirect_button' => 'https://yoa.st/redirects', 'shortlinks.readability_analysis_info' => 'https://yoa.st/readability-analysis', 'shortlinks.inclusive_language_analysis_info' => 'https://yoa.st/inclusive-language-analysis', 'shortlinks.activate_premium_info' => 'https://yoa.st/activate-subscription', 'shortlinks.upsell.sidebar.morphology_upsell_metabox' => 'https://yoa.st/morphology-upsell-metabox', 'shortlinks.upsell.sidebar.morphology_upsell_sidebar' => 'https://yoa.st/morphology-upsell-sidebar', 'shortlinks.semrush.volume_help' => 'https://yoa.st/3-v', 'shortlinks.semrush.trend_help' => 'https://yoa.st/3-v', 'shortlinks.semrush.prices' => 'https://yoa.st/semrush-prices', 'shortlinks.semrush.premium_landing_page' => 'https://yoa.st/413', 'shortlinks.wincher.seo_performance' => 'https://yoa.st/wincher-integration', 'shortlinks-insights-estimated_reading_time' => 'https://yoa.st/4fd', 'shortlinks-insights-flesch_reading_ease' => 'https://yoa.st/34r', 'shortlinks-insights-flesch_reading_ease_sidebar' => 'https://yoa.st/4mf', 'shortlinks-insights-flesch_reading_ease_metabox' => 'https://yoa.st/4mg', 'shortlinks-insights-flesch_reading_ease_article' => 'https://yoa.st/34s', 'shortlinks-insights-keyword_research_link' => 'https://yoa.st/keyword-research-metabox', 'shortlinks-insights-upsell-sidebar-prominent_words' => 'https://yoa.st/prominent-words-upsell-sidebar', 'shortlinks-insights-upsell-metabox-prominent_words' => 'https://yoa.st/prominent-words-upsell-metabox', 'shortlinks-insights-upsell-elementor-prominent_words' => 'https://yoa.st/prominent-words-upsell-elementor', 'shortlinks-insights-word_count' => 'https://yoa.st/word-count', 'shortlinks-insights-upsell-sidebar-text_formality' => 'https://yoa.st/formality-upsell-sidebar', 'shortlinks-insights-upsell-metabox-text_formality' => 'https://yoa.st/formality-upsell-metabox', 'shortlinks-insights-upsell-elementor-text_formality' => 'https://yoa.st/formality-upsell-elementor', 'shortlinks-insights-text_formality_info_free' => 'https://yoa.st/formality-free', 'shortlinks-insights-text_formality_info_premium' => 'https://yoa.st/formality']; /** - * Registers all hooks to WordPress. + * Returns whether a script asset should be loaded in the footer of the page. * - * @return void + * @return bool */ - public function register_hooks() + public function is_in_footer() { } /** - * Adds shortlinks to the passed array. + * Returns the script asset's async/defer loading strategy. * - * @param array $input The array to add shortlinks to. - * - * @return array The passed array with the additional shortlinks. + * @return string */ - public function expose_shortlinks($input) + public function get_strategy() { } /** - * Retrieves the shortlinks. + * Returns whether this CSS has a RTL counterpart. * - * @return array The shortlinks. + * @return bool */ - private function get_shortlinks() + public function has_rtl() { } /** - * Checks if the current page is a term edit page. + * Returns the file suffix. * - * @return bool True when page is term edit. + * @return string */ - private function is_term_edit() + public function get_suffix() { } } /** * WPSEO plugin file. * - * @package WPSEO\Gutenberg_Compatibility + * @package WPSEO\Admin\Bulk Editor + * @since 1.5.0 */ /** - * Class WPSEO_Gutenberg_Compatibility + * Implements table for bulk editing. */ - class WPSEO_Gutenberg_Compatibility + class WPSEO_Bulk_List_Table extends \WP_List_Table { /** - * The currently released version of Gutenberg. + * The nonce that was passed with the request. * * @var string */ - const CURRENT_RELEASE = '15.4.0'; + private $nonce; /** - * The minimally supported version of Gutenberg by the plugin. + * Array of post types for which the current user has `edit_others_posts` capabilities. * - * @var string + * @var array */ - const MINIMUM_SUPPORTED = '15.4.0'; + private $all_posts; /** - * Holds the current version. + * Array of post types for which the current user has `edit_posts` capabilities, but not `edit_others_posts`. * - * @var string + * @var array */ - protected $current_version = ''; + private $own_posts; /** - * WPSEO_Gutenberg_Compatibility constructor. + * Saves all the metadata into this array. + * + * @var array */ - public function __construct() - { - } + protected $meta_data = []; /** - * Determines whether or not Gutenberg is installed. + * The current requested page_url. * - * @return bool Whether or not Gutenberg is installed. + * @var string */ - public function is_installed() - { - } + private $request_url = ''; /** - * Determines whether or not the currently installed version of Gutenberg is below the minimum supported version. + * The current page (depending on $_GET['paged']) if current tab is for current page_type, else it will be 1. * - * @return bool True if the currently installed version is below the minimum supported version. False otherwise. + * @var int */ - public function is_below_minimum() - { - } + private $current_page; /** - * Gets the currently installed version. + * The current post filter, if is used (depending on $_GET['post_type_filter']). * - * @return string The currently installed version. + * @var string */ - public function get_installed_version() - { - } + private $current_filter; /** - * Determines whether or not the currently installed version of Gutenberg is the latest, fully compatible version. + * The current post status, if is used (depending on $_GET['post_status']). * - * @return bool Whether or not the currently installed version is fully compatible. + * @var string */ - public function is_fully_compatible() - { - } + private $current_status; /** - * Gets the latest released version of Gutenberg. + * The current sorting, if used (depending on $_GET['order'] and $_GET['orderby']). * - * @return string The latest release. + * @var string */ - protected function get_latest_release() - { - } + private $current_order; /** - * Gets the minimum supported version of Gutenberg. + * The page_type for current class instance (for example: title / description). * - * @return string The minumum supported release. + * @var string */ - protected function get_minimum_supported_version() - { - } + protected $page_type; /** - * Detects the currently installed Gutenberg version. + * Based on the page_type ($this->page_type) there will be constructed an url part, for subpages and + * navigation. * - * @return string The currently installed Gutenberg version. Empty if the version couldn't be detected. + * @var string */ - protected function detect_installed_gutenberg_version() - { - } - } - /** - * Class WPSEO_Meta_Columns. - */ - class WPSEO_Meta_Columns - { + protected $page_url; /** - * Holds the context objects for each indexable. + * The settings which will be used in the __construct. * - * @var Meta_Tags_Context[] + * @var array */ - protected $context = []; + protected $settings; /** - * Holds the SEO analysis. + * Holds the pagination config. * - * @var WPSEO_Metabox_Analysis_SEO + * @var array */ - private $analysis_seo; + protected $pagination = []; /** - * Holds the readability analysis. + * Holds the sanitized data from the user input. * - * @var WPSEO_Metabox_Analysis_Readability + * @var array */ - private $analysis_readability; + protected $input_fields = []; /** - * Admin columns cache. + * The field in the database where meta field is saved. * - * @var Admin_Columns_Cache_Integration + * Should be set in the child class. + * + * @var string */ - private $admin_columns_cache; + protected $target_db_field = ''; /** - * Holds the Score_Icon_Helper. + * Class constructor. * - * @var Score_Icon_Helper + * @param array $args The arguments. */ - private $score_icon_helper; + public function __construct($args = []) + { + } /** - * When page analysis is enabled, just initialize the hooks. + * Prepares the data and renders the page. + * + * @return void */ - public function __construct() + public function show_page() { } /** - * Sets up up the hooks. + * Used in the constructor to build a reference list of post types the current user can edit. + * + * @return void */ - public function setup_hooks() + protected function populate_editable_post_types() { } /** - * Adds the column headings for the SEO plugin for edit posts / pages overview. + * Will show the navigation for the table like page navigation and page filter. * - * @param array $columns Already existing columns. + * @param string $which Table nav location (such as top). * - * @return array Array containing the column headings. + * @return void */ - public function column_heading($columns) + public function display_tablenav($which) { } /** - * Displays the column content for the given column. + * This function builds the base sql subquery used in this class. * - * @param string $column_name Column to display the content for. - * @param int $post_id Post to display the column content for. + * This function takes into account the post types in which the current user can + * edit all posts, and the ones the current user can only edit his/her own. + * + * @return string The subquery, which should always be used in $wpdb->prepare(), + * passing the current user_id in as the first parameter. */ - public function column_content($column_name, $post_id) + public function get_base_subquery() { } /** - * Indicates which of the SEO columns are sortable. - * - * @param array $columns Appended with their orderby variable. + * Gets the views. * - * @return array Array containing the sortable columns. + * @return array The views. */ - public function column_sort($columns) + public function get_views() { } /** - * Hides the SEO title, meta description and focus keyword columns if the user hasn't chosen which columns to hide. + * Outputs extra table navigation. * - * @param array $hidden The hidden columns. + * @param string $which Table nav location (such as top). * - * @return array Array containing the columns to hide. + * @return void */ - public function column_hidden($hidden) + public function extra_tablenav($which) { } /** - * Adds a dropdown that allows filtering on the posts SEO Quality. + * Gets a list of sortable columns. + * + * The format is: 'internal-name' => array( 'orderby', bool ). + * + * @return array */ - public function posts_filter_dropdown() + public function get_sortable_columns() { } /** - * Adds a dropdown that allows filtering on the posts Readability Quality. + * Sets the correct pagenumber and pageurl for the navigation. * * @return void */ - public function posts_filter_dropdown_readability() + public function prepare_page_navigation() { } /** - * Generates an