khaihihi
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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 [];
|
||||
}
|
||||
}
|
||||
@@ -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 [];
|
||||
}
|
||||
}
|
||||
@@ -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 );
|
||||
}
|
||||
}
|
||||
@@ -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' );
|
||||
}
|
||||
}
|
||||
@@ -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' );
|
||||
}
|
||||
}
|
||||
@@ -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' );
|
||||
}
|
||||
}
|
||||
@@ -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 [];
|
||||
}
|
||||
}
|
||||
@@ -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' => [],
|
||||
];
|
||||
}
|
||||
@@ -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' );
|
||||
}
|
||||
}
|
||||
@@ -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 [];
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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 '';
|
||||
}
|
||||
}
|
||||
@@ -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' );
|
||||
}
|
||||
}
|
||||
@@ -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 '';
|
||||
}
|
||||
}
|
||||
@@ -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 [];
|
||||
}
|
||||
}
|
||||
@@ -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, '/' );
|
||||
}
|
||||
}
|
||||
@@ -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 [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user