Commit d3eb7cc3 authored by Simon's avatar Simon

Release 1.23.3

parent c20e359b
......@@ -20,9 +20,9 @@
## Production
- build CSS & JS assets - `C:\web\dev.biuro\ npm run build`
- build new image `docker build -t biuro/web:1.23.2 .` (update version number)
- build new image `docker build -t biuro/web:1.23.3 .` (update version number)
- login to biuro docker account `docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs`
- push image to docker repository - `docker push biuro/web:1.23.2`
- push image to docker repository - `docker push biuro/web:1.23.3`
## Production
- update biuro/web image version in .env file (staging or www)
......
......@@ -148,7 +148,7 @@ jQuery( function ( $ ) {
} );
}
$( '.checkforspam.enable-on-load' ).click( function( e ) {
$( '.checkforspam.enable-on-load' ).on( 'click', function( e ) {
if ( $( this ).hasClass( 'ajax-disabled' ) ) {
// Akismet hasn't been configured yet. Allow the user to proceed to the button's link.
return;
......@@ -165,8 +165,7 @@ jQuery( function ( $ ) {
$('.checkforspam-spinner').addClass( 'spinner' ).addClass( 'is-active' );
akismet_check_for_spam(0, 100);
});
$( '.checkforspam.enable-on-load' ).removeClass( 'button-disabled' );
}).removeClass( 'button-disabled' );
var spam_count = 0;
var recheck_count = 0;
......
......@@ -6,7 +6,7 @@
Plugin Name: Akismet Anti-Spam
Plugin URI: https://akismet.com/
Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. It keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key.
Version: 4.1.7
Version: 4.1.8
Author: Automattic
Author URI: https://automattic.com/wordpress-plugins/
License: GPLv2 or later
......@@ -37,7 +37,7 @@ if ( !function_exists( 'add_action' ) ) {
exit;
}
define( 'AKISMET_VERSION', '4.1.7' );
define( 'AKISMET_VERSION', '4.1.8' );
define( 'AKISMET__MINIMUM_WP_VERSION', '4.0' );
define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'AKISMET_DELETE_LIMIT', 100000 );
......
......@@ -207,7 +207,15 @@ class Akismet {
do_action( 'akismet_comment_check_response', $response );
$commentdata['comment_as_submitted'] = array_intersect_key( $comment, self::$comment_as_submitted_allowed_keys );
$commentdata['akismet_result'] = $response[1];
// Also include any form fields we inject into the comment form, like ak_js
foreach ( $_POST as $key => $value ) {
if ( is_string( $value ) && strpos( $key, 'ak_' ) === 0 ) {
$commentdata['comment_as_submitted'][ 'POST_' . $key ] = $value;
}
}
$commentdata['akismet_result'] = $response[1];
if ( isset( $response[0]['x-akismet-pro-tip'] ) )
$commentdata['akismet_pro_tip'] = $response[0]['x-akismet-pro-tip'];
......@@ -1284,10 +1292,9 @@ class Akismet {
return preg_replace( '/^<script /i', '<script async="async" ', $tag );
}
public static function inject_ak_js( $fields ) {
echo '<p style="display: none;">';
public static function inject_ak_js( $post_id ) {
echo '<input type="hidden" id="ak_js" name="ak_js" value="' . mt_rand( 0, 250 ) . '"/>';
echo '</p>';
echo '<textarea name="ak_hp_textarea" cols="45" rows="8" maxlength="100" style="display: none !important;"></textarea>';
}
private static function bail_on_activation( $message, $deactivate = true ) {
......@@ -1470,8 +1477,17 @@ p {
$meta_value = (array) $meta_value;
foreach ( $meta_value as $key => $value ) {
if ( ! isset( self::$comment_as_submitted_allowed_keys[$key] ) || ! is_scalar( $value ) ) {
unset( $meta_value[$key] );
if ( ! is_scalar( $value ) ) {
unset( $meta_value[ $key ] );
} else {
// These can change, so they're not explicitly listed in comment_as_submitted_allowed_keys.
if ( strpos( $key, 'POST_ak_' ) === 0 ) {
continue;
}
if ( ! isset( self::$comment_as_submitted_allowed_keys[ $key ] ) ) {
unset( $meta_value[ $key ] );
}
}
}
......
......@@ -2,8 +2,8 @@
Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic, jgs, procifer, stephdau
Tags: comments, spam, antispam, anti-spam, contact form, anti spam, comment moderation, comment spam, contact form spam, spam comments
Requires at least: 4.6
Tested up to: 5.5
Stable tag: 4.1.7
Tested up to: 5.6
Stable tag: 4.1.8
License: GPLv2 or later
The best anti-spam protection to block spam comments and spam in a contact form. The most trusted antispam solution for WordPress and WooCommerce.
......@@ -30,6 +30,12 @@ Upload the Akismet plugin to your blog, activate it, and then enter your Akismet
== Changelog ==
= 4.1.8 =
*Release Date - 6 January 2021*
* Fixed missing fields in submit-spam and submit-ham calls that could lead to reduced accuracy.
* Fixed usage of deprecated jQuery function.
= 4.1.7 =
*Release Date - 22 October 2020*
......
<div class="pod-queries-tools"><?php
if ( empty( $atts ) ) {
$atts = array(
$defaults = array(
'pod' => '',
);
}
if ( empty( $atts ) ) {
$atts = $defaults;
} else {
$atts = wp_parse_args( $atts, $defaults );
}
$api = pods_api();
$_pods = $api->load_pods();
echo '<select name="pod_reference[pod]" id="pod-reference" class="pod-switch" data-template="#podref-tmpl" data-target="#pod-reference-wrapper" data-action="pq_loadpod" data-event="change" />';
echo '<option value="">' . __( 'Select Pod to use as reference', 'pods' ) . '</option>';
foreach ( $_pods as $pod ) {
echo '<option value="' . esc_attr( $pod['name'] ) . '" ' . ( $atts['pod'] == $pod['name'] ? 'selected="selected"' : '' ) . '>' . esc_html( $pod['label'] ) . '</option>';
}
foreach ( $_pods as $pod ) {
echo '<option value="' . esc_attr( $pod['name'] ) . '" ' . ( $atts['pod'] == $pod['name'] ? 'selected="selected"' : '' ) . '>' . esc_html( $pod['label'] ) . '</option>';
}
echo '</select>';
?></div>
<div id="pod-reference-wrapper" class="pod-reference-wrapper">
......@@ -27,8 +30,6 @@ foreach ( $_pods as $pod ) {
echo '</div>';
}
}
} else {
}
?>
......
......@@ -882,9 +882,18 @@ function pods_shortcode_run( $tags, $content = null ) {
// Only allow revert to current object if there are no query tags.
if ( ! $has_query_tags ) {
/**
* Allow filtering whether to detect the pod name / item ID from the current post object.
*
* @since 2.7.26
*
* @param bool $detect_from_current Whether to detect the pod name / item ID from the current post object.
* @param array $shortcode_attributes The list of attributes used for the shortcode.
*/
$detect_from_current = apply_filters( 'pods_shortcode_detect_from_current_post', in_the_loop(), $tags );
// Archives, Post type archives, singular posts.
if ( in_the_loop() ) {
if ( $detect_from_current ) {
$pod = pods( get_post_type(), get_the_ID(), false );
if ( ! empty( $pod ) ) {
......
......@@ -3,7 +3,7 @@
Plugin Name: Pods - Custom Content Types and Fields
Plugin URI: https://pods.io/
Description: Pods is a framework for creating, managing, and deploying customized content types and fields
Version: 2.7.25
Version: 2.7.26
Author: Pods Framework Team
Author URI: https://pods.io/about/
Text Domain: pods
......@@ -37,7 +37,7 @@ if ( defined( 'PODS_VERSION' ) || defined( 'PODS_DIR' ) ) {
add_action( 'init', 'pods_deactivate_pods_ui' );
} else {
// Current version
define( 'PODS_VERSION', '2.7.25' );
define( 'PODS_VERSION', '2.7.26' );
// Version tracking between DB updates themselves
define( 'PODS_DB_VERSION', '2.3.5' );
......
......@@ -5,7 +5,7 @@ Tags: pods, custom post types, custom taxonomies, content types, custom fields,
Requires at least: 4.5
Tested up to: 5.6
Requires PHP: 5.3
Stable tag: 2.7.25
Stable tag: 2.7.26
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
......@@ -190,6 +190,11 @@ We are also available through our [Live Slack Chat](https://pods.io/chat/) to he
== Changelog ==
= 2.7.26 - January 8th, 2021 =
* Fixed: Prevent PHP warnings in the `components/Templates/includes/element-pod_reference.php` file. #5914 (@JoryHogeveen)
* Added: New filter `pods_shortcode_detect_from_current_post` allows you to override whether a shortcode should detect the post object outside of the loop (default is only when `in_the_loop()`). This helps to fix problems that are part of the integration which the free Pods Beaver Themer Add-On uses. (@sc0ttkclark)
= 2.7.25 - December 28th 2020 =
**New Features & Enhancements**
......
......@@ -131,6 +131,17 @@ class WPSEO_Admin_Asset_Manager {
}
}
/**
* Localizes the script.
*
* @param string $handle The script handle.
* @param string $object_name The object name.
* @param array $data The l10n data.
*/
public function localize_script( $handle, $object_name, $data ) {
\wp_localize_script( $this->prefix . $handle, $object_name, $data );
}
/**
* A list of styles that shouldn't be registered but are needed in other locations in the plugin.
*
......@@ -198,7 +209,7 @@ class WPSEO_Admin_Asset_Manager {
*/
protected function scripts_to_be_registered() {
$select2_language = 'en';
$user_locale = WPSEO_Language_Utils::get_user_locale();
$user_locale = \get_user_locale();
$language = WPSEO_Language_Utils::get_language( $user_locale );
if ( file_exists( WPSEO_PATH . "js/dist/select2/i18n/{$user_locale}.js" ) ) {
......@@ -580,6 +591,27 @@ class WPSEO_Admin_Asset_Manager {
self::PREFIX . 'legacy-components',
],
],
[
/**
* Asset exposing Yoast editor modules which are used in Yoast add-ons.
*/
'name' => 'editor-modules',
'src' => 'editor-modules-' . $flat_version,
'deps' => [
'lodash',
'wp-compose',
'wp-data',
'wp-element',
'wp-i18n',
self::PREFIX . 'analysis',
self::PREFIX . 'analysis-report',
self::PREFIX . 'helpers',
self::PREFIX . 'legacy-components',
self::PREFIX . 'style-guide',
self::PREFIX . 'styled-components',
self::PREFIX . 'yoast-components',
],
],
[
// The `@yoast/components` package.
'name' => 'yoast-components',
......
......@@ -62,7 +62,7 @@ final class WPSEO_Admin_Asset_SEO_Location implements WPSEO_Admin_Asset_Location
case WPSEO_Admin_Asset::TYPE_CSS:
// Path and suffix for RTL stylesheets.
if ( function_exists( 'is_rtl' ) && is_rtl() && $asset->has_rtl() ) {
if ( is_rtl() && $asset->has_rtl() ) {
$rtl_suffix = '-rtl';
}
$relative_path = 'css/dist/' . $asset->get_src() . $rtl_suffix . $asset->get_suffix() . '.css';
......
......@@ -10,6 +10,20 @@
*/
final class WPSEO_Admin_Asset_Yoast_Components_L10n {
/**
* Represents the asset manager.
*
* @var WPSEO_Admin_Asset_Manager
*/
protected $asset_manager;
/**
* WPSEO_Admin_Asset_Yoast_Components_L10n constructor.
*/
public function __construct() {
$this->asset_manager = new WPSEO_Admin_Asset_Manager();
}
/**
* Localizes the given script with the JavaScript translations.
*
......@@ -22,7 +36,7 @@ final class WPSEO_Admin_Asset_Yoast_Components_L10n {
'yoast-components' => $this->get_translations( 'yoast-components' ),
'wordpress-seo' => $this->get_translations( 'wordpress-seojs' ),
];
wp_localize_script( $script_handle, 'wpseoYoastJSL10n', $translations );
$this->asset_manager->localize_script( $script_handle, 'wpseoYoastJSL10n', $translations );
}
/**
......@@ -32,7 +46,7 @@ final class WPSEO_Admin_Asset_Yoast_Components_L10n {
* @return object The translations in a Jed format for JS files.
*/
protected function get_translations( $component ) {
$locale = WPSEO_Language_Utils::get_user_locale();
$locale = \get_user_locale();
$file = plugin_dir_path( WPSEO_FILE ) . 'languages/' . $component . '-' . $locale . '.json';
if ( file_exists( $file ) ) {
......
......@@ -253,8 +253,7 @@ class WPSEO_Admin {
public function config_page_scripts() {
$asset_manager = new WPSEO_Admin_Asset_Manager();
$asset_manager->enqueue_script( 'admin-global-script' );
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'admin-global-script', 'wpseoAdminGlobalL10n', $this->localize_admin_global_script() );
$asset_manager->localize_script( 'admin-global-script', 'wpseoAdminGlobalL10n', $this->localize_admin_global_script() );
}
/**
......@@ -315,29 +314,12 @@ class WPSEO_Admin {
'<code>%s</code>',
'HelpScout beacon'
),
'dismiss_about_url' => $this->get_dismiss_url( 'wpseo-dismiss-about' ),
/* translators: %s: expends to Yoast SEO */
'help_video_iframe_title' => sprintf( __( '%s video tutorial', 'wordpress-seo' ), 'Yoast SEO' ),
'scrollable_table_hint' => __( 'Scroll to see the table content.', 'wordpress-seo' ),
];
}
/**
* Extending the current page URL with two params to be able to ignore the notice.
*
* @param string $dismiss_param The param used to dismiss the notification.
*
* @return string
*/
private function get_dismiss_url( $dismiss_param ) {
$arr_params = [
$dismiss_param => '1',
'nonce' => wp_create_nonce( $dismiss_param ),
];
return esc_url( add_query_arg( $arr_params ) );
}
/**
* Sets the upsell notice.
*/
......
......@@ -75,7 +75,7 @@ class WPSEO_Admin_Pages {
wp_enqueue_script( 'thickbox' );
$script_data = [
'userLanguageCode' => WPSEO_Language_Utils::get_language( WPSEO_Language_Utils::get_user_locale() ),
'userLanguageCode' => WPSEO_Language_Utils::get_language( \get_user_locale() ),
];
$page = filter_input( INPUT_GET, 'page' );
......@@ -108,7 +108,7 @@ class WPSEO_Admin_Pages {
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
$yoast_components_l10n = new WPSEO_Admin_Asset_Yoast_Components_L10n();
$yoast_components_l10n->localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'settings' );
$yoast_components_l10n->localize_script( 'settings' );
}
if ( in_array( $page, [ 'wpseo_social', WPSEO_Admin::PAGE_IDENTIFIER, 'wpseo_titles' ], true ) ) {
......@@ -123,7 +123,7 @@ class WPSEO_Admin_Pages {
$this->enqueue_tools_scripts();
}
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'settings', 'wpseoScriptData', $script_data );
$this->asset_manager->localize_script( 'settings', 'wpseoScriptData', $script_data );
}
/**
......
......@@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
*
* @var string
*/
const CURRENT_RELEASE = '9.5.0';
const CURRENT_RELEASE = '9.7.0';
/**
* The minimally supported version of Gutenberg by the plugin.
*
* @var string
*/
const MINIMUM_SUPPORTED = '9.5.0';
const MINIMUM_SUPPORTED = '9.7.0';
/**
* Holds the current version.
......
......@@ -102,6 +102,7 @@ class WPSEO_Plugin_Conflict extends Yoast_Plugin_Conflict {
'seo' => [
'all-in-one-seo-pack/all_in_one_seo_pack.php', // All in One SEO Pack.
'seo-ultimate/seo-ultimate.php', // SEO Ultimate.
'seo-by-rank-math/rank-math.php', // Rank Math.
],
];
......
......@@ -130,8 +130,9 @@ class WPSEO_Primary_Term_Admin implements WPSEO_WordPress_Integration {
$data = [
'taxonomies' => $mapped_taxonomies,
];
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'post-edit', 'wpseoPrimaryCategoryL10n', $data );
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'post-edit-classic', 'wpseoPrimaryCategoryL10n', $data );
$asset_manager->localize_script( 'post-edit', 'wpseoPrimaryCategoryL10n', $data );
$asset_manager->localize_script( 'post-edit-classic', 'wpseoPrimaryCategoryL10n', $data );
}
/**
......
......@@ -104,9 +104,9 @@ class Yoast_Dashboard_Widget implements WPSEO_WordPress_Integration {
return;
}
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'dashboard-widget', 'wpseoDashboardWidgetL10n', $this->localize_dashboard_script() );
$this->asset_manager->localize_script( 'dashboard-widget', 'wpseoDashboardWidgetL10n', $this->localize_dashboard_script() );
$yoast_components_l10n = new WPSEO_Admin_Asset_Yoast_Components_L10n();
$yoast_components_l10n->localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'dashboard-widget' );
$yoast_components_l10n->localize_script( 'dashboard-widget' );
$this->asset_manager->enqueue_script( 'dashboard-widget' );
$this->asset_manager->enqueue_style( 'wp-dashboard' );
}
......
......@@ -197,8 +197,8 @@ class Yoast_Network_Admin implements WPSEO_WordPress_Integration, WPSEO_WordPres
/* translators: %s: error message */
'error_prefix' => __( 'Error: %s', 'wordpress-seo' ),
];
wp_localize_script(
WPSEO_Admin_Asset_Manager::PREFIX . 'network-admin-script',
$asset_manager->localize_script(
'network-admin-script',
'wpseoNetworkAdminGlobalL10n',
$translations
);
......
......@@ -361,7 +361,7 @@ class Yoast_Notification_Center {
public function display_notifications( $echo_as_json = false ) {
// Never display notifications for network admin.
if ( function_exists( 'is_network_admin' ) && is_network_admin() ) {
if ( is_network_admin() ) {
return;
}
......@@ -661,8 +661,9 @@ class Yoast_Notification_Center {
private static function get_user_input( $key ) {
$filter_input_type = INPUT_GET;
$request_method = isset( $_SERVER['REQUEST_METHOD'] ) ? filter_var( wp_unslash( $_SERVER['REQUEST_METHOD'] ) ) : '';
if ( isset( $_SERVER['REQUEST_METHOD'] ) && strtoupper( wp_unslash( $_SERVER['REQUEST_METHOD'] ) ) === 'POST' ) {
if ( strtoupper( $request_method ) === 'POST' ) {
$filter_input_type = INPUT_POST;
}
......
......@@ -90,10 +90,10 @@ class WPSEO_Configuration_Page {
$config = $this->get_config();
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'configuration-wizard', 'yoastWizardConfig', $config );
$asset_manager->localize_script( 'configuration-wizard', 'yoastWizardConfig', $config );
$yoast_components_l10n = new WPSEO_Admin_Asset_Yoast_Components_L10n();
$yoast_components_l10n->localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'configuration-wizard' );
$yoast_components_l10n->localize_script( 'configuration-wizard' );
}
/**
......
......@@ -69,7 +69,7 @@ class WPSEO_Configuration_Service {
$this->set_components( new WPSEO_Configuration_Components() );
$this->set_endpoint( new WPSEO_Configuration_Endpoint() );
$this->set_structure( new WPSEO_Configuration_Structure() );
$this->set_translations( new WPSEO_Configuration_Translations( WPSEO_Language_Utils::get_user_locale() ) );
$this->set_translations( new WPSEO_Configuration_Translations( \get_user_locale() ) );
}
/**
......@@ -132,7 +132,7 @@ class WPSEO_Configuration_Service {
*/
protected function populate_configuration() {
// Switch to the user locale with fallback to the site locale.
switch_to_locale( WPSEO_Language_Utils::get_user_locale() );
switch_to_locale( \get_user_locale() );
// Make sure we have our translations available.
wpseo_load_textdomain();
......@@ -146,9 +146,7 @@ class WPSEO_Configuration_Service {
$this->components->set_storage( $this->storage );
// @todo: check if this is really needed, since the switch happens only in the API.
if ( function_exists( 'restore_current_locale' ) ) {
restore_current_locale();
}
restore_current_locale();
}
/**
......
......@@ -84,8 +84,8 @@ abstract class WPSEO_Abstract_Post_Filter implements WPSEO_WordPress_Integration
$asset_manager = new WPSEO_Admin_Asset_Manager();
$asset_manager->enqueue_script( 'filter-explanation' );
$asset_manager->enqueue_style( 'filter-explanation' );
wp_localize_script(
WPSEO_Admin_Asset_Manager::PREFIX . 'filter-explanation',
$asset_manager->localize_script(
'filter-explanation',
'yoastFilterExplanation',
[ 'text' => $this->get_explanation() ]
);
......
......@@ -65,7 +65,7 @@ class WPSEO_Metabox_Formatter {
'keywordTab' => __( 'Keyphrase:', 'wordpress-seo' ),
'removeKeyword' => __( 'Remove keyphrase', 'wordpress-seo' ),
'contentLocale' => get_locale(),
'userLocale' => WPSEO_Language_Utils::get_user_locale(),
'userLocale' => \get_user_locale(),
'translations' => $this->get_translations(),
'keyword_usage' => [],
'title_template' => '',
......@@ -184,7 +184,7 @@ class WPSEO_Metabox_Formatter {
private function get_content_analysis_component_translations() {
// Esc_html is not needed because React already handles HTML in the (translations of) these strings.
return [
'locale' => WPSEO_Language_Utils::get_user_locale(),
'locale' => \get_user_locale(),
'content-analysis.errors' => __( 'Errors', 'wordpress-seo' ),
'content-analysis.problems' => __( 'Problems', 'wordpress-seo' ),
'content-analysis.improvements' => __( 'Improvements', 'wordpress-seo' ),
......@@ -203,7 +203,7 @@ class WPSEO_Metabox_Formatter {
* @return array
*/
private function get_translations() {
$locale = WPSEO_Language_Utils::get_user_locale();
$locale = \get_user_locale();
$file = plugin_dir_path( WPSEO_FILE ) . 'languages/wordpress-seo-' . $locale . '.json';
if ( file_exists( $file ) ) {
......
......@@ -5,6 +5,9 @@
* @package WPSEO\Admin
*/
use Yoast\WP\SEO\Conditionals\Admin\Post_Conditional;
use Yoast\WP\SEO\Conditionals\Admin\Estimated_Reading_Time_Conditional;
use Yoast\WP\SEO\Helpers\Input_Helper;
use Yoast\WP\SEO\Presenters\Admin\Alert_Presenter;
use Yoast\WP\SEO\Presenters\Admin\Meta_Fields_Presenter;
......@@ -55,6 +58,13 @@ class WPSEO_Metabox extends WPSEO_Meta {
*/
protected $is_advanced_metadata_enabled;
/**
* Represents the estimated_reading_time_conditional.
*
* @var Estimated_Reading_Time_Conditional
*/
protected $estimated_reading_time_conditional;
/**
* Class constructor.
*/
......@@ -77,6 +87,11 @@ class WPSEO_Metabox extends WPSEO_Meta {
$this->social_is_enabled = WPSEO_Options::get( 'opengraph', false ) || WPSEO_Options::get( 'twitter', false );
$this->is_advanced_metadata_enabled = WPSEO_Capability_Utils::current_user_can( 'wpseo_edit_advanced_metadata' ) || WPSEO_Options::get( 'disableadvanced_meta' ) === false;
$this->estimated_reading_time_conditional = new Estimated_Reading_Time_Conditional(
new Post_Conditional(),
new Input_Helper()
);
$this->seo_analysis = new WPSEO_Metabox_Analysis_SEO();
$this->readability_analysis = new WPSEO_Metabox_Analysis_Readability();
}
......@@ -143,6 +158,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
'</a>'
);
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output escaped above.
echo new Alert_Presenter( $content );
}
......@@ -326,15 +342,19 @@ class WPSEO_Metabox extends WPSEO_Meta {
protected function render_hidden_fields() {
wp_nonce_field( 'yoast_free_metabox', 'yoast_free_metabox_nonce' );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output escaped in class.
echo new Meta_Fields_Presenter( $this->get_metabox_post(), 'general' );
if ( $this->is_advanced_metadata_enabled ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output escaped in class.
echo new Meta_Fields_Presenter( $this->get_metabox_post(), 'advanced' );
}
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output escaped in class.
echo new Meta_Fields_Presenter( $this->get_metabox_post(), 'schema', $this->get_metabox_post()->post_type );
if ( $this->social_is_enabled ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output escaped in class.
echo new Meta_Fields_Presenter( $this->get_metabox_post(), 'social' );
}
......@@ -343,6 +363,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
*
* @api string $post_content The metabox content string.
*/
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output should be escaped in the filter.
echo apply_filters( 'wpseo_content_meta_section_content', '' );
}
......@@ -742,6 +763,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
}
else {
if ( isset( $_POST[ $field_name ] ) ) {
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- We're preparing to do just that.
$data = wp_unslash( $_POST[ $field_name ] );
// For multi-select.
......@@ -813,7 +835,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
$post_id = get_queried_object_id();
if ( empty( $post_id ) && isset( $_GET['post'] ) ) {
$post_id = sanitize_text_field( $_GET['post'] );
$post_id = sanitize_text_field( filter_input( INPUT_GET, 'post' ) );
}
if ( $post_id !== 0 ) {
......@@ -835,7 +857,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
$asset_manager->enqueue_style( 'admin-css' );
$yoast_components_l10n = new WPSEO_Admin_Asset_Yoast_Components_L10n();
$yoast_components_l10n->localize_script( WPSEO_Admin_Asset_Manager::PREFIX . $post_edit_handle );
$yoast_components_l10n->localize_script( $post_edit_handle );
/**
* Removes the emoji script as it is incompatible with both React and any
......@@ -843,43 +865,46 @@ class WPSEO_Metabox extends WPSEO_Meta {
*/
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . $post_edit_handle, 'wpseoAdminL10n', WPSEO_Utils::get_admin_l10n() );
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . $post_edit_handle, 'wpseoFeaturesL10n', WPSEO_Utils::retrieve_enabled_features() );
$asset_manager->localize_script( $post_edit_handle, 'wpseoAdminL10n', WPSEO_Utils::get_admin_l10n() );
$asset_manager->localize_script( $post_edit_handle, 'wpseoFeaturesL10n', WPSEO_Utils::retrieve_enabled_features() );
$analysis_worker_location = new WPSEO_Admin_Asset_Analysis_Worker_Location( $asset_manager->flatten_version( WPSEO_VERSION ) );
$used_keywords_assessment_location = new WPSEO_Admin_Asset_Analysis_Worker_Location( $asset_manager->flatten_version( WPSEO_VERSION ), 'used-keywords-assessment' );
$script_data = [
'analysis' => [
'plugins' => [
'replaceVars' => [
'no_parent_text' => __( '(no parent)', 'wordpress-seo' ),
'replace_vars' => $this->get_replace_vars(),
'recommended_replace_vars' => $this->get_recommended_replace_vars(),
'scope' => $this->determine_scope(),
'has_taxonomies' => $this->current_post_type_has_taxonomies(),
],
'shortcodes' => [
'wpseo_filter_shortcodes_nonce' => wp_create_nonce( 'wpseo-filter-shortcodes' ),
'wpseo_shortcode_tags' => $this->get_valid_shortcode_tags(),
],
],
'worker' => [
'url' => $analysis_worker_location->get_url( $analysis_worker_location->get_asset(), WPSEO_Admin_Asset::TYPE_JS ),
'keywords_assessment_url' => $used_keywords_assessment_location->get_url( $used_keywords_assessment_location->get_asset(), WPSEO_Admin_Asset::TYPE_JS ),
'log_level' => WPSEO_Utils::get_analysis_worker_log_level(),
// We need to make the feature flags separately available inside of the analysis web worker.
'enabled_features' => WPSEO_Utils::retrieve_enabled_features(),
],
$plugins_script_data = [
'replaceVars' => [
'no_parent_text' => __( '(no parent)', 'wordpress-seo' ),
'replace_vars' => $this->get_replace_vars(),
'recommended_replace_vars' => $this->get_recommended_replace_vars(),
'scope' => $this->determine_scope(),
'has_taxonomies' => $this->current_post_type_has_taxonomies(),
],
'media' => [
// @todo replace this translation with JavaScript translations.
'choose_image' => __( 'Use Image', 'wordpress-seo' ),
'shortcodes' => [
'wpseo_filter_shortcodes_nonce' => wp_create_nonce( 'wpseo-filter-shortcodes' ),
'wpseo_shortcode_tags' => $this->get_valid_shortcode_tags(),
],
];
$worker_script_data = [
'url' => $analysis_worker_location->get_url( $analysis_worker_location->get_asset(), WPSEO_Admin_Asset::TYPE_JS ),
'keywords_assessment_url' => $used_keywords_assessment_location->get_url( $used_keywords_assessment_location->get_asset(), WPSEO_Admin_Asset::TYPE_JS ),
'log_level' => WPSEO_Utils::get_analysis_worker_log_level(),
// We need to make the feature flags separately available inside of the analysis web worker.
'enabled_features' => WPSEO_Utils::retrieve_enabled_features(),
];
$script_data = [
// @todo replace this translation with JavaScript translations.
'media' => [ 'choose_image' => __( 'Use Image', 'wordpress-seo' ) ],
'metabox' => $this->get_metabox_script_data(),
'userLanguageCode' => WPSEO_Language_Utils::get_language( WPSEO_Language_Utils::get_user_locale() ),
'userLanguageCode' => WPSEO_Language_Utils::get_language( \get_user_locale() ),
'isPost' => true,
'isBlockEditor' => $is_block_editor,
'analysis' => [
'plugins' => $plugins_script_data,
'worker' => $worker_script_data,
'estimatedReadingTimeEnabled' => $this->estimated_reading_time_conditional->is_met(),
],
];
if ( post_type_supports( get_post_type(), 'thumbnail' ) ) {
......@@ -891,7 +916,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
];
}
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . $post_edit_handle, 'wpseoScriptData', $script_data );
$asset_manager->localize_script( $post_edit_handle, 'wpseoScriptData', $script_data );
}
/**
......
......@@ -11,13 +11,6 @@ if ( ! defined( 'WPSEO_VERSION' ) ) {
exit();
}
if ( filter_input( INPUT_GET, 'intro' ) ) {
update_user_meta( get_current_user_id(), 'wpseo_seen_about_version', WPSEO_VERSION );
require WPSEO_PATH . 'admin/views/about.php';
return;
}
if ( isset( $_GET['allow_tracking'] ) && check_admin_referer( 'wpseo_activate_tracking', 'nonce' ) ) {
WPSEO_Options::set( 'yoast_tracking', ( $_GET['allow_tracking'] === 'yes' ) );
......
......@@ -47,7 +47,7 @@ class WPSEO_Statistics_Service {
*/
public function get_statistics() {
// Switch to the user locale with fallback to the site locale.
switch_to_locale( WPSEO_Language_Utils::get_user_locale() );
switch_to_locale( \get_user_locale() );
$this->labels = $this->labels();
$statistics = $this->statistic_items();
......
......@@ -105,6 +105,7 @@ class WPSEO_Taxonomy {
'<a href="https://www.microsoft.com/windows/microsoft-edge">',
'</a>'
);
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output escaped above.
echo new Alert_Presenter( $content );
echo '</div></div>';
......@@ -139,7 +140,7 @@ class WPSEO_Taxonomy {
$asset_manager->enqueue_script( 'term-edit' );
$yoast_components_l10n = new WPSEO_Admin_Asset_Yoast_Components_L10n();
$yoast_components_l10n->localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'term-edit' );
$yoast_components_l10n->localize_script( 'term-edit' );
$analysis_worker_location = new WPSEO_Admin_Asset_Analysis_Worker_Location( $asset_manager->flatten_version( WPSEO_VERSION ) );
$used_keywords_assessment_location = new WPSEO_Admin_Asset_Analysis_Worker_Location( $asset_manager->flatten_version( WPSEO_VERSION ), 'used-keywords-assessment' );
......@@ -150,8 +151,8 @@ class WPSEO_Taxonomy {
*/
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'term-edit', 'wpseoAdminL10n', WPSEO_Utils::get_admin_l10n() );
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'term-edit', 'wpseoFeaturesL10n', WPSEO_Utils::retrieve_enabled_features() );
$asset_manager->localize_script( 'term-edit', 'wpseoAdminL10n', WPSEO_Utils::get_admin_l10n() );
$asset_manager->localize_script( 'term-edit', 'wpseoFeaturesL10n', WPSEO_Utils::retrieve_enabled_features() );
$script_data = [
'analysis' => [
......@@ -180,10 +181,10 @@ class WPSEO_Taxonomy {
'choose_image' => __( 'Use Image', 'wordpress-seo' ),
],
'metabox' => $this->localize_term_scraper_script(),
'userLanguageCode' => WPSEO_Language_Utils::get_language( WPSEO_Language_Utils::get_user_locale() ),
'userLanguageCode' => WPSEO_Language_Utils::get_language( \get_user_locale() ),
'isTerm' => true,
];
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'term-edit', 'wpseoScriptData', $script_data );
$asset_manager->localize_script( 'term-edit', 'wpseoScriptData', $script_data );
}
if ( self::is_term_overview( $pagenow ) ) {
......
......@@ -30,7 +30,7 @@ class WPSEO_Tracking_Server_Data implements WPSEO_Collection {
$server_data = [];
// Validate if the server address is a valid IP-address.
$ipaddress = filter_input( INPUT_SERVER, 'SERVER_ADDR', FILTER_VALIDATE_IP );
$ipaddress = isset( $_SERVER['SERVER_ADDR'] ) ? filter_var( wp_unslash( $_SERVER['SERVER_ADDR'] ), FILTER_VALIDATE_IP ) : '';
if ( $ipaddress ) {
$server_data['ip'] = $ipaddress;
$server_data['Hostname'] = gethostbyaddr( $ipaddress );
......
This diff is collapsed.
.yoast-labeled-inserter{position:relative;width:100%}.yoast-labeled-inserter:before{content:attr(data-label);position:absolute;right:0;height:100%;color:#000}.yoast-labeled-inserter>.block-editor-inserter{width:100%}
\ No newline at end of file
.yoast-labeled-inserter{position:relative;width:100%}.yoast-labeled-inserter:before{content:attr(data-label);position:absolute;left:0;height:100%;color:#000}.yoast-labeled-inserter>.block-editor-inserter{width:100%}
\ No newline at end of file
.yoast-labeled-inserter{position:relative;width:100%}.yoast-labeled-inserter:before{content:attr(data-label);position:absolute;right:0;height:100%;color:#000}.yoast-labeled-inserter>.block-editor-inserter{width:100%}.yoast-warning-block{border-width:0 4px 0 0;border-style:solid;padding:16px;font-size:13px;font-family:Arial,Roboto-Regular,HelveticaNeue,sans-serif}.yoast-warning-block.required{background:#f8ebea;border-color:#cd423b}.yoast-warning-block.recommended{background:#fef8ee;border-color:#f0b650}.yoast-warning-block>.yoast-warning-block-message{margin:0;font-family:Arial,Roboto-Regular,HelveticaNeue,sans-serif}.yoast-warning-block>div{text-align:left;padding-top:8px}.yoast-warning-block>div>button{background:none;border:none;text-decoration:underline;color:#0073aa}.yoast-warning-block>div>button:not(:last-child){margin-left:24px}
\ No newline at end of file
.yoast-labeled-inserter{position:relative;width:100%}.yoast-labeled-inserter:before{content:attr(data-label);position:absolute;left:0;height:100%;color:#000}.yoast-labeled-inserter>.block-editor-inserter{width:100%}.yoast-warning-block{border-width:0 0 0 4px;border-style:solid;padding:16px;font-size:13px;font-family:Arial,Roboto-Regular,HelveticaNeue,sans-serif}.yoast-warning-block.required{background:#f8ebea;border-color:#cd423b}.yoast-warning-block.recommended{background:#fef8ee;border-color:#f0b650}.yoast-warning-block>.yoast-warning-block-message{margin:0;font-family:Arial,Roboto-Regular,HelveticaNeue,sans-serif}.yoast-warning-block>div{text-align:right;padding-top:8px}.yoast-warning-block>div>button{background:none;border:none;text-decoration:underline;color:#0073aa}.yoast-warning-block>div>button:not(:last-child){margin-right:24px}
\ No newline at end of file
......@@ -364,6 +364,14 @@
padding: 16px;
}
@media (min-width: 782px) {
.yoast-modal-content--columns {
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 24px;
}
}
.yoast-post-settings-modal__button-container {
padding: 16px;
display: flex;
......
.yoast-labeled-inserter {
position: relative;
width: 100%;
}
.yoast-labeled-inserter::before {
content: attr(data-label);
position: absolute;
left: 0;
height: 100%;
color: black;
}
.yoast-labeled-inserter > .block-editor-inserter {
width: 100%;
}
@import '@yoast/schema-blocks/css/schema-blocks.css';
......@@ -76,6 +76,14 @@ class WPSEO_Admin_Bar_Menu implements WPSEO_WordPress_Integration {
*/
public function add_menu( WP_Admin_Bar $wp_admin_bar ) {
// On block editor pages, the admin bar only shows on mobile, where having this menu icon is not very helpful.
if ( is_admin() ) {
$screen = get_current_screen();
if ( isset( $screen ) && $screen->is_block_editor() ) {
return;
}
}
// If the current user can't write posts, this is all of no use, so let's not output an admin menu.
if ( ! current_user_can( 'edit_posts' ) ) {
return;
......
......@@ -211,6 +211,26 @@ class WPSEO_Replace_Vars {
return $string;
}
/**
* Register a new replacement variable if it has not been registered already.
*
* @param string $var The name of the variable to replace, i.e. '%%var%%'.
* Note: the surrounding %% are optional.
* @param mixed $replace_function Function or method to call to retrieve the replacement value for the variable.
* Uses the same format as add_filter/add_action function parameter and
* should *return* the replacement value. DON'T echo it.
* @param string $type Type of variable: 'basic' or 'advanced', defaults to 'advanced'.
* @param string $help_text Help text to be added to the help tab for this variable.
*
* @return bool `true` if the replace var has been registered, `false` if not.
*/
public function safe_register_replacement( $var, $replace_function, $type = 'advanced', $help_text = '' ) {
if ( ! $this->has_been_registered( $var ) ) {
return self::register_replacement( $var, $replace_function, $type, $help_text );
}
return false;
}
/**
* Checks whether the given replacement variable has already been registered or not.
*
......
......@@ -44,14 +44,14 @@ 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.
*
* @deprecated 15.6
* @codeCoverageIgnore
*
* @return string The locale.
*/
public static function get_user_locale() {
if ( function_exists( 'get_user_locale' ) ) {
return get_user_locale();
}
return get_locale();
_deprecated_function( __METHOD__, 'WPSEO 15.5', 'get_user_locale' );
return get_user_locale();
}
/**
......
......@@ -94,6 +94,8 @@ class WPSEO_Option_MS extends WPSEO_Option {
"{$allow_prefix}enable_xml_sitemap" => true,
"{$allow_prefix}enable_text_link_counter" => true,
"{$allow_prefix}enable_headless_rest_endpoints" => true,
"{$allow_prefix}enable_metabox_insights" => true,
"{$allow_prefix}enable_link_suggestions" => true,
"{$allow_prefix}tracking" => true,
"{$allow_prefix}enable_enhanced_slack_sharing" => true,
"{$allow_prefix}semrush_integration_active" => true,
......
......@@ -400,6 +400,8 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
'enable_cornerstone_content' => false,
'enable_xml_sitemap' => false,
'enable_text_link_counter' => false,
'enable_metabox_insights' => false,
'enable_link_suggestions' => false,
'enable_headless_rest_endpoints' => false,
'tracking' => false,
'enable_enhanced_slack_sharing' => false,
......
......@@ -193,16 +193,19 @@ class WPSEO_Taxonomy_Sitemap_Provider implements WPSEO_Sitemap_Provider {
$hide_empty = apply_filters( 'wpseo_sitemap_exclude_empty_terms', true, [ $taxonomy->name ] );
/** This filter is documented in inc/sitemaps/class-taxonomy-sitemap-provider.php */
$hide_empty_tax = apply_filters( 'wpseo_sitemap_exclude_empty_terms_taxonomy', $hide_empty, $taxonomy->name );
$terms = get_terms( $taxonomy->name, [ 'hide_empty' => $hide_empty_tax ] );
// If the total term count is lower than the offset, we are on an invalid page.
if ( count( $terms ) < $offset ) {
throw new OutOfBoundsException( 'Invalid sitemap page requested' );
}
$terms = array_splice( $terms, $offset, $steps );
$terms = get_terms(
[
'taxonomy' => $taxonomy->name,
'hide_empty' => $hide_empty_tax,
'update_term_meta_cache' => false,
'offset' => $offset,
'number' => $steps,
]
);
// If there are no terms fetched for this range, we are on an invalid page.
if ( empty( $terms ) ) {
return $links;
throw new OutOfBoundsException( 'Invalid sitemap page requested' );
}
$post_statuses = array_map( 'esc_sql', WPSEO_Sitemaps::get_post_statuses() );
......
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[1],{353:function(o,t,a){"use strict";!function(o){function t(o,t,a){jQuery.post(ajaxurl,{action:"wpseo_set_ignore",option:o,_wpnonce:a},function(a){a&&(jQuery("#"+t).hide(),jQuery("#hidden_ignore_"+o).val("ignore"))})}function a(){o("#wp-admin-bar-root-default > li").off("mouseenter.yoastalertpopup mouseleave.yoastalertpopup"),o(".yoast-issue-added").fadeOut(200)}function s(t,a){if(o(".yoast-notification-holder").off("click",".restore").off("click",".dismiss"),void 0!==a.html){a.html&&(t.closest(".yoast-container").html(a.html),n());var s=o("#wp-admin-bar-wpseo-menu"),e=s.find(".yoast-issue-counter");e.length||(s.find("> a:first-child").append('<div class="yoast-issue-counter"/>'),e=s.find(".yoast-issue-counter")),e.html(a.total),0===a.total?e.hide():e.show(),o("#toplevel_page_wpseo_dashboard .update-plugins").removeClass().addClass("update-plugins count-"+a.total),o("#toplevel_page_wpseo_dashboard .plugin-count").html(a.total)}}function n(){var t=o(".yoast-notification-holder");t.on("click",".dismiss",function(){var t=o(this),a=t.closest(".yoast-notification-holder");t.closest(".yoast-container").append('<div class="yoast-container-disabled"/>'),o.post(ajaxurl,{action:"yoast_dismiss_notification",notification:a.attr("id"),nonce:a.data("nonce"),data:t.data("json")||a.data("json")},s.bind(this,a),"json")}),t.on("click",".restore",function(){var t=o(this),a=t.closest(".yoast-notification-holder");t.closest(".yoast-container").append('<div class="yoast-container-disabled"/>'),o.post(ajaxurl,{action:"yoast_restore_notification",notification:a.attr("id"),nonce:a.data("nonce"),data:a.data("json")},s.bind(this,a),"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 i(){window.wpseoScrollableTables=o(".yoast-table-scrollable"),window.wpseoScrollableTables.length&&window.wpseoScrollableTables.each(function(){var t=o(this);if(!t.data("scrollContainer")){var a=o("<div />",{class:"yoast-table-scrollable__hintwrapper",html:"<span class='yoast-table-scrollable__hint' aria-hidden='true' />"}).insertBefore(t),s=o("<div />",{class:"yoast-table-scrollable__container",html:"<div class='yoast-table-scrollable__inner' />"}).insertBefore(t);a.find(".yoast-table-scrollable__hint").text(wpseoAdminGlobalL10n.scrollable_table_hint),t.data("scrollContainer",s),t.data("scrollHint",a),t.appendTo(s.find(".yoast-table-scrollable__inner")),e(t)}})}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),t=jQuery("#"+o.attr("aria-controls")),a=t.is(":visible");jQuery(t).slideToggle(200,function(){o.attr("aria-expanded",!a)})}),jQuery("#robotsmessage button").on("click",function(){t("search_engines_discouraged_notice","robotsmessage",jQuery(this).data("nonce"))})}),window.wpseoSetIgnore=t,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(t){t.each(function(){e(o(this))})}(window.wpseoScrollableTables)}),o(window).on({"Yoast:YoastTabsMounted":function(){setTimeout(function(){i()},100)},"Yoast:YoastTabsSelected":function(){setTimeout(function(){i()},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),n(),function(){var o=jQuery(".wpseo-js-premium-indicator"),t=o.find("svg");if(o.hasClass("wpseo-premium-indicator--no")){var a=t.find("path"),s=o.css("backgroundColor");a.css("fill",s)}t.css("display","block"),o.css({backgroundColor:"transparent",width:"20px",height:"20px"})}(),i()})}(jQuery)}},[[353,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[1],{359:function(o,t,a){"use strict";!function(o){function t(o,t,a){jQuery.post(ajaxurl,{action:"wpseo_set_ignore",option:o,_wpnonce:a},function(a){a&&(jQuery("#"+t).hide(),jQuery("#hidden_ignore_"+o).val("ignore"))})}function a(){o("#wp-admin-bar-root-default > li").off("mouseenter.yoastalertpopup mouseleave.yoastalertpopup"),o(".yoast-issue-added").fadeOut(200)}function s(t,a){if(o(".yoast-notification-holder").off("click",".restore").off("click",".dismiss"),void 0!==a.html){a.html&&(t.closest(".yoast-container").html(a.html),n());var s=o("#wp-admin-bar-wpseo-menu"),e=s.find(".yoast-issue-counter");e.length||(s.find("> a:first-child").append('<div class="yoast-issue-counter"/>'),e=s.find(".yoast-issue-counter")),e.html(a.total),0===a.total?e.hide():e.show(),o("#toplevel_page_wpseo_dashboard .update-plugins").removeClass().addClass("update-plugins count-"+a.total),o("#toplevel_page_wpseo_dashboard .plugin-count").html(a.total)}}function n(){var t=o(".yoast-notification-holder");t.on("click",".dismiss",function(){var t=o(this),a=t.closest(".yoast-notification-holder");t.closest(".yoast-container").append('<div class="yoast-container-disabled"/>'),o.post(ajaxurl,{action:"yoast_dismiss_notification",notification:a.attr("id"),nonce:a.data("nonce"),data:t.data("json")||a.data("json")},s.bind(this,a),"json")}),t.on("click",".restore",function(){var t=o(this),a=t.closest(".yoast-notification-holder");t.closest(".yoast-container").append('<div class="yoast-container-disabled"/>'),o.post(ajaxurl,{action:"yoast_restore_notification",notification:a.attr("id"),nonce:a.data("nonce"),data:a.data("json")},s.bind(this,a),"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 i(){window.wpseoScrollableTables=o(".yoast-table-scrollable"),window.wpseoScrollableTables.length&&window.wpseoScrollableTables.each(function(){var t=o(this);if(!t.data("scrollContainer")){var a=o("<div />",{class:"yoast-table-scrollable__hintwrapper",html:"<span class='yoast-table-scrollable__hint' aria-hidden='true' />"}).insertBefore(t),s=o("<div />",{class:"yoast-table-scrollable__container",html:"<div class='yoast-table-scrollable__inner' />"}).insertBefore(t);a.find(".yoast-table-scrollable__hint").text(wpseoAdminGlobalL10n.scrollable_table_hint),t.data("scrollContainer",s),t.data("scrollHint",a),t.appendTo(s.find(".yoast-table-scrollable__inner")),e(t)}})}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),t=jQuery("#"+o.attr("aria-controls")),a=t.is(":visible");jQuery(t).slideToggle(200,function(){o.attr("aria-expanded",!a)})}),jQuery("#robotsmessage button").on("click",function(){t("search_engines_discouraged_notice","robotsmessage",jQuery(this).data("nonce"))})}),window.wpseoSetIgnore=t,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(t){t.each(function(){e(o(this))})}(window.wpseoScrollableTables)}),o(window).on({"Yoast:YoastTabsMounted":function(){setTimeout(function(){i()},100)},"Yoast:YoastTabsSelected":function(){setTimeout(function(){i()},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),n(),function(){var o=jQuery(".wpseo-js-premium-indicator"),t=o.find("svg");if(o.hasClass("wpseo-premium-indicator--no")){var a=t.find("path"),s=o.css("backgroundColor");a.css("fill",s)}t.css("display","block"),o.css({backgroundColor:"transparent",width:"20px",height:"20px"})}(),i()})}(jQuery)}},[[359,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[2],{354: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)}},[[354,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[2],{360: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)}},[[360,0]]]);
\ No newline at end of file
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([[4],{378: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()})})}()}},[[378,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[4],{383: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()})})}()}},[[383,0]]]);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
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.
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.
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