8000 Null check needed for addCapability · Issue #123 · wpexpertsio/Post-SMTP · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000
Null check needed for addCapability #123
Open
@JoakimEwenson

Description

@JoakimEwenson

I have come across a bit of an edge case where the "administrator" role was removed from a WordPress multisite install, causing Post SMTP errors both on activation and when activated due to $role not being null checked before trying to add capabilities to it at

$role = get_role( Postman::ADMINISTRATOR_ROLE_NAME );
and
$role->add_cap( Postman::MANAGE_POSTMAN_CAPABILITY_NAME );

Even though it might be bad to remove "administrator" role at all, it would also be nice if the site did not crash due to this.

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

      0