PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | admin/import/plugins/class-import-rankmath.php +5 -1 18.4 → trunk View file →
@@ -108,8 +108,10 @@
108 108 }
109 109
110 110 /**
111 111 * RankMath stores robots meta quite differently, so we have to parse it out.
112 + *
113 + * @return void
112 114 */
113 115 private function import_meta_robots() {
114 116 global $wpdb;
115 117 $post_metas = $wpdb->get_results( "SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = 'rank_math_robots'" );
@@ -114,9 +116,9 @@
114 116 global $wpdb;
115 117 $post_metas = $wpdb->get_results( "SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = 'rank_math_robots'" );
116 118 foreach ( $post_metas as $post_meta ) {
117 119 // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- Reason: We can't control the form in which Rankmath sends the data.
118 - $robots_values = unserialize( $post_meta->meta_value );
120 + $robots_values = unserialize( $post_meta->meta_value, [ 'allowed_classes' => false ] );
119 121 foreach ( [ 'noindex', 'nofollow' ] as $directive ) {
120 122 $directive_key = array_search( $directive, $robots_values, true );
121 123 if ( $directive_key !== false ) {
122 124 update_post_meta( $post_meta->post_id, '_yoast_wpseo_meta-robots-' . $directive, 1 );
@@ -131,8 +133,10 @@
131 133 }
132 134
133 135 /**
134 136 * Imports some of the RankMath settings.
137 + *
138 + * @return void
135 139 */
136 140 private function import_settings() {
137 141 $settings = [
138 142 'title_separator' => 'separator',