WordPress SEO Plugin – Rank Math - Version 1.0.20

Version Description

[Mar 06, 2019] = * Enhanced the Role Manager to disallow any permissions by default to lesser used roles like contributor etc. * Fixed a fatal error happening when users were upgrading from a version lower than 1.0.18 to the latest version

Full changelog can be found here - Rank Math SEO changelog

Download this release

Release Info

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

Code changes from version 1.0.19 to 1.0.20

includes/modules/links/class-contentprocessor.php CHANGED
@@ -135,7 +135,7 @@ class ContentProcessor {
135
  * @return boolean
136
  */
137
  private function is_valid_link_type( $link ) {
138
- if ( '#' === $link[0] ) {
139
  return false;
140
  }
141
 
135
  * @return boolean
136
  */
137
  private function is_valid_link_type( $link ) {
138
+ if ( empty( $link ) || '#' === $link[0] ) {
139
  return false;
140
  }
141
 
includes/modules/role-manager/class-capability-manager.php CHANGED
@@ -102,7 +102,7 @@ class Capability_Manager {
102
  continue;
103
  }
104
 
105
- foreach ( self::get_default_capabilities_by_role( $slug ) as $cap ) {
106
  $role->add_cap( $cap );
107
  }
108
  }
@@ -138,28 +138,24 @@ class Capability_Manager {
138
  }
139
 
140
  if ( 'editor' === $role ) {
141
- return array(
142
  'rank_math_site_analysis',
143
  'rank_math_onpage_analysis',
144
  'rank_math_onpage_general',
145
  'rank_math_onpage_snippet',
146
  'rank_math_onpage_social',
147
- );
148
  }
149
 
150
  if ( 'author' === $role ) {
151
- return array(
152
  'rank_math_onpage_analysis',
153
  'rank_math_onpage_general',
154
  'rank_math_onpage_snippet',
155
  'rank_math_onpage_social',
156
- );
157
  }
158
 
159
- return array(
160
- 'rank_math_onpage_analysis',
161
- 'rank_math_onpage_general',
162
- 'rank_math_onpage_social',
163
- );
164
  }
165
  }
102
  continue;
103
  }
104
 
105
+ foreach ( $this->get_default_capabilities_by_role( $slug ) as $cap ) {
106
  $role->add_cap( $cap );
107
  }
108
  }
138
  }
139
 
140
  if ( 'editor' === $role ) {
141
+ return [
142
  'rank_math_site_analysis',
143
  'rank_math_onpage_analysis',
144
  'rank_math_onpage_general',
145
  'rank_math_onpage_snippet',
146
  'rank_math_onpage_social',
147
+ ];
148
  }
149
 
150
  if ( 'author' === $role ) {
151
+ return [
152
  'rank_math_onpage_analysis',
153
  'rank_math_onpage_general',
154
  'rank_math_onpage_snippet',
155
  'rank_math_onpage_social',
156
+ ];
157
  }
158
 
159
+ return [];
 
 
 
 
160
  }
161
  }
includes/modules/role-manager/class-members.php CHANGED
@@ -41,12 +41,12 @@ class Members {
41
  * Registers cap group.
42
  */
43
  public function register_cap_groups() {
44
- members_register_cap_group( self::GROUP, array(
45
  'label' => esc_html__( 'Rank Math', 'rank-math' ),
46
- 'caps' => array(),
47
  'icon' => 'dashicons-chart-area',
48
  'priority' => 30,
49
- ));
50
  }
51
 
52
  /**
@@ -59,10 +59,10 @@ class Members {
59
  }
60
 
61
  foreach ( $caps as $key => $value ) {
62
- members_register_cap( $key, array(
63
  'label' => html_entity_decode( $value ),
64
  'group' => self::GROUP,
65
- ));
66
  }
67
  }
68
  }
41
  * Registers cap group.
42
  */
43
  public function register_cap_groups() {
44
+ members_register_cap_group( self::GROUP, [
45
  'label' => esc_html__( 'Rank Math', 'rank-math' ),
46
+ 'caps' => [],
47
  'icon' => 'dashicons-chart-area',
48
  'priority' => 30,
49
+ ]);
50
  }
51
 
52
  /**
59
  }
60
 
61
  foreach ( $caps as $key => $value ) {
62
+ members_register_cap( $key, [
63
  'label' => html_entity_decode( $value ),
64
  'group' => self::GROUP,
65
+ ]);
66
  }
67
  }
68
  }
includes/modules/role-manager/class-role-manager.php CHANGED
@@ -28,22 +28,22 @@ class Role_Manager extends Module {
28
  public function __construct() {
29
 
30
  $directory = dirname( __FILE__ );
31
- $this->config(array(
32
  'id' => 'role-manager',
33
  'directory' => $directory,
34
- 'help' => array(
35
  'title' => esc_html__( 'Role Manager', 'rank-math' ),
36
  'view' => $directory . '/views/help.php',
37
- ),
38
- ));
39
  parent::__construct();
40
 
41
  $this->action( 'cmb2_admin_init', 'register_form' );
42
- add_filter( 'cmb2_override_option_get_rank-math-role-manager', array( '\RankMath\Helper', 'get_roles_capabilities' ) );
43
  $this->action( 'admin_post_rank_math_save_capabilities', 'save_capabilities' );
44
 
45
  if ( $this->page->is_current_page() ) {
46
- add_action( 'admin_enqueue_scripts', array( 'CMB2_hookup', 'enqueue_cmb_css' ), 25 );
47
  }
48
 
49
  // Members plugin integration.
@@ -63,19 +63,19 @@ class Role_Manager extends Module {
63
  public function register_admin_page() {
64
  $uri = untrailingslashit( plugin_dir_url( __FILE__ ) );
65
 
66
- $this->page = new Page( 'rank-math-role-manager', esc_html__( 'Role Manager', 'rank-math' ), array(
67
  'position' => 11,
68
  'parent' => 'rank-math',
69
  'render' => $this->directory . '/views/main.php',
70
- 'classes' => array( 'rank-math-page' ),
71
- 'assets' => array(
72
- 'styles' => array(
73
  'rank-math-common' => '',
74
  'rank-math-cmb2' => '',
75
  'rank-math-role-manager' => $uri . '/assets/role-manager.css',
76
- ),
77
- ),
78
- ));
79
  }
80
 
81
  /**
@@ -83,23 +83,23 @@ class Role_Manager extends Module {
83
  */
84
  public function register_form() {
85
 
86
- $cmb = new_cmb2_box( array(
87
  'id' => 'rank-math-role-manager',
88
- 'object_types' => array( 'options-page' ),
89
  'option_key' => 'rank-math-role-manager',
90
  'hookup' => false,
91
  'save_fields' => false,
92
- ) );
93
 
94
  foreach ( WordPress::get_roles() as $role => $label ) {
95
- $cmb->add_field( array(
96
  'id' => esc_attr( $role ),
97
  'type' => 'multicheck_inline',
98
  'name' => translate_user_role( $label ),
99
  'options' => Helper::get_capabilities(),
100
  'select_all_button' => false,
101
  'classes' => 'cmb-big-labels',
102
- ) );
103
  }
104
  }
105
 
28
  public function __construct() {
29
 
30
  $directory = dirname( __FILE__ );
31
+ $this->config([
32
  'id' => 'role-manager',
33
  'directory' => $directory,
34
+ 'help' => [
35
  'title' => esc_html__( 'Role Manager', 'rank-math' ),
36
  'view' => $directory . '/views/help.php',
37
+ ],
38
+ ]);
39
  parent::__construct();
40
 
41
  $this->action( 'cmb2_admin_init', 'register_form' );
42
+ add_filter( 'cmb2_override_option_get_rank-math-role-manager', [ '\RankMath\Helper', 'get_roles_capabilities' ] );
43
  $this->action( 'admin_post_rank_math_save_capabilities', 'save_capabilities' );
44
 
45
  if ( $this->page->is_current_page() ) {
46
+ add_action( 'admin_enqueue_scripts', [ 'CMB2_hookup', 'enqueue_cmb_css' ], 25 );
47
  }
48
 
49
  // Members plugin integration.
63
  public function register_admin_page() {
64
  $uri = untrailingslashit( plugin_dir_url( __FILE__ ) );
65
 
66
+ $this->page = new Page( 'rank-math-role-manager', esc_html__( 'Role Manager', 'rank-math' ), [
67
  'position' => 11,
68
  'parent' => 'rank-math',
69
  'render' => $this->directory . '/views/main.php',
70
+ 'classes' => [ 'rank-math-page' ],
71
+ 'assets' => [
72
+ 'styles' => [
73
  'rank-math-common' => '',
74
  'rank-math-cmb2' => '',
75
  'rank-math-role-manager' => $uri . '/assets/role-manager.css',
76
+ ],
77
+ ],
78
+ ]);
79
  }
80
 
81
  /**
83
  */
84
  public function register_form() {
85
 
86
+ $cmb = new_cmb2_box( [
87
  'id' => 'rank-math-role-manager',
88
+ 'object_types' => [ 'options-page' ],
89
  'option_key' => 'rank-math-role-manager',
90
  'hookup' => false,
91
  'save_fields' => false,
92
+ ]);
93
 
94
  foreach ( WordPress::get_roles() as $role => $label ) {
95
+ $cmb->add_field([
96
  'id' => esc_attr( $role ),
97
  'type' => 'multicheck_inline',
98
  'name' => translate_user_role( $label ),
99
  'options' => Helper::get_capabilities(),
100
  'select_all_button' => false,
101
  'classes' => 'cmb-big-labels',
102
+ ]);
103
  }
104
  }
105
 
includes/modules/role-manager/class-user-role-editor.php CHANGED
@@ -34,7 +34,7 @@ class User_Role_Editor {
34
  *
35
  * @var array
36
  */
37
- private $caps = array();
38
 
39
  /**
40
  * Class Members constructor.
@@ -52,14 +52,14 @@ class User_Role_Editor {
52
  * @param array $groups Current groups.
53
  * @return array Filtered list of capabilty groups.
54
  */
55
- public function register_group( $groups = array() ) {
56
  $groups = (array) $groups;
57
 
58
- $groups[ self::GROUP ] = array(
59
  'caption' => esc_html__( 'Rank Math', 'rank-math' ),
60
  'parent' => 'custom',
61
  'level' => 3,
62
- );
63
 
64
  return $groups;
65
  }
@@ -71,7 +71,7 @@ class User_Role_Editor {
71
  * @param string $cap_id Capability identifier.
72
  * @return array List of filtered groups.
73
  */
74
- public function register_capability_groups( $groups = array(), $cap_id = '' ) {
75
  if ( array_key_exists( $cap_id, $this->caps ) ) {
76
  $groups = (array) $groups;
77
  $groups[] = self::GROUP;
34
  *
35
  * @var array
36
  */
37
+ private $caps = [];
38
 
39
  /**
40
  * Class Members constructor.
52
  * @param array $groups Current groups.
53
  * @return array Filtered list of capabilty groups.
54
  */
55
+ public function register_group( $groups = [] ) {
56
  $groups = (array) $groups;
57
 
58
+ $groups[ self::GROUP ] = [
59
  'caption' => esc_html__( 'Rank Math', 'rank-math' ),
60
  'parent' => 'custom',
61
  'level' => 3,
62
+ ];
63
 
64
  return $groups;
65
  }
71
  * @param string $cap_id Capability identifier.
72
  * @return array List of filtered groups.
73
  */
74
+ public function register_capability_groups( $groups = [], $cap_id = '' ) {
75
  if ( array_key_exists( $cap_id, $this->caps ) ) {
76
  $groups = (array) $groups;
77
  $groups[] = self::GROUP;
includes/updates/update-1.0.18.php CHANGED
@@ -12,7 +12,7 @@
12
  * Change of authentication end-point notice.
13
  */
14
  function rank_math_1_0_18_authentication_change() {
15
- $is_skipped = Helper::is_plugin_active_for_network() ? get_blog_option( get_main_site_id(), 'rank_math_registration_skip' ) : get_option( 'rank_math_registration_skip' );
16
 
17
  \RankMath\Helper::add_notification(
18
  sprintf(
12
  * Change of authentication end-point notice.
13
  */
14
  function rank_math_1_0_18_authentication_change() {
15
+ $is_skipped = \RankMath\Helper::is_plugin_active_for_network() ? get_blog_option( get_main_site_id(), 'rank_math_registration_skip' ) : get_option( 'rank_math_registration_skip' );
16
 
17
  \RankMath\Helper::add_notification(
18
  sprintf(
rank-math.php CHANGED
@@ -9,7 +9,7 @@
9
  *
10
  * @wordpress-plugin
11
  * Plugin Name: Rank Math SEO
12
- * Version: 1.0.19
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.19';
38
 
39
  /**
40
  * Rank Math database version.
9
  *
10
  * @wordpress-plugin
11
  * Plugin Name: Rank Math SEO
12
+ * Version: 1.0.20
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.20';
38
 
39
  /**
40
  * Rank Math database version.
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: seo, sitemap, google search console, schema.org, redirection
5
  Tested up to: 5.1
6
  Requires at least: 4.6.0
7
  Requires PHP: 5.6
8
- Stable tag: 1.0.19
9
  License: GPL-2.0+
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.txt
11
 
@@ -448,21 +448,8 @@ We look forward to helping you.
448
 
449
  == Changelog ==
450
 
451
- = 1.0.19 [Mar 05, 2019] =
452
- * Added new Business Types for Google's Knowledge Base
453
- * Added a filter to allow users to add any business type
454
- * Improved sitemap performance by reducing query load
455
- * Changed few wrong URLs of RM's Knowledge Base articles
456
- * Enabled Author Archive page by default
457
- * Fixed Secondary Keyword(s) tests to run completely
458
- * Fixed Author Sitemap last modification Meta issue, which helps to show the authors in a chronicle order
459
- * Fixed registration tab not opening for some users
460
- * Fixed a Redirection issue if WordPress was installed in the sub-directory
461
- * Fixed an error in the Local SEO Data
462
- * Fixed Rating Error in WooCommerce Product Schema where the content was getting picked from the comments instead of the actual reviews
463
- * Fixed incorrect Rank Math connect URL in the multisite installation
464
- * Fixed the slug change process from the posts list page. The changes show correctly now
465
- * Fixed one RollBar related issue which was throwing a fatal error on some installations
466
- * Improved the overall test coverage and the API related code in the plugin
467
 
468
  Full changelog can be found here - **[Rank Math SEO changelog](https://rankmath.com/changelog)**
5
  Tested up to: 5.1
6
  Requires at least: 4.6.0
7
  Requires PHP: 5.6
8
+ Stable tag: 1.0.20
9
  License: GPL-2.0+
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.txt
11
 
448
 
449
  == Changelog ==
450
 
451
+ = 1.0.20 [Mar 06, 2019] =
452
+ * Enhanced the Role Manager to disallow any permissions by default to lesser used roles like contributor etc.
453
+ * Fixed a fatal error happening when users were upgrading from a version lower than 1.0.18 to the latest version
 
 
 
 
 
 
 
 
 
 
 
 
 
454
 
455
  Full changelog can be found here - **[Rank Math SEO changelog](https://rankmath.com/changelog)**