WordPress SEO Plugin – Rank Math - Version 1.0.52.1

Version Description

[Nov 09, 2020] = * Squashed a couple of small issues

Download this release

Release Info

Developer rankmath
Plugin Icon 128x128 WordPress SEO Plugin – Rank Math
Version 1.0.52.1
Comparing to
See all releases

Code changes from version 1.0.52 to 1.0.52.1

includes/modules/analytics/class-db.php CHANGED
@@ -160,7 +160,19 @@ class DB {
160
  * @return boolean
161
  */
162
  public static function date_exists( $date ) {
163
- $id = self::analytics()
 
 
 
 
 
 
 
 
 
 
 
 
164
  ->select( 'id' )
165
  ->where( 'created', $date )
166
  ->getVar();
160
  * @return boolean
161
  */
162
  public static function date_exists( $date ) {
163
+ $is_console = \RankMath\Google\Console::is_console_connected();
164
+ $is_analytics = \RankMath\Google\Analytics::is_analytics_connected();
165
+
166
+ if ( ! $is_console && ! $is_analytics ) {
167
+ return true;
168
+ }
169
+
170
+ $id = self::analytics();
171
+ if ( ! $is_console && $is_analytics ) {
172
+ $id = self::table( 'rank_math_analytics_ga' );
173
+ }
174
+
175
+ $id = $id
176
  ->select( 'id' )
177
  ->where( 'created', $date )
178
  ->getVar();
includes/modules/analytics/google/class-analytics.php CHANGED
@@ -63,4 +63,18 @@ class Analytics extends Request {
63
 
64
  return $accounts;
65
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  }
63
 
64
  return $accounts;
65
  }
66
+
67
+ /**
68
+ * Get site url.
69
+ *
70
+ * @return string
71
+ */
72
+ public static function is_analytics_connected() {
73
+ $account = wp_parse_args(
74
+ get_option( 'rank_math_google_analytic_options' ),
75
+ [ 'view_id' => '' ]
76
+ );
77
+
78
+ return ! empty( $account['view_id'] );
79
+ }
80
  }
includes/modules/analytics/google/class-console.php CHANGED
@@ -265,23 +265,6 @@ class Console extends Analytics {
265
  return compact( 'delete_sitemaps', 'sitemaps_in_list', 'local_sitemap' );
266
  }
267
 
268
- /**
269
- * Get site url.
270
- *
271
- * @return string
272
- */
273
- public static function is_console_connected() {
274
- $profile = wp_parse_args(
275
- get_option( 'rank_math_google_analytic_profile' ),
276
- [
277
- 'profile' => '',
278
- 'country' => 'all',
279
- ]
280
- );
281
-
282
- return ! empty( $profile['profile'] );
283
- }
284
-
285
  /**
286
  * Get site url.
287
  *
@@ -298,4 +281,21 @@ class Console extends Analytics {
298
 
299
  return $rank_math_site_url;
300
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
301
  }
265
  return compact( 'delete_sitemaps', 'sitemaps_in_list', 'local_sitemap' );
266
  }
267
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  /**
269
  * Get site url.
270
  *
281
 
282
  return $rank_math_site_url;
283
  }
284
+
285
+ /**
286
+ * Get site url.
287
+ *
288
+ * @return string
289
+ */
290
+ public static function is_console_connected() {
291
+ $profile = wp_parse_args(
292
+ get_option( 'rank_math_google_analytic_profile' ),
293
+ [
294
+ 'profile' => '',
295
+ 'country' => 'all',
296
+ ]
297
+ );
298
+
299
+ return ! empty( $profile['profile'] );
300
+ }
301
  }
includes/replace-variables/class-post-variables.php CHANGED
@@ -296,7 +296,23 @@ class Post_Variables extends Advanced_Variables {
296
  * @return string
297
  */
298
  public function get_seo_description() {
299
- return Paper::get()->get_description();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
300
  }
301
 
302
  /**
296
  * @return string
297
  */
298
  public function get_seo_description() {
299
+ if ( is_singular() ) {
300
+ return Paper::get()->get_description();
301
+ }
302
+
303
+ $object = $this->args;
304
+
305
+ // Early Bail!
306
+ if ( empty( $object ) || empty( $object->ID ) ) {
307
+ return '';
308
+ }
309
+
310
+ $description = Post::get_meta( 'description', $object->ID );
311
+ if ( '' !== $description ) {
312
+ return $description;
313
+ }
314
+
315
+ return Paper::get_from_options( "pt_{$object->post_type}_description", $object, '%excerpt%' );
316
  }
317
 
318
  /**
rank-math.php CHANGED
@@ -9,7 +9,7 @@
9
  *
10
  * @wordpress-plugin
11
  * Plugin Name: Rank Math SEO
12
- * Version: 1.0.52
13
  * Plugin URI: https://s.rankmath.com/home
14
  * Description: Rank Math is a revolutionary SEO product that combines the features of many SEO tools and lets you multiply your traffic in the easiest way possible.
15
  * Author: Rank Math
@@ -34,7 +34,7 @@ final class RankMath {
34
  *
35
  * @var string
36
  */
37
- public $version = '1.0.52';
38
 
39
  /**
40
  * Rank Math database version.
9
  *
10
  * @wordpress-plugin
11
  * Plugin Name: Rank Math SEO
12
+ * Version: 1.0.52.1
13
  * Plugin URI: https://s.rankmath.com/home
14
  * Description: Rank Math is a revolutionary SEO product that combines the features of many SEO tools and lets you multiply your traffic in the easiest way possible.
15
  * Author: Rank Math
34
  *
35
  * @var string
36
  */
37
+ public $version = '1.0.52.1';
38
 
39
  /**
40
  * Rank Math database version.
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: seo, sitemap, google search console, schema, redirection
5
  Tested up to: 5.5.3
6
  Requires at least: 5.2
7
  Requires PHP: 7.0
8
- Stable tag: 1.0.52
9
  License: GPL-2.0+
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.txt
11
 
@@ -475,6 +475,9 @@ Please drop us an email at support@rankmath.com and we would be more than happy
475
 
476
  == Changelog ==
477
 
 
 
 
478
  = 1.0.52 [Nov 09, 2020] =
479
  * Added: External icon in the Help & Support sidebar menu to [Rank Math's KB](https://rankmath.com/kb/)
480
  * Improved: CSS related to the block editor's sidebar tabs and Analytics
5
  Tested up to: 5.5.3
6
  Requires at least: 5.2
7
  Requires PHP: 7.0
8
+ Stable tag: 1.0.52.1
9
  License: GPL-2.0+
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.txt
11
 
475
 
476
  == Changelog ==
477
 
478
+ = 1.0.52.1 [Nov 09, 2020] =
479
+ * Squashed a couple of small issues
480
+
481
  = 1.0.52 [Nov 09, 2020] =
482
  * Added: External icon in the Help & Support sidebar menu to [Rank Math's KB](https://rankmath.com/kb/)
483
  * Improved: CSS related to the block editor's sidebar tabs and Analytics