This commit is contained in:
KhaiNguyen
2020-02-13 10:39:37 +07:00
commit 59401cb805
12867 changed files with 4646216 additions and 0 deletions

View File

@@ -0,0 +1,170 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin
*/
/**
* Generates and displays the HTML for a metabox section.
*/
class WPSEO_Metabox_Tab_Section extends WPSEO_Abstract_Metabox_Tab_With_Sections {
/**
* An instance of the Metabox Tab class.
*
* @var WPSEO_Metabox_Tab[]
*/
public $tabs = [];
/**
* Constructor.
*
* @deprecated 12.3
* @codeCoverageIgnore
*
* @param string $name The name of the section, used as an identifier in the html.
* Can only contain URL safe characters.
* @param string $link_content The text content of the section link.
* @param array $tabs The metabox tabs (`WPSEO_Metabox_Tabs[]`) to be included in the section.
* @param array $options Optional link attributes.
*/
public function __construct( $name, $link_content, array $tabs = [], array $options = [] ) {
_deprecated_function( __METHOD__, 'WPSEO 12.3' );
parent::__construct( $name, $link_content, $options );
// Filter out invalid tab instances.
$valid_tabs = array_filter( $tabs, [ $this, 'is_valid_tab' ] );
foreach ( $valid_tabs as $tab ) {
$this->add_tab( $tab );
}
}
/**
* Determines whether the passed tab is considered valid.
*
* @deprecated 12.3
* @codeCoverageIgnore
*
* @param mixed $tab The potential tab that needs to be validated.
*
* @return bool Whether or not the tab is valid.
*/
protected function is_valid_tab( $tab ) {
_deprecated_function( __METHOD__, 'WPSEO 12.3' );
if ( $tab instanceof WPSEO_Metabox_Tab && ! $tab instanceof WPSEO_Metabox_Null_Tab ) {
return true;
}
return false;
}
/**
* Outputs the section content if any tab has been added.
*
* @deprecated 12.3
* @codeCoverageIgnore
*/
public function display_content() {
_deprecated_function( __METHOD__, 'WPSEO 12.3' );
if ( $this->has_sections() ) {
$html = '<div role="tabpanel" id="wpseo-meta-section-%1$s" aria-labelledby="wpseo-meta-tab-%1$s" tabindex="0" class="wpseo-meta-section">';
$html .= '<div class="wpseo-metabox-tabs-div">';
$html .= '<ul class="wpseo-metabox-tabs %2$s">%3$s</ul>%4$s';
$html .= '</div></div>';
printf(
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: This is deprecated.
$html,
esc_attr( $this->name ),
esc_attr( 'wpseo-metabox-tab-' . $this->name ),
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: This is deprecated.
$this->tab_links(),
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: This is deprecated.
$this->tab_content()
);
}
}
/**
* Add a `WPSEO_Metabox_Tab` object to the tabs.
*
* @deprecated 12.3
* @codeCoverageIgnore
*
* @param WPSEO_Metabox_Tab $tab Tab to add.
*/
public function add_tab( WPSEO_Metabox_Tab $tab ) {
_deprecated_function( __METHOD__, 'WPSEO 12.3' );
$this->tabs[] = $tab;
}
/**
* Checks if any tabs have been added to the section.
*
* @deprecated 12.3
* @codeCoverageIgnore
*
* @return bool
*/
protected function has_sections() {
_deprecated_function( __METHOD__, 'WPSEO 12.3' );
return ! empty( $this->tabs );
}
/**
* Concatenates all tabs' links into one html string.
*
* @deprecated 12.3
* @codeCoverageIgnore
*
* @return string
*/
private function tab_links() {
_deprecated_function( __METHOD__, 'WPSEO 12.3' );
$links = '';
foreach ( $this->tabs as $tab ) {
$links .= $tab->link();
}
return $links;
}
/**
* Concatenates all tabs' content into one html string.
*
* @deprecated 12.3
* @codeCoverageIgnore
*
* @return string
*/
private function tab_content() {
_deprecated_function( __METHOD__, 'WPSEO 12.3' );
$content = '';
foreach ( $this->tabs as $tab ) {
$content .= $tab->content();
}
return $content;
}
/**
* Gets the name of the tab section.
*
* @deprecated 12.3
* @codeCoverageIgnore
*
* @return string The name of the tab section.
*/
public function get_name() {
_deprecated_function( __METHOD__, 'WPSEO 12.3' );
return $this->name;
}
}

View File

@@ -0,0 +1,119 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\ConfigurationUI
*/
/**
* Class WPSEO_Config_Component_Connect_Google_Search_Console.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
class WPSEO_Config_Component_Connect_Google_Search_Console implements WPSEO_Config_Component {
/**
* Option identifier where the GSC token is stored.
*
* @var string
*/
const OPTION_ACCESS_TOKEN = 'wpseo-gsc-access_token';
/**
* Option identifier where the GSC refresh token is stored.
*
* @var string
*/
const OPTION_REFRESH_TOKEN = 'wpseo-gsc-refresh_token';
/**
* Service to use.
*
* @var WPSEO_GSC_Service
*/
protected $gsc_service;
/**
* WPSEO_Config_Component_Connect_Google_Search_Console constructor.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
public function __construct() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Set the Google Search Console service.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param mixed $service Set service to use.
*/
public function set_gsc_service( $service ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Gets the component identifier.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return string
*/
public function get_identifier() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return 'ConnectGoogleSearchConsole';
}
/**
* Gets the field.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return null
*/
public function get_field() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return null;
}
/**
* Get the data for the field.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return mixed
*/
public function get_data() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return [];
}
/**
* Save data.
*
* @param array $data Data containing changes.
*
* @return mixed
*/
public function set_data( $data ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return [];
}
}

View File

@@ -0,0 +1,44 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\ConfigurationUI
*/
/**
* Class WPSEO_Config_Field_Connect_Google_Search_Console.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
class WPSEO_Config_Field_Connect_Google_Search_Console extends WPSEO_Config_Field {
/**
* WPSEO_Config_Field_Connect_Google_Search_Console constructor.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
public function __construct() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
parent::__construct( 'connectGoogleSearchConsole', 'ConnectGoogleSearchConsole' );
}
/**
* Get the data.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return array
*/
public function get_data() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return [];
}
}

View File

@@ -0,0 +1,44 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\ConfigurationUI
*/
/**
* Class WPSEO_Config_Field_Google_Search_Console_Intro.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
class WPSEO_Config_Field_Google_Search_Console_Intro extends WPSEO_Config_Field {
/**
* WPSEO_Config_Field_Social_Profiles_Intro constructor.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
public function __construct() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
parent::__construct( 'googleSearchConsoleIntro', 'HTML' );
$html =
sprintf(
/* translators: %1$s is the plugin name. %2$s is a link start tag to a Yoast help page, %3$s is the link closing tag. */
esc_html__( '%1$s integrates with Google Search Console, a must-have tool for site owners. It provides you with information about the health of your site. Don\'t have a Google account or is your site not activated yet? Find out %2$show to connect Google Search Console to your site%3$s.', 'wordpress-seo' ),
'Yoast SEO',
'<a href="' . esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/1ex' ) ) . '" target="_blank">',
'</a>'
);
$disclaimer = __( 'Note: we don\'t store your data in any way and don\'t have full access to your account. Your privacy is safe with us.', 'wordpress-seo' );
$html = '<p>' . $html . '</p><small>' . esc_html( $disclaimer ) . '</small>';
$this->set_property( 'html', $html );
}
}

View File

@@ -0,0 +1,38 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\ConfigurationUI
*/
_deprecated_file( __FILE__, 'WPSEO 10.1' );
/**
* Class WPSEO_Config_Field_Profile_URL_GooglePlus.
*
* @deprecated 10.1
*/
class WPSEO_Config_Field_Profile_URL_GooglePlus extends WPSEO_Config_Field {
/**
* WPSEO_Config_Field_Profile_URL_GooglePlus constructor.
*
* @deprecated 10.1
*/
public function __construct() {
_deprecated_function( __METHOD__, '10.1' );
}
/**
* Sets adapter.
*
* @deprecated 10.1
*
* @param WPSEO_Configuration_Options_Adapter $adapter Adapter to register lookup on.
*
* @return void
*/
public function set_adapter( WPSEO_Configuration_Options_Adapter $adapter ) {
_deprecated_function( __METHOD__, '10.1' );
}
}

View File

@@ -0,0 +1,112 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Google_Search_Console
*/
/**
* Class WPSEO_GSC_Ajax.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
class WPSEO_GSC_Ajax {
/**
* Setting the AJAX hooks for GSC.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
public function __construct() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* This method will be access by an AJAX request and will mark an issue as fixed.
*
* First it will do a request to the Google API.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
public function ajax_mark_as_fixed() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Handle the AJAX request and dismiss the GSC notice.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
public function dismiss_notice() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Saves the authorization code.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
public function save_auth_code() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Clears all authorization data.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
public function clear_auth_code() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Check if posted nonce is valid and return true if it is.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return mixed
*/
private function valid_nonce() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Returns an instance of the Google Search Console service.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return WPSEO_GSC_Service
*/
private function get_service() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return null;
}
/**
* Prints a JSON encoded string with the current profile config.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
private function get_profiles() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
}

View File

@@ -0,0 +1,27 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Google_Search_Console
*/
/**
* Class WPSEO_GSC_Bulk_Action.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
class WPSEO_GSC_Bulk_Action {
/**
* Setting the listener on the bulk action post.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
public function __construct() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
}

View File

@@ -0,0 +1,66 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Google_Search_Console
*/
/**
* Class WPSEO_GSC_Category_Filters.
*
* This class will get all category counts from the options and will parse the filter links that are displayed above
* the crawl issue tables.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
class WPSEO_GSC_Category_Filters {
/**
* Constructing this object.
*
* Setting the hook to create the issues categories as the links.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param array $platform_counts Set of issue counts by platform.
*/
public function __construct( array $platform_counts ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Returns the value of the current category.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return mixed|string
*/
public function get_category() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return '';
}
/**
* Returns the current filters as an array.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* Only return categories with more than 0 issues.
*
* @return array
*/
public function as_array() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return [];
}
}

View File

@@ -0,0 +1,33 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin
*/
/**
* Class WPSEO_GSC_Config.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
class WPSEO_GSC_Config {
/**
* The Google search console configuration.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @var array
*/
public static $gsc = [
'application_name' => '',
'client_id' => '',
'client_secret' => '',
'redirect_uri' => '',
'scopes' => [],
];
}

View File

@@ -0,0 +1,133 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Google_Search_Console
*/
/**
* Class WPSEO_GSC_Count.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
class WPSEO_GSC_Count {
/**
* The name of the option containing the last checked timestamp.
*
* @var string
*/
const OPTION_CI_LAST_FETCH = 'wpseo_gsc_last_fetch';
/**
* The option name where the issues counts are saved.
*
* @var string
*/
const OPTION_CI_COUNTS = 'wpseo_gsc_issues_counts';
/**
* Fetching the counts
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param WPSEO_GSC_Service $service Service class instance.
*/
public function __construct( WPSEO_GSC_Service $service ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Getting the counts for given platform and return them as an array.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $platform Platform (desktop, mobile, feature phone).
*
* @return array
*/
public function get_platform_counts( $platform ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return [];
}
/**
* Return the fetched issues.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return array
*/
public function get_issues() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return $this->issues;
}
/**
* Listing the issues an gives them back as fetched issues.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $platform Platform (desktop, mobile, feature phone).
* @param string $category Issue category.
*/
public function list_issues( $platform, $category ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Getting the counts for given platform and category.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $platform Platform (desktop, mobile, feature phone).
* @param string $category Issue type.
*
* @return integer
*/
public function get_issue_count( $platform, $category ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return 0;
}
/**
* Update the count of the issues.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $platform Platform (desktop, mobile, feature phone).
* @param string $category Issue type.
* @param integer $new_count Updated count.
*/
public function update_issue_count( $platform, $category, $new_count ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Fetching the counts from the GSC API.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
public function fetch_counts() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
}

View File

@@ -0,0 +1,47 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Google_Search_Console
*/
/**
* Class WPSEO_GSC_Issue.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
class WPSEO_GSC_Issue {
/**
* Search Console issue class constructor.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $url URL of the issue.
* @param DateTime $first_detected Time of first discovery.
* @param DateTime $last_crawled Time of last crawl.
* @param string $response_code HTTP response code.
*/
public function __construct( $url, DateTime $first_detected, DateTime $last_crawled, $response_code ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Put the class properties in array.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return array
*/
public function to_array() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return [];
}
}

View File

@@ -0,0 +1,63 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Google_Search_Console
*/
/**
* Class WPSEO_GSC_Issues.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
class WPSEO_GSC_Issues {
/**
* Setting up the properties and fetching the current issues.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $platform Platform type (desktop, mobile, feature phone).
* @param string $category Issues category.
* @param array|bool $fetched_issues Optional set of issues.
*/
public function __construct( $platform, $category, $fetched_issues = false ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Getting the issues from the options.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return array
*/
public function get_issues() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return [];
}
/**
* Deleting the issue from the issues.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $url URL to delete issues for.
*
* @return bool
*/
public function delete_issue( $url ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return false;
}
}

View File

@@ -0,0 +1,97 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Google_Search_Console
*/
/**
* Class WPSEO_GSC_Mapper.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
class WPSEO_GSC_Mapper {
/**
* If there is no platform, just get the first key out of the array and redirect to it.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $platform Platform (desktop, mobile, feature phone).
*
* @return mixed
*/
public static function get_current_platform( $platform ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Mapping the platform.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $platform Platform (desktop, mobile, feature phone).
*
* @return mixed
*/
public static function platform_to_api( $platform ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Mapping the given platform by value and return its key.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $platform Platform (desktop, mobile, feature phone).
*
* @return string
*/
public static function platform_from_api( $platform ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return $platform;
}
/**
* Mapping the given category by searching for its key.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $category Issue type.
*
* @return mixed
*/
public static function category_to_api( $category ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return $category;
}
/**
* Mapping the given category by value and return its key.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $category Issue type.
*
* @return string
*/
public static function category_from_api( $category ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return $category;
}
}

View File

@@ -0,0 +1,46 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Google_Search_Console
*/
/**
* Class WPSEO_GSC_Marker.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
class WPSEO_GSC_Marker {
/**
* Setting up the needed API libs and return the result.
*
* If param URL is given, the request is performed by a bulk action.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $url Optional URL.
*/
public function __construct( $url = '' ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Getting the response for the AJAX request.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return string
*/
public function get_response() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return '';
}
}

View File

@@ -0,0 +1,58 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Google_Search_Console
*/
/**
* Represents the Google Search Console modal.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
class WPSEO_GSC_Modal {
/**
* Sets the required attributes for this object.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $view The file with the view content.
* @param int $height The height that the modal will get.
* @param array $view_vars The attributes to use in the view.
*/
public function __construct( $view, $height, array $view_vars = [] ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Returns the height of the modal.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return int The set height.
*/
public function get_height() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return 0;
}
/**
* Loads the view of the modal.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $unique_id An unique identifier for the modal.
*/
public function load_view( $unique_id ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
}

View File

@@ -0,0 +1,46 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Google_Search_Console
*/
/**
* Class WPSEO_GSC_Platform_Tabs.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
class WPSEO_GSC_Platform_Tabs {
/**
* Return the tabs as a string.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return string
*/
public function __toString() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return '';
}
/**
* Getting the current_tab.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return string
*/
public function current_tab() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return '';
}
}

View File

@@ -0,0 +1,122 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Google_Search_Console
*/
/**
* Class WPSEO_GSC_Service.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
class WPSEO_GSC_Service {
/**
* Search Console service constructor.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $profile Profile name.
*/
public function __construct( $profile = '' ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Returns the client.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return Yoast_Api_Google_Client
*/
public function get_client() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return null;
}
/**
* Removes the option and calls the clients clear_data method to clear that one as well.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
public function clear_data() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Get all sites that are registered in the GSC panel.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return array
*/
public function get_sites() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return [];
}
/**
* Get crawl issues.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return array
*/
public function get_crawl_issue_counts() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return [];
}
/**
* Sending request to mark issue as fixed.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $url Issue URL.
* @param string $platform Platform (desktop, mobile, feature phone).
* @param string $category Issue type.
*
* @return bool
*/
public function mark_as_fixed( $url, $platform, $category ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return false;
}
/**
* Fetching the issues from the GSC API.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $platform Platform (desktop, mobile, feature phone).
* @param string $category Issue type.
*
* @return mixed
*/
public function fetch_category_issues( $platform, $category ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return [];
}
}

View File

@@ -0,0 +1,78 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Google_Search_Console
*/
/**
* Class WPSEO_GSC_Settings.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
class WPSEO_GSC_Settings {
/**
* Clear all data from the database.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param WPSEO_GSC_Service $service Service class instance.
*/
public static function clear_data( WPSEO_GSC_Service $service ) {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Reloading all the issues.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
public static function reload_issues() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* When authorization is successful return true, otherwise false.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return bool
*/
public static function validate_authorization() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return null;
}
/**
* Get the GSC profile.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return string
*/
public static function get_profile() {
// Get option.
$option = get_option( 'wpseo-gsc', [ 'profile' => '' ] );
// Set the profile.
$profile = '';
if ( ! empty( $option['profile'] ) ) {
$profile = $option['profile'];
}
// Return the profile.
return trim( $profile, '/' );
}
}

View File

@@ -0,0 +1,85 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Google_Search_Console
*/
if ( ! class_exists( 'WP_List_Table' ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
}
/**
* Class WPSEO_GSC_Table.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
class WPSEO_GSC_Table extends WP_List_Table {
/**
* Modal height.
*
* @var int
*/
const FREE_MODAL_HEIGHT = 140;
/**
* Search Console table class constructor (subclasses list table).
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @param string $platform Platform (desktop, mobile, feature phone).
* @param string $category Type of the issues.
* @param array $items Set of the issues to display.
*/
public function __construct( $platform, $category, array $items ) {
parent::__construct();
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Getting the screen id from this table.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return string
*/
public function get_screen_id() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return $this->screen->id;
}
/**
* Setup the table variables, fetch the items from the database, search, sort and format the items.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*/
public function prepare_items() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
}
/**
* Set the table columns.
*
* @deprecated 12.5
*
* @codeCoverageIgnore
*
* @return array
*/
public function get_columns() {
_deprecated_function( __METHOD__, 'WPSEO 12.5' );
return [];
}
}

View File

@@ -0,0 +1,61 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin
*/
/**
* Represents the yoast cornerstone content.
*
* @deprecated 8.4
*/
class WPSEO_Cornerstone {
/**
* Holds the cornerstone meta name.
*
* @var string
*/
const META_NAME = 'is_cornerstone';
/**
* Holds the cornerstone field name.
*
* @var string
*/
const FIELD_NAME = 'yoast_wpseo_is_cornerstone';
/**
* WPSEO_Cornerstone constructor.
*
* @deprecated 8.4
*/
public function __construct() {
_deprecated_function( __METHOD__, '8.4' );
}
/**
* Registers the hooks.
*
* @deprecated 8.4
*
* @return void
*/
public function register_hooks() {
_deprecated_function( 'WPSEO_Cornerstone::register_hooks', '8.4' );
}
/**
* Saves the meta value to the database.
*
* @deprecated 8.4
*
* @param int $post_id The post id to save the meta value for.
*
* @return void
*/
public function save_meta_value( $post_id ) {
_deprecated_function( 'WPSEO_Cornerstone::save_meta_value', '8.4' );
}
}

View File

@@ -0,0 +1,69 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin
*/
/**
* Generates and displays a section containing metabox tabs that have been added by other plugins through the
* `wpseo_tab_header` and `wpseo_tab_content` actions.
*
* @deprecated 11.9
*/
class WPSEO_Metabox_Addon_Tab_Section extends WPSEO_Metabox_Tab_Section {
/**
* WPSEO_Metabox_Addon_Tab_Section constructor.
*
* @deprecated 11.9
*
* @param string $name The name of the section, used as an identifier in the html.
* Can only contain URL safe characters.
* @param string $link_content The text content of the section link.
* @param array $tabs The metabox tabs (`WPSEO_Metabox_Tabs[]`) to be included in the section.
* @param array $options Optional link attributes.
*/
public function __construct( $name, $link_content, array $tabs = [], array $options = [] ) {
_deprecated_function( __METHOD__, '11.9' );
parent::__construct( $name, $link_content, $tabs, $options );
}
/**
* Applies the actions for adding a tab to the metabox.
*
* @deprecated 11.9
*/
public function display_content() {
_deprecated_function( __METHOD__, '11.9' );
?>
<div role="tabpanel" id="wpseo-meta-section-addons" aria-labelledby="wpseo-meta-tab-addons" tabindex="0" class="wpseo-meta-section">
<div class="wpseo-metabox-tabs-div">
<ul class="wpseo-metabox-tabs">
<?php
// @deprecated 11.9 This functionality has been replaced by the filter: `yoast_free_additional_metabox_sections`.
do_action_deprecated( 'wpseo_tab_header', [], '11.9' );
?>
</ul>
<?php
// @deprecated 11.9 This functionality has been replaced by the filter: `yoast_free_additional_metabox_sections`.
do_action_deprecated( 'wpseo_tab_content', [], '11.9' );
?>
</div>
</div>
<?php
}
/**
* `WPSEO_Metabox_Addon_Section` always has "sections", represented by registered actions. If this is not the case,
* it should not be instantiated.
*
* @deprecated 11.9
*
* @return bool
*/
protected function has_sections() {
_deprecated_function( __METHOD__, '11.9' );
return true;
}
}

View File

@@ -0,0 +1,52 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Notifiers
*/
_deprecated_file( __FILE__, 'WPSEO 9.6' );
/**
* Represents the logic for showing recalibration beta notice.
*
* @codeCoverageIgnore Ignore, because this class has been deprecated.
*
* @deprecated 9.6
*/
class WPSEO_Recalibration_Beta_Notification implements WPSEO_WordPress_Integration {
/**
* The name of the notifiers.
*
* @var string
*/
protected $notification_identifier = 'recalibration-meta-notification';
/**
* Class constructor.
*
* @deprecated 9.6
*/
public function __construct() {
_deprecated_function( __METHOD__, '9.6' );
}
/**
* Registers all hooks to WordPress.
*
* @return void
*/
public function register_hooks() {
// Do nothing.
}
/**
* Shows the notification when applicable.
*
* @return void
*/
public function handle_notice() {
// Do nothing.
}
}

View File

@@ -0,0 +1,248 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin
* @since 9.3.0
*/
// Mark this file as deprecated.
_deprecated_file( __FILE__, 'WPSEO 10.0' );
/**
* Holds the logic for the recalibration beta.
*
* @codeCoverageIgnore Ignore, because this class has been deprecated.
*
* @deprecated 10.0
*/
class WPSEO_Recalibration_Beta implements WPSEO_WordPress_Integration {
/**
* Name of the options.
*
* @var string
*/
protected $option_name = 'recalibration_beta';
/**
* The read more URL.
*
* @var string
*/
protected $read_more_url = 'https://yoa.st/recalibration-beta-explanation';
/**
* The class constructor.
*
* @deprecated 10.0
*
* @codeCoverageIgnore
*/
public function __construct() {
_deprecated_function( __METHOD__, '10.0' );
}
/**
* Shows the feature toggle.
*
* @codeCoverageIgnore Reason: most output is html.
*
* @return void
*/
public function show_feature_toggle() {
// If the recalibration beta has been disabled you will no longer be able to enable it.
// See https://github.com/Yoast/wordpress-seo/issues/12183.
if ( ! self::is_enabled() ) {
return;
}
$values = [
'on' => __( 'On', 'wordpress-seo' ),
'off' => __( 'Off', 'wordpress-seo' ),
];
echo '<div class="switch-container">';
echo '<fieldset id="', esc_attr( $this->option_name ), '" class="fieldset-switch-toggle">';
echo '<legend><strong>', esc_html__( 'Get an even better analysis', 'wordpress-seo' ), '</strong></legend>';
echo '<p class="clear">';
printf(
/* translators: 1: link opening tag, 2: link closing tag, 3: strong opening tag, 4: strong closing tag */
esc_html__(
'We have %1$srecalibrated our analysis%2$s. With the new analysis, we will get even closer to how Google sees your website. It would be %3$sawesome%4$s if you would like to %3$sbeta test this feature%4$s for us!',
'wordpress-seo'
),
'<a href="' . esc_url( WPSEO_Shortlinker::get( $this->read_more_url ) ) . '" target="_blank">',
'</a>',
'<strong>',
'</strong>'
);
echo '</p>';
echo '<div class="switch-toggle switch-candy switch-yoast-seo">';
foreach ( $values as $key => $value ) {
printf(
'<input type="radio" id="%1$s" name="%2$s" value="%3$s" %4$s /><label for="%1$s">%5$s</label>',
esc_attr( $this->option_name . '-' . $key ),
'wpseo[' . esc_attr( $this->option_name ) . ']',
esc_attr( $key ),
checked( $this->get_option_value( self::is_enabled() ), esc_attr( $key ), false ),
esc_html( $value )
);
}
echo '<a></a></div>';
echo '<p class="clear"><br/>';
esc_html_e(
'Simply switch the toggle to "on" and you\'ll be able to use the recalibrated analysis. At the same time, we\'ll add you to our specific mailing list. We\'ll only email you about your experiences with this recalibration!',
'wordpress-seo'
);
echo '</p>';
echo '</fieldset><div class="clear"></div></div>' . PHP_EOL . PHP_EOL;
}
/**
* Registers the hook to catch option change.
*
* @codeCoverageIgnore Reason: because it calls a WordPress function.
*
* @return void
*/
public function register_hooks() {
add_action( 'update_option_wpseo', [ $this, 'update_option' ], 10, 2 );
}
/**
* Compares the logic between old and new option value and send the request.
*
* @param mixed $old_value The old option value.
* @param mixed $new_value The new option value.
*
* @return void
*/
public function update_option( $old_value, $new_value ) {
$old_option_value = false;
if ( isset( $old_value[ $this->option_name ] ) ) {
$old_option_value = $old_value[ $this->option_name ];
}
$new_option_value = false;
if ( isset( $new_value[ $this->option_name ] ) ) {
$new_option_value = $new_value[ $this->option_name ];
}
if ( $old_option_value === $new_option_value ) {
return;
}
if ( $new_option_value === true ) {
$this->subscribe_newsletter();
}
}
/**
* Checks if the recalibration beta has been enabled.
*
* @codeCoverageIgnore Reason: It calls a dependency.
*
* @return bool True whether the beta has been enabled.
*/
public static function is_enabled() {
return WPSEO_Options::get( 'recalibration_beta' );
}
/**
* Checks if the user has a mailinglist subscription.
*
* @codeCoverageIgnore Reason: because it calls a WordPress function.
*
* The mailinglist subscription value will set to true when the beta is set
* to enabled. This value stays true, so it's a good indicator that the user
* tried the beta.
*
* @return bool True whether the user has a subscription.
*/
public function has_mailinglist_subscription() {
return (bool) get_option( 'wpseo_recalibration_beta_mailinglist_subscription', false );
}
/**
* Retrieves the option value based on the current setting.
*
* @param bool $is_enabled Is the option enabled.
*
* @return string On when is enabled, off when not.
*/
protected function get_option_value( $is_enabled ) {
if ( $is_enabled === true ) {
return 'on';
}
return 'off';
}
/**
* Subscribes to the newsletter.
*
* @return void
*/
protected function subscribe_newsletter() {
if ( $this->has_mailinglist_subscription() ) {
return;
}
try {
$this->do_request(
'https://my.yoast.com/api/customers/newsletter/recalibration/subscribe',
[
'email' => get_option( 'admin_email' ),
'firstName' => get_option( 'blogname' ),
'lastName' => '',
]
);
$this->set_mailinglist_subscription();
}
catch ( Requests_Exception_HTTP $e ) {
// Intentionally left blank. @todo We should offer this to a logger.
return;
}
}
/**
* Performs a request to the given url.
*
* @codeCoverageIgnore Reason: because it contains WordPress functions.
*
* @param string $url The request url.
* @param array $body The request body.
*
* @return void
*
* @throws Requests_Exception_HTTP When request has failed.
*/
protected function do_request( $url, $body ) {
$response = wp_remote_post(
$url,
[
'body' => $body,
]
);
if ( is_wp_error( $response ) ) {
throw new Requests_Exception_HTTP( $response->get_error_message() );
}
}
/**
* Sets the mailing list subscription value to true.
*
* @codeCoverageIgnore Reason: because it calls a WordPress function.
*
* @return void
*/
protected function set_mailinglist_subscription() {
update_option( 'wpseo_recalibration_beta_mailinglist_subscription', true );
}
}

View File

@@ -0,0 +1,39 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Menu
*/
// Mark this file as deprecated.
_deprecated_file( __FILE__, 'WPSEO 7.0' );
/**
* Hides submenu items if the advanced settings are not enabled.
*
* @deprecated 7.0
*/
class WPSEO_Submenu_Hider {
/**
* Registers all hooks to WordPress.
*
* @deprecated 7.0
*
* @return void
*/
public function register_hooks() {
_deprecated_function( __METHOD__, 'WPSEO 7.0' );
}
/**
* Filters all advanced settings pages from the given pages.
*
* @deprecated 7.0
*
* @return void
*/
public function filter_settings_pages() {
_deprecated_function( __METHOD__, 'WPSEO 7.0' );
}
}

View File

@@ -0,0 +1,49 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO
* @subpackage Internal
*/
// Mark this file as deprecated.
_deprecated_file( __FILE__, 'WPSEO 7.0' );
/**
* Class containing methods for WPSEO Advanced Settings.
*/
class WPSEO_Advanced_Settings {
/**
* Gets the list of default advanced pages.
*
* @deprecated 7.0
*
* @return void
*/
public static function get_advanced_pages() {
_deprecated_function( __METHOD__, 'WPSEO 7.0' );
}
/**
* Adds a page as an advanced settings page if it isn't already present or a default page.
*
* @deprecated 7.0
*
* @return void
*/
public static function add_advanced_page() {
_deprecated_function( __METHOD__, 'WPSEO 7.0' );
}
/**
* Checks if the current page is a Yoast SEO advanced settings page.
*
* @deprecated 7.0
*
* @return void
*/
public static function is_advanced_settings_page() {
_deprecated_function( __METHOD__, 'WPSEO 7.0' );
}
}

View File

@@ -0,0 +1,119 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Internals\Options
*/
// Mark this file as deprecated.
_deprecated_file( __FILE__, 'WPSEO 7.0' );
/**
* Option: wpseo_internallinks.
*
* @deprecated 7.0
*/
class WPSEO_Option_InternalLinks {
/**
* Option name.
*
* @var string
* @deprecated 7.0
*/
public $option_name = '';
/**
* Catch all other calls to this deprecated class.
*
* @param string $method The method to 'call'.
* @param array $args Possibly given arguments.
*/
public function __call( $method, array $args = [] ) {
_deprecated_function( $method, 'WPSEO 7.0' );
}
/**
* Get the singleton instance of this class.
*
* @deprecated 7.0
*
* @return void
*/
public static function get_instance() {
_deprecated_function( __METHOD__, 'WPSEO 7.0' );
}
/**
* Translate strings used in the option defaults.
*
* @deprecated 7.0
*
* @return void
*/
public function translate_defaults() {
_deprecated_function( __METHOD__, 'WPSEO 7.0' );
}
/**
* Add dynamically created default options based on available post types and taxonomies.
*
* @deprecated 7.0
*
* @return void
*/
public function enrich_defaults() {
_deprecated_function( __METHOD__, 'WPSEO 7.0' );
}
/**
* With the changes to v1.5, the defaults for some of the textual breadcrumb settings are added
* dynamically, but empty strings are allowed.
* This caused issues for people who left the fields empty on purpose relying on the defaults.
* This little routine fixes that.
* Needs to be run on 'init' hook at prio 3 to make sure the defaults are translated.
*
* @deprecated 7.0
*
* @return void
*/
public function bring_back_defaults() {
_deprecated_function( __METHOD__, 'WPSEO 7.0' );
}
/**
* Validate the option.
*
* @deprecated 7.0
*
* @return void
*/
protected function validate_option() {
_deprecated_function( __METHOD__, 'WPSEO 7.0' );
}
/**
* Retrieve a list of the allowed post types as breadcrumb parent for a taxonomy.
* Helper method for validation.
*
* {@internal Don't make static as new types may still be registered.}}
*
* @deprecated 7.0
*
* @return void
*/
protected function get_allowed_post_types() {
_deprecated_function( __METHOD__, 'WPSEO 7.0' );
}
/**
* Clean a given option value.
*
* @deprecated 7.0
*
* @return void
*/
protected function clean_option() {
_deprecated_function( __METHOD__, 'WPSEO 7.0' );
}
}

View File

@@ -0,0 +1,67 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Internals\Options
*/
// Mark this file as deprecated.
_deprecated_file( __FILE__, 'WPSEO 7.0' );
/**
* Option: wpseo_permalinks.
*
* @deprecated 7.0
*/
class WPSEO_Option_Permalinks {
/**
* Option name.
*
* @var string
*/
public $option_name = '';
/**
* Catch all other calls to this deprecated class.
*
* @param string $method The method to 'call'.
* @param array $args Possibly given arguments.
*/
public function __call( $method, array $args = [] ) {
_deprecated_function( $method, 'WPSEO 7.0' );
}
/**
* Add the actions and filters for the option.
*
* @deprecated 7.0
*
* @return void
*/
protected function __construct() {
_deprecated_function( __METHOD__, '7.0' );
}
/**
* Get the singleton instance of this class.
*
* @deprecated 7.0
*
* @return void
*/
public static function get_instance() {
_deprecated_function( __METHOD__, 'WPSEO 7.0' );
}
/**
* Validate the option.
*
* @deprecated 7.0
*
* @return void
*/
protected function validate_option() {
_deprecated_function( __METHOD__, 'WPSEO 7.0' );
}
}

View File

@@ -0,0 +1,235 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin
*/
/**
* Generate the HTML for a form fieldset to wrap grouped form elements.
*/
class Yoast_Form_Fieldset implements Yoast_Form_Element {
/**
* The fieldset ID.
*
* @var string
*/
private $id;
/**
* The fieldset HTML default attributes.
*
* @var array
*/
private $attributes = [
'class' => 'yoast-form-fieldset',
];
/**
* The grouped form elements for the fieldset.
*
* @var string
*/
private $content;
/**
* The fieldset legend HTML default attributes.
*
* @var array
*/
private $legend_attributes = [
'class' => 'yoast-form-legend',
];
/**
* A translatable string for the fieldset legend content.
*
* @var string
*/
private $legend_content;
/**
* Constructor.
*
* @deprecated 11.9
* @codeCoverageIgnore
*
* @param string $id ID for the fieldset.
* @param string $legend_content The translatable legend text.
* @param string $content The grouped form elements for the fieldset.
*/
public function __construct( $id, $legend_content, $content ) {
_deprecated_function( __METHOD__, '11.9' );
$this->id = $id;
$this->legend_content = $legend_content;
$this->content = $content;
}
/**
* Render the view.
*
* @deprecated 11.9
* @codeCoverageIgnore
*/
public function render_view() {
_deprecated_function( __METHOD__, '11.9' );
/*
* Extract because we want values accessible via variables for later use
* in the view instead of accessing them as an array.
*/
extract( $this->get_parts() );
require WPSEO_PATH . 'admin/views/form/fieldset.php';
}
/**
* Start output buffering to catch the form elements to wrap in the fieldset.
*
* @deprecated 11.9
* @codeCoverageIgnore
*/
public function start() {
_deprecated_function( __METHOD__, '11.9' );
ob_start();
}
/**
* Return output buffering with the form elements to wrap in the fieldset.
*
* @deprecated 11.9
* @codeCoverageIgnore
*/
public function end() {
_deprecated_function( __METHOD__, '11.9' );
$this->content = ob_get_clean();
}
/**
* Return the rendered view.
*
* @deprecated 11.9
* @codeCoverageIgnore
*
* @return string
*/
public function get_html() {
_deprecated_function( __METHOD__, '11.9' );
ob_start();
$this->render_view();
return ob_get_clean();
}
/**
* Output the rendered view.
*
* @deprecated 11.9
* @codeCoverageIgnore
*/
public function html() {
_deprecated_function( __METHOD__, '11.9' );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: This is deprecated.
echo $this->get_html();
}
/**
* Add attributes to the fieldset default attributes.
*
* @deprecated 11.9
* @codeCoverageIgnore
*
* @param array $attributes Array of attributes names and values to merge with the defaults.
*/
public function add_attributes( $attributes ) {
_deprecated_function( __METHOD__, '11.9' );
$this->attributes = wp_parse_args( $attributes, $this->attributes );
}
/**
* Add attributes to the fieldset legend default attributes.
*
* @deprecated 11.9
* @codeCoverageIgnore
*
* @param array $attributes Array of attributes names and values to merge with the defaults.
*/
public function legend_add_attributes( $attributes ) {
_deprecated_function( __METHOD__, '11.9' );
$this->legend_attributes = wp_parse_args( $attributes, $this->legend_attributes );
}
/**
* Visually hide the fieldset legend but keep it available to assistive technologies.
*
* @deprecated 11.9
* @codeCoverageIgnore
*/
public function legend_hide() {
_deprecated_function( __METHOD__, '11.9' );
$this->legend_attributes = wp_parse_args(
[ 'class' => 'screen-reader-text' ],
$this->legend_attributes
);
}
/**
* Return the set of attributes and content for the fieldset.
*
* @deprecated 11.9
* @codeCoverageIgnore
*
* @return array
*/
private function get_parts() {
return [
'id' => $this->id,
'attributes' => $this->get_attributes_html( $this->attributes ),
'legend_content' => $this->legend_content,
'legend_attributes' => $this->get_attributes_html( $this->legend_attributes ),
'content' => $this->content,
];
}
/**
* Return HTML formatted attributes as a string, when there are attributes set.
*
* @deprecated 11.9
* @codeCoverageIgnore
*
* @param array $attributes Fieldset or legend attributes.
*
* @return string A space separated list of HTML formatted attributes or empty string.
*/
private function get_attributes_html( $attributes ) {
if ( ! empty( $attributes ) ) {
array_walk( $attributes, [ $this, 'parse_attribute' ] );
// Use an initial space as `implode()` adds a space only between array elements.
return ' ' . implode( ' ', $attributes );
}
return '';
}
/**
* Escape and format an attribute as an HTML attribute.
*
* @deprecated 11.9
* @codeCoverageIgnore
*
* @param string $value The value of the attribute.
* @param string $attribute The attribute to look for.
*/
private function parse_attribute( &$value, $attribute ) {
$value = sprintf( '%s="%s"', sanitize_key( $attribute ), esc_attr( $value ) );
}
}

View File

@@ -0,0 +1,81 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin
*/
// Mark this file as deprecated.
_deprecated_file( __FILE__, 'WPSEO 9.2' );
/**
* Class to implement a React modal.
*
* @deprecated 9.2
*/
class Yoast_Modal {
/**
* Class constructor.
*
* @deprecated 9.2
*/
public function __construct() {
_deprecated_function( __METHOD__, '9.2' );
}
/**
* Enqueues the assets needed for the modal.
*
* @deprecated 9.2
*
* @return void
*/
public function enqueue_assets() {
_deprecated_function( 'Yoast_Modal::enqueue_assets', '9.2' );
}
/**
* Prints the modals configuration.
*
* @return void
*/
public function print_localized_config() {
_deprecated_function( 'Yoast_Modal::print_localized_config', '9.2' );
}
/**
* Adds a single modal configuration to the modals configuration.
*
* @deprecated 9.2
*
* @param array $args The modal configuration arguments.
*
* @return void
*/
public static function add( $args ) {
_deprecated_function( 'Yoast_Modal::add', '9.2' );
}
/**
* Gets the modals configuration.
*
* @deprecated 9.2
*
* @return void
*/
public function get_config() {
_deprecated_function( 'Yoast_Modal::get_config', '9.2' );
}
/**
* Gets the default configuration for a modal.
*
* @deprecated 9.2
*
* @return void
*/
public static function get_defaults() {
_deprecated_function( 'Yoast_Modal::get_defaults', '9.2' );
}
}

View File

@@ -0,0 +1,52 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\XML_Sitemaps
*/
/**
* Class WPSEO_Sitemap_Timezone.
*
* @deprecated 12.8
*/
class WPSEO_Sitemap_Timezone {
/**
* Format arbitrary UTC datetime string to desired form in site's time zone.
*
* @deprecated 12.8
*
* @codeCoverageIgnore
*
* @param string $datetime_string The input datetime string in UTC time zone.
* @param string $format Date format to use.
*
* @return string
*/
public function format_date( $datetime_string, $format = 'c' ) {
_deprecated_function( __METHOD__, 'WPSEO 12.8', 'Date_Helper::format' );
$date_helper = new WPSEO_Date_Helper();
return $date_helper->format( $format );
}
/**
* Get the datetime object, in site's time zone, if the datetime string was valid
*
* @deprecated 12.8
*
* @codeCoverageIgnore
*
* @param string $datetime_string The datetime string in UTC time zone, that needs
* to be converted to a DateTime object.
*
* @return DateTime|null DateTime object in site's time zone.
*/
public function get_datetime_with_timezone( $datetime_string ) {
_deprecated_function( __METHOD__, 'WPSEO 12.8' );
return null;
}
}

View File

@@ -0,0 +1,4 @@
<?php
/**
* Nothing to see here.
*/