Commit cf45548c authored by Simon's avatar Simon

Packages update

parent 394836f2
......@@ -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.2.2
Version: 4.2.3
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.2.2' );
define( 'AKISMET_VERSION', '4.2.3' );
define( 'AKISMET__MINIMUM_WP_VERSION', '5.0' );
define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'AKISMET_DELETE_LIMIT', 10000 );
......
......@@ -434,7 +434,7 @@ class Akismet_Admin {
if ( ! wp_verify_nonce( $_POST['nonce'], 'akismet_check_for_spam' ) ) {
wp_send_json( array(
'error' => __( "You don't have permission to do that."),
'error' => __( 'You don&#8217;t have permission to do that.', 'akismet' ),
));
return;
}
......
......@@ -68,6 +68,10 @@ class Akismet {
add_filter( 'frm_filter_final_form', array( 'Akismet', 'inject_custom_form_fields' ) );
add_filter( 'frm_akismet_values', array( 'Akismet', 'prepare_custom_form_values' ) );
// Fluent Forms
add_filter( 'fluentform_form_element_start', array( 'Akismet', 'output_custom_form_fields' ) );
add_filter( 'fluentform_akismet_fields', array( 'Akismet', 'prepare_custom_form_values' ), 10, 2 );
add_action( 'update_option_wordpress_api_key', array( 'Akismet', 'updated_option' ), 10, 2 );
add_action( 'add_option_wordpress_api_key', array( 'Akismet', 'added_option' ), 10, 2 );
......@@ -1399,9 +1403,16 @@ class Akismet {
* Ensure that any Akismet-added form fields are included in the comment-check call.
*
* @param array $form
* @param array $data Some plugins will supply the POST data via the filter, since they don't
* read it directly from $_POST.
* @return array $form
*/
public static function prepare_custom_form_values( $form ) {
public static function prepare_custom_form_values( $form, $data = null ) {
if ( is_null( $data ) ) {
// phpcs:ignore WordPress.Security.NonceVerification.Missing
$data = $_POST;
}
$prefix = 'ak_';
// Contact Form 7 uses _wpcf7 as a prefix to know which fields to exclude from comment_content.
......@@ -1409,8 +1420,7 @@ class Akismet {
$prefix = '_wpcf7_ak_';
}
// phpcs:ignore WordPress.Security.NonceVerification.Missing
foreach ( $_POST as $key => $val ) {
foreach ( $data as $key => $val ) {
if ( 0 === strpos( $key, $prefix ) ) {
$form[ 'POST_ak_' . substr( $key, strlen( $prefix ) ) ] = $val;
}
......
......@@ -3,7 +3,7 @@ Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eo
Tags: comments, spam, antispam, anti-spam, contact form, anti spam, comment moderation, comment spam, contact form spam, spam comments
Requires at least: 5.0
Tested up to: 5.9
Stable tag: 4.2.2
Stable tag: 4.2.3
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,13 +30,21 @@ Upload the Akismet plugin to your blog, activate it, and then enter your Akismet
== Changelog ==
= 4.2.3 =
*Release Date - 25 April 2022*
* Improved compatibility with Fluent Forms
* Fixed missing translation domains
* Updated stats URL.
* Improved accessibility of elements on the config page.
= 4.2.2 =
*Release Date - 24 January 2022*
* Improved compatibility with Formidable Forms
* Fixed a bug that could cause issues when multiple contact forms appear on one page.
* Updated delete_comment and deleted_comment actions to pass two arguments to match WordPress core since 4.9.0.
* Add a filter that allows comment types to be excluded when counting users' approved comments.
* Added a filter that allows comment types to be excluded when counting users' approved comments.
= 4.2.1 =
*Release Date - 1 October 2021*
......@@ -93,6 +101,6 @@ Upload the Akismet plugin to your blog, activate it, and then enter your Akismet
*Release Date - 4 June 2020*
* Disable "Check for Spam" button until the page is loaded to avoid errors with clicking through to queue recheck endpoint directly.
* Add filter "akismet_enable_mshots" to allow disabling screenshot popups on the edit comments admin page.
* Added filter "akismet_enable_mshots" to allow disabling screenshot popups on the edit comments admin page.
For older changelog entries, please see the [additional changelog.txt file](https://plugins.svn.wordpress.org/akismet/trunk/changelog.txt) delivered with the plugin.
......@@ -35,7 +35,7 @@
</div>
<div class="akismet-new-snapshot">
<iframe allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 220px; overflow: hidden;" src="<?php printf( '//akismet.com/web/1.0/snapshot.php?blog=%s&api_key=%s&height=200&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() );?>"></iframe>
<iframe allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 220px; overflow: hidden;" src="<?php echo esc_url( sprintf( 'https://tools.akismet.com/1.0/snapshot.php?blog=%s&api_key=%s&height=200&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() ) ); ?>"></iframe>
<ul>
<li>
<h3><?php esc_html_e( 'Past six months' , 'akismet');?></h3>
......@@ -73,7 +73,9 @@
<tbody>
<?php if ( ! Akismet::predefined_api_key() ) { ?>
<tr>
<th class="akismet-api-key" width="10%" align="left" scope="row"><?php esc_html_e('API Key', 'akismet');?></th>
<th class="akismet-api-key" width="10%" align="left" scope="row">
<label for="key"><?php esc_html_e( 'API Key', 'akismet' ); ?></label>
</th>
<td width="5%"/>
<td align="left">
<span class="api-key"><input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( get_option('wordpress_api_key') ); ?>" class="<?php echo esc_attr( 'regular-text code ' . $akismet_user->status ); ?>"></span>
......
......@@ -62,8 +62,8 @@
<?php Akismet::view( 'setup' );?>
</div>
<div class="centered akismet-toggles">
<a href="#" class="toggle-jp-connect"><?php esc_html_e( 'Connect with Jetpack' ); ?></a>
<a href="#" class="toggle-ak-connect"><?php esc_html_e( 'Set up a different account' ); ?></a>
<a href="#" class="toggle-jp-connect"><?php esc_html_e( 'Connect with Jetpack', 'akismet' ); ?></a>
<a href="#" class="toggle-ak-connect"><?php esc_html_e( 'Set up a different account', 'akismet' ); ?></a>
</div>
</div>
<br/>
......
......@@ -2,11 +2,11 @@
//phpcs:disable VariableAnalysis
// There are "undefined" variables here because they're defined in the code that includes this file as a template.
?>
<form name="akismet_activate" action="https://akismet.com/get/" method="POST" target="_blank">
<input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
<input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
<input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>"/>
<input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'akismet-button';?>" value="<?php echo esc_attr( $text ); ?>"/>
</form>
\ No newline at end of file
<button type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? esc_attr( implode( ' ', $classes ) ) : 'akismet-button'; ?>" value="<?php echo esc_attr( $text ); ?>"><?php echo esc_attr( $text ) . '<span class="screen-reader-text">' . esc_html__( '(opens in a new tab)', 'akismet' ) . '</span>'; ?></button>
</form>
......@@ -7,5 +7,5 @@
</div>
</div>
</div>
<iframe src="<?php echo esc_url( sprintf( '//akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() ) ); ?>" width="100%" height="2500px" frameborder="0"></iframe>
<iframe src="<?php echo esc_url( sprintf( 'https://tools.akismet.com/1.0/user-stats.php?blog=%s&api_key=%s&locale=%s', urlencode( get_option( 'home' ) ), esc_attr( Akismet::get_api_key() ), esc_attr( get_locale() ) ) ); ?>" width="100%" height="2500px" frameborder="0"></iframe>
</div>
\ No newline at end of file
......@@ -5022,6 +5022,12 @@ class PodsAPI {
$type = $field_data['type'];
$options = pods_v( 'options', $field_data, [] );
$field_object = $field_data;
if ( $field_data instanceof Value_Field ) {
$field_object = $field_data->get_field_object();
}
if ( in_array( $type, $layout_field_types, true ) ) {
continue;
}
......@@ -5145,8 +5151,12 @@ class PodsAPI {
}
}
$is_tableless_field = in_array( $type, $tableless_field_types, true );
$is_settings_pod = 'settings' === $pod['type'];
$save_non_simple_to_table = $is_tableless_field && ! $simple && ! $is_settings_pod && pods_relationship_table_storage_enabled_for_object_relationships( $field_object, $pod );
// Prepare all table / meta data
if ( $simple || ! in_array( $type, $tableless_field_types, true ) ) {
if ( ! $is_tableless_field || $simple || $save_non_simple_to_table ) {
if ( in_array( $type, $repeatable_field_types, true ) && 1 === (int) pods_v( $type . '_repeatable', $field_data, 0 ) ) {
// Don't save an empty array, just make it an empty string
if ( empty( $value ) ) {
......@@ -5157,12 +5167,11 @@ class PodsAPI {
}
}
$is_settings_pod = 'settings' === $pod['type'];
$save_simple_to_table = $simple && ! $is_settings_pod && pods_relationship_table_storage_enabled_for_simple_relationships( $options, $pod );
$save_simple_to_meta = $simple && ( $is_settings_pod || pods_relationship_meta_storage_enabled_for_simple_relationships( $options, $pod ) );
$save_simple_to_table = $simple && ! $is_settings_pod && pods_relationship_table_storage_enabled_for_simple_relationships( $field_object, $pod );
$save_simple_to_meta = $simple && ( $is_settings_pod || pods_relationship_meta_storage_enabled_for_simple_relationships( $field_object, $pod ) );
// Check if we should save to the table, and then check if the field is not a simple relationship OR the simple relationship field is allowed to be saved to the table.
if ( $save_to_table && ( ! $simple || $save_simple_to_table ) ) {
if ( $save_to_table && ( ! $simple || $save_simple_to_table || $save_non_simple_to_table ) ) {
$table_data[ $field ] = $value;
// Enforce JSON values for objects/arrays.
......@@ -5176,7 +5185,7 @@ class PodsAPI {
'{prefix}'
], $table_data[ $field ] );
$table_formats[] = PodsForm::prepare( $type, $options );
$table_formats[] = PodsForm::prepare( $type, $field_object );
}
// Check if the field is not a simple relationship OR the simple relationship field is allowed to be saved to meta.
......
......@@ -273,11 +273,22 @@ class PodsMigrate {
$data['items'][ $key ] = array();
foreach ( $data['columns'] as $ckey => $column ) {
$data['items'][ $key ][ $column ] = ( isset( $row[ $ckey ] ) ? $row[ $ckey ] : '' );
if ( 'NULL' === $data['items'][ $key ][ $column ] ) {
$data['items'][ $key ][ $column ] = null;
$column_value = ( isset( $row[ $ckey ] ) ? $row[ $ckey ] : '' );
if ( 'NULL' === $column_value ) {
// Maybe set the value as null.
$column_value = null;
} elseif (
0 === strpos( $column_value, '\\=' )
|| 0 === strpos( $column_value, '\\+' )
|| 0 === strpos( $column_value, '\\-' )
|| 0 === strpos( $column_value, '\\@' )
) {
// Maybe remove the first backslash.
$column_value = substr( $column_value, 1 );
}
$data['items'][ $key ][ $column ] = $column_value;
}
}
}
......@@ -623,6 +634,16 @@ class PodsMigrate {
$value = str_replace( array( '"', "\r\n", "\r", "\n" ), array( '\\"', "\n", "\n", '\n' ), $value );
// Maybe escape the first character to prevent formulas from getting used when opening the file with a spreadsheet app.
if (
0 === strpos( $value, '=' )
|| 0 === strpos( $value, '+' )
|| 0 === strpos( $value, '-' )
|| 0 === strpos( $value, '@' )
) {
$value = '\\' . $value;
}
$line .= '"' . $value . '"' . $this->delimiter;
}//end foreach
......
......@@ -504,4 +504,4 @@ class PodsAPI_CLI_Command extends WP_CLI_Command {
}
WP_CLI::add_command( 'pods-api', 'PodsAPI_CLI_Command' );
WP_CLI::add_command( 'pods-legacy-api', 'PodsAPI_CLI_Command' );
......@@ -385,4 +385,4 @@ class Pods_CLI_Command extends WP_CLI_Command {
}
WP_CLI::add_command( 'pods', 'Pods_CLI_Command' );
WP_CLI::add_command( 'pods-legacy', 'Pods_CLI_Command' );
......@@ -20,7 +20,7 @@ class PodsField_Boolean extends PodsField {
/**
* {@inheritdoc}
*/
public static $prepare = '%s';
public static $prepare = '%d';
/**
* {@inheritdoc}
......
......@@ -282,6 +282,20 @@ class PodsField_File extends PodsField {
}
/**
* {@inheritdoc}
*/
public function prepare( $options = null ) {
$format = static::$prepare;
// Maybe use number format for storage if limit is one.
if ( $options instanceof Field && 1 === $options->get_limit() ) {
$format = '%d';
}
return $format;
}
/**
* {@inheritdoc}
*/
......
......@@ -425,6 +425,20 @@ class PodsField_Pick extends PodsField {
}
/**
* {@inheritdoc}
*/
public function prepare( $options = null ) {
$format = static::$prepare;
// Maybe use number format for storage if not a simple relationship and limit is one.
if ( $options instanceof Field && ! $options->is_simple_relationship() && 1 === $options->get_limit() ) {
$format = '%d';
}
return $format;
}
/**
* Register a related object.
*
......
......@@ -552,6 +552,29 @@ function pods_relationship_table_storage_enabled_for_simple_relationships( $fiel
return (bool) apply_filters( 'pods_relationship_table_storage_enabled_for_simple_relationships', $enabled, $field, $pod );
}
/**
* Determine whether relationship table storage is enabled for object based relationships.
*
* @since 2.8.16
*
* @param null|array|Field $field The field object.
* @param null|array|Pod $pod The pod object.
*
* @return bool Whether relationship table storage is enabled.
*/
function pods_relationship_table_storage_enabled_for_object_relationships( $field = null, $pod = null ) {
/**
* Allow filtering of whether relationship table storage is enabled for object based relationships.
*
* @since 2.8.16
*
* @param bool $enabled Whether relationship table storage table is enabled for object based relationships.
* @param null|array|Field $field The field object.
* @param null|array|Pod $pod The pod object.
*/
return (bool) apply_filters( 'pods_relationship_table_storage_enabled_for_object_relationships', false, $field, $pod );
}
/**
* Determine if Light Mode is enabled
*
......
......@@ -10,7 +10,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.8.15
* Version: 2.8.16
* Author: Pods Framework Team
* Author URI: https://pods.io/about/
* Text Domain: pods
......@@ -43,7 +43,7 @@ if ( defined( 'PODS_VERSION' ) || defined( 'PODS_DIR' ) ) {
add_action( 'init', 'pods_deactivate_pods_ui' );
} else {
// Current version.
define( 'PODS_VERSION', '2.8.15' );
define( 'PODS_VERSION', '2.8.16' );
// Current database version, this is the last version the database changed.
define( 'PODS_DB_VERSION', '2.3.5' );
......
......@@ -3,9 +3,9 @@ Contributors: sc0ttkclark, zrothauser, keraweb, jimtrue, quasel, nicdford, james
Donate link: https://friends.pods.io/
Tags: pods, custom post types, custom taxonomies, content types, custom fields, block
Requires at least: 5.5
Tested up to: 5.9
Tested up to: 6.0
Requires PHP: 5.6
Stable tag: 2.8.15
Stable tag: 2.8.16
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
......@@ -156,6 +156,16 @@ Pods really wouldn't be where it is without all the contributions from our [dono
== Changelog ==
= 2.8.16 - May 6th, 2022 =
* Added: More compatiblity with Advanced Relationship Storage Add-On from Pods Pro by SKCDEV which allows for saving table-based relationship fields during the normal save process. (@sc0ttkclark)
* Fixed: Booleans when saving to the database now prepare as `%d` instead of the generic `%s`. (@sc0ttkclark)
* Fixed: Additional SV file escaping on exports to prevent formulas from evaluating in certain spreadsheet apps unexpectedly. (@sc0ttkclark)
* Fixed: The old Pods / Pods API CLI commands were unintentially removed in Pods 2.8 and they have now been brought back as `wp pods-legacy` and `wp pods-legacy-api`. (@sc0ttkclark)
* Fixed: Improved the text / link for registering connections on Post Types and Taxonomies so they reference the correct object type. (@sc0ttkclark)
* Fixed: Multi-select fields were not saving properly in certain forms. #6498 #6216 (@zrothauser)
* Confirmed compatibility with WordPress 6.0.
= 2.8.15 - April 16th, 2022 =
* Added: New `pods_callback` support in `Pods::find()` so that you can pass a callback function to use for `pods()` usage with relationships using the `output` as "pods". This allows for using shared instances across large data sets to reduce time. (@sc0ttkclark)
......
......@@ -723,13 +723,14 @@ class Pod extends Base {
];
}
$options['connections']['register_custom_post_type'] = [
'name' => 'register_custom_post_type',
'label' => __( 'Add new connections', 'pods' ),
$options['connections']['register_custom_taxonomy'] = [
'name' => 'register_custom_taxonomy',
'label' => __( 'Add new connection', 'pods' ),
'type' => 'html',
'html_content' => sprintf(
'<a href="%s">Create a new Custom Post Type</a>',
esc_url( admin_url( 'admin.php?page=pods-add-new&create_extend=create&type=post_type' ) )
'<a href="%1$s">%2$s</a>',
esc_url( admin_url( 'admin.php?page=pods-add-new&create_extend=create&type=taxonomy' ) ),
esc_html__( 'Create a new Custom Taxonomy', 'pods' )
),
];
......@@ -1134,13 +1135,14 @@ class Pod extends Base {
'type' => 'boolean_group',
'boolean_group' => [],
],
'register_custom_taxonomy' => [
'name' => 'register_custom_taxonomy',
'label' => __( 'Add new connections', 'pods' ),
'type' => 'html',
'html_content' => sprintf(
'<a href="%s">Create a new Custom Taxonomy</a>',
esc_url( admin_url( 'admin.php?page=pods-add-new&create_extend=create&type=taxonomy' ) )
'register_custom_post_type' => [
'name' => 'register_custom_post_type',
'label' => __( 'Add new connection', 'pods' ),
'type' => 'html',
'html_content' => sprintf(
'<a href="%1$s">%2$s</a>',
esc_url( admin_url( 'admin.php?page=pods-add-new&create_extend=create&type=post_type' ) ),
esc_html__( 'Create a new Custom Post Type', 'pods' )
),
],
];
......
......@@ -39,7 +39,7 @@ $donate_now_link = add_query_arg( $campaign_args, $donate_now_link );
<h2 class="pods-admin_friends-callout_headline">
<?php
printf(
esc_html__( 'We need %1$sYOU%2$s in 2021 and beyond', 'pods' ),
esc_html__( 'We need %1$sYOU%2$s', 'pods' ),
'<span class="pods-admin_friends-you">',
'</span>'
);
......@@ -51,7 +51,7 @@ $donate_now_link = add_query_arg( $campaign_args, $donate_now_link );
<?php
printf(
'%1$s: <a href="%2$s" target="_blank" rel="noreferrer">%3$s</a>',
esc_html__( 'Pods 2.8 is out now and we are building the next feature for Pods 2.9', 'pods' ),
esc_html__( 'Pods 2.8 is out and we are building the next feature for Pods 2.9', 'pods' ),
esc_url( $feature_callout_link ),
esc_html__( 'Simple Repeatable Fields', 'pods' )
);
......
......@@ -216,8 +216,16 @@
value = null;
}
// Fix for FormData converting arrays into comma-separated strings.
if ( null !== value ) {
postdata.append( field_name, value );
if ( field_name.endsWith( '[]' ) && Array.isArray( value ) ) {
value.forEach( ( subvalue ) => {
postdata.append( field_name, subvalue );
} );
} else {
postdata.append( field_name, value );
}
}
}
} );
......
......@@ -301,7 +301,7 @@ class PLL_Admin_Filters_Columns {
}
if ( $column == $this->get_first_language_column() ) {
$out = sprintf( '<div class="hidden" id="lang_%d">%s</div>', intval( $term_id ), esc_html( $lang->slug ) );
$out .= sprintf( '<div class="hidden" id="lang_%d">%s</div>', intval( $term_id ), esc_html( $lang->slug ) );
}
// Link to edit term ( or a translation )
......
......@@ -395,7 +395,7 @@ class PLL_Frontend_Filters_Links extends PLL_Filters_Links {
elseif ( is_category() || is_tag() || is_tax() ) {
if ( $this->model->is_translated_taxonomy( $this->get_queried_taxonomy( $this->wp_query()->tax_query ) ) ) {
if ( $this->links_model->using_permalinks && ( ! empty( $this->wp_query()->query['cat'] ) || ! empty( $this->wp_query()->query['tag'] ) ) ) {
if ( $this->links_model->using_permalinks && ( ! empty( $this->wp_query()->query['cat'] ) || ! empty( $this->wp_query()->query['tag'] ) || ! empty( $this->wp_query()->query['category_name'] ) ) ) {
// When we receive a plain permalink with a cat or tag query var, we need to redirect to the pretty permalink.
$term_id = $this->get_queried_term_id( $this->wp_query()->tax_query );
if ( is_feed() ) {
......@@ -518,13 +518,14 @@ class PLL_Frontend_Filters_Links extends PLL_Filters_Links {
}
$field = $queried_terms[ $taxonomy ]['field'];
$term = reset( $queried_terms[ $taxonomy ]['terms'] );
$lang = isset( $queried_terms['language']['terms'] ) ? reset( $queried_terms['language']['terms'] ) : '';
// We can get a term_id when requesting a plain permalink, eg /?cat=1.
if ( 'term_id' === $field ) {
return $term;
}
// We get a slug when requesting a pretty permalink with the wrong language.
// We get a slug when requesting a pretty permalink. Let's query all corresponding terms.
$args = array(
'lang' => '',
'taxonomy' => $taxonomy,
......@@ -533,6 +534,24 @@ class PLL_Frontend_Filters_Links extends PLL_Filters_Links {
'fields' => 'ids',
);
$terms = get_terms( $args );
$filtered_terms_by_lang = array_filter(
$terms,
function ( $term ) use ( $lang ) {
$term_lang = $this->model->term->get_language( $term );
return ! empty( $term_lang ) && $term_lang->slug === $lang;
}
);
$tr_term = reset( $filtered_terms_by_lang );
if ( ! empty( $tr_term ) ) {
// The queried term exists in the desired language.
return $tr_term;
}
// The queried term doesn't exist in the desired language, let's return the first one retrieved.
return reset( $terms );
}
......
......@@ -10,7 +10,7 @@
* Plugin Name: Polylang
* Plugin URI: https://polylang.pro
* Description: Adds multilingual capability to WordPress
* Version: 3.2.1
* Version: 3.2.2
* Requires at least: 5.6
* Requires PHP: 5.6
* Author: WP SYNTEX
......@@ -53,7 +53,7 @@ if ( defined( 'POLYLANG_VERSION' ) ) {
}
} else {
// Go on loading the plugin
define( 'POLYLANG_VERSION', '3.2.1' );
define( 'POLYLANG_VERSION', '3.2.2' );
define( 'PLL_MIN_WP_VERSION', '5.6' );
define( 'PLL_MIN_PHP_VERSION', '5.6' );
......
......@@ -5,7 +5,7 @@ Tags: multilingual, bilingual, translate, translation, language, multilanguage,
Requires at least: 5.6
Tested up to: 5.9
Requires PHP: 5.6
Stable tag: 3.2.1
Stable tag: 3.2.2
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
......@@ -97,6 +97,11 @@ Wherever third party code has been used, credit has been given in the code’s c
== Changelog ==
= 3.2.2 (2022-04-25) =
* Pro: Fix redirect occuring for tags sharing the same slug as their translations
* Fix quick edit allowing to modify the language of the default category when it should not #1018
= 3.2.1 (2022-04-14) =
* Pro: Fix users with editor role not able to save or publish posts
......
......@@ -482,7 +482,7 @@ class WPSEO_Admin_Asset_Manager {
'deps' => [
'jquery',
],
'version' => '4.1.0-rc.0',
'version' => '4.0.13',
];
$scripts['select2-translations'] = [
'name' => 'select2-translations',
......@@ -491,7 +491,7 @@ class WPSEO_Admin_Asset_Manager {
'jquery',
self::PREFIX . 'select2-core',
],
'version' => '4.1.0-rc.0',
'version' => '4.0.13',
];
return $scripts;
......@@ -616,7 +616,7 @@ class WPSEO_Admin_Asset_Manager {
'name' => 'select2',
'src' => 'select2/select2',
'suffix' => '.min',
'version' => '4.1.0-rc.0',
'version' => '4.0.13',
'rtl' => false,
],
[
......
......@@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
*
* @var string
*/
const CURRENT_RELEASE = '12.9.0';
const CURRENT_RELEASE = '13.1.0';
/**
* The minimally supported version of Gutenberg by the plugin.
*
* @var string
*/
const MINIMUM_SUPPORTED = '12.9.0';
const MINIMUM_SUPPORTED = '13.1.0';
/**
* Holds the current version.
......
......@@ -124,7 +124,7 @@ class Yoast_Input_Validation {
),
'linkedin_url' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'Please check the format of the Linkedin URL you entered. %s', 'wordpress-seo' ),
esc_html__( 'Please check the format of the LinkedIn URL you entered. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'linkedin_url' )
),
'msverify' => sprintf(
......@@ -164,7 +164,7 @@ class Yoast_Input_Validation {
),
'youtube_url' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'Please check the format of the Youtube URL you entered. %s', 'wordpress-seo' ),
esc_html__( 'Please check the format of the YouTube URL you entered. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'youtube_url' )
),
];
......
......@@ -12,7 +12,7 @@ $description = esc_html__( 'You haven\'t set a Shop page in your WooCommerce set
if ( YoastSEO()->helpers->woocommerce->get_shop_page_id() !== -1 ) {
$description = sprintf(
/* translators: %1$s expands to an opening anchor tag, %2$s expands to a closing anchor tag. */
esc_html__( 'You can edit the SEO meta-data for this custom type on the %1$sShop page%2$s.', 'wordpress-seo' ),
esc_html__( 'You can edit the SEO metadata for this custom type on the %1$sShop page%2$s.', 'wordpress-seo' ),
'<a href="' . esc_url( get_edit_post_link( YoastSEO()->helpers->woocommerce->get_shop_page_id() ) ) . '">',
'</a>'
);
......
......@@ -18,7 +18,7 @@ echo '<h2>' . esc_html__( 'Twitter settings', 'wordpress-seo' ) . '</h2>';
printf(
'<p>%s</p>',
esc_html__( 'Twitter uses Open Graph metadata just like Facebook, so be sure to keep the "Add Open Graph meta data" setting on the Facebook tab enabled if you want to optimize your site for Twitter.', 'wordpress-seo' )
esc_html__( 'Twitter uses Open Graph metadata just like Facebook, so be sure to keep the "Add Open Graph metadata" setting on the Facebook tab enabled if you want to optimize your site for Twitter.', 'wordpress-seo' )
);
$yform->light_switch( 'twitter', __( 'Add Twitter card meta data', 'wordpress-seo' ) );
......
......@@ -77,6 +77,7 @@ class WPSEO_Upgrade {
'17.7.1-RC0' => 'upgrade_1771',
'17.9-RC0' => 'upgrade_179',
'18.3-RC3' => 'upgrade_183',
'18.6-RC0' => 'upgrade_186',
];
array_walk( $routines, [ $this, 'run_upgrade_routine' ], $version );
......@@ -870,6 +871,15 @@ class WPSEO_Upgrade {
$this->delete_post_meta( 'yoast-structured-data-blocks-images-cache' );
}
/**
* Performs the 18.6 upgrade routine.
*/
private function upgrade_186() {
if ( is_multisite() ) {
WPSEO_Options::set( 'allow_wincher_integration_active', false );
}
}
/**
* Sets the home_url option for the 15.1 upgrade routine.
*
......
......@@ -100,7 +100,7 @@ class WPSEO_Option_MS extends WPSEO_Option {
"{$allow_prefix}enable_enhanced_slack_sharing" => true,
"{$allow_prefix}semrush_integration_active" => true,
"{$allow_prefix}zapier_integration_active" => true,
"{$allow_prefix}wincher_integration_active" => true,
"{$allow_prefix}wincher_integration_active" => false,
];
if ( is_multisite() ) {
......
......@@ -84,9 +84,7 @@ class WPSEO_Sitemap_Image_Parser {
if ( $thumbnail_id ) {
$src = $this->get_absolute_url( $this->image_url( $thumbnail_id ) );
$alt = WPSEO_Image_Utils::get_alt_tag( $thumbnail_id );
$title = get_post_field( 'post_title', $thumbnail_id );
$images[] = $this->get_image_item( $post, $src, $title, $alt );
$images[] = $this->get_image_item( $post, $src );
}
/**
......@@ -100,23 +98,17 @@ class WPSEO_Sitemap_Image_Parser {
$unfiltered_images = $this->parse_html_images( $content );
foreach ( $unfiltered_images as $image ) {
$images[] = $this->get_image_item( $post, $image['src'], $image['title'], $image['alt'] );
$images[] = $this->get_image_item( $post, $image['src'] );
}
foreach ( $this->parse_galleries( $content, $post->ID ) as $attachment ) {
$src = $this->get_absolute_url( $this->image_url( $attachment->ID ) );
$alt = WPSEO_Image_Utils::get_alt_tag( $attachment->ID );
$images[] = $this->get_image_item( $post, $src, $attachment->post_title, $alt );
$src = $this->get_absolute_url( $this->image_url( $attachment->ID ) );
$images[] = $this->get_image_item( $post, $src );
}
if ( $post->post_type === 'attachment' && wp_attachment_is_image( $post ) ) {
$src = $this->get_absolute_url( $this->image_url( $post->ID ) );
$alt = WPSEO_Image_Utils::get_alt_tag( $post->ID );
$images[] = $this->get_image_item( $post, $src, $post->post_title, $alt );
$src = $this->get_absolute_url( $this->image_url( $post->ID ) );
$images[] = $this->get_image_item( $post, $src );
}
foreach ( $images as $key => $image ) {
......@@ -152,8 +144,6 @@ class WPSEO_Sitemap_Image_Parser {
$images[] = [
'src' => $this->get_absolute_url( $this->image_url( $attachment->ID ) ),
'title' => $attachment->post_title,
'alt' => WPSEO_Image_Utils::get_alt_tag( $attachment->ID ),
];
}
......@@ -188,7 +178,11 @@ class WPSEO_Sitemap_Image_Parser {
// Clear the errors, so they don't get kept in memory.
libxml_clear_errors();
/** @var DOMElement $img */
/**
* Image attribute.
*
* @var DOMElement $img
*/
foreach ( $post_dom->getElementsByTagName( 'img' ) as $img ) {
$src = $img->getAttribute( 'src' );
......@@ -220,8 +214,6 @@ class WPSEO_Sitemap_Image_Parser {
$images[] = [
'src' => $src,
'title' => $img->getAttribute( 'title' ),
'alt' => $img->getAttribute( 'alt' ),
];
}
......@@ -298,12 +290,10 @@ class WPSEO_Sitemap_Image_Parser {
*
* @param WP_Post $post Post object for the context.
* @param string $src Image URL.
* @param string $title Optional image title.
* @param string $alt Optional image alt text.
*
* @return array
*/
protected function get_image_item( $post, $src, $title = '', $alt = '' ) {
protected function get_image_item( $post, $src ) {
$image = [];
......@@ -315,14 +305,6 @@ class WPSEO_Sitemap_Image_Parser {
*/
$image['src'] = apply_filters( 'wpseo_xml_sitemap_img_src', $src, $post );
if ( ! empty( $title ) ) {
$image['title'] = $title;
}
if ( ! empty( $alt ) ) {
$image['alt'] = $alt;
}
/**
* Filter image data to be included in XML sitemap for the post.
*
......@@ -330,8 +312,6 @@ class WPSEO_Sitemap_Image_Parser {
* Array of image data.
*
* @type string $src Image URL.
* @type string $title Image title attribute (optional).
* @type string $alt Image alt attribute (optional).
* }
*
* @param object $post Post object.
......
......@@ -230,31 +230,6 @@ class WPSEO_Sitemaps_Renderer {
$output .= "\t\t<image:image>\n";
$output .= "\t\t\t<image:loc>" . $this->encode_and_escape( $img['src'] ) . "</image:loc>\n";
if ( ! empty( $img['title'] ) ) {
$title = $img['title'];
if ( $this->needs_conversion ) {
$title = mb_convert_encoding( $title, $this->output_charset, $this->charset );
}
$title = _wp_specialchars( html_entity_decode( $title, ENT_QUOTES, $this->output_charset ) );
$output .= "\t\t\t<image:title><![CDATA[{$title}]]></image:title>\n";
}
if ( ! empty( $img['alt'] ) ) {
$alt = $img['alt'];
if ( $this->needs_conversion ) {
$alt = mb_convert_encoding( $alt, $this->output_charset, $this->charset );
}
$alt = _wp_specialchars( html_entity_decode( $alt, ENT_QUOTES, $this->output_charset ) );
$output .= "\t\t\t<image:caption><![CDATA[{$alt}]]></image:caption>\n";
}
$output .= "\t\t</image:image>\n";
}
unset( $img, $title, $alt );
......
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=189)}({189:function(e,t,r){var n=r(27);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}self.window=self,self.onmessage=function(e){var t=e.data;if(t&&t.dependencies){!function(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(self.importScripts(e[t]),"lodash"===t&&(self.lodash=_.noConflict()))}(t.dependencies),t.translations&&function(e){var t,r=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return o(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,u=!0,i=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return u=e.done,e},e:function(e){i=!0,l=e},f:function(){try{u||null==r.return||r.return()}finally{if(i)throw l}}}}(e);try{for(r.s();!(t=r.n()).done;){var a=n(t.value,2),l=a[0],u=a[1],i=u.locale_data[l]||u.locale_data.messages;i[""].domain=l,self.wp.i18n.setLocaleData(i,l)}}catch(e){r.e(e)}finally{r.f()}}(t.translations);var r=self.yoast.Researcher.default;new self.yoast.analysis.AnalysisWebWorker(self,new r).register()}}},27:function(e,t,r){var n=r(60),o=r(61),a=r(41),l=r(62);e.exports=function(e,t){return n(e)||o(e,t)||a(e,t)||l()},e.exports.__esModule=!0,e.exports.default=e.exports},39:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},41:function(e,t,r){var n=r(39);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},60:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},61:function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],_n=!0,l=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);_n=!0);}catch(e){l=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(l)throw o}}return a}},e.exports.__esModule=!0,e.exports.default=e.exports},62:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}});
\ No newline at end of file
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=199)}({199:function(e,t,r){var n=r(30);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}self.window=self,self.onmessage=function(e){var t=e.data;if(t&&t.dependencies){!function(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(self.importScripts(e[t]),"lodash"===t&&(self.lodash=_.noConflict()))}(t.dependencies),t.translations&&function(e){var t,r=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return o(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,u=!0,i=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return u=e.done,e},e:function(e){i=!0,l=e},f:function(){try{u||null==r.return||r.return()}finally{if(i)throw l}}}}(e);try{for(r.s();!(t=r.n()).done;){var a=n(t.value,2),l=a[0],u=a[1],i=u.locale_data[l]||u.locale_data.messages;i[""].domain=l,self.wp.i18n.setLocaleData(i,l)}}catch(e){r.e(e)}finally{r.f()}}(t.translations);var r=self.yoast.Researcher.default;new self.yoast.analysis.AnalysisWebWorker(self,new r).register()}}},30:function(e,t,r){var n=r(68),o=r(69),a=r(49),l=r(70);e.exports=function(e,t){return n(e)||o(e,t)||a(e,t)||l()},e.exports.__esModule=!0,e.exports.default=e.exports},47:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},49:function(e,t,r){var n=r(47);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},68:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},69:function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],_n=!0,l=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);_n=!0);}catch(e){l=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(l)throw o}}return a}},e.exports.__esModule=!0,e.exports.default=e.exports},70:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}});
\ No newline at end of file
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=190)}({190:function(e,t){!function(e,t){window.wpseoApi={get:function(e,t,n,o){this.request("GET",e,t,n,o)},post:function(e,t,n,o){this.request("POST",e,t,n,o)},put:function(e,t,n,o){this.request("PUT",e,t,n,o)},patch:function(e,t,n,o){this.request("PATCH",e,t,n,o)},delete:function(e,t,n,o){this.request("DELETE",e,t,n,o)},request:function(n,o,r,u,i){"function"==typeof r&&void 0===i&&(i=u,u=r,r={}),"POST"!==n&&"GET"!==n&&(r._method=n,n="POST"),e.ajax({url:t.root+"yoast/v1/"+o,method:n,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",t.nonce)},data:r}).done(u).fail(i)}}}(jQuery,wpApiSettings)}});
\ No newline at end of file
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=200)}({200:function(e,t){!function(e,t){window.wpseoApi={get:function(e,t,n,o){this.request("GET",e,t,n,o)},post:function(e,t,n,o){this.request("POST",e,t,n,o)},put:function(e,t,n,o){this.request("PUT",e,t,n,o)},patch:function(e,t,n,o){this.request("PATCH",e,t,n,o)},delete:function(e,t,n,o){this.request("DELETE",e,t,n,o)},request:function(n,o,r,u,i){"function"==typeof r&&void 0===i&&(i=u,u=r,r={}),"POST"!==n&&"GET"!==n&&(r._method=n,n="POST"),e.ajax({url:t.root+"yoast/v1/"+o,method:n,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",t.nonce)},data:r}).done(u).fail(i)}}}(jQuery,wpApiSettings)}});
\ No newline at end of file
!function(e){var n={};function t(s){if(n[s])return n[s].exports;var i=n[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,t),i.l=!0,i.exports}t.m=e,t.c=n,t.d=function(e,n,s){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:s})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(t.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(s,i,function(n){return e[n]}.bind(null,i));return s},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=191)}({191:function(e,n,t){"use strict";t.r(n);var s,i=t(22),o=t.n(i);s=function(e){var n=e.find("[class^=wpseo-new]").first().attr("class"),t="#"+n+"-",s=t.replace("new","existing"),i=e.find("th[id^=col_existing_yoast]").first().text().replace("Existing ",""),a=n.replace("-new-","_save_"),r="wpseo_save_all_"+e.attr("class").split("wpseo_bulk_")[1],l=a.replace("wpseo_save_",""),u={newClass:"."+n,newId:t,existingId:s},c={submit_new:function(e){c.submitNew(e)},submitNew:function(e){var n,t=u.newId+e,s=u.existingId+e;n="select-one"===o()(u.newId+e).prop("type")?o()(t).find(":selected").text():o()(t).val();var r=o()(s).html();if(n===r)o()(t).val("");else{if(""===n&&!window.confirm("Are you sure you want to remove the existing "+i+"?"))return void o()(t).val("");var l={action:a,_ajax_nonce:wpseoBulkEditorNonce,wpseo_post_id:e,new_value:n,existing_value:r};o.a.post(ajaxurl,l,c.handleResponse)}},submit_all:function(e){c.submitAll(e)},submitAll:function(e){e.preventDefault();var n={action:r,_ajax_nonce:wpseoBulkEditorNonce,send:!1,items:{},existingItems:{}};o()(u.newClass).each((function(){var e=o()(this).data("id"),t=o()(this).val(),s=o()(u.existingId+e).html();""!==t&&(t===s?o()(u.newId+e).val(""):(n.send=!0,n.items[e]=t,n.existingItems[e]=s))})),n.send&&o.a.post(ajaxurl,n,c.handleResponses)},handle_response:function(e,n){c.handleResponse(e,n)},handleResponse:function(e,n){if("success"===n){var t=e;if("string"==typeof t&&(t=JSON.parse(t)),t instanceof Array)o.a.each(t,(function(){c.handleResponse(this,n)}));else if("success"===t.status){var s=t["new_"+l];o()(u.existingId+t.post_id).html(s.replace(/\\(?!\\)/g,"")),o()(u.newId+t.post_id).val("")}}},handle_responses:function(e,n){c.handleResponses(e,n)},handleResponses:function(e,n){var t=o.a.parseJSON(e);o.a.each(t,(function(){c.handleResponse(this,n)}))},set_events:function(){c.setEvents()},setEvents:function(){e.find(".wpseo-save").click((function(e){var n=o()(this).data("id");e.preventDefault(),c.submitNew(n,this)})),e.find(".wpseo-save-all").click(c.submitAll),e.find(u.newClass).keydown((function(e){if(13===e.which){e.preventDefault();var n=o()(this).data("id");c.submitNew(n,this)}}))}};return c},window.bulk_editor=s,window.bulkEditor=s,o()(document).ready((function(){o()('table[class*="wpseo_bulk"]').each((function(e,n){var t=o()(n);s(t).setEvents()}))}))},22:function(e,n){e.exports=window.jQuery}});
\ No newline at end of file
!function(e){var n={};function t(s){if(n[s])return n[s].exports;var i=n[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,t),i.l=!0,i.exports}t.m=e,t.c=n,t.d=function(e,n,s){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:s})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(t.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(s,i,function(n){return e[n]}.bind(null,i));return s},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=201)}({201:function(e,n,t){"use strict";t.r(n);var s,i=t(24),o=t.n(i);s=function(e){var n=e.find("[class^=wpseo-new]").first().attr("class"),t="#"+n+"-",s=t.replace("new","existing"),i=e.find("th[id^=col_existing_yoast]").first().text().replace("Existing ",""),a=n.replace("-new-","_save_"),r="wpseo_save_all_"+e.attr("class").split("wpseo_bulk_")[1],l=a.replace("wpseo_save_",""),u={newClass:"."+n,newId:t,existingId:s},c={submit_new:function(e){c.submitNew(e)},submitNew:function(e){var n,t=u.newId+e,s=u.existingId+e;n="select-one"===o()(u.newId+e).prop("type")?o()(t).find(":selected").text():o()(t).val();var r=o()(s).html();if(n===r)o()(t).val("");else{if(""===n&&!window.confirm("Are you sure you want to remove the existing "+i+"?"))return void o()(t).val("");var l={action:a,_ajax_nonce:wpseoBulkEditorNonce,wpseo_post_id:e,new_value:n,existing_value:r};o.a.post(ajaxurl,l,c.handleResponse)}},submit_all:function(e){c.submitAll(e)},submitAll:function(e){e.preventDefault();var n={action:r,_ajax_nonce:wpseoBulkEditorNonce,send:!1,items:{},existingItems:{}};o()(u.newClass).each((function(){var e=o()(this).data("id"),t=o()(this).val(),s=o()(u.existingId+e).html();""!==t&&(t===s?o()(u.newId+e).val(""):(n.send=!0,n.items[e]=t,n.existingItems[e]=s))})),n.send&&o.a.post(ajaxurl,n,c.handleResponses)},handle_response:function(e,n){c.handleResponse(e,n)},handleResponse:function(e,n){if("success"===n){var t=e;if("string"==typeof t&&(t=JSON.parse(t)),t instanceof Array)o.a.each(t,(function(){c.handleResponse(this,n)}));else if("success"===t.status){var s=t["new_"+l];o()(u.existingId+t.post_id).html(s.replace(/\\(?!\\)/g,"")),o()(u.newId+t.post_id).val("")}}},handle_responses:function(e,n){c.handleResponses(e,n)},handleResponses:function(e,n){var t=o.a.parseJSON(e);o.a.each(t,(function(){c.handleResponse(this,n)}))},set_events:function(){c.setEvents()},setEvents:function(){e.find(".wpseo-save").click((function(e){var n=o()(this).data("id");e.preventDefault(),c.submitNew(n,this)})),e.find(".wpseo-save-all").click(c.submitAll),e.find(u.newClass).keydown((function(e){if(13===e.which){e.preventDefault();var n=o()(this).data("id");c.submitNew(n,this)}}))}};return c},window.bulk_editor=s,window.bulkEditor=s,o()(document).ready((function(){o()('table[class*="wpseo_bulk"]').each((function(e,n){var t=o()(n);s(t).setEvents()}))}))},24:function(e,n){e.exports=window.jQuery}});
\ No newline at end of file
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