Skip to content

PHP Notice and White Screen When User without Dashboard Access Logs In #63

Description

@mrwweb

See: https://wordpress.org/support/topic/bug-when-user-does-not-have-permission-to-access-page/

When a logged-in user does not have permission to view the admin dashboard and visits /wp-admin/ the following errors occur:

[30-Mar-2020 11:36:28 UTC] PHP Notice: Trying to get property ‘cap’ of non-object in /var/www/wordpress/wp-content/plugins/wp-help/classes/plugin.php on line 211
[30-Mar-2020 11:36:28 UTC] PHP Stack trace:
[30-Mar-2020 11:36:28 UTC] PHP 1. {main}() /var/www/wordpress/wp-admin/index.php:0
[30-Mar-2020 11:36:28 UTC] PHP 2. require_once() /var/www/wordpress/wp-admin/index.php:10
[30-Mar-2020 11:36:28 UTC] PHP 3. require() /var/www/wordpress/wp-admin/admin.php:153
[30-Mar-2020 11:36:28 UTC] PHP 4. require_once() /var/www/wordpress/wp-admin/menu.php:326
[30-Mar-2020 11:36:28 UTC] PHP 5. do_action() /var/www/wordpress/wp-admin/includes/menu.php:155
[30-Mar-2020 11:36:28 UTC] PHP 6. WP_Hook->do_action() /var/www/wordpress/wp-includes/plugin.php:478
[30-Mar-2020 11:36:28 UTC] PHP 7. WP_Hook->apply_filters() /var/www/wordpress/wp-includes/class-wp-hook.php:312
[30-Mar-2020 11:36:28 UTC] PHP 8. CWS_WP_Help_Plugin->admin_menu() /var/www/wordpress/wp-includes/class-wp-hook.php:288
[30-Mar-2020 11:36:28 UTC] PHP 9. CWS_WP_Help_Plugin->get_cap() /var/www/wordpress/wp-content/plugins/wp-help/classes/plugin.php:601
[30-Mar-2020 11:36:28 UTC] PHP Notice: Trying to get property ‘read_posts’ of non-object in /var/www/wordpress/wp-content/plugins/wp-help/classes/plugin.php on line 211
[30-Mar-2020 11:36:28 UTC] PHP Stack trace:
[30-Mar-2020 11:36:28 UTC] PHP 1. {main}() /var/www/wordpress/wp-admin/index.php:0
[30-Mar-2020 11:36:28 UTC] PHP 2. require_once() /var/www/wordpress/wp-admin/index.php:10
[30-Mar-2020 11:36:28 UTC] PHP 3. require() /var/www/wordpress/wp-admin/admin.php:153
[30-Mar-2020 11:36:28 UTC] PHP 4. require_once() /var/www/wordpress/wp-admin/menu.php:326
[30-Mar-2020 11:36:28 UTC] PHP 5. do_action() /var/www/wordpress/wp-admin/includes/menu.php:155
[30-Mar-2020 11:36:28 UTC] PHP 6. WP_Hook->do_action() /var/www/wordpress/wp-includes/plugin.php:478
[30-Mar-2020 11:36:28 UTC] PHP 7. WP_Hook->apply_filters() /var/www/wordpress/wp-includes/class-wp-hook.php:312
[30-Mar-2020 11:36:28 UTC] PHP 8. CWS_WP_Help_Plugin->admin_menu() /var/www/wordpress/wp-includes/class-wp-hook.php:288
[30-Mar-2020 11:36:28 UTC] PHP 9. CWS_WP_Help_Plugin->get_cap() /var/www/wordpress/wp-content/plugins/wp-help/classes/plugin.php:601

I am more than happy to fix this if you would like. Would it be possible to port the source code to github though, and I can submit a pull request?

I can confirm.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions