Adminimize - Version 1.10.5

Version Description

(2016-06-28) = * Fix PHP Warning * Fix check for active usage of Link Manager * Fix menu var type, if is object. * Check for multiple roles on Menu Settings, that it works only, if the option is still active on each role of this user.

Download this release

Release Info

Developer Bueltge
Plugin Icon wp plugin Adminimize
Version 1.10.5
Comparing to
See all releases

Code changes from version 1.10.4 to 1.10.5

CHANGELOG.md CHANGED
@@ -1,38 +1,70 @@
1
- ## 1.10.4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  * Add support for multiple roles to remove the Admin Bar via global options.
3
  * Add support for multiple roles to remove the Admin Bar Back end items.
4
  * Add also this support for Front End Admin Bar items.
5
  * Multiple roles supported now on "Menu Options", "Global Options", "Admin Bar Back end options" and "Admin Bar Front end options".
6
 
7
- ## 1.10.3
 
8
  * Fix exclude of set new Admin Bar on settings page of Adminimize.
9
  * Fix check for settings page.
10
  * Fix colors on raw, column of the settings page.
11
- * Add buffering for debug helper in the console.
12
  * Fix caching for Dashboard Widget options.
13
 
14
- ## 1.10.2
 
 
 
 
15
  * Add possibility for custom menu slugs, especially for Plugins, Themes, there add different slug for different roles.
16
  * Add the possibility to use the WP object cache for settings, if the webspace support this, like Memcached, APC.
 
 
17
  * More clarity for the "own options" label.
18
 
19
- ## 1.10.1
 
20
  * Fix the Removing of Admin Color Scheme Select on the profile page.
 
 
21
  * Back-end options are also excluded on the settings page.
 
 
22
  * Add new settings area for options of the plugin self.
23
  * The support for multiple roles is now optional.
24
  * The support for bbPress is now active and optional.
25
 
26
- ## 1.10.0
27
- * Rewrite the Admin Bar settings, simplify the source and new hook to get and render the Admin Bar.
28
- * Change settings screen for custom post type.
29
  * Fix "select all" on Admin Bar settings.
30
  * Fix exclude settings page for pages, there is the current screen not existent.
31
- * Improve the exclude settings page function for hooks, there fired before `get_current_screen`.
 
32
  * Remove more legacy code before WP 3.3.
 
 
 
 
33
  * Change removal of Menu and Sub-Menu items to WP core functions, possible to non support older WP Versions.
34
  * Supports multiple roles on "Menu Options" and "Global Options".
 
 
35
  * Add possibility to hide Admin Notices globally, new setting point in "Global Options".
 
36
 
37
  ## 1.9.2 (2016-01-30)
38
  * Change get role name, return now a array with slug and name to fix "Select All" function for custom roles.
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
3
+
4
+ ## [Unreleased](https://github.com/bueltge/Adminimize/compare/1.10.5...HEAD)
5
+ *
6
+
7
+ ## [1.10.5](https://github.com/bueltge/Adminimize/compare/1.10.4...1.10.5) - 2016-06-28
8
+ ### Fixed
9
+ * Fix PHP Warning
10
+ * Fix check for active usage of Link Manager
11
+ * Fix menu var type, if is object.
12
+ * Check for multiple roles on Menu Settings, that it works only, if the option is still active on each role of this user.
13
+
14
+ ## [1.10.4](https://github.com/bueltge/Adminimize/compare/1.10.3...1.10.4) - 2016-06-03
15
+ ### Added
16
  * Add support for multiple roles to remove the Admin Bar via global options.
17
  * Add support for multiple roles to remove the Admin Bar Back end items.
18
  * Add also this support for Front End Admin Bar items.
19
  * Multiple roles supported now on "Menu Options", "Global Options", "Admin Bar Back end options" and "Admin Bar Front end options".
20
 
21
+ ## [1.10.3](https://github.com/bueltge/Adminimize/compare/1.10.2...1.10.3) - 2016-05-11
22
+ ### Fixed
23
  * Fix exclude of set new Admin Bar on settings page of Adminimize.
24
  * Fix check for settings page.
25
  * Fix colors on raw, column of the settings page.
 
26
  * Fix caching for Dashboard Widget options.
27
 
28
+ ### Added
29
+ * Add buffering for debug helper in the console.
30
+
31
+ ## [1.10.2](https://github.com/bueltge/Adminimize/compare/1.10.1...1.10.2) - 2016-03-10
32
+ ### Added
33
  * Add possibility for custom menu slugs, especially for Plugins, Themes, there add different slug for different roles.
34
  * Add the possibility to use the WP object cache for settings, if the webspace support this, like Memcached, APC.
35
+
36
+ ### Changed
37
  * More clarity for the "own options" label.
38
 
39
+ ## [1.10.1](https://github.com/bueltge/Adminimize/compare/1.10.0...1.10.1) - 2016-02-29
40
+ ### Fixed
41
  * Fix the Removing of Admin Color Scheme Select on the profile page.
42
+
43
+ ### Changed
44
  * Back-end options are also excluded on the settings page.
45
+
46
+ ### Added
47
  * Add new settings area for options of the plugin self.
48
  * The support for multiple roles is now optional.
49
  * The support for bbPress is now active and optional.
50
 
51
+ ## [1.10.0](https://github.com/bueltge/Adminimize/compare/1.9.2...1.10.0) - 2016-02-21
52
+ ### Fixed
 
53
  * Fix "select all" on Admin Bar settings.
54
  * Fix exclude settings page for pages, there is the current screen not existent.
55
+
56
+ ### Removed
57
  * Remove more legacy code before WP 3.3.
58
+
59
+ ### Changed
60
+ * Rewrite the Admin Bar settings, simplify the source and new hook to get and render the Admin Bar.
61
+ * Change settings screen for custom post type.
62
  * Change removal of Menu and Sub-Menu items to WP core functions, possible to non support older WP Versions.
63
  * Supports multiple roles on "Menu Options" and "Global Options".
64
+
65
+ ### Added
66
  * Add possibility to hide Admin Notices globally, new setting point in "Global Options".
67
+ * Improve the exclude settings page function for hooks, there fired before `get_current_screen`.
68
 
69
  ## 1.9.2 (2016-01-30)
70
  * Change get role name, return now a array with slug and name to fix "Select All" function for custom roles.
LICENSE.txt CHANGED
File without changes
adminimize.php CHANGED
@@ -7,13 +7,13 @@
7
  * Description: Visually compresses the administrative meta-boxes so that more admin page content can be initially seen. The plugin that lets you hide 'unnecessary' items from the WordPress administration menu, for all roles of your install. You can also hide post meta controls on the edit-area to simplify the interface. It is possible to simplify the admin in different for all roles.
8
  * Author: Frank Bültge
9
  * Author URI: http://bueltge.de/
10
- * Version: 1.10.4
11
  * License: GPLv3+
12
  *
13
  * @package WordPress
14
  * @author Frank Bültge <frank@bueltge.de>
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
16
- * @version 22016-06-03
17
  */
18
 
19
  /**
@@ -22,6 +22,7 @@
22
  * of differently user-right and a user-friendly range in admin-area via reduce areas.
23
  * :( grmpf i have so much wishes and hints form users, there use the plugin and
24
  * it is not easy to development this on my free time.
 
25
  */
26
 
27
  if ( ! function_exists( 'add_action' ) ) {
@@ -581,9 +582,12 @@ function _mw_adminimize_set_menu_option() {
581
  _mw_adminimize_debug( $menu, 'Adminimize, WordPress Menu:' );
582
  _mw_adminimize_debug( $submenu, 'Adminimize, WordPress Sub-Menu:' );
583
 
584
- $user_roles = _mw_adminimize_get_all_user_roles();
585
  $disabled_menu_ = array();
586
  $disabled_submenu_ = array();
 
 
 
587
 
588
  foreach ( $user_roles as $role ) {
589
  $disabled_menu_[ $role ] = (array) _mw_adminimize_get_option_value(
@@ -596,7 +600,6 @@ function _mw_adminimize_set_menu_option() {
596
 
597
  $mw_adminimize_menu = array();
598
  $mw_adminimize_submenu = array();
599
- $user = wp_get_current_user();
600
 
601
  // Set admin-menu.
602
  foreach ( $user_roles as $role ) {
@@ -604,7 +607,7 @@ function _mw_adminimize_set_menu_option() {
604
  if ( in_array( $role, $user->roles, FALSE )
605
  && _mw_adminimize_current_user_has_role( $role )
606
  ) {
607
- // Create array about all items with all affected roles, important for multiple roles.
608
  foreach ( $disabled_menu_[ $role ] as $menu_item ) {
609
  $mw_adminimize_menu[] = $menu_item;
610
  }
@@ -616,10 +619,17 @@ function _mw_adminimize_set_menu_option() {
616
  }
617
 
618
  // Support Multiple Roles for users.
 
619
  if ( _mw_adminimize_get_option_value( 'mw_adminimize_multiple_roles' ) && 1 < count( $user->roles ) ) {
620
- $mw_adminimize_menu = _mw_adminimize_get_duplicate( $mw_adminimize_menu );
621
- $mw_adminimize_submenu = _mw_adminimize_get_duplicate( $mw_adminimize_submenu );
 
 
 
 
622
  }
 
 
623
 
624
  // Fallback on users.php on all user roles smaller admin.
625
  if ( in_array( 'users.php', $mw_adminimize_menu, FALSE ) ) {
7
  * Description: Visually compresses the administrative meta-boxes so that more admin page content can be initially seen. The plugin that lets you hide 'unnecessary' items from the WordPress administration menu, for all roles of your install. You can also hide post meta controls on the edit-area to simplify the interface. It is possible to simplify the admin in different for all roles.
8
  * Author: Frank Bültge
9
  * Author URI: http://bueltge.de/
10
+ * Version: 1.10.5
11
  * License: GPLv3+
12
  *
13
  * @package WordPress
14
  * @author Frank Bültge <frank@bueltge.de>
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
16
+ * @version 22016-06-28
17
  */
18
 
19
  /**
22
  * of differently user-right and a user-friendly range in admin-area via reduce areas.
23
  * :( grmpf i have so much wishes and hints form users, there use the plugin and
24
  * it is not easy to development this on my free time.
25
+ * Also I hate the source, old and harrd to maintain, no OOP.
26
  */
27
 
28
  if ( ! function_exists( 'add_action' ) ) {
582
  _mw_adminimize_debug( $menu, 'Adminimize, WordPress Menu:' );
583
  _mw_adminimize_debug( $submenu, 'Adminimize, WordPress Sub-Menu:' );
584
 
585
+ //$user_roles = _mw_adminimize_get_all_user_roles();
586
  $disabled_menu_ = array();
587
  $disabled_submenu_ = array();
588
+ $user = wp_get_current_user();
589
+ $user_roles = $user->roles;
590
+ _mw_adminimize_debug( $user, 'Adminimize, Current User:' );
591
 
592
  foreach ( $user_roles as $role ) {
593
  $disabled_menu_[ $role ] = (array) _mw_adminimize_get_option_value(
600
 
601
  $mw_adminimize_menu = array();
602
  $mw_adminimize_submenu = array();
 
603
 
604
  // Set admin-menu.
605
  foreach ( $user_roles as $role ) {
607
  if ( in_array( $role, $user->roles, FALSE )
608
  && _mw_adminimize_current_user_has_role( $role )
609
  ) {
610
+ // Create array about all items with all affected roles.
611
  foreach ( $disabled_menu_[ $role ] as $menu_item ) {
612
  $mw_adminimize_menu[] = $menu_item;
613
  }
619
  }
620
 
621
  // Support Multiple Roles for users.
622
+ // Leave only the items, there are active on each roles of the users.
623
  if ( _mw_adminimize_get_option_value( 'mw_adminimize_multiple_roles' ) && 1 < count( $user->roles ) ) {
624
+ $mw_adminimize_menu = _mw_adminimize_get_intersection( $disabled_menu_ );
625
+ $mw_adminimize_submenu = _mw_adminimize_get_intersection( $disabled_submenu_ );
626
+ } else {
627
+ // Alternative filter the array to remove duplicates, much faster.
628
+ $mw_adminimize_menu = array_unique( $mw_adminimize_menu );
629
+ $mw_adminimize_submenu = array_unique( $mw_adminimize_submenu );
630
  }
631
+ _mw_adminimize_debug( $mw_adminimize_menu, 'Adminimize, Menu Slugs to hide after Filter.' );
632
+ _mw_adminimize_debug( $mw_adminimize_menu, 'Adminimize, Sub-Menu Slugs to hide after Filter.' );
633
 
634
  // Fallback on users.php on all user roles smaller admin.
635
  if ( in_array( 'users.php', $mw_adminimize_menu, FALSE ) ) {
adminimize_page.php CHANGED
File without changes
css/mw_cat_full.css CHANGED
File without changes
css/mw_small_user_info.css CHANGED
File without changes
css/style.css CHANGED
File without changes
inc-options/admin_bar.php CHANGED
File without changes
inc-options/backend_options.php CHANGED
File without changes
inc-options/dashboard_options.php CHANGED
File without changes
inc-options/deinstall_options.php CHANGED
File without changes
inc-options/global_options.php CHANGED
File without changes
inc-options/im_export_options.php CHANGED
File without changes
inc-options/links_options.php CHANGED
File without changes
inc-options/menu_options.php CHANGED
@@ -55,8 +55,8 @@ if ( ! function_exists( 'add_action' ) ) {
55
  </thead>
56
  <tbody>
57
  <?php
58
- $wp_menu = _mw_adminimize_get_option_value( 'mw_adminimize_default_menu' );
59
- $wp_submenu = _mw_adminimize_get_option_value( 'mw_adminimize_default_submenu' );
60
 
61
  // Object to array
62
  if ( is_object( $wp_submenu ) ) {
@@ -66,7 +66,7 @@ if ( ! function_exists( 'add_action' ) ) {
66
  if ( ! isset( $wp_menu ) || empty( $wp_menu ) ) {
67
  global $menu;
68
 
69
- $wp_menu = $menu;
70
  }
71
  if ( ! isset( $wp_submenu ) || empty( $wp_submenu ) ) {
72
  global $submenu;
55
  </thead>
56
  <tbody>
57
  <?php
58
+ $wp_menu = (array) _mw_adminimize_get_option_value( 'mw_adminimize_default_menu' );
59
+ $wp_submenu = (array) _mw_adminimize_get_option_value( 'mw_adminimize_default_submenu' );
60
 
61
  // Object to array
62
  if ( is_object( $wp_submenu ) ) {
66
  if ( ! isset( $wp_menu ) || empty( $wp_menu ) ) {
67
  global $menu;
68
 
69
+ $wp_menu = (array) $menu;
70
  }
71
  if ( ! isset( $wp_submenu ) || empty( $wp_submenu ) ) {
72
  global $submenu;
inc-options/minimenu.php CHANGED
@@ -99,7 +99,7 @@ if ( _mw_adminimize_is_active_on_multisite() ) {
99
  }
100
 
101
  // check for active links, active since WP 3.5
102
- if ( 0 !== (int) get_option( 'link_manager_enabled' ) ) {
103
  ?>
104
  <tr>
105
  <td class="row-title"><a href="#links_options"><?php esc_attr_e(
99
  }
100
 
101
  // check for active links, active since WP 3.5
102
+ if ( 0 !== get_option( 'link_manager_enabled' ) ) {
103
  ?>
104
  <tr>
105
  <td class="row-title"><a href="#links_options"><?php esc_attr_e(
inc-options/settings_notice.php CHANGED
File without changes
inc-options/theme_options.php CHANGED
File without changes
inc-options/widget_options.php CHANGED
File without changes
inc-options/wp_nav_menu_options.php CHANGED
File without changes
inc-options/write_cp_options.php CHANGED
File without changes
inc-options/write_page_options.php CHANGED
File without changes
inc-options/write_post_options.php CHANGED
File without changes
inc-setup/admin-bar-items.php CHANGED
@@ -115,7 +115,7 @@ function _mw_adminimize_change_admin_bar() {
115
  }
116
 
117
  // Merge multidimensional array in to one, flat.
118
- $disabled_admin_bar_option_ = array_reduce( $disabled_admin_bar_option_, 'array_merge', array() );
119
 
120
  // Support Multiple Roles for users.
121
  if ( _mw_adminimize_get_option_value( 'mw_adminimize_multiple_roles' ) && 1 < count( $user->roles ) ) {
@@ -130,4 +130,4 @@ function _mw_adminimize_change_admin_bar() {
130
  foreach ( $disabled_admin_bar_option_ as $admin_bar_item ) {
131
  $wp_admin_bar->remove_node( $admin_bar_item );
132
  }
133
- }
115
  }
116
 
117
  // Merge multidimensional array in to one, flat.
118
+ $disabled_admin_bar_option_ = (array) array_reduce( $disabled_admin_bar_option_, 'array_merge', array() );
119
 
120
  // Support Multiple Roles for users.
121
  if ( _mw_adminimize_get_option_value( 'mw_adminimize_multiple_roles' ) && 1 < count( $user->roles ) ) {
130
  foreach ( $disabled_admin_bar_option_ as $admin_bar_item ) {
131
  $wp_admin_bar->remove_node( $admin_bar_item );
132
  }
133
+ }
inc-setup/admin-footer.php CHANGED
File without changes
inc-setup/dashboard.php CHANGED
File without changes
inc-setup/helping_hands.php CHANGED
@@ -91,9 +91,9 @@ function _mw_adminimize_debug( $data, $description = '' ) {
91
 
92
  // Buffering to solve problems with WP core, header() etc.
93
  ob_start();
94
- $output = 'console.info(' . json_encode( $description ) . ');';
95
  $output .= 'console.log(' . json_encode( $data ) . ');';
96
- $output = sprintf( '<script>%s</script>', $output );
97
 
98
  echo $output;
99
  }
@@ -111,3 +111,17 @@ function _mw_adminimize_get_duplicate( $array ) {
111
  array_diff_assoc( $array, array_unique( $array ) )
112
  );
113
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
  // Buffering to solve problems with WP core, header() etc.
93
  ob_start();
94
+ $output = 'console.info(' . json_encode( $description ) . ');';
95
  $output .= 'console.log(' . json_encode( $data ) . ');';
96
+ $output = sprintf( '<script>%s</script>', $output );
97
 
98
  echo $output;
99
  }
111
  array_diff_assoc( $array, array_unique( $array ) )
112
  );
113
  }
114
+
115
+ /**
116
+ * Get intersection of a multiple array.
117
+ *
118
+ * @since 2016-06-28
119
+ *
120
+ * @param $array array Array with settings of all roles.
121
+ *
122
+ * @return array Data with only the data, there in each role active.
123
+ */
124
+ function _mw_adminimize_get_intersection( $array ) {
125
+
126
+ return (array) call_user_func_array( 'array_intersect', $array );
127
+ }
inc-setup/meta-boxes.php CHANGED
File without changes
inc-setup/remove-admin-bar.php CHANGED
File without changes
inc-setup/widget.php CHANGED
File without changes
js/adminimize.js CHANGED
File without changes
js/remove_footer.js CHANGED
File without changes
js/remove_header.js CHANGED
File without changes
js/tb_window.js CHANGED
File without changes
js/timestamp.js CHANGED
File without changes
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Bueltge, inpsyde
3
  Donate link: https://www.paypal.me/FrankBueltge
4
  Tags: color, scheme, theme, admin, dashboard, color scheme, plugin, interface, ui, metabox, hide, editor, minimal, menu, customization, interface, administration, lite, light, usability, lightweight, layout, zen
5
  Requires at least: 4.0
6
- Tested up to: 4.5.2
7
- Stable tag: 1.10.4
8
 
9
  Adminimize that lets you hide 'unnecessary' items from the WordPress backend
10
 
@@ -43,6 +43,12 @@ Use the installer via back-end of your install or ...
43
  1. Settings area in WP 4.5-alpha
44
 
45
  == Changelog ==
 
 
 
 
 
 
46
  = 1.10.4 (2016-06-03) =
47
  * Add support for multiple roles to remove the Admin Bar via global options.
48
  * Add support for multiple roles to remove the Admin Bar Back end items.
3
  Donate link: https://www.paypal.me/FrankBueltge
4
  Tags: color, scheme, theme, admin, dashboard, color scheme, plugin, interface, ui, metabox, hide, editor, minimal, menu, customization, interface, administration, lite, light, usability, lightweight, layout, zen
5
  Requires at least: 4.0
6
+ Tested up to: 4.5.3
7
+ Stable tag: 1.10.5
8
 
9
  Adminimize that lets you hide 'unnecessary' items from the WordPress backend
10
 
43
  1. Settings area in WP 4.5-alpha
44
 
45
  == Changelog ==
46
+ = 1.10.5 (2016-06-28) =
47
+ * Fix PHP Warning
48
+ * Fix check for active usage of Link Manager
49
+ * Fix menu var type, if is object.
50
+ * Check for multiple roles on Menu Settings, that it works only, if the option is still active on each role of this user.
51
+
52
  = 1.10.4 (2016-06-03) =
53
  * Add support for multiple roles to remove the Admin Bar via global options.
54
  * Add support for multiple roles to remove the Admin Bar Back end items.