Capability Manager Enhanced - Version 1.10.1

Version Description

  • 8 Oct 2020 =
    • Fixed : Type-Specific Capabilities options included some non-public WordPress post types that don't support capability customization
    • Fixed : Review of role backup contents does not show name of current roles which would be removed by restoring backup
Download this release

Release Info

Developer kevinB
Plugin Icon 128x128 Capability Manager Enhanced
Version 1.10.1
Comparing to
See all releases

Code changes from version 1.10 to 1.10.1

capsman-enhanced.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: PublishPress Capabilities
4
  * Plugin URI: https://publishpress.com/capability-manager/
5
  * Description: Manage WordPress role definitions, per-site or network-wide. Organizes post capabilities by post type and operation.
6
- * Version: 1.10
7
  * Author: PublishPress
8
  * Author URI: https://publishpress.com/
9
  * Text Domain: capsman-enhanced
@@ -25,13 +25,13 @@
25
  * @copyright Copyright (C) 2009, 2010 Jordi Canals; modifications Copyright (C) 2020 PublishPress
26
  * @license GNU General Public License version 3
27
  * @link https://publishpress.com/
28
- * @version 1.10
29
  */
30
 
31
  if (!defined('CAPSMAN_VERSION')) {
32
- define('CAPSMAN_VERSION', '1.10');
33
- define('CAPSMAN_ENH_VERSION', '1.10');
34
- define('PUBLISHPRESS_CAPS_VERSION', '1.10');
35
  }
36
 
37
  foreach (get_option('active_plugins') as $plugin_file) {
3
  * Plugin Name: PublishPress Capabilities
4
  * Plugin URI: https://publishpress.com/capability-manager/
5
  * Description: Manage WordPress role definitions, per-site or network-wide. Organizes post capabilities by post type and operation.
6
+ * Version: 1.10.1
7
  * Author: PublishPress
8
  * Author URI: https://publishpress.com/
9
  * Text Domain: capsman-enhanced
25
  * @copyright Copyright (C) 2009, 2010 Jordi Canals; modifications Copyright (C) 2020 PublishPress
26
  * @license GNU General Public License version 3
27
  * @link https://publishpress.com/
28
+ * @version 1.10.1
29
  */
30
 
31
  if (!defined('CAPSMAN_VERSION')) {
32
+ define('CAPSMAN_VERSION', '1.10.1');
33
+ define('CAPSMAN_ENH_VERSION', '1.10.1');
34
+ define('PUBLISHPRESS_CAPS_VERSION', '1.10.1');
35
  }
36
 
37
  foreach (get_option('active_plugins') as $plugin_file) {
composer.lock ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_readme": [
3
+ "This file locks the dependencies of your project to a known state",
4
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
+ "This file is @generated automatically"
6
+ ],
7
+ "content-hash": "c76385b90de4ed5978b18686f681904b",
8
+ "packages": [
9
+ {
10
+ "name": "pimple/pimple",
11
+ "version": "v3.3.0",
12
+ "source": {
13
+ "type": "git",
14
+ "url": "https://github.com/silexphp/Pimple.git",
15
+ "reference": "e55d12f9d6a0e7f9c85992b73df1267f46279930"
16
+ },
17
+ "dist": {
18
+ "type": "zip",
19
+ "url": "https://api.github.com/repos/silexphp/Pimple/zipball/e55d12f9d6a0e7f9c85992b73df1267f46279930",
20
+ "reference": "e55d12f9d6a0e7f9c85992b73df1267f46279930",
21
+ "shasum": ""
22
+ },
23
+ "require": {
24
+ "php": "^7.2.5",
25
+ "psr/container": "^1.0"
26
+ },
27
+ "require-dev": {
28
+ "symfony/phpunit-bridge": "^3.4|^4.4|^5.0"
29
+ },
30
+ "type": "library",
31
+ "extra": {
32
+ "branch-alias": {
33
+ "dev-master": "3.3.x-dev"
34
+ }
35
+ },
36
+ "autoload": {
37
+ "psr-0": {
38
+ "Pimple": "src/"
39
+ }
40
+ },
41
+ "notification-url": "https://packagist.org/downloads/",
42
+ "license": [
43
+ "MIT"
44
+ ],
45
+ "authors": [
46
+ {
47
+ "name": "Fabien Potencier",
48
+ "email": "fabien@symfony.com"
49
+ }
50
+ ],
51
+ "description": "Pimple, a simple Dependency Injection Container",
52
+ "homepage": "https://pimple.symfony.com",
53
+ "keywords": [
54
+ "container",
55
+ "dependency injection"
56
+ ],
57
+ "time": "2020-03-03T09:12:48+00:00"
58
+ },
59
+ {
60
+ "name": "psr/container",
61
+ "version": "1.0.0",
62
+ "source": {
63
+ "type": "git",
64
+ "url": "https://github.com/php-fig/container.git",
65
+ "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
66
+ },
67
+ "dist": {
68
+ "type": "zip",
69
+ "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
70
+ "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
71
+ "shasum": ""
72
+ },
73
+ "require": {
74
+ "php": ">=5.3.0"
75
+ },
76
+ "type": "library",
77
+ "extra": {
78
+ "branch-alias": {
79
+ "dev-master": "1.0.x-dev"
80
+ }
81
+ },
82
+ "autoload": {
83
+ "psr-4": {
84
+ "Psr\\Container\\": "src/"
85
+ }
86
+ },
87
+ "notification-url": "https://packagist.org/downloads/",
88
+ "license": [
89
+ "MIT"
90
+ ],
91
+ "authors": [
92
+ {
93
+ "name": "PHP-FIG",
94
+ "homepage": "http://www.php-fig.org/"
95
+ }
96
+ ],
97
+ "description": "Common Container Interface (PHP FIG PSR-11)",
98
+ "homepage": "https://github.com/php-fig/container",
99
+ "keywords": [
100
+ "PSR-11",
101
+ "container",
102
+ "container-interface",
103
+ "container-interop",
104
+ "psr"
105
+ ],
106
+ "time": "2017-02-14T16:28:37+00:00"
107
+ },
108
+ {
109
+ "name": "publishpress/wordpress-version-notices",
110
+ "version": "dev-master",
111
+ "source": {
112
+ "type": "git",
113
+ "url": "https://github.com/publishpress/WordPress-Version-Notices.git",
114
+ "reference": "b710c9d4ddf15384546d2f2209554bfdb10c5339"
115
+ },
116
+ "dist": {
117
+ "type": "zip",
118
+ "url": "https://api.github.com/repos/publishpress/WordPress-Version-Notices/zipball/b710c9d4ddf15384546d2f2209554bfdb10c5339",
119
+ "reference": "b710c9d4ddf15384546d2f2209554bfdb10c5339",
120
+ "shasum": ""
121
+ },
122
+ "require": {
123
+ "php": ">=5.6.20",
124
+ "pimple/pimple": "^3"
125
+ },
126
+ "require-dev": {
127
+ "lucatume/wp-browser": "^2.4"
128
+ },
129
+ "type": "library",
130
+ "autoload": {
131
+ "psr-4": {
132
+ "PPVersionNotices\\": "src/"
133
+ }
134
+ },
135
+ "notification-url": "https://packagist.org/downloads/",
136
+ "license": [
137
+ "GPL-3.0-or-later"
138
+ ],
139
+ "authors": [
140
+ {
141
+ "name": "PublishPress",
142
+ "email": "help@publishpress.com",
143
+ "homepage": "https://publishpress.com",
144
+ "role": "Developer"
145
+ }
146
+ ],
147
+ "description": "Library for displaying version notices for Pro plugins in WordPress.",
148
+ "time": "2020-08-11T03:28:34+00:00"
149
+ }
150
+ ],
151
+ "packages-dev": [],
152
+ "aliases": [],
153
+ "minimum-stability": "stable",
154
+ "stability-flags": {
155
+ "publishpress/wordpress-version-notices": 20
156
+ },
157
+ "prefer-stable": false,
158
+ "prefer-lowest": false,
159
+ "platform": {
160
+ "php": ">=5.6.20"
161
+ },
162
+ "platform-dev": [],
163
+ "plugin-api-version": "1.1.0"
164
+ }
includes/admin.php CHANGED
@@ -217,14 +217,14 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
217
  $custom_tax = get_taxonomies( array( '_builtin' => false ), 'names' );
218
 
219
  $defined = array();
220
- $defined['type'] = get_post_types( array( 'public' => true, 'show_ui' => true, 'map_meta_cap' => true ), 'object', 'or' );
221
  $defined['taxonomy'] = get_taxonomies( array( 'public' => true ), 'object' );
222
 
223
  $unfiltered['type'] = apply_filters( 'pp_unfiltered_post_types', array( 'forum','topic','reply','wp_block' ) ); // bbPress' dynamic role def requires additional code to enforce stored caps
224
  $unfiltered['taxonomy'] = apply_filters( 'pp_unfiltered_taxonomies', array( 'post_status', 'topic-tag' ) ); // avoid confusion with Edit Flow administrative taxonomy
225
 
226
  $enabled_taxonomies = cme_get_assisted_taxonomies();
227
-
228
  /*
229
  if ( ( count($custom_types) || count($custom_tax) ) && ( $is_administrator || current_user_can( 'manage_pp_settings' ) ) ) {
230
  $cap_properties[''] = array();
@@ -423,7 +423,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
423
  $disabled = '';
424
  $checked = checked(1, ! empty($rcaps[$cap_name]), false );
425
 
426
- $checkbox = '<input type="checkbox"' . $title . ' name="caps[' . $cap_name . ']" value="1" ' . $checked . $disabled . ' />';
427
 
428
  $type_caps [$cap_name] = true;
429
  $display_row = true;
@@ -512,7 +512,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
512
  foreach( array_keys($core_caps) as $cap_name ) {
513
  if ( ! $is_administrator && ! current_user_can($cap_name) )
514
  continue;
515
-
516
  if ( $i == $checks_per_row ) {
517
  echo '</tr><tr>';
518
  $i = 0;
@@ -552,7 +552,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
552
  }
553
 
554
  ?>
555
- <td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" value="1" <?php echo $checked . $disabled;?> />
556
  <span>
557
  <?php
558
  echo str_replace( '_', ' ', $cap_name );
@@ -587,7 +587,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
587
  <tr class="cme-bulk-select">
588
  <td colspan="<?php echo $checks_per_row;?>">
589
  <span style="float:right">
590
- <input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>">&nbsp;&nbsp;<a class="cme-neg-all" href="#" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
591
  </span>
592
  </td></tr>
593
 
@@ -610,14 +610,14 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
610
  if (defined('PUBLISHPRESS_VERSION')) {
611
  $plugin_caps['PublishPress'] = apply_filters('cme_publishpress_capabilities',
612
  array(
613
- 'edit_metadata',
614
- 'edit_post_subscriptions',
615
- 'ppma_edit_orphan_post',
616
- 'pp_manage_roles',
617
- 'pp_set_notification_channel',
618
- 'pp_view_calendar',
619
- 'pp_view_content_overview',
620
- 'status_change',
621
  )
622
  );
623
  }
@@ -796,7 +796,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
796
  $checked = checked(1, ! empty($rcaps[$cap_name]), false );
797
  $title = $title_text;
798
  ?>
799
- <td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" value="1" <?php echo $checked . $disabled;?> />
800
  <span>
801
  <?php
802
  echo str_replace( '_', ' ', $cap_name );
@@ -826,7 +826,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
826
  <tr class="cme-bulk-select">
827
  <td colspan="<?php echo $checks_per_row;?>">
828
  <span style="float:right">
829
- <input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>">&nbsp;&nbsp;<a class="cme-neg-all" href="#" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
830
  </span>
831
  </td></tr>
832
 
@@ -900,7 +900,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
900
  }
901
  }
902
  ?>
903
- <td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title_text;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" value="1" <?php echo $checked . $disabled;?> />
904
  <span>
905
  <?php
906
  echo str_replace( '_', ' ', $cap );
@@ -935,7 +935,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
935
  <tr class="cme-bulk-select">
936
  <td colspan="<?php echo $checks_per_row;?>">
937
  <span style="float:right">
938
- <input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>">&nbsp;&nbsp;<a class="cme-neg-all" href="#" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
939
  </span>
940
  </td></tr>
941
 
@@ -987,7 +987,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
987
  $disabled = '';
988
  $checked = checked(1, ! empty($rcaps[$cap_name]), false );
989
  ?>
990
- <td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title_text;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" value="1" <?php echo $checked . $disabled;?> />
991
  <span>
992
  <?php
993
  echo str_replace( '_', ' ', $cap );
@@ -1022,7 +1022,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
1022
  <tr class="cme-bulk-select">
1023
  <td colspan="<?php echo $checks_per_row;?>">
1024
  <span style="float:right">
1025
- <input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>">&nbsp;&nbsp;<a class="cme-neg-all" href="#" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
1026
  </span>
1027
  </td></tr>
1028
 
@@ -1100,7 +1100,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
1100
  <p><input type="text" name="create-name" class="<?php echo $class;?>" placeholder="<?php _e('Role Name', 'capsman-enhanced') ?>" />
1101
 
1102
  <?php if( $support_pp_only_roles ) : ?>
1103
- <label for="new_role_pp_only" title="<?php _e('Make role available for supplemental assignment to Permission Groups only', 'capsman-enhanced');?>"> <input type="checkbox" name="new_role_pp_only" id="new_role_pp_only" value="1"> <?php _e('hidden', 'capsman-enhanced'); ?> </label>
1104
  <?php endif; ?>
1105
 
1106
  <br />
@@ -1116,7 +1116,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
1116
  <p><input type="text" name="copy-name" class="<?php echo $class;?>" placeholder="<?php _e('Role Name', 'capsman-enhanced') ?>" />
1117
 
1118
  <?php if( $support_pp_only_roles ) : ?>
1119
- <label for="copy_role_pp_only" title="<?php _e('Make role available for supplemental assignment to Permission Groups only', 'capsman-enhanced');?>"> <input type="checkbox" name="copy_role_pp_only" id="copy_role_pp_only" value="1"> <?php _e('hidden', 'capsman-enhanced'); ?> </label>
1120
  <?php endif; ?>
1121
 
1122
  <br />
@@ -1210,10 +1210,10 @@ function cme_network_role_ui( $default ) {
1210
  $checked = ( in_array( $default, $autocreate_roles ) ) ? 'checked="checked"': '';
1211
  ?>
1212
  <div style="margin-bottom: 5px">
1213
- <label for="cme_autocreate_role" title="<?php _e('Create this role definition in new (future) sites', 'capsman-enhanced');?>"><input type="checkbox" name="cme_autocreate_role" id="cme_autocreate_role" value="1" <?php echo $checked;?>> <?php _e('include in new sites', 'capsman-enhanced'); ?> </label>
1214
  </div>
1215
  <div>
1216
- <label for="cme_net_sync_role" title="<?php echo esc_attr(__('Copy / update this role definition to all sites now', 'capsman-enhanced'));?>"><input type="checkbox" name="cme_net_sync_role" id="cme_net_sync_role" value="1"> <?php _e('sync role to all sites now', 'capsman-enhanced'); ?> </label>
1217
  </div>
1218
  </div>
1219
  <?php
217
  $custom_tax = get_taxonomies( array( '_builtin' => false ), 'names' );
218
 
219
  $defined = array();
220
+ $defined['type'] = apply_filters('cme_filterable_post_types', get_post_types( array( 'public' => true, 'show_ui' => true), 'object', 'or' ));
221
  $defined['taxonomy'] = get_taxonomies( array( 'public' => true ), 'object' );
222
 
223
  $unfiltered['type'] = apply_filters( 'pp_unfiltered_post_types', array( 'forum','topic','reply','wp_block' ) ); // bbPress' dynamic role def requires additional code to enforce stored caps
224
  $unfiltered['taxonomy'] = apply_filters( 'pp_unfiltered_taxonomies', array( 'post_status', 'topic-tag' ) ); // avoid confusion with Edit Flow administrative taxonomy
225
 
226
  $enabled_taxonomies = cme_get_assisted_taxonomies();
227
+
228
  /*
229
  if ( ( count($custom_types) || count($custom_tax) ) && ( $is_administrator || current_user_can( 'manage_pp_settings' ) ) ) {
230
  $cap_properties[''] = array();
423
  $disabled = '';
424
  $checked = checked(1, ! empty($rcaps[$cap_name]), false );
425
 
426
+ $checkbox = '<input type="checkbox"' . $title . ' name="caps[' . $cap_name . ']" autocomplete="off" value="1" ' . $checked . $disabled . ' />';
427
 
428
  $type_caps [$cap_name] = true;
429
  $display_row = true;
512
  foreach( array_keys($core_caps) as $cap_name ) {
513
  if ( ! $is_administrator && ! current_user_can($cap_name) )
514
  continue;
515
+
516
  if ( $i == $checks_per_row ) {
517
  echo '</tr><tr>';
518
  $i = 0;
552
  }
553
 
554
  ?>
555
+ <td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" autocomplete="off" value="1" <?php echo $checked . $disabled;?> />
556
  <span>
557
  <?php
558
  echo str_replace( '_', ' ', $cap_name );
587
  <tr class="cme-bulk-select">
588
  <td colspan="<?php echo $checks_per_row;?>">
589
  <span style="float:right">
590
+ <input type="checkbox" class="cme-check-all" autocomplete="off" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>">&nbsp;&nbsp;<a class="cme-neg-all" href="#" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
591
  </span>
592
  </td></tr>
593
 
610
  if (defined('PUBLISHPRESS_VERSION')) {
611
  $plugin_caps['PublishPress'] = apply_filters('cme_publishpress_capabilities',
612
  array(
613
+ 'edit_metadata',
614
+ 'edit_post_subscriptions',
615
+ 'ppma_edit_orphan_post',
616
+ 'pp_manage_roles',
617
+ 'pp_set_notification_channel',
618
+ 'pp_view_calendar',
619
+ 'pp_view_content_overview',
620
+ 'status_change',
621
  )
622
  );
623
  }
796
  $checked = checked(1, ! empty($rcaps[$cap_name]), false );
797
  $title = $title_text;
798
  ?>
799
+ <td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" autocomplete="off" value="1" <?php echo $checked . $disabled;?> />
800
  <span>
801
  <?php
802
  echo str_replace( '_', ' ', $cap_name );
826
  <tr class="cme-bulk-select">
827
  <td colspan="<?php echo $checks_per_row;?>">
828
  <span style="float:right">
829
+ <input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>">&nbsp;&nbsp;<a class="cme-neg-all" href="#" autocomplete="off" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
830
  </span>
831
  </td></tr>
832
 
900
  }
901
  }
902
  ?>
903
+ <td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title_text;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" autocomplete="off" value="1" <?php echo $checked . $disabled;?> />
904
  <span>
905
  <?php
906
  echo str_replace( '_', ' ', $cap );
935
  <tr class="cme-bulk-select">
936
  <td colspan="<?php echo $checks_per_row;?>">
937
  <span style="float:right">
938
+ <input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>">&nbsp;&nbsp;<a class="cme-neg-all" href="#" autocomplete="off" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
939
  </span>
940
  </td></tr>
941
 
987
  $disabled = '';
988
  $checked = checked(1, ! empty($rcaps[$cap_name]), false );
989
  ?>
990
+ <td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title_text;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" autocomplete="off" value="1" <?php echo $checked . $disabled;?> />
991
  <span>
992
  <?php
993
  echo str_replace( '_', ' ', $cap );
1022
  <tr class="cme-bulk-select">
1023
  <td colspan="<?php echo $checks_per_row;?>">
1024
  <span style="float:right">
1025
+ <input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>">&nbsp;&nbsp;<a class="cme-neg-all" href="#" autocomplete="off" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
1026
  </span>
1027
  </td></tr>
1028
 
1100
  <p><input type="text" name="create-name" class="<?php echo $class;?>" placeholder="<?php _e('Role Name', 'capsman-enhanced') ?>" />
1101
 
1102
  <?php if( $support_pp_only_roles ) : ?>
1103
+ <label for="new_role_pp_only" title="<?php _e('Make role available for supplemental assignment to Permission Groups only', 'capsman-enhanced');?>"> <input type="checkbox" name="new_role_pp_only" id="new_role_pp_only" autocomplete="off" value="1"> <?php _e('hidden', 'capsman-enhanced'); ?> </label>
1104
  <?php endif; ?>
1105
 
1106
  <br />
1116
  <p><input type="text" name="copy-name" class="<?php echo $class;?>" placeholder="<?php _e('Role Name', 'capsman-enhanced') ?>" />
1117
 
1118
  <?php if( $support_pp_only_roles ) : ?>
1119
+ <label for="copy_role_pp_only" title="<?php _e('Make role available for supplemental assignment to Permission Groups only', 'capsman-enhanced');?>"> <input type="checkbox" name="copy_role_pp_only" id="copy_role_pp_only" autocomplete="off" value="1"> <?php _e('hidden', 'capsman-enhanced'); ?> </label>
1120
  <?php endif; ?>
1121
 
1122
  <br />
1210
  $checked = ( in_array( $default, $autocreate_roles ) ) ? 'checked="checked"': '';
1211
  ?>
1212
  <div style="margin-bottom: 5px">
1213
+ <label for="cme_autocreate_role" title="<?php _e('Create this role definition in new (future) sites', 'capsman-enhanced');?>"><input type="checkbox" name="cme_autocreate_role" id="cme_autocreate_role" autocomplete="off" value="1" <?php echo $checked;?>> <?php _e('include in new sites', 'capsman-enhanced'); ?> </label>
1214
  </div>
1215
  <div>
1216
+ <label for="cme_net_sync_role" title="<?php echo esc_attr(__('Copy / update this role definition to all sites now', 'capsman-enhanced'));?>"><input type="checkbox" name="cme_net_sync_role" id="cme_net_sync_role" autocomplete="off" value="1"> <?php _e('sync role to all sites now', 'capsman-enhanced'); ?> </label>
1217
  </div>
1218
  </div>
1219
  <?php
includes/backup.php CHANGED
@@ -152,7 +152,7 @@ $auto_backups = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb-
152
 
153
  <td class="cme-backup-info">
154
  <div class="cme_backup_info_changes_only" style="display:none">
155
- <input type="checkbox" class="cme_backup_info_changes_only" checked=checked><?php _e('Show changes from current roles only', 'capsman-enhanced');?>
156
  </div>
157
 
158
  <?php
@@ -187,9 +187,9 @@ $auto_backups = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb-
187
  <h3><?php printf(__("%s (%s roles)", 'capsman-enhanded'), $caption, count($backup_data)); ?></h3>
188
 
189
  <?php
190
- foreach (array_keys($wp_roles->role_objects) as $role) {
191
  if (empty($backup_data[$role])) {
192
- $role_caption = $props['name'];
193
  $role_class = ' class="cme-change cme-minus"';
194
  ?>
195
  <h4><span<?php echo $role_class;?>><?php echo (translate_user_role($role_caption));?></span> <?php _e('(this role will be removed if you restore backup)', 'capsman-enhanced');?></h4>
152
 
153
  <td class="cme-backup-info">
154
  <div class="cme_backup_info_changes_only" style="display:none">
155
+ <input type="checkbox" class="cme_backup_info_changes_only" autocomplete="off" checked="checked"><?php _e('Show changes from current roles only', 'capsman-enhanced');?>
156
  </div>
157
 
158
  <?php
187
  <h3><?php printf(__("%s (%s roles)", 'capsman-enhanded'), $caption, count($backup_data)); ?></h3>
188
 
189
  <?php
190
+ foreach ($wp_roles->role_objects as $role => $role_object) {
191
  if (empty($backup_data[$role])) {
192
+ $role_caption = $role_object->name;
193
  $role_class = ' class="cme-change cme-minus"';
194
  ?>
195
  <h4><span<?php echo $role_class;?>><?php echo (translate_user_role($role_caption));?></span> <?php _e('(this role will be removed if you restore backup)', 'capsman-enhanced');?></h4>
includes/filters.php CHANGED
@@ -31,8 +31,8 @@ if ( defined( 'WC_PLUGIN_FILE' ) ) {
31
  if (!defined('CME_DISABLE_WP_EDIT_PUBLISHED_WORKAROUND')) {
32
  global $wp_version;
33
  if (version_compare($wp_version, '4.9.7', '>=')) { // avoid any issues with old REST API implementations
34
- require_once (dirname(__FILE__) . '/filters-wp_rest_workarounds.php');
35
- new PublishPress\Capabilities\WP_REST_Workarounds();
36
  }
37
  }
38
 
@@ -51,6 +51,16 @@ add_filter('pp_custom_status_list', 'cme_filter_custom_status_list', 10, 2);
51
 
52
  add_action('plugins_loaded', '_cme_migrate_pp_options');
53
 
 
 
 
 
 
 
 
 
 
 
54
  function _cme_publishpress_roles_js() {
55
  if (defined('PUBLISHPRESS_VERSION') && ((strpos($_SERVER['REQUEST_URI'], 'page=pp-manage-roles')))) {
56
  require_once(dirname(__FILE__) . '/publishpress-roles.php');
@@ -233,12 +243,13 @@ function cme_get_assisted_post_types() {
233
 
234
  $post_types = get_post_types( $type_args, 'names', 'or' );
235
 
236
- if ( $omit_types = apply_filters( 'pp_unfiltered_post_types', array( 'wp_block' ) ) ) {
237
  $post_types = array_diff_key( $post_types, array_fill_keys( (array) $omit_types, true ) );
238
  }
239
 
240
  $option_name = (defined('PPC_VERSION') && !defined('PRESSPERMIT_VERSION')) ? 'pp_enabled_post_types' : 'presspermit_enabled_post_types';
241
  $enabled = (array) get_option( $option_name, array( 'post' => true, 'page' => true ) );
 
242
  $post_types = array_intersect( $post_types, array_keys( array_filter( $enabled ) ) );
243
 
244
  return apply_filters( 'cme_assisted_post_types', $post_types, $type_args );
31
  if (!defined('CME_DISABLE_WP_EDIT_PUBLISHED_WORKAROUND')) {
32
  global $wp_version;
33
  if (version_compare($wp_version, '4.9.7', '>=')) { // avoid any issues with old REST API implementations
34
+ require_once (dirname(__FILE__) . '/filters-wp_rest_workarounds.php');
35
+ new PublishPress\Capabilities\WP_REST_Workarounds();
36
  }
37
  }
38
 
51
 
52
  add_action('plugins_loaded', '_cme_migrate_pp_options');
53
 
54
+ add_filter('cme_filterable_post_types', '_cme_filterable_post_types');
55
+
56
+ function _cme_filterable_post_types($post_type_objects) {
57
+ if ($advgb_profiles = get_post_type_object('advgb_profiles')) {
58
+ $post_type_objects['advgb_profiles'] = $advgb_profiles;
59
+ }
60
+
61
+ return $post_type_objects;
62
+ }
63
+
64
  function _cme_publishpress_roles_js() {
65
  if (defined('PUBLISHPRESS_VERSION') && ((strpos($_SERVER['REQUEST_URI'], 'page=pp-manage-roles')))) {
66
  require_once(dirname(__FILE__) . '/publishpress-roles.php');
243
 
244
  $post_types = get_post_types( $type_args, 'names', 'or' );
245
 
246
+ if ( $omit_types = apply_filters( 'pp_unfiltered_post_types', array('forum', 'topic', 'reply', 'wp_block', 'customize_changeset') ) ) {
247
  $post_types = array_diff_key( $post_types, array_fill_keys( (array) $omit_types, true ) );
248
  }
249
 
250
  $option_name = (defined('PPC_VERSION') && !defined('PRESSPERMIT_VERSION')) ? 'pp_enabled_post_types' : 'presspermit_enabled_post_types';
251
  $enabled = (array) get_option( $option_name, array( 'post' => true, 'page' => true ) );
252
+
253
  $post_types = array_intersect( $post_types, array_keys( array_filter( $enabled ) ) );
254
 
255
  return apply_filters( 'cme_assisted_post_types', $post_types, $type_args );
includes/pp-ui.php CHANGED
@@ -48,7 +48,7 @@ class Capsman_PP_UI {
48
  $parenthetical = '';
49
 
50
  if ( defined( 'PRESSPERMIT_ACTIVE' ) )
51
- printf( __( '"Posts" capabilities selected here also define type-specific role assignment for Permission Groups%s.', $cme_id ), $parenthetical );
52
  else
53
  printf( __( '"Posts" capabilities selected here also define type-specific role assignment for Permit Groups%s.', $cme_id ), $parenthetical ) ;
54
 
@@ -83,7 +83,7 @@ class Capsman_PP_UI {
83
  $pp_only = (array) pp_capabilities_get_permissions_option( 'supplemental_role_defs' );
84
  $checked = ( in_array( $default, $pp_only ) ) ? 'checked="checked"': '';
85
  ?>
86
- <label for="pp_only_role" title="<?php _e('Make role available for supplemental assignment to Permission Groups only', 'capsman-enhanced');?>"><input type="checkbox" name="pp_only_role" id="pp_only_role" value="1" <?php echo $checked;?>> <?php _e('hidden role', 'capsman-enhanced'); ?> </label>
87
  </div>
88
  <?php endif; ?>
89
  <?php
@@ -108,7 +108,7 @@ class Capsman_PP_UI {
108
 
109
  echo "<table style='width:100%'><tr>";
110
 
111
- $unfiltered = apply_filters( 'pp_unfiltered_post_types', array('forum','topic','reply','wp_block') ); // bbPress' dynamic role def requires additional code to enforce stored caps
112
  $hidden = apply_filters( 'pp_hidden_post_types', array() );
113
 
114
  echo '<td style="width:50%">';
@@ -136,7 +136,7 @@ class Capsman_PP_UI {
136
  <div class="agp-vspaced_input">
137
  <label for="<?php echo($id);?>" title="<?php echo($key);?>">
138
  <input name="<?php echo("{$option_basename}-options[]");?>" type="hidden" value="<?php echo($key)?>" />
139
- <input name="<?php echo($id);?>" type="checkbox" id="<?php echo($id);?>" value="1" <?php checked('1', ! empty($enabled[$key]) );?> /> <?php echo($type_obj->label);?>
140
 
141
  <?php
142
  echo ('</label></div>');
@@ -156,7 +156,7 @@ class Capsman_PP_UI {
156
 
157
  <div style="margin-top:10px;margin-bottom:10px">
158
  <label for="pp_define_create_posts_cap">
159
- <input name="pp_define_create_posts_cap" type="checkbox" id="pp_define_create_posts_cap" value="1" <?php checked('1', $define_create_posts_cap );?> title="<?php esc_attr( _e( 'Make selected post types require a different capability to add new posts.', 'capsman-enhanced') );?>" /> <?php _e('Use create_posts capability');?>
160
  </label>
161
  </div>
162
 
@@ -209,7 +209,7 @@ class Capsman_PP_UI {
209
  <div class="agp-vspaced_input">
210
  <label for="<?php echo($id);?>" title="<?php echo($taxonomy);?>">
211
  <input name="<?php echo("{$option_basename}-options[]");?>" type="hidden" value="<?php echo($taxonomy)?>" />
212
- <input name="<?php echo($id);?>" type="checkbox" id="<?php echo($id);?>" value="1" <?php checked('1', ! empty($enabled[$taxonomy]) );?> /> <?php echo($type_obj->label);?>
213
 
214
  <?php
215
  echo ('</label></div>');
@@ -265,7 +265,7 @@ class Capsman_PP_UI {
265
  <div class="agp-vspaced_input">
266
  <label for="<?php echo($id);?>" title="<?php echo($taxonomy);?>">
267
  <input name="<?php echo("{$option_basename}-options[]");?>" type="hidden" value="<?php echo($taxonomy)?>" />
268
- <input name="<?php echo($id);?>" type="checkbox" id="<?php echo($id);?>" value="1" <?php checked('1', ! empty($enabled[$taxonomy]) );?> /> <?php echo($type_obj->label);?>
269
 
270
  <?php
271
  echo ('</label></div>');
48
  $parenthetical = '';
49
 
50
  if ( defined( 'PRESSPERMIT_ACTIVE' ) )
51
+ printf( __( '"Posts" capabilities selected here also define type-specific role assignment for Permission Groups%s.', $cme_id ), $parenthetical ) ;
52
  else
53
  printf( __( '"Posts" capabilities selected here also define type-specific role assignment for Permit Groups%s.', $cme_id ), $parenthetical ) ;
54
 
83
  $pp_only = (array) pp_capabilities_get_permissions_option( 'supplemental_role_defs' );
84
  $checked = ( in_array( $default, $pp_only ) ) ? 'checked="checked"': '';
85
  ?>
86
+ <label for="pp_only_role" title="<?php _e('Make role available for supplemental assignment to Permission Groups only', 'capsman-enhanced');?>"><input type="checkbox" name="pp_only_role" id="pp_only_role" autocomplete="off" value="1" <?php echo $checked;?>> <?php _e('hidden role', 'capsman-enhanced'); ?> </label>
87
  </div>
88
  <?php endif; ?>
89
  <?php
108
 
109
  echo "<table style='width:100%'><tr>";
110
 
111
+ $unfiltered = apply_filters( 'pp_unfiltered_post_types', array('forum','topic','reply','wp_block', 'customize_changeset') ); // bbPress' dynamic role def requires additional code to enforce stored caps
112
  $hidden = apply_filters( 'pp_hidden_post_types', array() );
113
 
114
  echo '<td style="width:50%">';
136
  <div class="agp-vspaced_input">
137
  <label for="<?php echo($id);?>" title="<?php echo($key);?>">
138
  <input name="<?php echo("{$option_basename}-options[]");?>" type="hidden" value="<?php echo($key)?>" />
139
+ <input name="<?php echo($id);?>" type="checkbox" id="<?php echo($id);?>" autocomplete="off" value="1" <?php checked('1', ! empty($enabled[$key]) );?> /> <?php echo($type_obj->label);?>
140
 
141
  <?php
142
  echo ('</label></div>');
156
 
157
  <div style="margin-top:10px;margin-bottom:10px">
158
  <label for="pp_define_create_posts_cap">
159
+ <input name="pp_define_create_posts_cap" type="checkbox" id="pp_define_create_posts_cap" autocomplete="off" value="1" <?php checked('1', $define_create_posts_cap );?> title="<?php esc_attr( _e( 'Make selected post types require a different capability to add new posts.', 'capsman-enhanced') );?>" /> <?php _e('Use create_posts capability');?>
160
  </label>
161
  </div>
162
 
209
  <div class="agp-vspaced_input">
210
  <label for="<?php echo($id);?>" title="<?php echo($taxonomy);?>">
211
  <input name="<?php echo("{$option_basename}-options[]");?>" type="hidden" value="<?php echo($taxonomy)?>" />
212
+ <input name="<?php echo($id);?>" type="checkbox" autocomplete="off" id="<?php echo($id);?>" value="1" <?php checked('1', ! empty($enabled[$taxonomy]) );?> /> <?php echo($type_obj->label);?>
213
 
214
  <?php
215
  echo ('</label></div>');
265
  <div class="agp-vspaced_input">
266
  <label for="<?php echo($id);?>" title="<?php echo($taxonomy);?>">
267
  <input name="<?php echo("{$option_basename}-options[]");?>" type="hidden" value="<?php echo($taxonomy)?>" />
268
+ <input name="<?php echo($id);?>" type="checkbox" autocomplete="off" id="<?php echo($id);?>" value="1" <?php checked('1', ! empty($enabled[$taxonomy]) );?> /> <?php echo($type_obj->label);?>
269
 
270
  <?php
271
  echo ('</label></div>');
lang/capsman.mo CHANGED
Binary file
lang/capsman.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Capability Manager Enhanced\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2020-10-01 11:42-0500\n"
6
- "PO-Revision-Date: 2020-10-01 11:42-0500\n"
7
  "Last-Translator: Kevin Behrens <kevin@publishpress.com>\n"
8
  "Language-Team: PublishPress <help@publishpress.com>\n"
9
  "MIME-Version: 1.0\n"
@@ -560,7 +560,7 @@ msgstr ""
560
  msgid "Add New"
561
  msgstr ""
562
 
563
- #: F:\snapshot\capability-manager-enhanced/includes/filters.php:298
564
  msgid "Edit Roles"
565
  msgstr ""
566
 
2
  msgstr ""
3
  "Project-Id-Version: Capability Manager Enhanced\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2020-10-08 11:17-0500\n"
6
+ "PO-Revision-Date: 2020-10-08 11:17-0500\n"
7
  "Last-Translator: Kevin Behrens <kevin@publishpress.com>\n"
8
  "Language-Team: PublishPress <help@publishpress.com>\n"
9
  "MIME-Version: 1.0\n"
560
  msgid "Add New"
561
  msgstr ""
562
 
563
+ #: F:\snapshot\capability-manager-enhanced/includes/filters.php:309
564
  msgid "Edit Roles"
565
  msgstr ""
566
 
readme.txt CHANGED
@@ -5,9 +5,9 @@ Author: PublishPress
5
  Author URI: https://publishpress.com
6
  Tags: user roles, capabilities, permissions, authors, editors, post types, taxonomies
7
  Requires at least: 4.9.7
8
- Tested up to: 5.5
9
  Requires PHP: 5.6.20
10
- Stable tag: 1.10
11
  License: GPLv3
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
13
 
@@ -47,7 +47,7 @@ The PublishPress Capabilities plugin allows you to add extra permissions to the
47
 
48
  PublishPress Capabilities offers you the ability to back up and restore your permissions. This feature is very helpful if you want to test out changes on your site, or if you've installed a new plugin that has changed your site's permissions.
49
 
50
- Every time you change your permissions, the PublishPress Capabilities plugin will now automatically create a backup. If you make a mistake, go to the Backup menu link and you'll be able to roll back to a previous version.
51
  [Click here to see how to backup permissions](https://publishpress.com/knowledge-base/backup-restore-permissions/).
52
 
53
  = Create or Copy User Roles =
@@ -83,7 +83,7 @@ Join PublishPress and you'll get access to these 6 Pro plugins:
83
  * [PublishPress Pro](https://publishpress.com/publishpress) is the plugin for managing and scheduling WordPress content.
84
  * [PublishPress Revisions Pro](https://publishpress.com/revisions) allows you to update your published pages with teamwork and precision.
85
 
86
- Together, these plugins are a suite of powerful publishing tools for WordPress. If you need to create a professional workflow in WordPress, with moderation, revisions, permissions and more then you should try PublishPress.
87
 
88
  = Bug Reports =
89
 
@@ -114,6 +114,10 @@ Fixed : Non-administrators with user editing capabilities could add new Administ
114
 
115
  == Changelog ==
116
 
 
 
 
 
117
  = 1.10 - 1 Oct 2020 =
118
  * Feature : Improved design and styling for Backup and Restore
119
  * Feature : Backup > Restore - filter to display only modified capabilities
5
  Author URI: https://publishpress.com
6
  Tags: user roles, capabilities, permissions, authors, editors, post types, taxonomies
7
  Requires at least: 4.9.7
8
+ Tested up to: 5.6
9
  Requires PHP: 5.6.20
10
+ Stable tag: 1.10.1
11
  License: GPLv3
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
13
 
47
 
48
  PublishPress Capabilities offers you the ability to back up and restore your permissions. This feature is very helpful if you want to test out changes on your site, or if you've installed a new plugin that has changed your site's permissions.
49
 
50
+ Every time you change your permissions, the PublishPress Capabilities plugin will now automatically create a backup. If you make a mistake, go to the "Backup" menu link and you'll be able to roll back to a previous version.
51
  [Click here to see how to backup permissions](https://publishpress.com/knowledge-base/backup-restore-permissions/).
52
 
53
  = Create or Copy User Roles =
83
  * [PublishPress Pro](https://publishpress.com/publishpress) is the plugin for managing and scheduling WordPress content.
84
  * [PublishPress Revisions Pro](https://publishpress.com/revisions) allows you to update your published pages with teamwork and precision.
85
 
86
+ Together, these plugins are a suite of powerful publishing tools for WordPress. If you need to create a professional workflow in WordPress, with moderation, revisions, permissions and more... then you should try PublishPress.
87
 
88
  = Bug Reports =
89
 
114
 
115
  == Changelog ==
116
 
117
+ = 1.10.1 - 8 Oct 2020 =
118
+ * Fixed : Type-Specific Capabilities options included some non-public WordPress post types that don't support capability customization
119
+ * Fixed : Review of role backup contents does not show name of current roles which would be removed by restoring backup
120
+
121
  = 1.10 - 1 Oct 2020 =
122
  * Feature : Improved design and styling for Backup and Restore
123
  * Feature : Backup > Restore - filter to display only modified capabilities