Groups - Version 1.3.3

Version Description

  • WP 3.5 compatibility http://core.trac.wordpress.org/ticket/22262
Download this release

Release Info

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

Code changes from version 1.3.2 to 1.3.3

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.3.2
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.3.2' );
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.3.3
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.3.3' );
31
  define( 'GROUPS_FILE', __FILE__ );
32
  if ( !defined( 'GROUPS_CORE_DIR' ) ) {
33
  define( 'GROUPS_CORE_DIR', WP_PLUGIN_DIR . '/groups' );
lib/admin/class-groups-admin-users.php CHANGED
@@ -98,7 +98,7 @@ class Groups_Admin_Users {
98
  $group_table = _groups_get_tablename( "group" );
99
  // groups select
100
  $groups_select = "<select name='group_id'>";
101
- $groups = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $group_table ORDER BY name" ) );
102
  foreach( $groups as $group ) {
103
  $groups_select .= "<option value='" . esc_attr( $group->group_id ) . "'>" . wp_filter_nohtml_kses( $group->name ) . "</option>";
104
  }
@@ -151,7 +151,7 @@ class Groups_Admin_Users {
151
  global $pagenow, $wpdb;
152
  if ( ( $pagenow == 'users.php' ) && empty( $_GET['page'] ) ) {
153
  $group_table = _groups_get_tablename( "group" );
154
- $groups = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $group_table ORDER BY name" ) );
155
  foreach( $groups as $group ) {
156
  $group = new Groups_Group( $group->group_id );
157
  $user_count = count( $group->users );
98
  $group_table = _groups_get_tablename( "group" );
99
  // groups select
100
  $groups_select = "<select name='group_id'>";
101
+ $groups = $wpdb->get_results( "SELECT * FROM $group_table ORDER BY name" );
102
  foreach( $groups as $group ) {
103
  $groups_select .= "<option value='" . esc_attr( $group->group_id ) . "'>" . wp_filter_nohtml_kses( $group->name ) . "</option>";
104
  }
151
  global $pagenow, $wpdb;
152
  if ( ( $pagenow == 'users.php' ) && empty( $_GET['page'] ) ) {
153
  $group_table = _groups_get_tablename( "group" );
154
+ $groups = $wpdb->get_results( "SELECT * FROM $group_table ORDER BY name" );
155
  foreach( $groups as $group ) {
156
  $group = new Groups_Group( $group->group_id );
157
  $user_count = count( $group->users );
lib/admin/groups-admin-groups-add.php CHANGED
@@ -42,7 +42,7 @@ function groups_admin_groups_add() {
42
  $group_table = _groups_get_tablename( 'group' );
43
  $parent_select = '<select name="parent-id-field">';
44
  $parent_select .= '<option value="">--</option>';
45
- $groups = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $group_table" ) );
46
  foreach ( $groups as $group ) {
47
  $parent_select .= '<option value="' . esc_attr( $group->group_id ) . '">' . wp_filter_nohtml_kses( $group->name ) . '</option>';
48
  }
42
  $group_table = _groups_get_tablename( 'group' );
43
  $parent_select = '<select name="parent-id-field">';
44
  $parent_select .= '<option value="">--</option>';
45
+ $groups = $wpdb->get_results( "SELECT * FROM $group_table" );
46
  foreach ( $groups as $group ) {
47
  $parent_select .= '<option value="' . esc_attr( $group->group_id ) . '">' . wp_filter_nohtml_kses( $group->name ) . '</option>';
48
  }
lib/admin/groups-admin-groups.php CHANGED
@@ -323,7 +323,7 @@ function groups_admin_groups() {
323
 
324
  // capabilities select
325
  $capabilities_select = '<select name="capability_id">';
326
- $capabilities = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $capability_table ORDER BY capability" ) );
327
  foreach( $capabilities as $capability ) {
328
  $capabilities_select .= '<option value="' . esc_attr( $capability->capability_id ) . '">' . wp_filter_nohtml_kses( $capability->capability ) . '</option>';
329
  }
323
 
324
  // capabilities select
325
  $capabilities_select = '<select name="capability_id">';
326
+ $capabilities = $wpdb->get_results( "SELECT * FROM $capability_table ORDER BY capability" );
327
  foreach( $capabilities as $capability ) {
328
  $capabilities_select .= '<option value="' . esc_attr( $capability->capability_id ) . '">' . wp_filter_nohtml_kses( $capability->capability ) . '</option>';
329
  }
lib/admin/groups-admin-options.php CHANGED
@@ -229,7 +229,7 @@ function groups_admin_options() {
229
  '</p>';
230
 
231
  $capability_table = _groups_get_tablename( "capability" );
232
- $capabilities = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $capability_table ORDER BY capability" ) );
233
  $applicable_read_caps = Groups_Options::get_option( Groups_Post_Access::READ_POST_CAPABILITIES, array( Groups_Post_Access::READ_POST_CAPABILITY ) );
234
  foreach( $capabilities as $capability ) {
235
  $checked = in_array( $capability->capability, $applicable_read_caps ) ? ' checked="checked" ' : '';
229
  '</p>';
230
 
231
  $capability_table = _groups_get_tablename( "capability" );
232
+ $capabilities = $wpdb->get_results( "SELECT * FROM $capability_table ORDER BY capability" );
233
  $applicable_read_caps = Groups_Options::get_option( Groups_Post_Access::READ_POST_CAPABILITIES, array( Groups_Post_Access::READ_POST_CAPABILITY ) );
234
  foreach( $capabilities as $capability ) {
235
  $checked = in_array( $capability->capability, $applicable_read_caps ) ? ' checked="checked" ' : '';
lib/core/class-groups-capability.php CHANGED
@@ -116,7 +116,7 @@ class Groups_Capability {
116
  }
117
  $capability_table = _groups_get_tablename( 'capability' );
118
  if ( $wpdb->insert( $capability_table, $data, $formats ) ) {
119
- if ( $result = $wpdb->get_var( $wpdb->prepare( "SELECT LAST_INSERT_ID()" ) ) ) {
120
  do_action( "groups_created_capability", $result );
121
  }
122
  }
116
  }
117
  $capability_table = _groups_get_tablename( 'capability' );
118
  if ( $wpdb->insert( $capability_table, $data, $formats ) ) {
119
+ if ( $result = $wpdb->get_var( "SELECT LAST_INSERT_ID()" ) ) {
120
  do_action( "groups_created_capability", $result );
121
  }
122
  }
lib/core/class-groups-group.php CHANGED
@@ -134,7 +134,7 @@ class Groups_Group implements I_Capable {
134
  $group_ids = array( $this->group->group_id );
135
  $iterations = 0;
136
  $old_group_ids_count = 0;
137
- $all_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $group_table" ) );
138
  while( ( $iterations < $all_groups ) && ( count( $group_ids ) !== $old_group_ids_count ) ) {
139
  $iterations++;
140
  $old_group_ids_count = count( $group_ids );
@@ -232,7 +232,7 @@ class Groups_Group implements I_Capable {
232
  }
233
  if ( !$error ) {
234
  if ( $wpdb->insert( $group_table, $data, $formats ) ) {
235
- if ( $result = $wpdb->get_var( $wpdb->prepare( "SELECT LAST_INSERT_ID()" ) ) ) {
236
  do_action( "groups_created_group", $result );
237
  }
238
  }
@@ -322,7 +322,7 @@ class Groups_Group implements I_Capable {
322
  // It must hold: !( P(g) in S*(g) )
323
 
324
  // Find all successors of this group
325
- $groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $group_table" ) );
326
  if ( $groups !== null ) {
327
  $group_ids = array();
328
  $group_ids[] = Groups_Utility::id( $group_id );
134
  $group_ids = array( $this->group->group_id );
135
  $iterations = 0;
136
  $old_group_ids_count = 0;
137
+ $all_groups = $wpdb->get_var( "SELECT COUNT(*) FROM $group_table" );
138
  while( ( $iterations < $all_groups ) && ( count( $group_ids ) !== $old_group_ids_count ) ) {
139
  $iterations++;
140
  $old_group_ids_count = count( $group_ids );
232
  }
233
  if ( !$error ) {
234
  if ( $wpdb->insert( $group_table, $data, $formats ) ) {
235
+ if ( $result = $wpdb->get_var( "SELECT LAST_INSERT_ID()" ) ) {
236
  do_action( "groups_created_group", $result );
237
  }
238
  }
322
  // It must hold: !( P(g) in S*(g) )
323
 
324
  // Find all successors of this group
325
+ $groups = $wpdb->get_var( "SELECT COUNT(*) FROM $group_table" );
326
  if ( $groups !== null ) {
327
  $group_ids = array();
328
  $group_ids[] = Groups_Utility::id( $group_id );
lib/core/class-groups-user.php CHANGED
@@ -148,7 +148,7 @@ class Groups_User implements I_Capable {
148
  // ... or because any of the parent groups can
149
  if ( !$result ) {
150
  // search in parent groups
151
- $limit = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $group_table" ) );
152
  if ( $limit !== null ) {
153
 
154
  // note that limits by blog_id for multisite are
148
  // ... or because any of the parent groups can
149
  if ( !$result ) {
150
  // search in parent groups
151
+ $limit = $wpdb->get_var( "SELECT COUNT(*) FROM $group_table" );
152
  if ( $limit !== null ) {
153
 
154
  // note that limits by blog_id for multisite are
lib/views/class-groups-shortcodes.php CHANGED
@@ -282,9 +282,9 @@ class Groups_Shortcodes {
282
  $order = 'ASC';
283
  }
284
  $group_table = _groups_get_tablename( "group" );
285
- if ( $groups = $wpdb->get_results( $wpdb->prepare(
286
  "SELECT group_id FROM $group_table ORDER BY $order_by $order"
287
- ) ) ) {
288
  switch( $options['format'] ) {
289
  case 'list' :
290
  case 'ul' :
282
  $order = 'ASC';
283
  }
284
  $group_table = _groups_get_tablename( "group" );
285
+ if ( $groups = $wpdb->get_results(
286
  "SELECT group_id FROM $group_table ORDER BY $order_by $order"
287
+ ) ) {
288
  switch( $options['format'] ) {
289
  case 'list' :
290
  case 'ul' :
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.3
6
- Tested up to: 3.4.2
7
- Stable tag: 1.3.2
8
  License: GPLv3
9
 
10
  Groups provides group-based user membership management, group-based capabilities and content access control.
@@ -19,6 +19,7 @@ It integrates standard WordPress capabilities and application-specific capabilit
19
  - [Groups File Access](http://www.itthinx.com/plugins/groups-file-access/) Groups File Access is an extension that allows to provide file download links for authorized users. Access to files is restricted to users by their group membership.
20
  - [Groups Notifications](http://www.itthinx.com/plugins/groups-notifications/) Adds customizable notifications for events related to Groups.
21
  - [Groups PayPal](http://www.itthinx.com/plugins/groups-paypal/) Groups for PayPal allows to sell memberships and subscriptions with Groups.
 
22
  - [Groups WooCommerce](http://www.woothemes.com/extension/groups-woocommerce/) Groups for WooCommerce is a WordPress plugin that allows you to sell memberships.
23
 
24
  ### Features ###
@@ -321,6 +322,9 @@ See also [Groups](http://www.itthinx.com/plugins/groups/)
321
 
322
  == Changelog ==
323
 
 
 
 
324
  = 1.3.2 =
325
  * Fixed capabilities cannot be added or removed from groups in localized installations
326
 
@@ -410,6 +414,9 @@ Some installations wouldn't work correctly, showing no capabilities and making i
410
 
411
  == Upgrade Notice ==
412
 
 
 
 
413
  = 1.3.2 =
414
  * Please update if you are or will be using a localized installation (bug fixes).
415
 
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.3
6
+ Tested up to: 3.5
7
+ Stable tag: 1.3.3
8
  License: GPLv3
9
 
10
  Groups provides group-based user membership management, group-based capabilities and content access control.
19
  - [Groups File Access](http://www.itthinx.com/plugins/groups-file-access/) Groups File Access is an extension that allows to provide file download links for authorized users. Access to files is restricted to users by their group membership.
20
  - [Groups Notifications](http://www.itthinx.com/plugins/groups-notifications/) Adds customizable notifications for events related to Groups.
21
  - [Groups PayPal](http://www.itthinx.com/plugins/groups-paypal/) Groups for PayPal allows to sell memberships and subscriptions with Groups.
22
+ - [Groups Jigoshop](http://jigoshop.com/product/subscriptions/) Groups integration for Jigoshop that supports memberships and subscriptions.
23
  - [Groups WooCommerce](http://www.woothemes.com/extension/groups-woocommerce/) Groups for WooCommerce is a WordPress plugin that allows you to sell memberships.
24
 
25
  ### Features ###
322
 
323
  == Changelog ==
324
 
325
+ = 1.3.3 =
326
+ * WP 3.5 compatibility http://core.trac.wordpress.org/ticket/22262
327
+
328
  = 1.3.2 =
329
  * Fixed capabilities cannot be added or removed from groups in localized installations
330
 
414
 
415
  == Upgrade Notice ==
416
 
417
+ = 1.3.3 =
418
+ * Compatibility update for WordPress 3.5.
419
+
420
  = 1.3.2 =
421
  * Please update if you are or will be using a localized installation (bug fixes).
422