Skip to content

Commit

Permalink
Improve readme.txt and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
zackkatz committed Jan 29, 2024
1 parent 8f09e0a commit 3bb12b3
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 163 deletions.
130 changes: 1 addition & 129 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# Remove Dashboard Access
##### (Remove Dashboard Access for Non-Admins)

* Contributors: DrewAPicture
* Tags: dashboard, access, users, administration
* Requires at least: 3.1.0
* Tested up to: 4.1.1
* Stable tag: 1.1.3
## (Remove Dashboard Access for Non-Admins)

This WordPress plugin limits user access to the dashboard based on whether users have a chosen capability or role. Disallowed users are redirected to a chosen URL.

Expand All @@ -15,9 +9,6 @@ This WordPress plugin limits user access to the dashboard based on whether users
* Choose your own redirect URL
* Optionally allow user profile access
* Optionally display a message on the login screen
* See **Other Notes** for more info

A full list of capabilities and their associated roles can be found here: http://codex.wordpress.org/Roles_and_Capabilities

#### Contribute to RDA

Expand All @@ -27,122 +18,3 @@ Pull requests are welcome!

1. Search 'Remove Dashboard Access' from the Install Plugins screen.
2. Install plugin, click Activate.

## Frequently Asked Questions

#### What happens to disallowed users who try to login to the Dashboard?

Users lacking the chosen capability or role will be redirected to the URL set in Settings > Dashboard Access.

#### Why haven't you added an option to disable the WordPress Toolbar?

The Toolbar contains certain important links (even for disallowed users) such as for accessing to the profile editor and/or logging out. Plus, there are many plugins out there for disabling the Toolbar if you really want to.

#### Can I disable the redirection/profile-editing controls without disabling the plugin?

No. Disable the plugin if you don't wish to leverage the functionality.

## Other Notes

#### Capabilities

* You can limit Dashboard access to Admins only, Editors or above, Authors or above, or by selecting a capability. More information on WordPress' default roles and capabilities can be found here: http://codex.wordpress.org/Roles_and_Capabilities

#### User Profile Access

* You can optionally allow all users the ability to edit their profiles in the Dashboard. Users lacking the chosen capability won't be able to access any other sections of the Dashboard.

#### Login Message

* Supply a message to display on the login screen. Leaving this blank disables the message.

#### Hiding other plugins/themes' Toolbar menus

This hides some built-in WordPress Toolbar menus by default, but can be extended to hide menus from other plugins or themes via two filters: `rda_toolbar_nodes`, and `rda_frontend_toolbar_nodes`.

##### How to find the menu (node) id:

* In the HTML page source, look for the `<li>` container for the menu node you're targeting. It should take the form of `<li id="wp-admin-bar-SOMETHING">`
* In `<li id="wp-admin-bar-SOMETHING">`, you want the "SOMETHING" part.

##### How to filter the disallowed Toolbar nodes on the front-end:

```php
/**
* Filter hidden Toolbar menus on the front-end.
*
* @param array $ids Toolbar menu IDs.
* @return array (maybe) filtered front-end Toolbar menu IDs.
*/
function hide_some_toolbar_menu( $ids ) {
$ids[] = 'SOMETHING';
return $ids;
}
add_filter( 'rda_frontend_toolbar_nodes', 'hide_some_toolbar_menu' );
```

##### Common plugin Toolbar menus and their ids:

| Plugin | Menu ID |
| ------ | ------- |
| [Jetpack by WordPress.com](http://wordpress.org/extend/plugins/jetpack/) (notifications) | 'notes |
| [WordPress SEO by Yoast](http://wordpress.org/extend/plugins/wordpress-seo/) | 'wpseo-menu' |
| [W3 Total Cache](http://wordpress.org/extend/plugins/w3-total-cache/) | 'w3tc' |

#### Debug Mode

* To view debugging information on the Settings > Reading screen, visit yoursite.com/options-general.php?page=dashboard-access&rda_debug=1

## Changelog

#### 1.1.3

* Fixed a compatibility issue with bbPress and the media grid view.

#### 1.1.2

* Bump tested-up-to to 4.1.0
* Miscellaneous readme changes.

#### 1.1.1

Bug Fix:
* Move options back to Settings > Dashboard Access screen to resolve conflict with page_on_front UI.

#### 1.1

Enhancements:
* Instantiate as a static instance for better modularity
* Move Dashboard Access Controls settings to Settings > Dashboard Access
* Add optional login message option
* Add better settings sanitization
* New Filter: `rda_default_caps_for_role` - Filter default roles for Admins, Editors, and Authors

Bug Fixes:
* Remove unnecessarily stringent URL mask on the redirect URL option

#### 1.0

* Complete rewrite!
* New: Limit dashboard access for Admins only or by capability
* New: Allow/disallow edit-profile access
* New: Choose your own redirect URL
* New Filter: `rda_default_access_cap` - Change default access capability
* New Filter: `rda_toolbar_nodes` - Filter which back-end Toolbar nodes are hidden
* New Filter: `rda_frontend_toolbar_nodes` - Filter which front-end Toolbar nodes are hidden

#### 0.4

* Refined DOING_AJAX check for logged-out users, props @nacin and @BoiteAWeb

#### 0.3

* Changed cap to manage_options, replaced PHP_SELF with DOING_AJAX

#### 0.2

* Replaced preg_match with admin-ajax test. Added compatibility with rewritten dashboard URLs.

#### 0.1

* Submitted to repository
72 changes: 39 additions & 33 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,40 @@
=== Plugin Name ===
=== Remove Dashboard Access ===
Contributors: TrustedLogin
Donate link: https://www.trustedlogin.com
Tags: dashboard, access, users, administration, login, redirect, membership, restrict
Tags: dashboard, access, administration, login, restrict
Requires at least: 3.1.0
Tested up to: 5.9.3
Stable tag: 1.1.5
Tested up to: 6.4.2
Stable tag: 1.1.6
Requires PHP: 5.3

Allows you to disable Dashboard access for users of a specific role or capability. Disallowed users are redirected to a chosen URL.
Disable Dashboard access for users of a specific role or capability. Disallowed users are redirected to a chosen URL. Get set up in seconds.

== Description ==

* Limit Dashboard access to admins only, admins + editors, admins + editors + authors, or limit by specific capability.
The easiest and safest way to restrict access to your WordPress site's Dashboard and administrative menus. Remove Dashboard Access is a lightweight plugin that automatically redirects users who shouldn't have access to the Dashboard to a custom URL of your choosing. Redirects can also be configured on a per-role/per-capability basis, allowing you to keep certain users out of the Dashboard, while retaining access for others.

* Limit Dashboard access to user roles:
- Admins only
- Admins + editors
- Admins, editors, and authors
- or restrict by specific user capability
* Choose your own redirect URL
* Optionally allow user profile access
* Optionally display a message on the login screen
* (<a href="http://wordpress.org/extend/plugins/remove-dashboard-access-for-non-admins/other_notes/">more info</a>)
* Optionally allow users to edit their profiles
* Display a message on the login screen so users know why they're being redirected

Blocking access to the Dashboard is a great way to prevent clients from breaking their sites, prevent users from seeing things they shouldn't, and to keep your site's backend more secure.

<strong>Allow only users with roles or capabilities:</strong>

You can restrict Dashboard access to Admins only, Editors or above, Authors or above, or by selecting a specific user capability.

<strong>Grant access to user profiles:</strong>

<strong>Contribute to RDA</strong>
Optionally allow all users the ability to edit their profiles in the Dashboard. Users lacking the chosen capability won't be able to access any other sections of the Dashboard.

This plugin is in active development <a href="https://github.com/DrewAPicture/remove-dashboard-access" target="_new">on GitHub</a>. Pull requests are welcome!
<strong>Show a custom login message:</strong>

* Supply a message to display on the login screen. Leaving this blank disables the message.

== Installation ==

Expand All @@ -39,30 +55,16 @@ The Toolbar contains certain important links (even for disallowed users) such as

No. Disable the plugin if you don't wish to leverage the functionality.

== Other Notes ==

<strong>Capabilities:</strong>

* You can limit Dashboard access to Admins only, Editors or above, Authors or above, or by selecting a capability. More information on WordPress' default roles and capabilities can be found here: http://codex.wordpress.org/Roles_and_Capabilities

<strong>User Profile Access:</strong>

* You can optionally allow all users the ability to edit their profiles in the Dashboard. Users lacking the chosen capability won't be able to access any other sections of the Dashboard.

<strong>Login Message:</strong>

* Supply a message to display on the login screen. Leaving this blank disables the message.

<strong>Hiding other plugins/themes' Toolbar menus:</strong>
= How do I hide other plugins/themes' Toolbar menus? =

* Remove Dashboard Access removes some built-in WordPress Toolbar menus by default, but can be extended to hide menus from other plugins or themes via two filters: `rda_toolbar_nodes` (viewing from the admin), and `rda_frontend_toolbar_nodes` (viewing from the front-end).

<strong>How to find the menu (node) id:</strong>
= How do I find the menu (node) id? =

* In the HTML page source, look for the `<li>` container for the menu node you're targeting. It should take the form of `<li id="wp-admin-bar-SOMETHING">`
* In `<li id="wp-admin-bar-SOMETHING">`, you want the "SOMETHING" part.

<strong>How to filter the disallowed Toolbar nodes on the front-end:</strong>
= How can I filter the disallowed Toolbar nodes on the front-end? =

`
/**
Expand All @@ -76,21 +78,24 @@ function wpdocs_hide_some_toolbar_menu( $ids ) {
return $ids;
}
add_filter( 'rda_frontend_toolbar_nodes', 'wpdocs_hide_some_toolbar_menu' );
`

<strong>Common plugin Toolbar menus and their ids:</strong>

* <a href="http://wordpress.org/extend/plugins/jetpack/">Jetpack by WordPress.com</a> (notifications) – 'notes'
* <a href="http://wordpress.org/extend/plugins/wordpress-seo/">WordPress SEO by Yoast</a> – 'wpseo-menu'
* <a href="http://wordpress.org/extend/plugins/w3-total-cache/">W3 Total Cache</a> – 'w3tc'
* <a href="https://wordpress.org/extend/plugins/jetpack/">Jetpack by WordPress.com</a> (notifications) – 'notes'
* <a href="https://wordpress.org/extend/plugins/wordpress-seo/">WordPress SEO by Yoast</a> – 'wpseo-menu'
* <a href="https://wordpress.org/extend/plugins/w3-total-cache/">W3 Total Cache</a> – 'w3tc'

<strong>Debug Mode</strong>
= How do I enable Debug Mode? =

To view debugging information on the Settings > Reading screen, visit:
`
example.com/options-general.php?page=dashboard-access&rda_debug=1
`

= Can I contribute to the plugin? =

Yes! This plugin is in active development <a href="https://github.com/trustedlogin/Remove-Dashboard-Access" target="_new">on GitHub</a>. Pull requests are welcome!

== Screenshots ==

1. The Dashboard Access Controls settings in the Settings > Dashboard Access screen.
Expand All @@ -101,6 +106,7 @@ example.com/options-general.php?page=dashboard-access&rda_debug=1

= 1.1.6 on January 29, 2024 =

* Confirmed compatibility with WordPress 6.4.2
* Improved: Added a description that clarifies that the Login Message is only displayed on the WordPress "Log In" screen
* Improved: The User Profile Access text is now a proper label for the checkbox

Expand Down
3 changes: 2 additions & 1 deletion remove-dashboard-access.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
* Plugin Name: Remove Dashboard Access
* Plugin URI: https://www.trustedlogin.com/remove-dashboard-access/
* Description: Removes Dashboard access for certain users based on capability.
* Version: 1.1.5
* Version: 1.1.6
* Author: TrustedLogin
* Author URI: https://www.trustedlogin.com
* License: GPLv2
* Requires PHP: 5.3
*/

// Bail if called directly.
Expand Down

0 comments on commit 3bb12b3

Please sign in to comment.