Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix check in give_install_roles_on_network #376

Merged
merged 1 commit into from
Oct 28, 2015
Merged

Fix check in give_install_roles_on_network #376

merged 1 commit into from
Oct 28, 2015

Conversation

jimwebb
Copy link
Contributor

@jimwebb jimwebb commented Oct 28, 2015

The $wp_roles->roles array is multidimensional, so checking for the presence of the give_manager role by using in_array() will always return false, and the plugin will re-initialize roles and capabilities on every admin page load (including admin-ajax calls). It's slowing down one of my clients' sites by about a second per page load. Use array_key_exists() instead and get faster admin load times!

The $wp_roles->roles array is multidimensional, so checking in_array() will always return false, and the Give plugin will re-initialize roles and capabilities on every admin page load. Use array_key_exists() instead and get faster admin load times!
@DevinWalker
Copy link
Member

Thanks @jimwebb that's good to know.

DevinWalker pushed a commit that referenced this pull request Oct 28, 2015
Fix check in give_install_roles_on_network
@DevinWalker DevinWalker merged commit 9b050dc into impress-org:master Oct 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants