home
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.103.1
|
||||
*
|
||||
* @since 1.0.103.1
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
use RankMath\Helper;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Enable author sitemap.
|
||||
*/
|
||||
function rank_math_1_0_103_1_update_html_sitemap() {
|
||||
$all_opts = rank_math()->settings->all_raw();
|
||||
$sitemap_settings = $all_opts['sitemap'];
|
||||
if ( isset( $sitemap_settings['authors_sitemap'] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$sitemap_settings['authors_sitemap'] = 'on';
|
||||
|
||||
Helper::update_all_settings( null, null, $sitemap_settings );
|
||||
rank_math()->settings->reset();
|
||||
}
|
||||
rank_math_1_0_103_1_update_html_sitemap();
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.104
|
||||
*
|
||||
* @since 1.0.104
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
use RankMath\Helper;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Update TOC block settings on existing sites.
|
||||
*/
|
||||
function rank_math_1_0_104_toc_block_settings() {
|
||||
$all_opts = rank_math()->settings->all_raw();
|
||||
$general = $all_opts['general'];
|
||||
$general['toc_block_title'] = 'Table of Contents';
|
||||
$general['toc_block_list_style'] = 'ul';
|
||||
|
||||
Helper::update_all_settings( $general, null, null );
|
||||
rank_math()->settings->reset();
|
||||
}
|
||||
rank_math_1_0_104_toc_block_settings();
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.107.3
|
||||
*
|
||||
* @since 1.0.107.3
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
use RankMath\Helper;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Replace %searchphrase% variable to %search_query%
|
||||
*/
|
||||
function rank_math_1_0_107_3_replace_search_variable() {
|
||||
$all_opts = rank_math()->settings->all_raw();
|
||||
$titles = $all_opts['titles'];
|
||||
|
||||
$titles['search_title'] = str_replace( '%searchphrase%', '%search_query%', $titles['search_title'] );
|
||||
|
||||
RankMath\Helper::update_all_settings( null, $titles, null );
|
||||
rank_math()->settings->reset();
|
||||
}
|
||||
rank_math_1_0_107_3_replace_search_variable();
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.110
|
||||
*
|
||||
* @since 1.0.110
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
use RankMath\Helper;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Update the deprecated schema type Attorney and used it as LegalService.
|
||||
*/
|
||||
function rank_math_1_0_110_update_local_business_type() {
|
||||
$all_opts = rank_math()->settings->all_raw();
|
||||
$titles = $all_opts['titles'];
|
||||
|
||||
if ( 'Attorney' !== $titles['local_business_type'] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$titles['local_business_type'] = 'LegalService';
|
||||
|
||||
Helper::update_all_settings( null, $titles, null );
|
||||
rank_math()->settings->reset();
|
||||
}
|
||||
rank_math_1_0_110_update_local_business_type();
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.201.1
|
||||
*
|
||||
* @since 1.0.201.1
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Remove the schedule event used to update the prompts.
|
||||
*/
|
||||
function rank_math_1_0_201_1_remove_prompt_event() {
|
||||
wp_clear_scheduled_hook( 'rank_math/content-ai/update_prompts' );
|
||||
}
|
||||
rank_math_1_0_201_1_remove_prompt_event();
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.201
|
||||
*
|
||||
* @since 1.0.201
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
use RankMath\Helper;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Add default values for the new Content AI settings.
|
||||
*/
|
||||
function rank_math_1_0_201_content_ai_settings() {
|
||||
$all_opts = rank_math()->settings->all_raw();
|
||||
$general = $all_opts['general'];
|
||||
$general['content_ai_country'] = 'all';
|
||||
$general['content_ai_tone'] = 'Formal';
|
||||
$general['content_ai_audience'] = 'General Audience';
|
||||
$general['content_ai_language'] = Helper::content_ai_default_language();
|
||||
|
||||
Helper::update_all_settings( $general, null, null );
|
||||
rank_math()->settings->reset();
|
||||
|
||||
// Update credits to array format. This is needed in case the call to credits endpoint on server fails for some reason.
|
||||
Helper::update_credits( get_option( 'rank_math_ca_credits' ) );
|
||||
|
||||
// Fetch credits, plan & refresh date.
|
||||
if ( Helper::is_site_connected() ) {
|
||||
Helper::get_content_ai_credits( true );
|
||||
}
|
||||
}
|
||||
rank_math_1_0_201_content_ai_settings();
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.202.
|
||||
*
|
||||
* @since 1.0.202
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
use RankMath\Helper;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Convert English Language stored in Content AI settings to US English.
|
||||
*/
|
||||
function rank_math_1_0_202_content_ai_convert_english_language() {
|
||||
$all_opts = rank_math()->settings->all_raw();
|
||||
$general = $all_opts['general'];
|
||||
if ( ! empty( $general['content_ai_language'] ) && 'English' === $general['content_ai_language'] ) {
|
||||
$general['content_ai_language'] = 'US English';
|
||||
}
|
||||
|
||||
Helper::update_all_settings( $general, null, null );
|
||||
rank_math()->settings->reset();
|
||||
}
|
||||
rank_math_1_0_202_content_ai_convert_english_language();
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.211.
|
||||
*
|
||||
* @since 1.0.211
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Add value in options table to show a notification in Dashboard menu on existing setup.
|
||||
*/
|
||||
function rank_math_1_0_211_content_ai_store_notification_option() {
|
||||
update_option( 'rank_math_view_modules', true, false );
|
||||
}
|
||||
rank_math_1_0_211_content_ai_store_notification_option();
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.232.
|
||||
*
|
||||
* @since 1.0.232
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Add indexes to the internal links table (target_post_id column).
|
||||
*/
|
||||
function rank_math_1_0_232_internal_links_table_indexes() {
|
||||
global $wpdb;
|
||||
|
||||
$wpdb->query( "ALTER TABLE {$wpdb->prefix}rank_math_internal_links ADD INDEX target_post_id (target_post_id)" );
|
||||
}
|
||||
rank_math_1_0_232_internal_links_table_indexes();
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.237.
|
||||
*
|
||||
* @since 1.0.237
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Alter the redirections table structure.
|
||||
*/
|
||||
function rank_math_1_0_237_update_redirection_structure() {
|
||||
// Early Bail if redirections table doesn't exist.
|
||||
if ( ! \RankMath\Helpers\DB::check_table_exists( 'rank_math_redirections' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
global $wpdb;
|
||||
$wpdb->query( "ALTER TABLE {$wpdb->prefix}rank_math_redirections MODIFY COLUMN sources LONGTEXT NOT NULL" );
|
||||
}
|
||||
rank_math_1_0_237_update_redirection_structure();
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.238.
|
||||
*
|
||||
* @since 1.0.238
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
use RankMath\Helper;
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Flush rewrite rules.
|
||||
*/
|
||||
function rank_math_1_0_238_flush_rules() {
|
||||
if (
|
||||
Helper::is_woocommerce_active() &&
|
||||
Helper::is_module_active( 'woocommerce' ) && (
|
||||
Helper::get_settings( 'general.wc_remove_category_base' ) ||
|
||||
Helper::get_settings( 'general.wc_remove_category_parent_slugs' ) )
|
||||
) {
|
||||
flush_rewrite_rules( true );
|
||||
}
|
||||
}
|
||||
|
||||
rank_math_1_0_238_flush_rules();
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.239.
|
||||
*
|
||||
* @since 1.0.239
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
use RankMath\KB;
|
||||
use RankMath\Helper;
|
||||
use RankMath\Helpers\Str;
|
||||
use RankMath\Google\Analytics;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Displays an admin notice to users with a Universal Analytics (UA) property, informing them to update to Google Analytics 4 (GA4).
|
||||
*/
|
||||
function rank_math_1_0_239_force_to_connect_ga4() {
|
||||
if ( ! Analytics::is_analytics_connected() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$analytics = get_option( 'rank_math_google_analytic_options' );
|
||||
|
||||
if ( ! isset( $analytics['property_id'] ) || ! Str::starts_with( 'UA-', $analytics['property_id'] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
Helper::add_notification(
|
||||
sprintf(
|
||||
// Translators: placeholders are opening and closing tags for connect analytics setting and using ga4 property doc.
|
||||
__( 'Universal Analytics (UA) is no longer supported. Please connect your Google Analytics GA4 account by navigating to %1$sGeneral Settings → Analytics%2$s. For more details, refer to this guide: %3$sHow to Use Google Analytics 4 (GA4) Property with Rank Math%4$s.', 'seo-by-rank-math' ),
|
||||
'<a href="' . esc_url( Helper::get_admin_url( 'options-general#setting-panel-analytics' ) ) . '">',
|
||||
'</a>',
|
||||
'<a href="' . KB::get( 'using-ga4', 'Analytics GA4 KB' ) . '" target="_blank">',
|
||||
'</a>'
|
||||
),
|
||||
[
|
||||
'id' => 'upgrade-ua-to-ga4',
|
||||
'type' => 'error',
|
||||
'classes' => 'is-dismissible',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
rank_math_1_0_239_force_to_connect_ga4();
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.250
|
||||
*
|
||||
* @since 1.0.250
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
use RankMath\Helper;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Update LLMS Post types on existing sites.
|
||||
*/
|
||||
function rank_math_1_0_250_update_llms_post_types() {
|
||||
$post_types = Helper::get_accessible_post_types();
|
||||
if ( isset( $post_types['attachment'] ) ) {
|
||||
unset( $post_types['attachment'] );
|
||||
}
|
||||
|
||||
if ( empty( $post_types ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$all_opts = rank_math()->settings->all_raw();
|
||||
$general = $all_opts['general'];
|
||||
$general['llms_post_types'] = array_keys( $post_types );
|
||||
|
||||
Helper::update_all_settings( $general, null, null );
|
||||
rank_math()->settings->reset();
|
||||
}
|
||||
rank_math_1_0_250_update_llms_post_types();
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.251
|
||||
*
|
||||
* @since 1.0.251
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Update code needed to support React migration.
|
||||
*/
|
||||
function rank_math_1_0_251_migrate_react_settings() {
|
||||
\RankMath\Status\Backup::create_backup();
|
||||
update_option( 'rank_math_react_settings_ui', 'on', false );
|
||||
}
|
||||
rank_math_1_0_251_migrate_react_settings();
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.264
|
||||
*
|
||||
* @since 1.0.264
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use RankMath\Helpers\DB;
|
||||
|
||||
/**
|
||||
* Add composite index on status and updated columns to rank_math_redirections table.
|
||||
*/
|
||||
function rank_math_1_0_264_add_redirections_index() {
|
||||
$index_name = 'idx_rm_status_updated';
|
||||
$table_name = 'rank_math_redirections';
|
||||
$columns = [ 'status', 'updated' ];
|
||||
|
||||
if ( DB::check_table_exists( 'rank_math_redirections' ) ) {
|
||||
DB::create_index( $index_name, $table_name, $columns );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add composite index to rank_math_redirections table for performance optimization.
|
||||
*/
|
||||
function rank_math_1_0_264_create_redirections_index() {
|
||||
if ( ! is_multisite() ) {
|
||||
rank_math_1_0_264_add_redirections_index();
|
||||
return;
|
||||
}
|
||||
}
|
||||
rank_math_1_0_264_create_redirections_index();
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.273
|
||||
*
|
||||
* @since 1.0.273
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use RankMath\Helper;
|
||||
|
||||
/**
|
||||
* Enable AI Visibility module by default for existing installs.
|
||||
*/
|
||||
function rank_math_1_0_273_enable_ai_visibility_module() {
|
||||
Helper::update_modules( [ 'ai-visibility' => 'on' ] );
|
||||
}
|
||||
|
||||
rank_math_1_0_273_enable_ai_visibility_module();
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.277.2
|
||||
*
|
||||
* @since 1.0.277.2
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Delete WordPress Application Passwords minted by the Support Agent WAP integration.
|
||||
*/
|
||||
function rank_math_1_0_277_2_delete_wap_application_passwords() {
|
||||
global $wpdb;
|
||||
|
||||
if ( ! class_exists( 'WP_Application_Passwords' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$password_name = 'WAP – Rank Math Support Agent';
|
||||
|
||||
// Narrows to only usermeta rows that can contain the password, so the
|
||||
// LIKE scan doesn't touch unrelated meta on large sites.
|
||||
$user_ids = $wpdb->get_col(
|
||||
$wpdb->prepare(
|
||||
"SELECT DISTINCT user_id FROM %i WHERE meta_key = '_application_passwords' AND meta_value LIKE %s",
|
||||
$wpdb->usermeta,
|
||||
'%' . $wpdb->esc_like( $password_name ) . '%'
|
||||
)
|
||||
);
|
||||
|
||||
foreach ( $user_ids as $user_id ) {
|
||||
$passwords = WP_Application_Passwords::get_user_application_passwords( $user_id );
|
||||
foreach ( $passwords as $password ) {
|
||||
if ( $password_name === $password['name'] ) {
|
||||
WP_Application_Passwords::delete_application_password( $user_id, $password['uuid'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
rank_math_1_0_277_2_delete_wap_application_passwords();
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.84
|
||||
*
|
||||
* @since 1.0.84
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Start the scheduled URL Inspections if Analytics module is enabled.
|
||||
*/
|
||||
function rank_math_1_0_84_init_url_inspections() {
|
||||
$active_modules = get_option( 'rank_math_modules', [] );
|
||||
if ( ! is_array( $active_modules ) || ! in_array( 'analytics', $active_modules, true ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Start first fetch in 15 minutes.
|
||||
$start = time() + ( 15 * MINUTE_IN_SECONDS );
|
||||
as_schedule_single_action( $start, 'rank_math/analytics/workflow', [ 'inspections', 0, null, null ], 'rank-math' );
|
||||
}
|
||||
|
||||
rank_math_1_0_84_init_url_inspections();
|
||||
|
||||
/**
|
||||
* Fix collations for the Analytics tables.
|
||||
*/
|
||||
function rank_math_1_0_84_check_analytics_collations() {
|
||||
$tables = [
|
||||
'rank_math_analytics_ga',
|
||||
'rank_math_analytics_gsc',
|
||||
'rank_math_analytics_keyword_manager',
|
||||
];
|
||||
|
||||
$objects_coll = \RankMath\Helpers\DB::get_table_collation( 'rank_math_analytics_objects' );
|
||||
foreach ( $tables as $table ) {
|
||||
\RankMath\Helpers\DB::check_collation( $table, 'all', $objects_coll );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Run collation fixer on multisite or simple install.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function rank_math_1_0_84_check_collations() {
|
||||
if ( is_multisite() ) {
|
||||
foreach ( get_sites() as $site ) {
|
||||
switch_to_blog( $site->blog_id );
|
||||
rank_math_1_0_84_check_analytics_collations();
|
||||
restore_current_blog();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
rank_math_1_0_84_check_analytics_collations();
|
||||
}
|
||||
|
||||
rank_math_1_0_84_check_collations();
|
||||
|
||||
/**
|
||||
* Enable the Index Status tab by default.
|
||||
*/
|
||||
function rank_math_1_0_84_update_analytics_options() {
|
||||
$active_modules = get_option( 'rank_math_modules', [] );
|
||||
if ( ! is_array( $active_modules ) || ! in_array( 'analytics', $active_modules, true ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$options = get_option( 'rank_math_google_analytic_profile' );
|
||||
if ( ! is_array( $options ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$options['enable_index_status'] = true;
|
||||
update_option( 'rank_math_google_analytic_profile', $options );
|
||||
}
|
||||
|
||||
rank_math_1_0_84_update_analytics_options();
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.86
|
||||
*
|
||||
* @since 1.0.86
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
use RankMath\Helper;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Update Analytics Stats on existing sites.
|
||||
*/
|
||||
function rank_math_1_0_86_update_analytics_stats() {
|
||||
$all_opts = rank_math()->settings->all_raw();
|
||||
$general = $all_opts['general'];
|
||||
$general['analytics_stats'] = 'on';
|
||||
|
||||
Helper::update_all_settings( $general, null, null );
|
||||
rank_math()->settings->reset();
|
||||
}
|
||||
rank_math_1_0_86_update_analytics_stats();
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.89
|
||||
*
|
||||
* @since 1.0.89
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Convert keywords used in Content AI to lower case on existing sites.
|
||||
*/
|
||||
function rank_math_1_0_89_update_contentai_data() {
|
||||
$data = get_option( 'rank_math_ca_data' );
|
||||
if ( empty( $data ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ( $data as $country => $keywords ) {
|
||||
if ( empty( $keywords ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ret = [];
|
||||
foreach ( $keywords as $key => $keyword ) {
|
||||
$ret[ mb_strtolower( $key ) ] = $keyword;
|
||||
}
|
||||
|
||||
if ( ! empty( $ret ) ) {
|
||||
$data[ $country ] = $ret;
|
||||
}
|
||||
}
|
||||
|
||||
update_option( 'rank_math_ca_data', $data );
|
||||
}
|
||||
|
||||
rank_math_1_0_89_update_contentai_data();
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- This filename format is intentionally used to match the plugin version.
|
||||
/**
|
||||
* The Updates routine for version 1.0.98
|
||||
*
|
||||
* @since 1.0.98
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Updates
|
||||
* @author Rank Math <support@rankmath.com>
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Get a group's ID based on its name/slug.
|
||||
*
|
||||
* @param string $slug The string name of a group.
|
||||
*
|
||||
* @return int The group's ID, if it exists or is created, or 0 if it does not exist and is not created.
|
||||
*/
|
||||
function rank_math_1_0_98_as_get_group_id( $slug ) {
|
||||
if ( empty( $slug ) ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
global $wpdb;
|
||||
$table = $wpdb->prefix . 'actionscheduler_groups';
|
||||
$group_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT group_id FROM {$table} WHERE slug=%s", $slug ) );
|
||||
|
||||
return $group_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix Action Scheduler groups.
|
||||
*/
|
||||
function rank_math_1_0_98_fix_as_groups() {
|
||||
$workflow_group_id = rank_math_1_0_98_as_get_group_id( 'workflow' );
|
||||
$inspections_group_id = rank_math_1_0_98_as_get_group_id( 'rank_math/analytics/get_inspections_data' );
|
||||
$rank_math_group_id = rank_math_1_0_98_as_get_group_id( 'rank-math' );
|
||||
|
||||
if ( 0 === $rank_math_group_id ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// In the actions table, update the group_id for all actions in the 'workflow' & 'rank_math/analytics/get_inspections_data' groups to the 'rank-math' group.
|
||||
global $wpdb;
|
||||
$actions_table = $wpdb->prefix . 'actionscheduler_actions';
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE {$actions_table} SET group_id=%d WHERE group_id=%d OR group_id=%d", $rank_math_group_id, $workflow_group_id, $inspections_group_id ) );
|
||||
|
||||
// Delete the 'workflow' & 'rank_math/analytics/get_inspections_data' groups.
|
||||
$groups_table = $wpdb->prefix . 'actionscheduler_groups';
|
||||
$wpdb->query( $wpdb->prepare( "DELETE FROM {$groups_table} WHERE group_id=%d OR group_id=%d", $workflow_group_id, $inspections_group_id ) );
|
||||
}
|
||||
|
||||
rank_math_1_0_98_fix_as_groups();
|
||||
Reference in New Issue
Block a user