Absolutely Glamorous Custom Admin - Version 5.7.3

Version Description

  • Fix for ABSPATH value
  • Added option to hide profile color scheme
Download this release

Release Info

Developer argonius
Plugin Icon 128x128 Absolutely Glamorous Custom Admin
Version 5.7.3
Comparing to
See all releases

Code changes from version 5.7.1 to 5.7.3

Files changed (2) hide show
  1. plugin.php +90 -67
  2. readme.txt +13 -5
plugin.php CHANGED
@@ -4,12 +4,12 @@ Plugin Name: AG Custom Admin
4
  Plugin URI: http://wordpressadminpanel.com/ag-custom-admin/
5
  Description: All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes.
6
  Author: WAP
7
- Version: 5.7.1
8
  Text Domain: ag-custom-admin
9
  Domain Path: /languages
10
  Author URI: http://www.wordpressadminpanel.com/
11
 
12
- Copyright 2016. WAP (email : info@wordpressadminpanel.com)
13
 
14
  This program is free software: you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License as published by
@@ -36,18 +36,18 @@ class AGCA{
36
  private $saveAfterImport = false;
37
  private $templateCustomizations = "";
38
  private $templates_ep = "http://wordpressadminpanel.com/configuration.php";
39
-
40
  public function __construct()
41
- {
42
- add_action('init', array(&$this,'init'));
43
  }
44
-
45
- function init(){
46
- $this->reloadScript();
47
  $this->checkPOST();
48
  $this->checkGET();
49
-
50
- if(function_exists("add_filter")){
51
  add_filter('admin_title', array(&$this,'change_title'), 10, 2);
52
  add_filter('plugin_row_meta', array(&$this,'jk_filter_plugin_links'), 10, 2);
53
  }
@@ -64,19 +64,19 @@ class AGCA{
64
 
65
  add_action( 'customize_controls_enqueue_scripts', array(&$this,'agca_customizer_php') );
66
 
67
- /* wp_localize_script(
68
- 'agca-script',//use agca enqueued script
69
- 'agca_string',
70
- $this->get_language_strings()
71
- );*/
72
 
73
  /*Initialize properties*/
74
  $this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
75
 
76
- $this->agca_version = "5.7.1";
77
 
78
  //TODO:upload images programmatically
79
- }
80
 
81
  function load_plugin_textdomain() {
82
  load_plugin_textdomain( 'ag-custom-admin', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
@@ -98,6 +98,14 @@ class AGCA{
98
  return $links;
99
  }
100
 
 
 
 
 
 
 
 
 
101
  function change_admin_color(){
102
  return 'default';
103
  }
@@ -109,6 +117,12 @@ class AGCA{
109
  function admin_init(){
110
  $this->agca_register_settings();
111
  $this->agca_init_session();
 
 
 
 
 
 
112
  }
113
 
114
  function login_init(){
@@ -245,7 +259,7 @@ class AGCA{
245
  exit;
246
  }
247
  }
248
-
249
  function verifyPostRequest(){
250
  if ($_SERVER['REQUEST_METHOD'] === 'POST') {
251
  if (!is_admin()) {
@@ -256,34 +270,34 @@ class AGCA{
256
  if(get_option('agca_disable_postver')){
257
  return;
258
  }
259
- if (is_multisite()) {
260
- $blog_id = get_current_blog_id();
261
- $user_id = get_current_user_id();
262
- $msError = __('Please try temporary disabling POST verification. Go to AG Custom Admin -> Advanced -> Temporary disable POST verification. Do not forget to un-check this option once you are done with customizations.', 'ag-custom-admin');
263
- if (is_user_member_of_blog($user_id, $blog_id)) {
264
- if (!current_user_can('manage_options')) {
265
- _e('Multi-site: Current user is not recognized as administrator.', 'ag-custom-admin');
266
- echo ' '.$msError;
267
- exit;
268
- }
269
- } else {
270
- printf(
271
- /*translators: 1: User Id 2: Blog Id*/
272
- __('Multi-site: User (%1$s) does not have access to this blog (%2$s).', 'ag-custom-admin'),
273
- $user_id,
274
- $blog_id
275
- );
276
- echo ' '. $msError;
277
- exit;
278
- }
279
- } else {
280
- include_once(ABSPATH . 'wp-includes/pluggable.php');
281
- if (!is_user_logged_in() || !current_user_can('manage_options')) {
282
- echo !is_user_logged_in() ? __('User is not logged in.', 'ag-custom-admin').' ' : '';
283
- echo !current_user_can('manage_options') ? __('User can not manage options.', 'ag-custom-admin').' ' : '';
284
- exit;
285
- }
286
- }
287
  if (!wp_verify_nonce($_POST['_agca_token'], 'agca_form')) {
288
  echo __('Nonce verification failed.', 'ag-custom-admin');
289
  exit;
@@ -435,21 +449,21 @@ class AGCA{
435
  }
436
 
437
  function WPSPluginIsLoginPage(){
438
-
439
- $WPSPluginName = 'wps-hide-login/wps-hide-login.php';
440
- if(is_multisite()){
441
- if ( ! function_exists( 'is_plugin_active_for_network' ) )
442
- require_once( ABSPATH . '/wp-admin/includes/plugin.php#general-settings' );
443
-
444
- if(!$this->isPluginActiveForNetwork($WPSPluginName)){
445
- return '';
446
- }
447
- }else{
448
- if(!$this->isPluginActive($WPSPluginName)){
449
- return '';
450
- }
451
- }
452
-
453
  if ( $slug = get_option( 'whl_page' ) ) {
454
  return $slug;
455
  } else if ( ( is_multisite() && $this->isPluginActiveForNetwork($WPSPluginName) && ( $slug = get_site_option( 'whl_page', 'login' ) ) ) ) {
@@ -467,7 +481,7 @@ class AGCA{
467
  $isAdmin = true;
468
  }
469
  if($isAdmin || $this->WPSPluginIsLoginPage()){
470
- $this->agca_enqueue_scripts();
471
  }
472
  }
473
 
@@ -489,6 +503,7 @@ class AGCA{
489
  register_setting( 'agca-options-group', 'agca_wp_logo_custom' );
490
  register_setting( 'agca-options-group', 'agca_remove_site_link' );
491
  register_setting( 'agca-options-group', 'agca_wp_logo_custom_link' );
 
492
 
493
  register_setting( 'agca-options-group', 'agca_site_heading' );
494
  register_setting( 'agca-options-group', 'agca_custom_site_heading' );
@@ -630,6 +645,7 @@ class AGCA{
630
  'agca_remove_site_link',
631
  'agca_wp_logo_custom',
632
  'agca_wp_logo_custom_link',
 
633
  'agca_site_heading',
634
  'agca_custom_site_heading',
635
  'agca_update_bar',
@@ -1606,8 +1622,8 @@ class AGCA{
1606
  }
1607
  return is_plugin_active($plugin);
1608
  }
1609
- function isPluginActiveForNetwork($plugin){
1610
- return is_plugin_active_for_network($plugin);
1611
  }
1612
  function print_admin_css()
1613
  {
@@ -1825,7 +1841,7 @@ class AGCA{
1825
  jQuery("#dashboard-widgets-wrap").parent().find("h1").html("<?php echo addslashes(get_option('agca_dashboard_text')); ?>");
1826
  <?php } ?>
1827
  <?php if(get_option('agca_dashboard_text_paragraph')!=""){
1828
- require_once(ABSPATH . 'wp-includes/formatting.php');
1829
  ?>
1830
  jQuery("#wpbody-content #dashboard-widgets-wrap").before('<div id="agca_custom_dashboard_content"></div>');
1831
 
@@ -2230,6 +2246,13 @@ class AGCA{
2230
  'title'=>__('Hides the menu from the admin pages (located on the top right corner of the page, below the admin bar)', 'ag-custom-admin')
2231
  ));
2232
 
 
 
 
 
 
 
 
2233
  $this->print_options_h3(__('Security', 'ag-custom-admin'));
2234
 
2235
  ?>
@@ -2552,12 +2575,12 @@ class AGCA{
2552
  </table>
2553
  </div>
2554
  <div id="section_dashboard_page" style="display:none" class="ag_section">
2555
- <h2 class="section_title"><?php _e('Dashboard Page Settings', 'ag-custom-admin'); ?></h2>
2556
  <?php $this->show_save_button_upper(); ?>
2557
  <table class="form-table" width="500px">
2558
  <?php
2559
 
2560
- $this->print_options_h3(__('Dashboard Page Options', 'ag-custom-admin'));
2561
 
2562
  $this->print_input(array(
2563
  'title'=>__('Main heading (\'Dashboard\') on Dashboard page', 'ag-custom-admin'),
4
  Plugin URI: http://wordpressadminpanel.com/ag-custom-admin/
5
  Description: All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes.
6
  Author: WAP
7
+ Version: 5.7.3
8
  Text Domain: ag-custom-admin
9
  Domain Path: /languages
10
  Author URI: http://www.wordpressadminpanel.com/
11
 
12
+ Copyright 2017. WAP (email : info@wordpressadminpanel.com)
13
 
14
  This program is free software: you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License as published by
36
  private $saveAfterImport = false;
37
  private $templateCustomizations = "";
38
  private $templates_ep = "http://wordpressadminpanel.com/configuration.php";
39
+
40
  public function __construct()
41
+ {
42
+ add_action('init', array(&$this,'init'));
43
  }
44
+
45
+ function init(){
46
+ $this->reloadScript();
47
  $this->checkPOST();
48
  $this->checkGET();
49
+
50
+ if(function_exists("add_filter")){
51
  add_filter('admin_title', array(&$this,'change_title'), 10, 2);
52
  add_filter('plugin_row_meta', array(&$this,'jk_filter_plugin_links'), 10, 2);
53
  }
64
 
65
  add_action( 'customize_controls_enqueue_scripts', array(&$this,'agca_customizer_php') );
66
 
67
+ /* wp_localize_script(
68
+ 'agca-script',//use agca enqueued script
69
+ 'agca_string',
70
+ $this->get_language_strings()
71
+ );*/
72
 
73
  /*Initialize properties*/
74
  $this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
75
 
76
+ $this->agca_version = "5.7.3";
77
 
78
  //TODO:upload images programmatically
79
+ }
80
 
81
  function load_plugin_textdomain() {
82
  load_plugin_textdomain( 'ag-custom-admin', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
98
  return $links;
99
  }
100
 
101
+
102
+ function filePath($url){
103
+ $absPath = ABSPATH;
104
+ $absPath = rtrim($absPath, '/');
105
+ $url = ltrim($url, '/');
106
+ return $absPath.'/'.$url;
107
+ }
108
+
109
  function change_admin_color(){
110
  return 'default';
111
  }
117
  function admin_init(){
118
  $this->agca_register_settings();
119
  $this->agca_init_session();
120
+ $isAdminUser = current_user_can($this->admin_capability());
121
+ if(!$isAdminUser || ($isAdminUser && !get_option('agca_role_allbutadmin'))){
122
+ if(get_option('agca_profile_color_scheme')){
123
+ remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
124
+ }
125
+ }
126
  }
127
 
128
  function login_init(){
259
  exit;
260
  }
261
  }
262
+
263
  function verifyPostRequest(){
264
  if ($_SERVER['REQUEST_METHOD'] === 'POST') {
265
  if (!is_admin()) {
270
  if(get_option('agca_disable_postver')){
271
  return;
272
  }
273
+ if (is_multisite()) {
274
+ $blog_id = get_current_blog_id();
275
+ $user_id = get_current_user_id();
276
+ $msError = __('Please try temporary disabling POST verification. Go to AG Custom Admin -> Advanced -> Temporary disable POST verification. Do not forget to un-check this option once you are done with customizations.', 'ag-custom-admin');
277
+ if (is_user_member_of_blog($user_id, $blog_id)) {
278
+ if (!current_user_can('manage_options')) {
279
+ _e('Multi-site: Current user is not recognized as administrator.', 'ag-custom-admin');
280
+ echo ' '.$msError;
281
+ exit;
282
+ }
283
+ } else {
284
+ printf(
285
+ /*translators: 1: User Id 2: Blog Id*/
286
+ __('Multi-site: User (%1$s) does not have access to this blog (%2$s).', 'ag-custom-admin'),
287
+ $user_id,
288
+ $blog_id
289
+ );
290
+ echo ' '. $msError;
291
+ exit;
292
+ }
293
+ } else {
294
+ include_once($this->filePath('wp-includes/pluggable.php'));
295
+ if (!is_user_logged_in() || !current_user_can('manage_options')) {
296
+ echo !is_user_logged_in() ? __('User is not logged in.', 'ag-custom-admin').' ' : '';
297
+ echo !current_user_can('manage_options') ? __('User can not manage options.', 'ag-custom-admin').' ' : '';
298
+ exit;
299
+ }
300
+ }
301
  if (!wp_verify_nonce($_POST['_agca_token'], 'agca_form')) {
302
  echo __('Nonce verification failed.', 'ag-custom-admin');
303
  exit;
449
  }
450
 
451
  function WPSPluginIsLoginPage(){
452
+
453
+ $WPSPluginName = 'wps-hide-login/wps-hide-login.php';
454
+ if(is_multisite()){
455
+ if ( ! function_exists( 'is_plugin_active_for_network' ) )
456
+ require_once($this->filePath('wp-admin/includes/plugin.php#general-settings'));
457
+
458
+ if(!$this->isPluginActiveForNetwork($WPSPluginName)){
459
+ return '';
460
+ }
461
+ }else{
462
+ if(!$this->isPluginActive($WPSPluginName)){
463
+ return '';
464
+ }
465
+ }
466
+
467
  if ( $slug = get_option( 'whl_page' ) ) {
468
  return $slug;
469
  } else if ( ( is_multisite() && $this->isPluginActiveForNetwork($WPSPluginName) && ( $slug = get_site_option( 'whl_page', 'login' ) ) ) ) {
481
  $isAdmin = true;
482
  }
483
  if($isAdmin || $this->WPSPluginIsLoginPage()){
484
+ $this->agca_enqueue_scripts();
485
  }
486
  }
487
 
503
  register_setting( 'agca-options-group', 'agca_wp_logo_custom' );
504
  register_setting( 'agca-options-group', 'agca_remove_site_link' );
505
  register_setting( 'agca-options-group', 'agca_wp_logo_custom_link' );
506
+ register_setting( 'agca-options-group', 'agca_profile_color_scheme' );
507
 
508
  register_setting( 'agca-options-group', 'agca_site_heading' );
509
  register_setting( 'agca-options-group', 'agca_custom_site_heading' );
645
  'agca_remove_site_link',
646
  'agca_wp_logo_custom',
647
  'agca_wp_logo_custom_link',
648
+ 'agca_profile_color_scheme',
649
  'agca_site_heading',
650
  'agca_custom_site_heading',
651
  'agca_update_bar',
1622
  }
1623
  return is_plugin_active($plugin);
1624
  }
1625
+ function isPluginActiveForNetwork($plugin){
1626
+ return is_plugin_active_for_network($plugin);
1627
  }
1628
  function print_admin_css()
1629
  {
1841
  jQuery("#dashboard-widgets-wrap").parent().find("h1").html("<?php echo addslashes(get_option('agca_dashboard_text')); ?>");
1842
  <?php } ?>
1843
  <?php if(get_option('agca_dashboard_text_paragraph')!=""){
1844
+ require_once($this->filePath('wp-includes/formatting.php'));
1845
  ?>
1846
  jQuery("#wpbody-content #dashboard-widgets-wrap").before('<div id="agca_custom_dashboard_content"></div>');
1847
 
2246
  'title'=>__('Hides the menu from the admin pages (located on the top right corner of the page, below the admin bar)', 'ag-custom-admin')
2247
  ));
2248
 
2249
+ $this->print_checkbox(array(
2250
+ 'title'=>__('Hides colors scheme on profile page', 'ag-custom-admin'),
2251
+ 'name'=>'agca_profile_color_scheme',
2252
+ 'hide'=>true,
2253
+ 'label'=>__('Profile Color Scheme', 'ag-custom-admin')
2254
+ ));
2255
+
2256
  $this->print_options_h3(__('Security', 'ag-custom-admin'));
2257
 
2258
  ?>
2575
  </table>
2576
  </div>
2577
  <div id="section_dashboard_page" style="display:none" class="ag_section">
2578
+ <h2 class="section_title"><?php _e('Dashboard Settings', 'ag-custom-admin'); ?></h2>
2579
  <?php $this->show_save_button_upper(); ?>
2580
  <table class="form-table" width="500px">
2581
  <?php
2582
 
2583
+ $this->print_options_h3(__('Dashboard Options', 'ag-custom-admin'));
2584
 
2585
  $this->print_input(array(
2586
  'title'=>__('Main heading (\'Dashboard\') on Dashboard page', 'ag-custom-admin'),
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === AG Custom Admin ===
2
  Contributors: wap
3
  Donate link: http://wordpressadminpanel.com/ag-custom-admin/
4
- Tags: admin, customize, hide, change admin, themes, admin themes, admin bar, login page
5
  Requires at least: 3.0
6
- Tested up to: 4.7
7
- Stable tag: 5.7.1
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl.txt
10
 
@@ -32,6 +32,7 @@ With this plugin you can easily customize WordPress **admin panel**, **login pag
32
  = General Settings =
33
  * Hide "Screen Options" menu
34
  * Hide "Help" menu
 
35
 
36
  = Admin Bar Settings =
37
  * Hide admin bar completely
@@ -152,6 +153,10 @@ If you have the latest WordPress and plugin versions and you still experience so
152
 
153
  == Change Log ==
154
 
 
 
 
 
155
  = 5.7.1 =
156
  * Added General Options tests
157
 
@@ -164,7 +169,7 @@ If you have the latest WordPress and plugin versions and you still experience so
164
  * Added acceptance test suite
165
 
166
  = 5.6.5 =
167
- * Resolved Colorizer backround color issue in WP 4.6
168
  * Removed AGCA script from admin bar front end when user is not logged in
169
  * Removed WP version from AGCA front end script
170
  * Login page compatibility with WP Cerber plugin
@@ -523,6 +528,9 @@ If you have the latest WordPress and plugin versions and you still experience so
523
 
524
  == Upgrade Notice ==
525
 
 
 
 
526
  = 5.7.1 =
527
  * Added tests.
528
 
@@ -730,4 +738,4 @@ Added settings for fully customization of admin menus.
730
  Better explanations in Settings page. No changes in functionality.
731
 
732
  = 1.0 =
733
- Initial version.
1
  === AG Custom Admin ===
2
  Contributors: wap
3
  Donate link: http://wordpressadminpanel.com/ag-custom-admin/
4
+ Tags: admin, customize, branding, hide, change, white label, themes, admin themes, admin bar, login page
5
  Requires at least: 3.0
6
+ Tested up to: 4.8
7
+ Stable tag: 5.7.3
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl.txt
10
 
32
  = General Settings =
33
  * Hide "Screen Options" menu
34
  * Hide "Help" menu
35
+ * Hide Color scheme on Profile page
36
 
37
  = Admin Bar Settings =
38
  * Hide admin bar completely
153
 
154
  == Change Log ==
155
 
156
+ = 5.7.3 =
157
+ * Fix for ABSPATH value
158
+ * Added option to hide profile color scheme
159
+
160
  = 5.7.1 =
161
  * Added General Options tests
162
 
169
  * Added acceptance test suite
170
 
171
  = 5.6.5 =
172
+ * Resolved Colorizer background color issue in WP 4.6
173
  * Removed AGCA script from admin bar front end when user is not logged in
174
  * Removed WP version from AGCA front end script
175
  * Login page compatibility with WP Cerber plugin
528
 
529
  == Upgrade Notice ==
530
 
531
+ = 5.7.3 =
532
+ * Fix for ABSPATH value, and added option to hide profile color scheme
533
+
534
  = 5.7.1 =
535
  * Added tests.
536
 
738
  Better explanations in Settings page. No changes in functionality.
739
 
740
  = 1.0 =
741
+ Initial version.