Groups - Version 1.5.0

Version Description

  • Please MAKE A BACKUP of your site and database PRIOR to updating.
  • WordPress 4.2 compatible.
  • Reduced the index size on the capability row of the capability table.
Download this release

Release Info

Developer itthinx
Plugin Icon 128x128 Groups
Version 1.5.0
Comparing to
See all releases

Code changes from version 1.4.15 to 1.5.0

Files changed (3) hide show
  1. groups.php +2 -2
  2. lib/core/class-groups-controller.php +7 -2
  3. readme.txt +10 -5
groups.php CHANGED
@@ -21,13 +21,13 @@
21
  * Plugin Name: Groups
22
  * Plugin URI: http://www.itthinx.com/plugins/groups
23
  * Description: Groups provides group-based user membership management, group-based capabilities and content access control.
24
- * Version: 1.4.15
25
  * Author: itthinx
26
  * Author URI: http://www.itthinx.com
27
  * Donate-Link: http://www.itthinx.com
28
  * License: GPLv3
29
  */
30
- define( 'GROUPS_CORE_VERSION', '1.4.15' );
31
  define( 'GROUPS_FILE', __FILE__ );
32
  if ( !defined( 'GROUPS_CORE_DIR' ) ) {
33
  define( 'GROUPS_CORE_DIR', WP_PLUGIN_DIR . '/groups' );
21
  * Plugin Name: Groups
22
  * Plugin URI: http://www.itthinx.com/plugins/groups
23
  * Description: Groups provides group-based user membership management, group-based capabilities and content access control.
24
+ * Version: 1.5.0
25
  * Author: itthinx
26
  * Author URI: http://www.itthinx.com
27
  * Donate-Link: http://www.itthinx.com
28
  * License: GPLv3
29
  */
30
+ define( 'GROUPS_CORE_VERSION', '1.5.0' );
31
  define( 'GROUPS_FILE', __FILE__ );
32
  if ( !defined( 'GROUPS_CORE_DIR' ) ) {
33
  define( 'GROUPS_CORE_DIR', WP_PLUGIN_DIR . '/groups' );
lib/core/class-groups-controller.php CHANGED
@@ -163,12 +163,13 @@ class Groups_Controller {
163
  if ( $wpdb->get_var( "SHOW TABLES LIKE '$capability_table'" ) != $capability_table ) {
164
  $queries[] = "CREATE TABLE $capability_table (
165
  capability_id BIGINT(20) UNSIGNED NOT NULL auto_increment,
166
- capability VARCHAR(255) UNIQUE NOT NULL,
167
  class VARCHAR(255) DEFAULT NULL,
168
  object VARCHAR(255) DEFAULT NULL,
169
  name VARCHAR(100) DEFAULT NULL,
170
  description LONGTEXT DEFAULT NULL,
171
  PRIMARY KEY (capability_id),
 
172
  INDEX capability_kco (capability(20),class(20),object(20))
173
  ) $charset_collate;";
174
  }
@@ -210,7 +211,7 @@ class Groups_Controller {
210
  // add WordPress capabilities
211
  Groups_WordPress::activate();
212
  // ... end of plugin activation work.
213
- }
214
 
215
  /**
216
  * Checks current version and triggers update if needed.
@@ -269,6 +270,10 @@ class Groups_Controller {
269
  Groups_Options::update_option( Groups_Post_Access::READ_POST_CAPABILITIES, array( Groups_Post_Access::READ_POST_CAPABILITY ) );
270
  $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->postmeta SET meta_value = %s WHERE meta_key = %s", Groups_Post_Access::READ_POST_CAPABILITY, Groups_Post_Access::POSTMETA_PREFIX . Groups_Post_Access::READ_POST_CAPABILITY ) );
271
  }
 
 
 
 
272
  }
273
  } // switch
274
  foreach ( $queries as $query ) {
163
  if ( $wpdb->get_var( "SHOW TABLES LIKE '$capability_table'" ) != $capability_table ) {
164
  $queries[] = "CREATE TABLE $capability_table (
165
  capability_id BIGINT(20) UNSIGNED NOT NULL auto_increment,
166
+ capability VARCHAR(255) NOT NULL,
167
  class VARCHAR(255) DEFAULT NULL,
168
  object VARCHAR(255) DEFAULT NULL,
169
  name VARCHAR(100) DEFAULT NULL,
170
  description LONGTEXT DEFAULT NULL,
171
  PRIMARY KEY (capability_id),
172
+ UNIQUE INDEX capability (capability(20)),
173
  INDEX capability_kco (capability(20),class(20),object(20))
174
  ) $charset_collate;";
175
  }
211
  // add WordPress capabilities
212
  Groups_WordPress::activate();
213
  // ... end of plugin activation work.
214
+ }
215
 
216
  /**
217
  * Checks current version and triggers update if needed.
270
  Groups_Options::update_option( Groups_Post_Access::READ_POST_CAPABILITIES, array( Groups_Post_Access::READ_POST_CAPABILITY ) );
271
  $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->postmeta SET meta_value = %s WHERE meta_key = %s", Groups_Post_Access::READ_POST_CAPABILITY, Groups_Post_Access::POSTMETA_PREFIX . Groups_Post_Access::READ_POST_CAPABILITY ) );
272
  }
273
+ if ( strcmp( $previous_version, '1.5.0' ) < 0 ) {
274
+ $capability_table = _groups_get_tablename( 'capability' );
275
+ $queries[] = "ALTER TABLE $capability_table DROP INDEX capability, ADD UNIQUE INDEX capability(capability(20));";
276
+ }
277
  }
278
  } // switch
279
  foreach ( $queries as $query ) {
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: itthinx
3
  Donate link: http://www.itthinx.com/plugins/groups
4
  Tags: access, access control, capability, capabilities, content, download, downloads, file, file access, files, group, groups, member, members, membership, memberships, paypal, permission, permissions, subscription, subscriptions, woocommerce
5
  Requires at least: 3.5
6
- Tested up to: 4.1.1
7
- Stable tag: 1.4.15
8
  License: GPLv3
9
 
10
  Groups is an efficient and powerful solution, providing group-based user membership management, group-based capabilities and content access control.
@@ -177,6 +177,11 @@ See also [Groups](http://www.itthinx.com/plugins/groups/)
177
 
178
  == Changelog ==
179
 
 
 
 
 
 
180
  = 1.4.15 =
181
  * Due to changes in versions 1.4.14 and 1.4.15, it's important to **MAKE A BACKUP** of the site & database, test the site, extensions & theme PRIOR to updating.
182
  * Fixes a cache incompatibility with caching mechanisms that do not implement wp_cache_get()'s function signature fully.
@@ -425,6 +430,6 @@ Some installations wouldn't work correctly, showing no capabilities and making i
425
 
426
  == Upgrade Notice ==
427
 
428
- = 1.4.15 =
429
- Fixes a cache incompatibility with some object caching implementations.
430
- Due to changes in versions 1.4.14 and 1.4.15, it's important to **MAKE A BACKUP** of the site & database, test the site, extensions & theme PRIOR to updating.
3
  Donate link: http://www.itthinx.com/plugins/groups
4
  Tags: access, access control, capability, capabilities, content, download, downloads, file, file access, files, group, groups, member, members, membership, memberships, paypal, permission, permissions, subscription, subscriptions, woocommerce
5
  Requires at least: 3.5
6
+ Tested up to: 4.2
7
+ Stable tag: 1.5.0
8
  License: GPLv3
9
 
10
  Groups is an efficient and powerful solution, providing group-based user membership management, group-based capabilities and content access control.
177
 
178
  == Changelog ==
179
 
180
+ = 1.5.0 =
181
+ * Please **MAKE A BACKUP** of your site and database PRIOR to updating.
182
+ * WordPress 4.2 compatible.
183
+ * Reduced the index size on the capability row of the capability table.
184
+
185
  = 1.4.15 =
186
  * Due to changes in versions 1.4.14 and 1.4.15, it's important to **MAKE A BACKUP** of the site & database, test the site, extensions & theme PRIOR to updating.
187
  * Fixes a cache incompatibility with caching mechanisms that do not implement wp_cache_get()'s function signature fully.
430
 
431
  == Upgrade Notice ==
432
 
433
+ = 1.5.0 =
434
+ Please **MAKE A BACKUP** of your site and database PRIOR to updating.
435
+ This release is required for compatibility with WordPress 4.2 and above (uses a reduced index size on a database table).