Commit 4ba3f759 authored by Simonas's avatar Simonas

Merge branch 'recommend-component' into dev

parents 158469f1 d5898956
......@@ -158,59 +158,59 @@ services:
- ./wordpress:/var/www/html
- './wp-init.sh:/usr/local/bin/wp-init.sh'
# command:
# - wp-init.sh
command: >
/bin/sh -c '
sleep 120;
echo "WP CLI init";
wp core update --force;
wp core update-db --network;
# wp option update permalink_structure "/%postname%/" --skip-themes --skip-plugins;
# wp option update timezone_string "Manual Offsets/UTC+2";
# wp option update date_format "Y-m-d";
# wp option update time_format "H:i";
wp plugin install loco-translate --version=2.3.0 --activate-network;
# wp plugin update loco-translate --version=2.3.0;
wp plugin install pods --version=2.7.15 --activate-network;
# wp plugin update pods --version=2.7.15;
wp plugin install polylang --version=2.6.4 --activate-network;
# wp plugin update polylang --version=2.6.4;
wp plugin install wordpress-seo --version=12.1 --activate-network;
# wp plugin update wordpress-seo --version=12.1;
wp plugin update akismet --version=4.1.2;
wp plugin uninstall hello;
# wp plugin activate akismet --network;
# wp plugin activate biuro-contacts --network;
# wp plugin activate biuro-feedbacks --network;
# wp plugin activate biuro-html --network;
# wp plugin activate biuro-sections --network;
# wp plugin activate biuro-services --network;
# wp plugin activate biuro-values --network;
# wp plugin activate cookies-warning --network;
# wp plugin activate data-controller --network;
# wp plugin activate jobs-importer --network;
# wp theme update --all;
# wp theme activate biuro;
wp theme delete twentynineteen
wp theme delete twentyseventeen
wp theme delete twentysixteen
wp language core update;
wp language theme update --all;
wp language plugin update --all;
echo "WP CLI done. Ready to use.";
'
command:
- wp-init.sh
# command: >
# /bin/sh -c '
# sleep 120;
# echo "WP CLI init";
# wp core update --force;
# wp core update-db --network;
# # wp option update permalink_structure "/%postname%/" --skip-themes --skip-plugins;
# # wp option update timezone_string "Manual Offsets/UTC+2";
# # wp option update date_format "Y-m-d";
# # wp option update time_format "H:i";
# wp plugin install loco-translate --version=2.3.0 --activate-network;
# wp plugin update loco-translate --version=2.3.0;
# wp plugin install pods --version=2.7.15 --activate-network;
# wp plugin update pods --version=2.7.15;
# wp plugin install polylang --version=2.6.4 --activate-network;
# wp plugin update polylang --version=2.6.4;
# wp plugin install wordpress-seo --version=12.2 --activate-network;
# wp plugin update wordpress-seo --version=12.2;
# wp plugin update akismet --version=4.1.2;
# wp plugin uninstall hello;
# # wp plugin activate akismet --network;
# # wp plugin activate biuro-contacts --network;
# # wp plugin activate biuro-feedbacks --network;
# # wp plugin activate biuro-html --network;
# # wp plugin activate biuro-sections --network;
# # wp plugin activate biuro-services --network;
# # wp plugin activate biuro-values --network;
# # wp plugin activate cookies-warning --network;
# # wp plugin activate data-controller --network;
# # wp plugin activate jobs-importer --network;
# # wp theme update --all;
# # wp theme activate biuro;
# wp theme delete twentynineteen
# wp theme delete twentyseventeen
# wp theme delete twentysixteen
# wp language core update;
# wp language theme update --all;
# wp language plugin update --all;
# echo "WP CLI done. Ready to use.";
# '
networks:
front:
......
......@@ -18,9 +18,18 @@
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) die;
global $recommendPage;
?>
<div class="c-form--row c-form--row-sticky">
<button type="submit" class="o-btn c-btn--main c-btn--fill" name="s" value="1"><?php _e('Apply', 'biuro-contacts'); ?></button>
<button type="submit" class="o-btn c-btn--main c-btn--fit" name="s" value="1"><?php _e('Apply', 'biuro-contacts'); ?></button>
<?php
if ($recommendPage):
?>
<a href="<?php echo $recommendPage; ?>" class="o-btn c-btn--slim c-btn--fit"><?php _e('Recommend a friend', 'biuro'); ?></a>
<?php
endif;
?>
</div><!-- .c-form--row -->
......@@ -111,6 +111,7 @@ class WPSEO_Admin {
$integrations[] = new WPSEO_MyYoast_Proxy();
$integrations[] = new WPSEO_MyYoast_Route();
$integrations[] = new WPSEO_Schema_Person_Upgrade_Notification();
$integrations[] = new WPSEO_Tracking( 'https://tracking.yoast.com/stats', ( WEEK_IN_SECONDS * 2 ) );
$integrations = array_merge(
$integrations,
......
......@@ -137,13 +137,16 @@ class WPSEO_Admin_Pages {
* @return array The search appearance variables.
*/
public function localize_search_appearance_script() {
return array(
$search_appearance_l10n = array(
'isRtl' => is_rtl(),
'userEditUrl' => add_query_arg( 'user_id', '{user_id}', admin_url( 'user-edit.php' ) ),
'brushstrokeBackgroundURL' => plugins_url( 'images/brushstroke_background.svg', WPSEO_FILE ),
'showLocalSEOUpsell' => $this->should_show_local_seo_upsell(),
'localSEOUpsellURL' => WPSEO_Shortlinker::get( 'https://yoa.st/3mp' ),
);
$search_appearance_l10n['knowledgeGraphCompanyInfoMissing'] = WPSEO_Language_Utils::get_knowledge_graph_company_info_missing_l10n();
return $search_appearance_l10n;
}
/**
......
......@@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
*
* @var string
*/
const CURRENT_RELEASE = '6.4.0';
const CURRENT_RELEASE = '6.5.0';
/**
* The minimally supported version of Gutenberg by the plugin.
*
* @var string
*/
const MINIMUM_SUPPORTED = '6.4.0';
const MINIMUM_SUPPORTED = '6.5.0';
/**
* Holds the current version.
......
......@@ -118,10 +118,10 @@ class WPSEO_Help_Center {
/* translators: %s expands to Yoast SEO */
'title' => sprintf( __( 'Want to be a %s Expert?', 'wordpress-seo' ), 'Yoast SEO' ),
/* translators: %1$s expands to Yoast SEO */
'description' => sprintf( __( 'Follow our %1$s for WordPress training and become a certified %1$s Expert!', 'wordpress-seo' ), 'Yoast SEO' ),
'description' => sprintf( __( 'Follow our free %1$s for WordPress training and become a certified %1$s Expert!', 'wordpress-seo' ), 'Yoast SEO' ),
'link' => WPSEO_Shortlinker::get( 'https://yoa.st/wordpress-training-vt' ),
/* translators: %s expands to Yoast SEO */
'linkText' => sprintf( __( 'Enroll in the %s for WordPress training', 'wordpress-seo' ), 'Yoast SEO' ),
'linkText' => sprintf( __( 'Enroll in the free %s for WordPress training', 'wordpress-seo' ), 'Yoast SEO' ),
);
}
......
......@@ -266,9 +266,6 @@ class Yoast_Form {
$class = '';
if ( $label_left !== false ) {
if ( ! empty( $label_left ) ) {
$label_left .= ':';
}
$this->label( $label_left, array( 'for' => $var ) );
}
else {
......@@ -364,7 +361,7 @@ class Yoast_Form {
}
$this->label(
$label . ':',
$label,
array(
'for' => $var,
'class' => 'textinput',
......@@ -406,7 +403,7 @@ class Yoast_Form {
$val = ( isset( $this->options[ $var ] ) ) ? $this->options[ $var ] : '';
$this->label(
$label . ':',
$label,
array(
'for' => $var,
'class' => 'textinput',
......@@ -455,7 +452,7 @@ class Yoast_Form {
if ( $show_label ) {
$this->label(
$label . ':',
$label,
array(
'for' => $var,
'class' => 'select',
......@@ -505,7 +502,7 @@ class Yoast_Form {
$var_esc = esc_attr( $var );
$this->label(
$label . ':',
$label,
array(
'for' => $var,
'class' => 'select',
......@@ -544,7 +541,7 @@ class Yoast_Form {
$var_esc = esc_attr( $var );
$this->label(
$label . ':',
$label,
array(
'for' => 'wpseo_' . $var,
'class' => 'select',
......
......@@ -49,6 +49,7 @@ class WPSEO_Configuration_Storage {
new WPSEO_Config_Field_Profile_URL_YouTube(),
new WPSEO_Config_Field_Profile_URL_Wikipedia(),
new WPSEO_Config_Field_Company_Or_Person(),
new WPSEO_Config_Field_Company_Info_Missing(),
new WPSEO_Config_Field_Company_Name(),
new WPSEO_Config_Field_Company_Logo(),
new WPSEO_Config_Field_Person(),
......
......@@ -31,6 +31,7 @@ class WPSEO_Configuration_Structure {
'publishingEntity' => array(
'publishingEntity',
'publishingEntityType',
'publishingEntityCompanyInfo',
'publishingEntityCompanyName',
'publishingEntityCompanyLogo',
'publishingEntityPersonId',
......@@ -53,8 +54,10 @@ class WPSEO_Configuration_Structure {
'siteName',
'separator',
),
'newsletter' => array( 'mailchimpSignup' ),
'suggestions' => array( 'suggestions' ),
'newsletter' => array(
'mailchimpSignup',
'suggestions',
),
'success' => array( 'successMessage' ),
);
......@@ -93,9 +96,7 @@ class WPSEO_Configuration_Structure {
// @codingStandardsIgnoreEnd
$this->add_step( 'title-template', __( 'Title settings', 'wordpress-seo' ), $this->fields['titleTemplate'] );
$this->add_step( 'newsletter', __( 'Newsletter', 'wordpress-seo' ), $this->fields['newsletter'], true, true );
$this->add_step( 'suggestions', __( 'You might like', 'wordpress-seo' ), $this->fields['suggestions'], true, true );
$this->add_step( 'newsletter', __( 'Continue learning', 'wordpress-seo' ), $this->fields['newsletter'], true, true );
$this->add_step( 'success', __( 'Success!', 'wordpress-seo' ), $this->fields['success'], true, true );
}
......
......@@ -72,26 +72,6 @@ class WPSEO_Config_Component_Suggestions implements WPSEO_Config_Component {
)
);
$field->add_suggestion(
/* translators: %1$s resolves to Yoast SEO, %2$s resolves to Yoast SEO plugin training */
sprintf( __( 'Get the most out of %1$s with the %2$s', 'wordpress-seo' ), 'Yoast SEO', 'Yoast SEO plugin training' ),
/* translators: %1$s resolves to Yoast SEO */
sprintf( __( 'Do you want to know all the ins and outs of the %1$s plugin? Do you want to learn all about our advanced settings? Want to be able to really get the most out of the %1$s plugin? Check out our %1$s plugin training and start outranking the competition!', 'wordpress-seo' ), 'Yoast SEO' ),
array(
'label' => 'Yoast SEO plugin training',
'type' => 'link',
'href' => WPSEO_Shortlinker::get( 'https://yoa.st/wizard-suggestion-plugin-course' ),
),
array(
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/video-plugin-course' ),
'title' => sprintf(
/* translators: %1$s expands to Yoast SEO plugin training. */
__( '%1$s video', 'wordpress-seo' ),
'Yoast SEO plugin training'
),
)
);
// When we are running in Yoast SEO Premium and don't have Local SEO installed, show Local SEO as suggestion.
if ( WPSEO_Utils::is_yoast_seo_premium() && ! defined( 'WPSEO_LOCAL_FILE' ) ) {
$field->add_suggestion(
......
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Configurator
*/
/**
* Class WPSEO_Config_Field_Company_Info_Missing.
*/
class WPSEO_Config_Field_Company_Info_Missing extends WPSEO_Config_Field {
/**
* WPSEO_Config_Field_Company_Info_Missing constructor.
*
* @codeCoverageIgnore This is only using WPSEO_Config_Field and WPSEO_Utils functionality.
*/
public function __construct() {
parent::__construct( 'publishingEntityCompanyInfo', 'CompanyInfoMissing' );
$l10n_data = WPSEO_Language_Utils::get_knowledge_graph_company_info_missing_l10n();
$this->set_property( 'message', $l10n_data['message'] );
$this->set_property( 'link', $l10n_data['URL'] );
$this->set_requires( 'publishingEntityType', 'company' );
}
}
......@@ -18,19 +18,21 @@ class WPSEO_Config_Field_Success_Message extends WPSEO_Config_Field {
$success_message = sprintf(
/* translators: %1$s expands to Yoast SEO. */
__( '%1$s will now take care of all the needed technical optimization of your site. To really improve your site\'s performance in the search results, it\'s important to start creating content that ranks well for keyphrases you care about. Check out this video in which we explain how to use the %1$s metabox when you edit posts or pages.', 'wordpress-seo' ),
__( '%1$s will now take care of all the needed technical optimization of your site. To really improve your site\'s performance in the search results, it\'s important to know everything our plugin has to offer. Sign up for our free %1$s plugin training, in which you\'ll learn how to use %1$s and how it can help you make the best of your website!', 'wordpress-seo' ),
'Yoast SEO'
);
$this->set_property( 'title', __( 'You\'ve done it!', 'wordpress-seo' ) );
$this->set_property( 'message', $success_message );
$this->set_property( 'href', WPSEO_Shortlinker::get( 'https://yoa.st/3rp' ) );
/* translators: %1$s expands to Yoast SEO. */
$video_title = __( '%1$s video tutorial', 'wordpress-seo' );
$video_args = array(
'url' => WPSEO_Shortlinker::get( 'https://yoa.st/metabox-screencast' ),
'title' => sprintf( $video_title, 'Yoast SEO' ),
$img_alt = __( '%1$s video tutorial', 'wordpress-seo' );
$img_args = array(
'src' => plugin_dir_url( WPSEO_FILE ) . ( 'images/Yoast_Academy_video.png' ),
'alt' => sprintf( $img_alt, 'Yoast SEO' ),
);
$this->set_property( 'video', $video_args );
$this->set_property( 'image', $img_args );
}
}
......@@ -116,7 +116,7 @@ class WPSEO_Metabox_Formatter {
__( '%1$sSEO%2$s: %3$s', 'wordpress-seo' ),
'<a href="#yoast-seo-analysis-collapsible-metabox">',
'</a>',
'<strong>' . __( 'Focus Keyphrase not set', 'wordpress-seo' ) . '</strong>'
'<strong>' . __( 'Not available', 'wordpress-seo' ) . '</strong>'
),
'bad' => sprintf(
/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the SEO score. */
......
......@@ -22,9 +22,10 @@ class WPSEO_Metabox_Section_Readability implements WPSEO_Metabox_Section {
*/
public function display_link() {
printf(
'<li role="presentation"><a role="tab" href="#wpseo-meta-section-%1$s" id="wpseo-meta-tab-%1$s" aria-controls="wpseo-meta-section-%1$s" class="wpseo-meta-section-link">%2$s</a></li>',
'<li role="presentation"><a role="tab" href="#wpseo-meta-section-%1$s" id="wpseo-meta-tab-%1$s" aria-controls="wpseo-meta-section-%1$s" class="wpseo-meta-section-link">
<div class="wpseo-score-icon-container" id="wpseo-readability-score-icon"></div><span>%2$s</span></a></li>',
esc_attr( $this->name ),
'<div class="wpseo-score-icon-container" id="wpseo-readability-score-icon"></div><span>' . __( 'Readability', 'wordpress-seo' ) . '</span>'
esc_html__( 'Readability', 'wordpress-seo' )
);
}
......@@ -32,13 +33,10 @@ class WPSEO_Metabox_Section_Readability implements WPSEO_Metabox_Section {
* Outputs the section content.
*/
public function display_content() {
$html = sprintf(
printf(
'<div role="tabpanel" id="wpseo-meta-section-%1$s" aria-labelledby="wpseo-meta-tab-%1$s" tabindex="0" class="wpseo-meta-section">',
esc_attr( $this->name )
);
$html .= '<div id="wpseo-metabox-readability-root" class="wpseo-metabox-root"></div>';
$html .= '</div>';
echo $html;
echo '<div id="wpseo-metabox-readability-root" class="wpseo-metabox-root"></div>', '</div>';
}
}
......@@ -255,21 +255,6 @@ class WPSEO_Metabox extends WPSEO_Meta {
);
}
/**
* Output a tab in the Yoast SEO Metabox.
*
* @param string $id CSS ID of the tab.
* @param string $heading Heading for the tab.
* @param string $content Content of the tab. This content should be escaped.
*/
public function do_tab( $id, $heading, $content ) {
?>
<div id="<?php echo esc_attr( 'wpseo_' . $id ); ?>" class="wpseotab wpseo-form <?php echo esc_attr( $id ); ?>">
<?php echo $content; ?>
</div>
<?php
}
/**
* Output the meta box.
*/
......@@ -277,6 +262,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
$content_sections = $this->get_content_sections();
echo '<div class="wpseo-metabox-content">';
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $this->get_product_title is considered safe.
printf( '<div class="wpseo-metabox-menu"><ul role="tablist" class="yoast-aria-tabs" aria-label="%s">', $this->get_product_title() );
foreach ( $content_sections as $content_section ) {
......@@ -1070,4 +1056,27 @@ class WPSEO_Metabox extends WPSEO_Meta {
public function setup_page_analysis() {
_deprecated_function( __METHOD__, 'WPSEO 9.6' );
}
/**
* Output a tab in the Yoast SEO Metabox.
*
* @deprecated 12.2
* @codeCoverageIgnore
*
* @param string $id CSS ID of the tab.
* @param string $heading Heading for the tab.
* @param string $content Content of the tab. This content should be escaped.
*/
public function do_tab( $id, $heading, $content ) {
_deprecated_function( __METHOD__, '12.2' );
?>
<div id="<?php echo esc_attr( 'wpseo_' . $id ); ?>" class="wpseotab wpseo-form <?php echo esc_attr( $id ); ?>">
<?php
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: deprecated function.
echo $content;
?>
</div>
<?php
}
}
......@@ -69,6 +69,7 @@ class WPSEO_Taxonomy_Metabox {
$product_title .= ' Premium';
}
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $product_title is hardcoded.
printf( '<div id="wpseo_meta" class="postbox yoast wpseo-taxonomy-metabox-postbox"><h2><span>%1$s</span></h2>', $product_title );
echo '<div class="inside">';
......@@ -76,6 +77,7 @@ class WPSEO_Taxonomy_Metabox {
echo '<div class="wpseo-metabox-content">';
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $product_title is hardcoded.
printf( '<div class="wpseo-metabox-menu"><ul role="tablist" class="yoast-aria-tabs" aria-label="%s">', $product_title );
foreach ( $content_sections as $content_section ) {
......
......@@ -36,7 +36,13 @@ class WPSEO_Tracking_Plugin_Data implements WPSEO_Collection {
$plugins = array_map( 'get_plugin_data', $plugins );
$plugins = array_map( array( $this, 'format_plugin' ), $plugins );
return $plugins;
$plugin_data = array();
foreach ( $plugins as $plugin ) {
$plugin_key = sanitize_title( $plugin['name'] );
$plugin_data[ $plugin_key ] = $plugin;
}
return $plugin_data;
}
/**
......
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Tracking
*/
/**
* Collects anonymized settings data.
*/
class WPSEO_Tracking_Settings_Data implements WPSEO_Collection {
/**
* @var array $anonymous_settings contains all of the option_names which need to be
* anonimized before they can be sent elsewhere.
*/
private $anonymous_settings = array(
'baiduverify',
'googleverify',
'msverify',
'yandexverify',
'website_name',
'alternate_website_name',
'company_logo',
'company_name',
'person_name',
'person_logo',
'person_logo_id',
'company_logo_id',
'facebook_site',
'instagram_url',
'linkedin_url',
'myspace_url',
'pinterest_url',
'pinterestverify',
'twitter_site',
'youtube_url',
'wikipedia_url',
'fbadminapp',
);
/**
* Returns the collection data.
*
* @return array The collection data.
*/
public function get() {
return array(
'settings' => $this->anonymize_settings( WPSEO_Options::get_all() ),
);
}
/**
* Anonimizes the WPSEO_Options array by replacing all $anonymous_settings values to 'used'.
*
* @param array $settings The settings.
* @return array The anonymized settings.
*/
private function anonymize_settings( $settings ) {
foreach ( $this->anonymous_settings as $setting ) {
if ( ! empty( $settings[ $setting ] ) ) {
$settings[ $setting ] = 'used';
}
}
return $settings;
}
}
......@@ -8,7 +8,7 @@
/**
* This class handles the tracking routine.
*/
class WPSEO_Tracking {
class WPSEO_Tracking implements WPSEO_WordPress_Integration {
/**
* The tracking option name.
......@@ -31,6 +31,13 @@ class WPSEO_Tracking {
*/
protected $endpoint = '';
/**
* The current time.
*
* @var int
*/
private $current_time;
/**
* Constructor setting the threshold.
*
......@@ -40,15 +47,21 @@ class WPSEO_Tracking {
public function __construct( $endpoint, $threshold ) {
$this->endpoint = $endpoint;
$this->threshold = $threshold;
$this->current_time = time();
}
/**
* Registers all hooks to WordPress.
*/
public function send() {
public function register_hooks() {
add_action( 'admin_init', array( $this, 'send' ), 1 );
}
$current_time = time();
if ( ! $this->should_send_tracking( $current_time ) ) {
/**
* Sends the tracking data.
*/
public function send() {
if ( ! $this->should_send_tracking() ) {
return;
}
......@@ -58,17 +71,31 @@ class WPSEO_Tracking {
$request->set_body( $collector->get_as_json() );
$request->send();
update_option( $this->option_name, $current_time, 'yes' );
update_option( $this->option_name, $this->current_time, 'yes' );
}
/**
* Returns true when last tracking data was send more than two weeks ago.
*
* @param int $current_time The current timestamp.
*
* @return bool True when tracking data should be send.
*/
protected function should_send_tracking( $current_time ) {
protected function should_send_tracking() {
global $pagenow;
/**
* Filter: 'wpseo_disable_tracking' - Disables the data tracking of Yoast SEO Premium.
*
* @api string $is_disabled The disabled state. Default is false.
*/
if ( apply_filters( 'wpseo_enable_tracking', false ) === false ) {
return false;
}
// Because we don't want to possibly block plugin actions with our routines.
if ( in_array( $pagenow, array( 'plugins.php', 'plugin-install.php', 'plugin-editor.php' ), true ) ) {
return false;
}
$last_time = get_option( $this->option_name );
// When there is no data being set.
......@@ -76,7 +103,7 @@ class WPSEO_Tracking {
return true;
}
return $this->exceeds_treshhold( $current_time - $last_time );
return $this->exceeds_treshhold( $this->current_time - $last_time );
}
/**
......@@ -95,12 +122,13 @@ class WPSEO_Tracking {
*
* @return WPSEO_Collector The instance of the collector.
*/
protected function get_collector() {
public function get_collector() {
$collector = new WPSEO_Collector();
$collector->add_collection( new WPSEO_Tracking_Default_Data() );
$collector->add_collection( new WPSEO_Tracking_Server_Data() );
$collector->add_collection( new WPSEO_Tracking_Theme_Data() );
$collector->add_collection( new WPSEO_Tracking_Plugin_Data() );
$collector->add_collection( new WPSEO_Tracking_Settings_Data() );
return $collector;
}
......
......@@ -11,6 +11,8 @@
* @uses string $content The fieldset content, i.e. a set of logically grouped form controls.
*/
_deprecated_file( __FILE__, '11.9' );
if ( ! defined( 'WPSEO_VERSION' ) ) {
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
......
......@@ -107,7 +107,10 @@ $has_valid_premium_subscription = WPSEO_Utils::is_yoast_seo_premium() && $addon_
/* translators: %1$s expands to Yoast SEO. */
$wpseo_extensions_header = sprintf( __( '%1$s Extensions', 'wordpress-seo' ), 'Yoast SEO' );
$new_tab_message = '<span class="screen-reader-text">' . esc_html__( '(Opens in a new browser tab)', 'wordpress-seo' ) . '</span>'
$new_tab_message = sprintf(
'<span class="screen-reader-text">%1$s</span>',
esc_html__( '(Opens in a new browser tab)', 'wordpress-seo' )
);
?>
......@@ -120,8 +123,9 @@ $new_tab_message = '<span class="screen-reader-text">' . esc_html__( '(O
<h2>
<?php
printf(
/* translators: %1$s expands to Yoast SEO Premium */
/* translators: 1: expands to Yoast SEO Premium */
esc_html__( '%1$s, take your optimization to the next level!', 'wordpress-seo' ),
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The `get_title` value is hardcoded; only passed through the WPSEO_Extensions class.
'<span class="yoast-heading-highlight">' . $premium_extension->get_title() . '</span>'
);
?>
......@@ -157,8 +161,13 @@ $new_tab_message = '<span class="screen-reader-text">' . esc_html__( '(O
<a target="_blank" href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/13k' ); ?>"
class="yoast-link--license">
<?php
/* translators: %s expands to the extension title */
printf( esc_html__( 'Manage your %s subscription on MyYoast', 'wordpress-seo' ), $premium_extension->get_title() );
printf(
/* translators: %s expands to the extension title */
esc_html__( 'Manage your %s subscription on MyYoast', 'wordpress-seo' ),
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The `get_title` value is hardcoded; only passed through the WPSEO_Extensions class.
$premium_extension->get_title()
);
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message;
?>
</a>
......@@ -167,8 +176,13 @@ $new_tab_message = '<span class="screen-reader-text">' . esc_html__( '(O
<a target="_blank" href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/13i' ); ?>"
class="yoast-link--license">
<?php
/* translators: %s expands to the extension title */
printf( esc_html__( 'Activate %s for your site on MyYoast', 'wordpress-seo' ), $premium_extension->get_title() );
printf(
/* translators: %s expands to the extension title */
esc_html__( 'Activate %s for your site on MyYoast', 'wordpress-seo' ),
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The `get_title` value is hardcoded; only passed through the WPSEO_Extensions class.
$premium_extension->get_title()
);
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message;
?>
</a>
......@@ -179,8 +193,13 @@ $new_tab_message = '<span class="screen-reader-text">' . esc_html__( '(O
<a target="_blank" href="<?php echo esc_url( $premium_extension->get_buy_url() ); ?>"
class="yoast-button-upsell">
<?php
/* translators: $s expands to Yoast SEO Premium */
printf( esc_html__( 'Buy %s', 'wordpress-seo' ), $premium_extension->get_title() );
printf(
/* translators: $s expands to Yoast SEO Premium */
esc_html__( 'Buy %s', 'wordpress-seo' ),
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The `get_title` value is hardcoded; only passed through the WPSEO_Extensions class.
$premium_extension->get_title()
);
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message;
echo '<span aria-hidden="true" class="yoast-button-upsell__caret"></span>';
?>
......@@ -190,12 +209,14 @@ $new_tab_message = '<span class="screen-reader-text">' . esc_html__( '(O
class="yoast-link--more-info">
<?php
printf(
/* translators: Text between %1$s and %2$s will only be shown to screen readers. %3$s expands to the product name. */
/* translators: Text between 1: and 2: will only be shown to screen readers. 3: expands to the product name. */
esc_html__( 'More information %1$sabout %3$s%2$s', 'wordpress-seo' ),
'<span class="screen-reader-text">',
'</span>',
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The `get_title` value is hardcoded; only passed through the WPSEO_Extensions class.
$premium_extension->get_title()
);
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message;
?>
</a>
......@@ -212,12 +233,16 @@ $new_tab_message = '<span class="screen-reader-text">' . esc_html__( '(O
<section class="yoast-promo-extensions">
<h2>
<?php
/* translators: %1$s expands to Yoast SEO */
$yoast_seo_extensions = sprintf( __( '%1$s extensions', 'wordpress-seo' ), 'Yoast SEO' );
/* translators: 1: expands to Yoast SEO */
$yoast_seo_extensions = sprintf( esc_html__( '%1$s extensions', 'wordpress-seo' ), 'Yoast SEO' );
$yoast_seo_extensions = '<span class="yoast-heading-highlight">' . $yoast_seo_extensions . '</span>';
/* translators: %1$s expands to Yoast SEO extensions */
printf( esc_html__( '%1$s to optimize your site even further', 'wordpress-seo' ), $yoast_seo_extensions );
printf(
/* translators: 1: expands to Yoast SEO extensions */
esc_html__( '%1$s to optimize your site even further', 'wordpress-seo' ),
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $yoast_seo_extensions is properly escaped.
$yoast_seo_extensions
);
?>
</h2>
......@@ -241,8 +266,13 @@ $new_tab_message = '<span class="screen-reader-text">' . esc_html__( '(O
<a target="_blank" href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/13k' ); ?>"
class="yoast-link--license">
<?php
/* translators: %s expands to the extension title */
printf( esc_html__( 'Manage your %s subscription on MyYoast', 'wordpress-seo' ), $extension->get_title() );
printf(
/* translators: %s expands to the extension title */
esc_html__( 'Manage your %s subscription on MyYoast', 'wordpress-seo' ),
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The `get_title` value is hardcoded; only passed through the WPSEO_Extensions class.
$extension->get_title()
);
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message;
?>
</a>
......@@ -251,8 +281,13 @@ $new_tab_message = '<span class="screen-reader-text">' . esc_html__( '(O
<a target="_blank" href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/13i' ); ?>"
class="yoast-link--license">
<?php
/* translators: %s expands to the extension title */
printf( esc_html__( 'Activate %s for your site on MyYoast', 'wordpress-seo' ), $extension->get_title() );
printf(
/* translators: %s expands to the extension title */
esc_html__( 'Activate %s for your site on MyYoast', 'wordpress-seo' ),
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The `get_title` value is hardcoded; only passed through the WPSEO_Extensions class.
$extension->get_title()
);
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message;
?>
</a>
......@@ -261,8 +296,13 @@ $new_tab_message = '<span class="screen-reader-text">' . esc_html__( '(O
<a target="_blank" class="yoast-button-upsell"
href="<?php echo esc_url( $extension->get_buy_url() ); ?>">
<?php
/* translators: %s expands to the product name */
printf( esc_html__( 'Buy %s', 'wordpress-seo' ), $extension->get_buy_button() );
printf(
/* translators: %s expands to the product name */
esc_html__( 'Buy %s', 'wordpress-seo' ),
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The possible `get_buy_button` values are hardcoded (buy_button or title); only passed through the WPSEO_Extensions class.
$extension->get_buy_button()
);
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message;
echo '<span aria-hidden="true" class="yoast-button-upsell__caret"></span>';
?>
......@@ -272,12 +312,14 @@ $new_tab_message = '<span class="screen-reader-text">' . esc_html__( '(O
href="<?php echo esc_url( $extension->get_info_url() ); ?>">
<?php
printf(
/* translators: Text between %1$s and %2$s will only be shown to screen readers. %3$s expands to the product name. */
/* translators: Text between 1: and 2: will only be shown to screen readers. 3: expands to the product name. */
esc_html__( 'More information %1$sabout %3$s%2$s', 'wordpress-seo' ),
'<span class="screen-reader-text">',
'</span>',
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The `get_title` value is hardcoded; only passed through the WPSEO_Extensions class.
$extension->get_title()
);
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message;
?>
</a>
......
......@@ -42,91 +42,94 @@ $new_tab_message = WPSEO_Admin_Utils::get_new_tab_message();
?>
</a><br>
</div>
<div class="yoast-sidebar__section">
<h2><?php esc_html_e( 'Improve your SEO skills', 'wordpress-seo' ); ?></h2>
<div class="wp-clearfix">
<p>
<strong><?php echo esc_html_x( 'Free:', 'course', 'wordpress-seo' ); ?></strong>
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/2oi' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/SEO_for_beginners.svg' ); ?>" alt="">
<strong><?php esc_html_e( 'SEO for Beginners training', 'wordpress-seo' ); ?></strong>
<?php echo $new_tab_message; ?>
</a><br>
<?php esc_html_e( 'Get quick wins to make your site rank higher in search engines.', 'wordpress-seo' ); ?>
</p>
</div>
<div class="wp-clearfix">
<p>
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jv' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/yoast_seo_for_wp_2.svg' ); ?>" alt="">
<strong>
<?php
/* translators: %s expands to Yoast SEO */
printf( esc_html__( '%s for WordPress training', 'wordpress-seo' ), 'Yoast SEO' );
?>
</strong>
<?php echo $new_tab_message; ?>
</a><br>
<?php esc_html_e( 'Don’t waste time figuring out the best settings yourself.', 'wordpress-seo' ); ?>
</p>
</div>
<div class="wp-clearfix">
<p>
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/3lj' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/all-round-SEO.svg' ); ?>" alt="">
<strong><?php esc_html_e( 'All-around SEO training', 'wordpress-seo' ); ?></strong>
<?php echo $new_tab_message; ?>
</a><br>
<?php esc_html_e( 'Learn practical SEO skills to rank higher in Google.', 'wordpress-seo' ); ?>
</p>
</div>
</div>
<div class="yoast-sidebar__section">
<h2>
<?php
/* translators: %s expands to Yoast SEO */
printf( esc_html__( 'Extend %s', 'wordpress-seo' ), 'Yoast SEO' );
?>
</h2>
<div class="wp-clearfix">
<p>
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jq' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/Local_SEO_Icon.svg' ); ?>" alt="">
<strong>Local SEO</strong>
<?php echo $new_tab_message; ?>
</a><br>
<?php esc_html_e( 'Be found in Google Maps and local results.', 'wordpress-seo' ); ?>
</p>
</div>
<div class="wp-clearfix">
<p>
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jo' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/Video_SEO_Icon.svg' ); ?>" alt="">
<strong>Video SEO</strong>
<?php echo $new_tab_message; ?>
</a><br>
<?php esc_html_e( 'Be found in Google Video search and enhance your video sharing on social media.', 'wordpress-seo' ); ?>
</p>
<div class="yoast-sidebar__product-list">
<div class="yoast-sidebar__section">
<h2><?php esc_html_e( 'Improve your SEO skills', 'wordpress-seo' ); ?></h2>
<div class="wp-clearfix">
<p>
<strong><?php echo esc_html_x( 'Free:', 'course', 'wordpress-seo' ); ?></strong>
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/2oi' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/SEO_for_beginners.svg' ); ?>" alt="">
<strong><?php esc_html_e( 'SEO for Beginners training', 'wordpress-seo' ); ?></strong>
<?php echo $new_tab_message; ?>
</a><br>
<?php esc_html_e( 'Get quick wins to make your site rank higher in search engines.', 'wordpress-seo' ); ?>
</p>
</div>
<div class="wp-clearfix">
<p>
<strong><?php echo esc_html_x( 'Free:', 'course', 'wordpress-seo' ); ?></strong>
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jv' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/yoast_seo_for_wp_2.svg' ); ?>" alt="">
<strong>
<?php
/* translators: %s expands to Yoast SEO */
printf( esc_html__( '%s for WordPress training', 'wordpress-seo' ), 'Yoast SEO' );
?>
</strong>
<?php echo $new_tab_message; ?>
</a><br>
<?php esc_html_e( 'Don’t waste time figuring out the best settings yourself.', 'wordpress-seo' ); ?>
</p>
</div>
<div class="wp-clearfix">
<p>
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/3lj' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/all-round-SEO.svg' ); ?>" alt="">
<strong><?php esc_html_e( 'All-around SEO training', 'wordpress-seo' ); ?></strong>
<?php echo $new_tab_message; ?>
</a><br>
<?php esc_html_e( 'Learn practical SEO skills to rank higher in Google.', 'wordpress-seo' ); ?>
</p>
</div>
</div>
<div class="wp-clearfix">
<p>
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jp' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/Woo_SEO_Icon.svg' ); ?>" alt="">
<strong>WooCommerce SEO</strong>
<?php echo $new_tab_message; ?>
</a><br>
<?php esc_html_e( 'Optimize your shop\'s SEO and sell more products!', 'wordpress-seo' ); ?>
</p>
</div>
<div class="wp-clearfix">
<p>
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jr' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/News_SEO_Icon.svg' ); ?>" alt="">
<strong>News SEO</strong>
<?php echo $new_tab_message; ?>
</a><br>
<?php esc_html_e( 'Optimize your site for Google News.', 'wordpress-seo' ); ?>
</p>
<div class="yoast-sidebar__section">
<h2>
<?php
/* translators: %s expands to Yoast SEO */
printf( esc_html__( 'Extend %s', 'wordpress-seo' ), 'Yoast SEO' );
?>
</h2>
<div class="wp-clearfix">
<p>
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jq' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/Local_SEO_Icon.svg' ); ?>" alt="">
<strong>Local SEO</strong>
<?php echo $new_tab_message; ?>
</a><br>
<?php esc_html_e( 'Be found in Google Maps and local results.', 'wordpress-seo' ); ?>
</p>
</div>
<div class="wp-clearfix">
<p>
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jo' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/Video_SEO_Icon.svg' ); ?>" alt="">
<strong>Video SEO</strong>
<?php echo $new_tab_message; ?>
</a><br>
<?php esc_html_e( 'Be found in Google Video search and enhance your video sharing on social media.', 'wordpress-seo' ); ?>
</p>
</div>
<div class="wp-clearfix">
<p>
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jp' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/Woo_SEO_Icon.svg' ); ?>" alt="">
<strong>WooCommerce SEO</strong>
<?php echo $new_tab_message; ?>
</a><br>
<?php esc_html_e( 'Optimize your shop\'s SEO and sell more products!', 'wordpress-seo' ); ?>
</p>
</div>
<div class="wp-clearfix">
<p>
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jr' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/News_SEO_Icon.svg' ); ?>" alt="">
<strong>News SEO</strong>
<?php echo $new_tab_message; ?>
</a><br>
<?php esc_html_e( 'Optimize your site for Google News.', 'wordpress-seo' ); ?>
</p>
</div>
</div>
</div>
<div class="yoast-sidebar__section">
......
......@@ -44,6 +44,18 @@ $knowledge_graph_help = new WPSEO_Admin_Help_Panel(
$yform->select( 'company_or_person', __( 'Organization or person', 'wordpress-seo' ), $yoast_free_kg_select_options, 'styled', false );
?>
<div id="knowledge-graph-company">
<?php
/*
* Render the `knowledge-graph-company-warning` div when the company name or logo are not set.
* This div is used as React render root in `js/src/search-appearance.js`.
*/
$is_company_info_missing = empty( $yform->options['company_name'] ) || empty( $yform->options['company_logo'] );
if ( $is_company_info_missing ) :
?>
<div id="knowledge-graph-company-warning"></div>
<?php endif; ?>
<h3><?php esc_html_e( 'Organization', 'wordpress-seo' ); ?></h3>
<?php
$yform->textinput( 'company_name', __( 'Organization name', 'wordpress-seo' ), array( 'autocomplete' => 'organization' ) );
......
......@@ -119,6 +119,7 @@ function wpseo_get_rendered_tab( $table, $id ) {
?>
<script>
// phpcs:ignore WordPress.Security.OutputEscaping -- WPSEO_Utils::format_json_encode is safe.
var wpseoBulkEditorNonce = <?php echo WPSEO_Utils::format_json_encode( wp_create_nonce( 'wpseo-bulk-editor' ) ); ?>;
// eslint-disable-next-line
......
......@@ -74,7 +74,9 @@ if ( $import ) {
$status = 'updated';
}
echo '<div id="message" class="message ', $status, '"><p>', esc_html( $msg ), '</p></div>';
$class = 'message ' . $status;
echo '<div id="message" class="', esc_attr( $status ), '"><p>', esc_html( $msg ), '</p></div>';
}
}
......
......@@ -20,7 +20,7 @@ class WPSEO_Config_Field_Profile_URL_GooglePlus extends WPSEO_Config_Field {
* @deprecated 10.1
*/
public function __construct() {
_deprecated_constructor( 'WPSEO_Config_Field_Profile_URL_GooglePlus', '10.1' );
_deprecated_function( __METHOD__, '10.1' );
}
/**
......
......@@ -32,7 +32,7 @@ class WPSEO_Cornerstone {
* @deprecated 8.4
*/
public function __construct() {
_deprecated_constructor( 'WPSEO_Cornerstone', '8.4' );
_deprecated_function( __METHOD__, '8.4' );
}
/**
......
......@@ -25,7 +25,7 @@ class WPSEO_Metabox_Addon_Tab_Section extends WPSEO_Metabox_Tab_Section {
* @param array $options Optional link attributes.
*/
public function __construct( $name, $link_content, array $tabs = array(), array $options = array() ) {
_deprecated_constructor( 'WPSEO_Metabox_Addon_Tab_Section', '11.9' );
_deprecated_function( __METHOD__, '11.9' );
parent::__construct( $name, $link_content, $tabs, $options );
}
......
......@@ -29,7 +29,7 @@ class WPSEO_Recalibration_Beta_Notification implements WPSEO_WordPress_Integrati
* @deprecated 9.6
*/
public function __construct() {
_deprecated_constructor( 'WPSEO_Recalibration_Beta_Notification', 'WPSEO 9.6' );
_deprecated_function( __METHOD__, '9.6' );
}
/**
......
......@@ -40,7 +40,7 @@ class WPSEO_Recalibration_Beta implements WPSEO_WordPress_Integration {
* @codeCoverageIgnore
*/
public function __construct() {
_deprecated_constructor( 'WPSEO_Recalibration_Beta', 'WPSEO 10.0' );
_deprecated_function( __METHOD__, '10.0' );
}
/**
......
......@@ -40,7 +40,7 @@ class WPSEO_Option_Permalinks {
* @return void
*/
protected function __construct() {
_deprecated_constructor( __CLASS__, 'WPSEO 7.0' );
_deprecated_function( __METHOD__, '7.0' );
}
/**
......
......@@ -52,11 +52,16 @@ class Yoast_Form_Fieldset implements Yoast_Form_Element {
/**
* 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;
......@@ -64,8 +69,13 @@ class Yoast_Form_Fieldset implements Yoast_Form_Element {
/**
* 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.
......@@ -77,24 +87,39 @@ class Yoast_Form_Fieldset implements Yoast_Form_Element {
/**
* 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();
......@@ -102,33 +127,54 @@ class Yoast_Form_Fieldset implements Yoast_Form_Element {
/**
* 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(
array( 'class' => 'screen-reader-text' ),
$this->legend_attributes
......@@ -138,6 +184,9 @@ class Yoast_Form_Fieldset implements Yoast_Form_Element {
/**
* Return the set of attributes and content for the fieldset.
*
* @deprecated 11.9
* @codeCoverageIgnore
*
* @return array
*/
private function get_parts() {
......@@ -153,6 +202,9 @@ class Yoast_Form_Fieldset implements Yoast_Form_Element {
/**
* 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.
......@@ -171,6 +223,9 @@ class Yoast_Form_Fieldset implements Yoast_Form_Element {
/**
* 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.
*/
......
......@@ -21,7 +21,7 @@ class Yoast_Modal {
* @deprecated 9.2
*/
public function __construct() {
_deprecated_constructor( 'Yoast_Modal', '9.2' );
_deprecated_function( __METHOD__, '9.2' );
}
/**
......
......@@ -777,6 +777,13 @@ class WPSEO_Frontend {
$robotsstr = preg_replace( '`^index,follow,?`', '', $robotsstr );
$robotsstr = str_replace( array( 'noodp,', 'noodp' ), '', $robotsstr );
if ( strpos( $robotsstr, 'noindex' ) === false && strpos( $robotsstr, 'nosnippet' ) === false ) {
if ( $robotsstr !== '' ) {
$robotsstr .= ', ';
}
$robotsstr .= 'max-snippet:-1, max-image-preview:large, max-video-preview:-1';
}
/**
* Filter: 'wpseo_robots' - Allows filtering of the meta robots output of Yoast SEO.
*
......
......@@ -135,7 +135,7 @@ class WPSEO_Rank {
*/
public function get_label() {
$labels = array(
self::NO_FOCUS => __( 'Focus Keyphrase not set', 'wordpress-seo' ),
self::NO_FOCUS => __( 'Not available', 'wordpress-seo' ),
self::NO_INDEX => __( 'No index', 'wordpress-seo' ),
self::BAD => __( 'Needs improvement', 'wordpress-seo' ),
self::OK => __( 'OK', 'wordpress-seo' ),
......
......@@ -1364,6 +1364,22 @@ SVG;
return array_merge_recursive( $allowed_post_tags, $input_tags );
}
/**
* Gets an array of enabled features.
*
* @return string[] The array of enabled features.
*/
public static function retrieve_enabled_features() {
$enabled_features = array();
if ( defined( 'YOAST_SEO_ENABLED_FEATURES' ) ) {
$enabled_features = preg_split( '/,\W*/', YOAST_SEO_ENABLED_FEATURES );
}
// Make the array of enabled features filterable, so features can be enabled at will.
$enabled_features = apply_filters( 'wpseo_enable_feature', $enabled_features );
return $enabled_features;
}
/* ********************* DEPRECATED METHODS ********************* */
/**
......@@ -1404,20 +1420,4 @@ SVG;
return WPSEO_Language_Utils::get_user_locale();
}
/**
* Gets an array of enabled features.
*
* @return string[] The array of enabled features.
*/
public static function retrieve_enabled_features() {
$enabled_features = array();
if ( defined( 'YOAST_SEO_ENABLED_FEATURES' ) ) {
$enabled_features = preg_split( '/,\W*/', YOAST_SEO_ENABLED_FEATURES );
}
// Make the array of enabled features filterable, so features can be enabled at will.
$enabled_features = apply_filters( 'wpseo_enable_feature', $enabled_features );
return $enabled_features;
}
}
......@@ -17,7 +17,7 @@ class WPSEO_Language_Utils {
*
* @param string $locale The locale to get the language of.
*
* @returns string The language part of the locale.
* @return string The language part of the locale.
*/
public static function get_language( $locale = null ) {
$language = 'en';
......@@ -44,7 +44,7 @@ class WPSEO_Language_Utils {
* Can be removed when support for WordPress 4.6 will be dropped, in favor
* of WordPress get_user_locale() that already fallbacks to the site's locale.
*
* @returns string The locale.
* @return string The locale.
*/
public static function get_user_locale() {
if ( function_exists( 'get_user_locale' ) ) {
......@@ -68,4 +68,20 @@ class WPSEO_Language_Utils {
return $language;
}
/**
* Returns the l10n array for the knowledge graph company info missing.
*
* @return array The l10n array.
*/
public static function get_knowledge_graph_company_info_missing_l10n() {
return array(
'URL' => esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/3r3' ) ),
/* translators: 1: expands to a link opening tag; 2: expands to a link closing tag */
'message' => esc_html__(
'A company name and logo need to be set for structured data to work properly. %1$sLearn more about the importance of structured data.%2$s',
'wordpress-seo'
),
);
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[11],{874:function(o,a,s){"use strict";!function(o){function a(){o("#wp-admin-bar-root-default > li").off("mouseenter.yoastalertpopup mouseleave.yoastalertpopup"),o(".yoast-issue-added").fadeOut(200)}function s(a,s){if(o(".yoast-alert-holder").off("click",".restore").off("click",".dismiss"),void 0!==s.html){s.html&&(a.closest(".yoast-container").html(s.html),t());var e=o("#wp-admin-bar-wpseo-menu"),n=e.find(".yoast-issue-counter");n.length||(e.find("> a:first-child").append('<div class="yoast-issue-counter"/>'),n=e.find(".yoast-issue-counter")),n.html(s.total),0===s.total?n.hide():n.show(),o("#toplevel_page_wpseo_dashboard .update-plugins").removeClass().addClass("update-plugins count-"+s.total),o("#toplevel_page_wpseo_dashboard .plugin-count").html(s.total)}}function t(){var a=o(".yoast-alert-holder");a.on("click",".dismiss",function(){var a=o(this),t=a.closest(".yoast-alert-holder");a.closest(".yoast-container").append('<div class="yoast-container-disabled"/>'),a.find("span").removeClass("dashicons-no-alt").addClass("dashicons-randomize"),o.post(ajaxurl,{action:"yoast_dismiss_alert",notification:t.attr("id"),nonce:t.data("nonce"),data:t.data("json")},s.bind(this,t),"json")}),a.on("click",".restore",function(){var a=o(this),t=a.closest(".yoast-alert-holder");a.closest(".yoast-container").append('<div class="yoast-container-disabled"/>'),a.find("span").removeClass("dashicons-arrow-up").addClass("dashicons-randomize"),o.post(ajaxurl,{action:"yoast_restore_alert",notification:t.attr("id"),nonce:t.data("nonce"),data:t.data("json")},s.bind(this,t),"json")})}function e(o){o.is(":hidden")||(o.outerWidth()>o.parent().outerWidth()?(o.data("scrollHint").addClass("yoast-has-scroll"),o.data("scrollContainer").addClass("yoast-has-scroll")):(o.data("scrollHint").removeClass("yoast-has-scroll"),o.data("scrollContainer").removeClass("yoast-has-scroll")))}function n(){window.wpseoScrollableTables=o(".yoast-table-scrollable"),window.wpseoScrollableTables.length&&window.wpseoScrollableTables.each(function(){var a=o(this);if(!a.data("scrollContainer")){var s=o("<div />",{class:"yoast-table-scrollable__hintwrapper",html:"<span class='yoast-table-scrollable__hint' aria-hidden='true' />"}).insertBefore(a),t=o("<div />",{class:"yoast-table-scrollable__container",html:"<div class='yoast-table-scrollable__inner' />"}).insertBefore(a);s.find(".yoast-table-scrollable__hint").text(wpseoAdminGlobalL10n.scrollable_table_hint),a.data("scrollContainer",t),a.data("scrollHint",s),a.appendTo(t.find(".yoast-table-scrollable__inner")),e(a)}})}jQuery(document).ready(function(){if(void 0!==window.wpseoConsoleNotifications&&"undefined"!=typeof console)for(var o=0;o<wpseoConsoleNotifications.length;o++)console.warn(wpseoConsoleNotifications[o])}),jQuery(document).ready(function(){jQuery(".yoast-dismissible").on("click",".yoast-notice-dismiss",function(){var o=jQuery(this).parent();return jQuery.post(ajaxurl,{action:o.attr("id").replace(/-/g,"_"),_wpnonce:o.data("nonce"),data:o.data("json")}),jQuery.post(ajaxurl,{action:"yoast_dismiss_notification",notification:o.attr("id"),nonce:o.data("nonce"),data:o.data("json")}),o.fadeTo(100,0,function(){o.slideUp(100,function(){o.remove()})}),!1}),jQuery(".yoast-help-button").on("click",function(){var o=jQuery(this),a=jQuery("#"+o.attr("aria-controls")),s=a.is(":visible");jQuery(a).slideToggle(200,function(){o.attr("aria-expanded",!s)})})}),window.wpseoDismissTaglineNotice=function(o){jQuery.post(ajaxurl,{action:"wpseo_dismiss_tagline_notice",_wpnonce:o})},window.wpseoSetIgnore=function(o,a,s){jQuery.post(ajaxurl,{action:"wpseo_set_ignore",option:o,_wpnonce:s},function(s){s&&(jQuery("#"+a).hide(),jQuery("#hidden_ignore_"+o).val("ignore"))})},window.wpseoDismissLink=function(o){return jQuery('<a href="'+o+'" type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></a>')},o(window).on("wp-window-resized orientationchange",function(){window.wpseoScrollableTables&&window.wpseoScrollableTables.length&&function(a){a.each(function(){e(o(this))})}(window.wpseoScrollableTables)}),o(window).on({"Yoast:YoastTabsMounted":function(){setTimeout(function(){n()},100)},"Yoast:YoastTabsSelected":function(){setTimeout(function(){n()},100)}}),o(document).ready(function(){o(".yoast-issue-added").on("mouseenter mouseleave",function(o){o.stopPropagation(),a()}).fadeIn(),o("#wp-admin-bar-root-default > li").on("mouseenter.yoastalertpopup mouseleave.yoastalertpopup",a),setTimeout(a,3e3),t(),function(){var o=jQuery(".wpseo-js-premium-indicator"),a=o.find("svg");if(o.hasClass("wpseo-premium-indicator--no")){var s=a.find("path"),t=o.css("backgroundColor");s.css("fill",t)}a.css("display","block"),o.css({backgroundColor:"transparent",width:"20px",height:"20px"})}(),n()})}(jQuery)}},[[874,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[11],{876:function(o,a,s){"use strict";!function(o){function a(){o("#wp-admin-bar-root-default > li").off("mouseenter.yoastalertpopup mouseleave.yoastalertpopup"),o(".yoast-issue-added").fadeOut(200)}function s(a,s){if(o(".yoast-alert-holder").off("click",".restore").off("click",".dismiss"),void 0!==s.html){s.html&&(a.closest(".yoast-container").html(s.html),t());var e=o("#wp-admin-bar-wpseo-menu"),n=e.find(".yoast-issue-counter");n.length||(e.find("> a:first-child").append('<div class="yoast-issue-counter"/>'),n=e.find(".yoast-issue-counter")),n.html(s.total),0===s.total?n.hide():n.show(),o("#toplevel_page_wpseo_dashboard .update-plugins").removeClass().addClass("update-plugins count-"+s.total),o("#toplevel_page_wpseo_dashboard .plugin-count").html(s.total)}}function t(){var a=o(".yoast-alert-holder");a.on("click",".dismiss",function(){var a=o(this),t=a.closest(".yoast-alert-holder");a.closest(".yoast-container").append('<div class="yoast-container-disabled"/>'),a.find("span").removeClass("dashicons-no-alt").addClass("dashicons-randomize"),o.post(ajaxurl,{action:"yoast_dismiss_alert",notification:t.attr("id"),nonce:t.data("nonce"),data:t.data("json")},s.bind(this,t),"json")}),a.on("click",".restore",function(){var a=o(this),t=a.closest(".yoast-alert-holder");a.closest(".yoast-container").append('<div class="yoast-container-disabled"/>'),a.find("span").removeClass("dashicons-arrow-up").addClass("dashicons-randomize"),o.post(ajaxurl,{action:"yoast_restore_alert",notification:t.attr("id"),nonce:t.data("nonce"),data:t.data("json")},s.bind(this,t),"json")})}function e(o){o.is(":hidden")||(o.outerWidth()>o.parent().outerWidth()?(o.data("scrollHint").addClass("yoast-has-scroll"),o.data("scrollContainer").addClass("yoast-has-scroll")):(o.data("scrollHint").removeClass("yoast-has-scroll"),o.data("scrollContainer").removeClass("yoast-has-scroll")))}function n(){window.wpseoScrollableTables=o(".yoast-table-scrollable"),window.wpseoScrollableTables.length&&window.wpseoScrollableTables.each(function(){var a=o(this);if(!a.data("scrollContainer")){var s=o("<div />",{class:"yoast-table-scrollable__hintwrapper",html:"<span class='yoast-table-scrollable__hint' aria-hidden='true' />"}).insertBefore(a),t=o("<div />",{class:"yoast-table-scrollable__container",html:"<div class='yoast-table-scrollable__inner' />"}).insertBefore(a);s.find(".yoast-table-scrollable__hint").text(wpseoAdminGlobalL10n.scrollable_table_hint),a.data("scrollContainer",t),a.data("scrollHint",s),a.appendTo(t.find(".yoast-table-scrollable__inner")),e(a)}})}jQuery(document).ready(function(){if(void 0!==window.wpseoConsoleNotifications&&"undefined"!=typeof console)for(var o=0;o<wpseoConsoleNotifications.length;o++)console.warn(wpseoConsoleNotifications[o])}),jQuery(document).ready(function(){jQuery(".yoast-dismissible").on("click",".yoast-notice-dismiss",function(){var o=jQuery(this).parent();return jQuery.post(ajaxurl,{action:o.attr("id").replace(/-/g,"_"),_wpnonce:o.data("nonce"),data:o.data("json")}),jQuery.post(ajaxurl,{action:"yoast_dismiss_notification",notification:o.attr("id"),nonce:o.data("nonce"),data:o.data("json")}),o.fadeTo(100,0,function(){o.slideUp(100,function(){o.remove()})}),!1}),jQuery(".yoast-help-button").on("click",function(){var o=jQuery(this),a=jQuery("#"+o.attr("aria-controls")),s=a.is(":visible");jQuery(a).slideToggle(200,function(){o.attr("aria-expanded",!s)})})}),window.wpseoDismissTaglineNotice=function(o){jQuery.post(ajaxurl,{action:"wpseo_dismiss_tagline_notice",_wpnonce:o})},window.wpseoSetIgnore=function(o,a,s){jQuery.post(ajaxurl,{action:"wpseo_set_ignore",option:o,_wpnonce:s},function(s){s&&(jQuery("#"+a).hide(),jQuery("#hidden_ignore_"+o).val("ignore"))})},window.wpseoDismissLink=function(o){return jQuery('<a href="'+o+'" type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></a>')},o(window).on("wp-window-resized orientationchange",function(){window.wpseoScrollableTables&&window.wpseoScrollableTables.length&&function(a){a.each(function(){e(o(this))})}(window.wpseoScrollableTables)}),o(window).on({"Yoast:YoastTabsMounted":function(){setTimeout(function(){n()},100)},"Yoast:YoastTabsSelected":function(){setTimeout(function(){n()},100)}}),o(document).ready(function(){o(".yoast-issue-added").on("mouseenter mouseleave",function(o){o.stopPropagation(),a()}).fadeIn(),o("#wp-admin-bar-root-default > li").on("mouseenter.yoastalertpopup mouseleave.yoastalertpopup",a),setTimeout(a,3e3),t(),function(){var o=jQuery(".wpseo-js-premium-indicator"),a=o.find("svg");if(o.hasClass("wpseo-premium-indicator--no")){var s=a.find("path"),t=o.css("backgroundColor");s.css("fill",t)}a.css("display","block"),o.css({backgroundColor:"transparent",width:"20px",height:"20px"})}(),n()})}(jQuery)}},[[876,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[13],{877:function(e,t,a){"use strict";jQuery(document).ready(function(e){void 0!==wp.media&&e(".wpseo_image_upload_button").each(function(t,a){var n=function(t){var a=(t=e(t)).data("target");return a&&""!==a||(a=e(t).attr("id").replace(/_button$/,"")),a}(a),i=function(t){return(t=e(t)).data("target-id")}(a),o=e("#"+n),r=e("#"+i),u=wp.media.frames.file_frame=wp.media({title:wpseoMediaL10n.choose_image,button:{text:wpseoMediaL10n.choose_image},multiple:!1,library:{type:"image"}});u.on("select",function(){var e=u.state().get("selection").first().toJSON();o.val(e.url),r.val(e.id)});var c=e(a);c.click(function(e){e.preventDefault(),u.open()}),c.siblings(".wpseo_image_remove_button").on("click",function(e){e.preventDefault(),o.val(""),r.val("")})})})}},[[877,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[13],{879:function(e,t,a){"use strict";jQuery(document).ready(function(e){void 0!==wp.media&&e(".wpseo_image_upload_button").each(function(t,a){var n=function(t){var a=(t=e(t)).data("target");return a&&""!==a||(a=e(t).attr("id").replace(/_button$/,"")),a}(a),i=function(t){return(t=e(t)).data("target-id")}(a),o=e("#"+n),r=e("#"+i),u=wp.media.frames.file_frame=wp.media({title:wpseoMediaL10n.choose_image,button:{text:wpseoMediaL10n.choose_image},multiple:!1,library:{type:"image"}});u.on("select",function(){var e=u.state().get("selection").first().toJSON();o.val(e.url),r.val(e.id)});var c=e(a);c.click(function(e){e.preventDefault(),u.open()}),c.siblings(".wpseo_image_remove_button").on("click",function(e){e.preventDefault(),o.val(""),r.val("")})})})}},[[879,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[22],{896:function(t,e,n){"use strict";!function(t,e){window.wpseoApi={get:function(t,e,n,o){this.request("GET",t,e,n,o)},post:function(t,e,n,o){this.request("POST",t,e,n,o)},put:function(t,e,n,o){this.request("PUT",t,e,n,o)},patch:function(t,e,n,o){this.request("PATCH",t,e,n,o)},delete:function(t,e,n,o){this.request("DELETE",t,e,n,o)},request:function(n,o,i,s,u){t.isFunction(i)&&void 0===u&&(u=s,s=i,i={}),"POST"!==n&&"GET"!==n&&(i._method=n,n="POST"),t.ajax({url:e.root+"yoast/v1/"+o,method:n,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",e.nonce)},data:i}).done(s).fail(u)}}}(jQuery,wpApiSettings)}},[[896,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[22],{898:function(t,e,n){"use strict";!function(t,e){window.wpseoApi={get:function(t,e,n,o){this.request("GET",t,e,n,o)},post:function(t,e,n,o){this.request("POST",t,e,n,o)},put:function(t,e,n,o){this.request("PUT",t,e,n,o)},patch:function(t,e,n,o){this.request("PATCH",t,e,n,o)},delete:function(t,e,n,o){this.request("DELETE",t,e,n,o)},request:function(n,o,i,s,u){t.isFunction(i)&&void 0===u&&(u=s,s=i,i={}),"POST"!==n&&"GET"!==n&&(i._method=n,n="POST"),t.ajax({url:e.root+"yoast/v1/"+o,method:n,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",e.nonce)},data:i}).done(s).fail(u)}}}(jQuery,wpApiSettings)}},[[898,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[15],{879:function(e,s,n){"use strict";!function(){var e=function(e){var s=e.find("[class^=wpseo-new]").first().attr("class"),n="#"+s+"-",t=n.replace("new","existing"),i=e.find("th[id^=col_existing_yoast]").first().text().replace("Existing ",""),a=s.replace("-new-","_save_"),o="wpseo_save_all_"+e.attr("class").split("wpseo_bulk_")[1],u=a.replace("wpseo_save_",""),r={newClass:"."+s,newId:n,existingId:t},l={submit_new:function(e){l.submitNew(e)},submitNew:function(e){var s,n=r.newId+e,t=r.existingId+e;s="select-one"===jQuery(r.newId+e).prop("type")?jQuery(n).find(":selected").text():jQuery(n).val();var o=jQuery(t).html();if(s===o)jQuery(n).val("");else{if(""===s&&!window.confirm("Are you sure you want to remove the existing "+i+"?"))return void jQuery(n).val("");var u={action:a,_ajax_nonce:wpseoBulkEditorNonce,wpseo_post_id:e,new_value:s,existing_value:o};jQuery.post(ajaxurl,u,l.handleResponse)}},submit_all:function(e){l.submitAll(e)},submitAll:function(e){e.preventDefault();var s={action:o,_ajax_nonce:wpseoBulkEditorNonce,send:!1,items:{},existingItems:{}};jQuery(r.newClass).each(function(){var e=jQuery(this).data("id"),n=jQuery(this).val(),t=jQuery(r.existingId+e).html();""!==n&&(n===t?jQuery(r.newId+e).val(""):(s.send=!0,s.items[e]=n,s.existingItems[e]=t))}),s.send&&jQuery.post(ajaxurl,s,l.handleResponses)},handle_response:function(e,s){l.handleResponse(e,s)},handleResponse:function(e,s){if("success"===s){var n=e;if("string"==typeof n&&(n=JSON.parse(n)),n instanceof Array)jQuery.each(n,function(){l.handleResponse(this,s)});else if("success"===n.status){var t=n["new_"+u];jQuery(r.existingId+n.post_id).html(t.replace(/\\(?!\\)/g,"")),jQuery(r.newId+n.post_id).val("")}}},handle_responses:function(e,s){l.handleResponses(e,s)},handleResponses:function(e,s){var n=jQuery.parseJSON(e);jQuery.each(n,function(){l.handleResponse(this,s)})},set_events:function(){l.setEvents()},setEvents:function(){e.find(".wpseo-save").click(function(e){var s=jQuery(this).data("id");e.preventDefault(),l.submitNew(s,this)}),e.find(".wpseo-save-all").click(l.submitAll),e.find(r.newClass).keydown(function(e){if(13===e.which){e.preventDefault();var s=jQuery(this).data("id");l.submitNew(s,this)}})}};return l};window.bulk_editor=e,window.bulkEditor=e,jQuery(document).ready(function(){jQuery('table[class*="wpseo_bulk"]').each(function(s,n){var t=jQuery(n);e(t).setEvents()})})}()}},[[879,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[15],{881:function(e,s,n){"use strict";!function(){var e=function(e){var s=e.find("[class^=wpseo-new]").first().attr("class"),n="#"+s+"-",t=n.replace("new","existing"),i=e.find("th[id^=col_existing_yoast]").first().text().replace("Existing ",""),a=s.replace("-new-","_save_"),o="wpseo_save_all_"+e.attr("class").split("wpseo_bulk_")[1],u=a.replace("wpseo_save_",""),r={newClass:"."+s,newId:n,existingId:t},l={submit_new:function(e){l.submitNew(e)},submitNew:function(e){var s,n=r.newId+e,t=r.existingId+e;s="select-one"===jQuery(r.newId+e).prop("type")?jQuery(n).find(":selected").text():jQuery(n).val();var o=jQuery(t).html();if(s===o)jQuery(n).val("");else{if(""===s&&!window.confirm("Are you sure you want to remove the existing "+i+"?"))return void jQuery(n).val("");var u={action:a,_ajax_nonce:wpseoBulkEditorNonce,wpseo_post_id:e,new_value:s,existing_value:o};jQuery.post(ajaxurl,u,l.handleResponse)}},submit_all:function(e){l.submitAll(e)},submitAll:function(e){e.preventDefault();var s={action:o,_ajax_nonce:wpseoBulkEditorNonce,send:!1,items:{},existingItems:{}};jQuery(r.newClass).each(function(){var e=jQuery(this).data("id"),n=jQuery(this).val(),t=jQuery(r.existingId+e).html();""!==n&&(n===t?jQuery(r.newId+e).val(""):(s.send=!0,s.items[e]=n,s.existingItems[e]=t))}),s.send&&jQuery.post(ajaxurl,s,l.handleResponses)},handle_response:function(e,s){l.handleResponse(e,s)},handleResponse:function(e,s){if("success"===s){var n=e;if("string"==typeof n&&(n=JSON.parse(n)),n instanceof Array)jQuery.each(n,function(){l.handleResponse(this,s)});else if("success"===n.status){var t=n["new_"+u];jQuery(r.existingId+n.post_id).html(t.replace(/\\(?!\\)/g,"")),jQuery(r.newId+n.post_id).val("")}}},handle_responses:function(e,s){l.handleResponses(e,s)},handleResponses:function(e,s){var n=jQuery.parseJSON(e);jQuery.each(n,function(){l.handleResponse(this,s)})},set_events:function(){l.setEvents()},setEvents:function(){e.find(".wpseo-save").click(function(e){var s=jQuery(this).data("id");e.preventDefault(),l.submitNew(s,this)}),e.find(".wpseo-save-all").click(l.submitAll),e.find(r.newClass).keydown(function(e){if(13===e.which){e.preventDefault();var s=jQuery(this).data("id");l.submitNew(s,this)}})}};return l};window.bulk_editor=e,window.bulkEditor=e,jQuery(document).ready(function(){jQuery('table[class*="wpseo_bulk"]').each(function(s,n){var t=jQuery(n);e(t).setEvents()})})}()}},[[881,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[16],{880:function(t,o,a){"use strict";!function(t){t(".yoast-column-header-has-tooltip").each(function(){t(this).closest("th").find("a").addClass("yoast-tooltip yoast-tooltip-alt yoast-tooltip-n yoast-tooltip-multiline").attr("data-label",t(this).data("tooltip-text")).attr("aria-label",t(this).text())})}(jQuery)}},[[880,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[16],{882:function(t,o,a){"use strict";!function(t){t(".yoast-column-header-has-tooltip").each(function(){t(this).closest("th").find("a").addClass("yoast-tooltip yoast-tooltip-alt yoast-tooltip-n yoast-tooltip-multiline").attr("data-label",t(this).data("tooltip-text")).attr("aria-label",t(this).text())})}(jQuery)}},[[882,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[23],{897:function(t,i,o){"use strict";jQuery("#posts-filter .tablenav.top").after('<div class="notice notice-info inline wpseo-filter-explanation"><p class="dashicons-before dashicons-lightbulb">'+yoastFilterExplanation.text+"</p></div>")}},[[897,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[23],{899:function(t,i,o){"use strict";jQuery("#posts-filter .tablenav.top").after('<div class="notice notice-info inline wpseo-filter-explanation"><p class="dashicons-before dashicons-lightbulb">'+yoastFilterExplanation.text+"</p></div>")}},[[899,0]]]);
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment