WordPress / plugin-check

A repository for the new Plugin Check plugin from the WordPress Performance and Plugins Team.
https://wordpress.org/plugins/plugin-check/
GNU General Public License v2.0
199 stars 39 forks source link

Create Autoloaded_Options_Check #28

Open mehulkaklotar opened 1 year ago

mehulkaklotar commented 1 year ago

Description

Checks the usage of the add_option and update_option functions and warns if the $autoload parameter is not set, i.e. the default $autoload value is used, which is true. Too many autoloaded options can lead to performance issues so this option should not be set to true unless necessary. No existing sniff exists but the existing WordPress.WP.EnqueuedResourceParameters sniff in the WordPress Coding Standards can be used as a starting point.

Potentially, a warning could be triggered if "yes" is passed, but the most important part is to highlight the importance of considering that parameter and what it means for performance.

Acceptance Criteria

Tests Coverage

vishalkakadiya commented 1 year ago

@jjgrainger I will update AC for this issue, thanks! 🙂