Commit 051199a4 authored by Simon's avatar Simon

release 1.27.1

parent e3fc294a
......@@ -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.27.0 .` (update version number)
- build new image `docker build -t biuro/web:1.27.1 .` (update version number)
- login to biuro docker account `docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs`
- push image to docker repository - `docker push biuro/web:1.27.0`
- push image to docker repository - `docker push biuro/web:1.27.1`
## Production
- update biuro/web image version in .env file (staging or www)
......
......@@ -23,7 +23,7 @@
</FilesMatch>
# Akismet images
<FilesMatch "^logo-full-2x\.png$">
<FilesMatch "^logo-(a|full)-2x\.png$">
<IfModule !mod_authz_core.c>
Allow from all
</IfModule>
......
......@@ -659,4 +659,63 @@ table.comments td.comment p a:after {
.akismet-setup-instructions form {
padding-bottom: 1.5rem;
}
div.error.akismet-usage-limit-alert {
padding: 25px 45px 25px 15px;
display: flex;
align-items: center;
}
#akismet-plugin-container .akismet-usage-limit-alert {
margin: 0 auto 0.625rem auto;
box-sizing: border-box;
box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;
border: none;
border-left: 4px solid #d63638;
}
.akismet-usage-limit-alert .akismet-usage-limit-logo {
width: 38px;
min-width: 38px;
height: 38px;
border-radius: 20px;
margin-right: 18px;
background: black;
position: relative;
}
.akismet-usage-limit-alert .akismet-usage-limit-logo img {
position: absolute;
width: 22px;
left: 8px;
top: 10px;
}
.akismet-usage-limit-alert .akismet-usage-limit-text {
flex-grow: 1;
margin-right: 18px;
}
.akismet-usage-limit-alert h3 {
margin: 0;
}
.akismet-usage-limit-alert .akismet-usage-limit-cta {
text-align: right;
}
@media (max-width: 550px) {
div.error.akismet-usage-limit-alert {
display: block;
}
.akismet-usage-limit-alert .akismet-usage-limit-logo,
.akismet-usage-limit-alert .akismet-usage-limit-text {
margin-bottom: 15px;
}
.akismet-usage-limit-alert .akismet-usage-limit-cta {
text-align: left;
}
}
\ No newline at end of file
......@@ -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.10
Version: 4.1.11
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.10' );
define( 'AKISMET_VERSION', '4.1.11' );
define( 'AKISMET__MINIMUM_WP_VERSION', '4.0' );
define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'AKISMET_DELETE_LIMIT', 100000 );
......
......@@ -888,6 +888,22 @@ class Akismet_Admin {
) );
}
public static function get_usage_limit_alert_data() {
return array(
'type' => 'usage-limit',
'code' => (int) get_option( 'akismet_alert_code' ),
'msg' => get_option( 'akismet_alert_msg' ),
'api_calls' => get_option( 'akismet_alert_api_calls' ),
'usage_limit' => get_option( 'akismet_alert_usage_limit' ),
'upgrade_plan' => get_option( 'akismet_alert_upgrade_plan' ),
'upgrade_url' => get_option( 'akismet_alert_upgrade_url' ),
);
}
public static function display_usage_limit_alert() {
Akismet::view( 'notice', self::get_usage_limit_alert_data() );
}
public static function display_spam_check_warning() {
Akismet::fix_scheduled_recheck();
......@@ -1021,6 +1037,11 @@ class Akismet_Admin {
$notices[] = array( 'type' => $akismet_user->status );
}
$alert_code = get_option( 'akismet_alert_code' );
if ( isset( Akismet::$LIMIT_NOTICES[ $alert_code ] ) ) {
$notices[] = self::get_usage_limit_alert_data();
}
/*
// To see all variants when testing.
$notices[] = array( 'type' => 'active-notice', 'time_saved' => 'Cleaning up spam takes time. Akismet has saved you 1 minute!' );
......@@ -1040,6 +1061,7 @@ class Akismet_Admin {
$notices[] = array( 'type' => 'new-key-failed' );
$notices[] = array( 'type' => 'limit-reached', 'level' => 'yellow' );
$notices[] = array( 'type' => 'limit-reached', 'level' => 'red' );
$notices[] = array( 'type' => 'usage-limit', 'api_calls' => '15000', 'usage_limit' => '10000', 'upgrade_plan' => 'Enterprise', 'upgrade_url' => 'https://akismet.com/account/' );
*/
Akismet::log( compact( 'stat_totals', 'akismet_user' ) );
......@@ -1056,9 +1078,14 @@ class Akismet_Admin {
if ( in_array( $hook_suffix, array( 'edit-comments.php' ) ) && (int) get_option( 'akismet_alert_code' ) > 0 ) {
Akismet::verify_key( Akismet::get_api_key() ); //verify that the key is still in alert state
if ( get_option( 'akismet_alert_code' ) > 0 )
$alert_code = get_option( 'akismet_alert_code' );
if ( isset( Akismet::$LIMIT_NOTICES[ $alert_code ] ) ) {
self::display_usage_limit_alert();
}
elseif ( $alert_code > 0 ) {
self::display_alert();
}
}
elseif ( ( 'plugins.php' === $hook_suffix || 'edit-comments.php' === $hook_suffix ) && ! Akismet::get_api_key() ) {
// Show the "Set Up Akismet" banner on the comments and plugin pages if no API key has been set.
......
......@@ -5,6 +5,14 @@ class Akismet {
const API_PORT = 80;
const MAX_DELAY_BEFORE_MODERATION_EMAIL = 86400; // One day in seconds
public static $LIMIT_NOTICES = array(
10501 => 'FIRST_MONTH_OVER_LIMIT',
10502 => 'SECOND_MONTH_OVER_LIMIT',
10504 => 'THIRD_MONTH_APPROACHING_LIMIT',
10508 => 'THIRD_MONTH_OVER_LIMIT',
10516 => 'FOUR_PLUS_MONTHS_OVER_LIMIT',
);
private static $last_comment = '';
private static $initiated = false;
private static $prevent_moderation_email_for_these_comments = array();
......@@ -408,6 +416,10 @@ class Akismet {
clean_comment_cache( $comment_ids );
do_action( 'akismet_delete_comment_batch', count( $comment_ids ) );
foreach ( $comment_ids as $comment_id ) {
do_action( 'deleted_comment', comment_id );
}
}
if ( apply_filters( 'akismet_optimize_table', ( mt_rand(1, 5000) == 11), $wpdb->comments ) ) // lucky number
......@@ -1254,21 +1266,31 @@ class Akismet {
// given a response from an API call like check_key_status(), update the alert code options if an alert is present.
public static function update_alert( $response ) {
$code = $msg = null;
if ( isset( $response[0]['x-akismet-alert-code'] ) ) {
$code = $response[0]['x-akismet-alert-code'];
$msg = $response[0]['x-akismet-alert-msg'];
}
$alert_option_prefix = 'akismet_alert_';
$alert_header_prefix = 'x-akismet-alert-';
$alert_header_names = array(
'code',
'msg',
'api-calls',
'usage-limit',
'upgrade-plan',
'upgrade-url',
);
// only call update_option() if the value has changed
if ( $code != get_option( 'akismet_alert_code' ) ) {
if ( ! $code ) {
delete_option( 'akismet_alert_code' );
delete_option( 'akismet_alert_msg' );
foreach( $alert_header_names as $alert_header_name ) {
$value = null;
if ( isset( $response[0][$alert_header_prefix . $alert_header_name] ) ) {
$value = $response[0][$alert_header_prefix . $alert_header_name];
}
else {
update_option( 'akismet_alert_code', $code );
update_option( 'akismet_alert_msg', $msg );
$option_name = $alert_option_prefix . str_replace( '-', '_', $alert_header_name );
if ( $value != get_option( $option_name ) ) {
if ( ! $value ) {
delete_option( $option_name );
}
else {
update_option( $option_name, $value );
}
}
}
}
......
......@@ -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: 4.6
Tested up to: 5.8
Stable tag: 4.1.10
Stable tag: 4.1.11
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.11 =
*Release Date - 23 August 2021*
* Added support for Akismet API usage notifications on Akismet settings and edit-comments admin pages.
* Added support for the deleted_comment action when bulk-deleting comments from Spam.
= 4.1.10 =
*Release Date - 6 July 2021*
......
<div class="akismet-enter-api-key-box centered">
<a href="#"><?php esc_html_e( 'Manually enter an API key' ); ?></a>
<a href="#"><?php esc_html_e( 'Manually enter an API key', 'akismet' ); ?></a>
<div class="enter-api-key">
<form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post">
<?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
......
......@@ -139,4 +139,59 @@
</p>
<?php endif; ?>
</div>
<?php elseif ( $type == 'usage-limit' && isset( Akismet::$LIMIT_NOTICES[ $code ] ) ) :?>
<div class="error akismet-usage-limit-alert">
<div class="akismet-usage-limit-logo">
<img src="<?php echo esc_url( plugins_url( '../_inc/img/logo-a-2x.png', __FILE__ ) ); ?>" alt="Akismet" />
</div>
<div class="akismet-usage-limit-text">
<h3>
<?php
switch ( Akismet::$LIMIT_NOTICES[ $code ] ) {
case 'FIRST_MONTH_OVER_LIMIT':
case 'SECOND_MONTH_OVER_LIMIT':
esc_html_e( 'Your Akismet account usage is over your plan\'s limit', 'akismet' );
break;
case 'THIRD_MONTH_APPROACHING_LIMIT':
esc_html_e( 'Your Akismet account usage is approaching your plan\'s limit', 'akismet' );
break;
case 'THIRD_MONTH_OVER_LIMIT':
case 'FOUR_PLUS_MONTHS_OVER_LIMIT':
esc_html_e( 'Your account has been restricted', 'akismet' );
break;
default:
}
?>
</h3>
<p>
<?php
switch ( Akismet::$LIMIT_NOTICES[ $code ] ) {
case 'FIRST_MONTH_OVER_LIMIT':
printf(
__( 'Since %s, your account made %s API calls, compared to your plan\'s limit of %s. <a href="%s" target="_blank">Learn more</a> about usage limits.', 'akismet' ),
esc_html( gmdate( 'F' ) . ' 1' ),
number_format( $api_calls ),
number_format( $usage_limit ),
'https://docs.akismet.com/akismet-api-usage-limits/'
);
break;
case 'SECOND_MONTH_OVER_LIMIT':
esc_html_e( 'Your Akismet usage has been over your plan\'s limit for two consecutive months. Next month, we will restrict your account after you reach the limit. Please consider upgrading your plan.', 'akismet' );
break;
case 'THIRD_MONTH_APPROACHING_LIMIT':
esc_html_e( 'Your Akismet usage is nearing your plan\'s limit for the third consecutive month. We will restrict your account after you reach the limit. Upgrade your plan so Akismet can continue blocking spam.', 'akismet' );
break;
case 'THIRD_MONTH_OVER_LIMIT':
case 'FOUR_PLUS_MONTHS_OVER_LIMIT':
esc_html_e( 'Your Akismet usage has been over your plan\'s limit for three consecutive months. We have restricted your account for the rest of the month. Upgrade your plan so Akismet can continue blocking spam.', 'akismet' );
break;
default:
}
?>
</p>
</div>
<div class="akismet-usage-limit-cta">
<?php printf( __( '<a href="%1$s" class="button" target="_blank">Upgrade to %2$s</a>', 'akismet' ), esc_attr( $upgrade_url ), esc_html( $upgrade_plan ) ); ?>
</div>
</div>
<?php endif;?>
......@@ -35,7 +35,6 @@ class WPSEO_Admin_Init {
$this->asset_manager = new WPSEO_Admin_Asset_Manager();
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_dismissible' ] );
add_action( 'admin_init', [ $this, 'yoast_plugin_suggestions_notification' ], 15 );
add_action( 'admin_init', [ $this, 'unsupported_php_notice' ], 15 );
add_action( 'admin_init', [ $this->asset_manager, 'register_assets' ] );
add_action( 'admin_init', [ $this, 'show_hook_deprecation_warnings' ] );
......@@ -78,59 +77,6 @@ class WPSEO_Admin_Init {
$this->asset_manager->enqueue_style( 'dismissible' );
}
/**
* Determines whether a suggested plugins notification needs to be displayed.
*
* @return void
*/
public function yoast_plugin_suggestions_notification() {
$checker = new WPSEO_Plugin_Availability();
$notification_center = Yoast_Notification_Center::get();
// Get all Yoast plugins that have dependencies.
$plugins = $checker->get_plugins_with_dependencies();
foreach ( $plugins as $plugin_name => $plugin ) {
$dependency_names = $checker->get_dependency_names( $plugin );
$notification = $this->get_yoast_seo_suggested_plugins_notification( $plugin_name, $plugin, $dependency_names[0] );
if ( $checker->dependencies_are_satisfied( $plugin ) && ! $checker->is_installed( $plugin ) ) {
$notification_center->add_notification( $notification );
continue;
}
$notification_center->remove_notification( $notification );
}
}
/**
* Build Yoast SEO suggested plugins notification.
*
* @param string $name The plugin name to use for the unique ID.
* @param array $plugin The plugin to retrieve the data from.
* @param string $dependency_name The name of the dependency.
*
* @return Yoast_Notification The notification containing the suggested plugin.
*/
private function get_yoast_seo_suggested_plugins_notification( $name, $plugin, $dependency_name ) {
$info_message = sprintf(
/* translators: %1$s expands to Yoast SEO, %2$s expands to the plugin version, %3$s expands to the plugin name */
__( '%1$s and %2$s can work together a lot better by adding a helper plugin. Please install %3$s to make your life better.', 'wordpress-seo' ),
'Yoast SEO',
$dependency_name,
sprintf( '<a href="%s">%s</a>', $plugin['url'], $plugin['title'] )
);
return new Yoast_Notification(
$info_message,
[
'id' => 'wpseo-suggested-plugin-' . $name,
'type' => Yoast_Notification::WARNING,
]
);
}
/**
* Creates an unsupported PHP version notification in the notification center.
*
......
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin
*/
/**
* Handles the media purge notification showing and hiding.
*/
class WPSEO_Admin_Media_Purge_Notification implements WPSEO_WordPress_Integration {
/**
* Notification ID to use.
*
* @var string
*/
private $notification_id = 'wpseo_media_purge';
/**
* Registers all hooks to WordPress.
*
* @return void
*/
public function register_hooks() {
add_action( 'admin_init', [ $this, 'manage_notification' ] );
add_filter( 'wpseo_option_tab-metas_media', [ $this, 'output_hidden_setting' ] );
// Dismissing is just setting the relevancy to false, which cancels out any functionality.
if ( YoastSEO()->helpers->current_page->is_yoast_seo_page() && filter_input( INPUT_GET, 'dismiss' ) === $this->notification_id ) {
WPSEO_Options::set( 'is-media-purge-relevant', false );
}
}
/**
* Adds a hidden setting to the media tab.
*
* To make sure the setting is not reverted to the default when -anything-
* is saved on the entire page (not just the media tab).
*
* @param string|null $input Current filter value.
*
* @return string|null
*/
public function output_hidden_setting( $input ) {
$form = Yoast_Form::get_instance();
$form->hidden( 'is-media-purge-relevant' );
return $input;
}
/**
* Manages if the notification should be shown or removed.
*
* @return void
*/
public function manage_notification() {
$this->remove_notification();
}
/**
* Retrieves the notification that should be shown or removed.
*
* @return Yoast_Notification The notification to use.
*/
private function get_notification() {
$content = sprintf(
/* translators: %1$s expands to the link to the article, %2$s closes the link tag. */
__( 'Your site\'s settings currently allow attachment URLs on your site to exist. Please read %1$sthis post about a potential issue%2$s with attachment URLs and check whether you have the correct setting for your site.', 'wordpress-seo' ),
'<a href="' . esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/2r8' ) ) . '" rel="noopener noreferrer" target="_blank">',
'</a>'
);
$content .= '<br><br>';
$content .= sprintf(
/* translators: %1$s dismiss link open tag, %2$s closes the link tag. */
__( 'If you know what this means and you do not want to see this message anymore, you can %1$sdismiss this message%2$s.', 'wordpress-seo' ),
'<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_dashboard&dismiss=' . $this->notification_id ) ) . '">',
'</a>'
);
return new Yoast_Notification(
$content,
[
'type' => Yoast_Notification::ERROR,
'id' => $this->notification_id,
'capabilities' => 'wpseo_manage_options',
'priority' => 1,
]
);
}
/**
* Adds the notification to the notificaton center.
*
* @return void
*/
private function add_notification() {
$notification_center = Yoast_Notification_Center::get();
$notification_center->add_notification( $this->get_notification() );
}
/**
* Removes the notification from the notification center.
*
* @return void
*/
private function remove_notification() {
$notification_center = Yoast_Notification_Center::get();
$notification_center->remove_notification( $this->get_notification() );
}
}
......@@ -100,7 +100,6 @@ class WPSEO_Admin {
$integrations[] = new WPSEO_Yoast_Columns();
$integrations[] = new WPSEO_Statistic_Integration();
$integrations[] = new WPSEO_Capability_Manager_Integration( WPSEO_Capability_Manager_Factory::get() );
$integrations[] = new WPSEO_Admin_Media_Purge_Notification();
$integrations[] = new WPSEO_Admin_Gutenberg_Compatibility_Notification();
$integrations[] = new WPSEO_Expose_Shortlinks();
$integrations[] = new WPSEO_MyYoast_Proxy();
......
......@@ -909,7 +909,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
$meta_value = $values[ $meta_value ];
}
$id = "wpseo-existing-$record_id-$this->target_db_field";
$id = "wpseo-existing-$this->target_db_field-$record_id";
// $attributes correctly escaped, verified by Alexander. See WPSEO_Bulk_Description_List_Table::parse_page_specific_column.
return sprintf( '<td %2$s id="%3$s">%1$s</td>', esc_html( $meta_value ), $attributes, esc_attr( $id ) );
......
......@@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
*
* @var string
*/
const CURRENT_RELEASE = '11.1.0';
const CURRENT_RELEASE = '11.2.1';
/**
* The minimally supported version of Gutenberg by the plugin.
*
* @var string
*/
const MINIMUM_SUPPORTED = '11.1.0';
const MINIMUM_SUPPORTED = '11.2.1';
/**
* Holds the current version.
......
......@@ -61,8 +61,7 @@ class WPSEO_Suggested_Plugins implements WPSEO_WordPress_Integration {
continue;
}
$dependency_names = $checker->get_dependency_names( $plugin );
$notification = $this->get_yoast_seo_suggested_plugins_notification( $plugin_name, $plugin, $dependency_names[0] );
$notification = $this->get_yoast_seo_suggested_plugins_notification( $plugin_name, $plugin );
if ( ! $checker->is_installed( $plugin ) || ! $checker->is_active( $plugin['slug'] ) ) {
$this->notification_center->add_notification( $notification );
......@@ -79,15 +78,14 @@ class WPSEO_Suggested_Plugins implements WPSEO_WordPress_Integration {
*
* @param string $name The plugin name to use for the unique ID.
* @param array $plugin The plugin to retrieve the data from.
* @param string $dependency_name The name of the dependency.
*
* @return Yoast_Notification The notification containing the suggested plugin.
*/
protected function get_yoast_seo_suggested_plugins_notification( $name, $plugin, $dependency_name ) {
$message = $this->create_install_suggested_plugin_message( $plugin, $dependency_name );
protected function get_yoast_seo_suggested_plugins_notification( $name, $plugin ) {
$message = $this->create_install_suggested_plugin_message( $plugin );
if ( $this->availability_checker->is_installed( $plugin ) && ! $this->availability_checker->is_active( $plugin['slug'] ) ) {
$message = $this->create_activate_suggested_plugin_message( $plugin, $dependency_name );
$message = $this->create_activate_suggested_plugin_message( $plugin );
}
return new Yoast_Notification(
......@@ -104,21 +102,21 @@ class WPSEO_Suggested_Plugins implements WPSEO_WordPress_Integration {
* Creates a message to suggest the installation of a particular plugin.
*
* @param array $suggested_plugin The suggested plugin.
* @param array $third_party_plugin The third party plugin that we have a suggested plugin for.
*
* @return string The install suggested plugin message.
*/
protected function create_install_suggested_plugin_message( $suggested_plugin, $third_party_plugin ) {
/* translators: %1$s expands to Yoast SEO, %2$s expands to the dependency name, %3$s expands to the install link, %4$s expands to the more info link. */
$message = __( '%1$s and %2$s can work together a lot better by adding a helper plugin. Please install %3$s to make your life better. %4$s.', 'wordpress-seo' );
protected function create_install_suggested_plugin_message( $suggested_plugin ) {
/* translators: %1$s expands to an opening strong tag, %2$s expands to the dependency name, %3$s expands to a closing strong tag, %4$s expands to an opening anchor tag, %5$s expands to a closing anchor tag. */
$message = __( 'It looks like you aren\'t using our %1$s%2$s addon%3$s. %4$sUpgrade today%5$s to unlock more tools and SEO features to make your products stand out in search results.', 'wordpress-seo' );
$install_link = WPSEO_Admin_Utils::get_install_link( $suggested_plugin );
return sprintf(
$message,
'Yoast SEO',
$third_party_plugin,
'<strong>',
$install_link,
$this->create_more_information_link( $suggested_plugin['url'], $suggested_plugin['title'] )
'</strong>',
$this->create_more_information_link( $suggested_plugin['url'], $suggested_plugin['title'] ),
'</a>'
);
}
......@@ -132,11 +130,10 @@ class WPSEO_Suggested_Plugins implements WPSEO_WordPress_Integration {
*/
protected function create_more_information_link( $url, $name ) {
return sprintf(
'<a href="%s" aria-label="%s" target="_blank" rel="noopener noreferrer">%s</a>',
'<a href="%s" aria-label="%s" target="_blank" rel="noopener noreferrer">',
$url,
/* translators: %1$s expands to the dependency name. */
sprintf( __( 'More information about %1$s', 'wordpress-seo' ), $name ),
__( 'More information', 'wordpress-seo' )
sprintf( __( 'More information about %1$s', 'wordpress-seo' ), $name )
);
}
......@@ -144,20 +141,21 @@ class WPSEO_Suggested_Plugins implements WPSEO_WordPress_Integration {
* Creates a message to suggest the activation of a particular plugin.
*
* @param array $suggested_plugin The suggested plugin.
* @param array $third_party_plugin The third party plugin that we have a suggested plugin for.
*
* @return string The activate suggested plugin message.
*/
protected function create_activate_suggested_plugin_message( $suggested_plugin, $third_party_plugin ) {
/* translators: %1$s expands to Yoast SEO, %2$s expands to the dependency name, %3$s expands to activation link. */
$message = __( '%1$s and %2$s can work together a lot better by adding a helper plugin. Please activate %3$s to make your life better.', 'wordpress-seo' );
protected function create_activate_suggested_plugin_message( $suggested_plugin ) {
/* translators: %1$s expands to an opening strong tag, %2$s expands to the dependency name, %3$s expands to a closing strong tag, %4$s expands to and opening anchor tag, %5$s expands to a closing anchor tag. */
$message = __( 'It looks like you\'ve installed our %1$s%2$s addon%3$s. %4$sActivate it now%5$s to unlock more tools and SEO features to make your products stand out in search results.', 'wordpress-seo' );
$activation_url = WPSEO_Admin_Utils::get_activation_url( $suggested_plugin['slug'] );
return sprintf(
$message,
'Yoast SEO',
$third_party_plugin,
sprintf( '<a href="%s">%s</a>', $activation_url, $suggested_plugin['title'] )
'<strong>',
$suggested_plugin['title'],
'</strong>',
'<a href="' . $activation_url . '">',
'</a>'
);
}
}
......@@ -105,7 +105,6 @@ class WPSEO_Tracking_Settings_Data implements WPSEO_Collection {
'disable-date',
'disable-post_format',
'disable-attachment',
'is-media-purge-relevant',
'breadcrumbs-404crumb',
'breadcrumbs-display-blog-page',
'breadcrumbs-boldlast',
......
......@@ -31,25 +31,6 @@ $yform->toggle_switch(
<br/>
<?php
$noindex_option_name = 'noindex-' . $wpseo_post_type->name;
if ( WPSEO_Options::get( 'is-media-purge-relevant' ) && WPSEO_Options::get( $noindex_option_name ) === false ) {
$description = esc_html__(
'By enabling this option, attachment URLs become visible to both your visitors and Google. To add value to your website, they should contain useful information, or they might have a negative impact on your ranking.',
'wordpress-seo'
);
$description .= ' ';
$description .= sprintf(
/* translators: %1$s expands to the link to the article, %2$s closes the link to the article */
esc_html__( 'Please carefully consider the implications and %1$sread this post%2$s if you want more information about the impact of showing media in search results.', 'wordpress-seo' ),
'<a href="' . esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/2r8' ) ) . '" rel="noopener noreferrer" target="_blank">',
'</a>'
);
// phpcs:ignore WordPress.Security.EscapeOutput -- $description is properly escaped above.
echo '<div style="clear:both; background-color: #ffeb3b; color: #000000; padding: 16px; max-width: 450px; margin-bottom: 32px;">' . $description . '</div>';
}
require __DIR__ . '/post_type/post-type.php';
?>
</div>
......@@ -74,6 +74,7 @@ class WPSEO_Upgrade {
'16.2-RC0' => 'upgrade_162',
'16.5-RC0' => 'upgrade_165',
'16.9-RC0' => 'upgrade_169',
'17.0-RC0' => 'upgrade_170',
];
array_walk( $routines, [ $this, 'run_upgrade_routine' ], $version );
......@@ -853,6 +854,22 @@ class WPSEO_Upgrade {
}
}
/**
* Performs the 17.0 upgrade. shop_order indexables were cleaned from the indexable table in 16.9, so we have to clean out the orphaned entries from the rest of the tables.
*
* @return void
*/
private function upgrade_170() {
// Sets a scheduled job to do the cleanup eventually and not in the upgrade process itself. When that cleanup is completed, the job will de-register itself.
if ( ! wp_next_scheduled( 'wpseo_cleanup_orphaned_indexables' ) ) {
wp_schedule_event(
time(),
'hourly',
'wpseo_cleanup_orphaned_indexables'
);
}
}
/**
* Sets the home_url option for the 15.1 upgrade routine.
*
......
......@@ -61,7 +61,6 @@ class WPSEO_Option_Titles extends WPSEO_Option {
'disable-date' => false,
'disable-post_format' => false,
'disable-attachment' => true,
'is-media-purge-relevant' => false,
'breadcrumbs-404crumb' => '', // Text field.
'breadcrumbs-display-blog-page' => true,
......@@ -658,7 +657,6 @@ class WPSEO_Option_Titles extends WPSEO_Option {
* 'breadcrumbs-boldlast'
* 'breadcrumbs-enable'
* 'stripcategorybase'
* 'is-media-purge-relevant'
*/
default:
$clean[ $key ] = ( isset( $dirty[ $key ] ) ? WPSEO_Utils::validate_bool( $dirty[ $key ] ) : false );
......
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