Linux 软件免费装
Banner图

Remove Dashboard Access

开发者 DrewAPicture
TrustedLogin
更新时间 2024年1月30日 11:36
捐献地址: 去捐款
PHP版本: 5.3 及以上
WordPress版本: 6.4.2

标签

dashboard login access restrict administration

下载

0.3 0.4 1.0 1.1 1.1.1 1.1.2 1.1.3 0.2 1.1.4 1.1.5 1.2

详情介绍:

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. 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. Allow only users with roles or capabilities: You can restrict Dashboard access to Admins only, Editors or above, Authors or above, or by selecting a specific user capability. Grant access to user profiles: 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. Show a custom login message:

安装:

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

屏幕截图:

  • Allow users to access their profile settings (only).
  • Optional login message.

升级注意事项:

0.4
  • Refined DOING_AJAX check for logged-out users
0.3
  • Improved function.
0.2
  • No additional files were added.
0.1
  • Initial submission

常见问题:

What happens to disallowed users who try to access to the Dashboard?

Users lacking the chosen capability or role(s) 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.

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).

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.

How can I allow access to specific pages of the Dashboard?

The function returns an associative array with $pagenow as the key and a nested array of key => value pairs where the key is the $_GET parameter and the value is the allowed value. Example: If you want to allow a URL of tools.php?page=EXAMPLE, there are three parts to know:

  • The $pagenow global value (tools.php in this case)
  • The $_GET key (page in this case)
  • The $_GET value (EXAMPLE in this case)
Here is how we would add that URL to the allowlist: /** * Allow users to access a page with a URL of tools.php?page=EXAMPLE * * @param array $pages Allowed Dashboard pages. * @return array Filtered allowed Dashboard pages. */ function wpdocs_allow_example_dashboard_page( $pages ) { // If the $pages array doesn't contain the 'tools.php' key, add it. if ( ! isset( $pages['tools.php'] ) ) { $pages['tools.php'] = array(); } // Now add `?page=EXAMPLE` combination to the allowed parameter set for that page. $pages['tools.php'][] = array( 'page' => 'EXAMPLE' ); return $pages; } add_filter( 'rda_allowlist', 'wpdocs_allow_example_dashboard_page' );

How can I filter the disallowed Toolbar nodes on the front-end?

/** * Filter hidden Toolbar menus on the front-end. * * @param array $ids Toolbar menu IDs. * @return array Filtered front-end Toolbar menu IDs. */ function wpdocs_hide_some_toolbar_menu( $ids ) { $ids[] = 'SOMETHING'; return $ids; } add_filter( 'rda_frontend_toolbar_nodes', 'wpdocs_hide_some_toolbar_menu' ); Common plugin Toolbar menus and their ids:

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 on GitHub. Pull requests are welcome!

Is the plugin GDPR compliant?

Yes. The plugin does not collect any personal data, nor does it set any cookies.

更新日志:

1.2 on January 29, 2024 1.1.4 & 1.1.5 on April 18, 2022 Remove Dashboard Access is now being maintained by TrustedLogin! Remove Dashboard Access aligns with what we do at TrustedLogin: simply making WordPress more secure. Email any questions to support@trustedlogin.com. 1.1.3 1.1.2 1.1.1 Bug Fix: 1.1 Enhancements: Bug Fixes: 1.0 0.4 0.3 0.2 0.1