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

performance improvement in Abstract_File_Check::get_files() #695

Open
pbiron opened this issue Oct 3, 2024 · 1 comment
Open

performance improvement in Abstract_File_Check::get_files() #695

pbiron opened this issue Oct 3, 2024 · 1 comment
Labels
[Type] Bug An existing feature is broken

Comments

@pbiron
Copy link
Contributor

pbiron commented Oct 3, 2024

Abstract_File_Check::get_files() has a call to $directories_to_ignore = Plugin_Request_Utility::get_directories_to_ignore(); inside the loop over all files in the plugin being checked.

I think that call should be moved outside the loop, but am wondering whether there was a specific reason it was included within the loop.
Plugin_Request_Utility::get_directories_to_ignore() does apply_filters( 'wp_plugin_check_ignore_directories' ) so, theoretically, it could return different values each time through the loop. But I think that is extremely unlikely and that moving the call outside the loop could improve performance for plugins that contain a lot of files.

Happy to do a PR if consensus is that it should be moved outside the loop.

@swissspidy
Copy link
Member

I think that call should be moved outside the loop, but am wondering whether there was a specific reason it was included within the loop.

I don't think so.

Happy to accept such a PR 👍

@swissspidy swissspidy added the [Type] Bug An existing feature is broken label Oct 23, 2024
@swissspidy swissspidy added this to the 1.3.0 milestone Oct 23, 2024
@ernilambar ernilambar removed this from the 1.3.0 milestone Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature is broken
Projects
None yet
Development

No branches or pull requests

3 participants