We can silence the error code WordPress.WP.AlternativeFunctions.file_system_read_fclose since it's redundant, as the error is already triggered when fopen() is called:
|
<rule ref="WordPress.WP.AlternativeFunctions.file_system_read_fopen"> |
|
<message>File system operations only work on the `/tmp/` and `wp-content/uploads/` directories. To avoid unexpected results, please use helper functions like `get_temp_dir()` or `wp_get_upload_dir()` to get the proper directory path when using functions such as %s(). For more details, please see: https://docs.wpvip.com/technical-references/vip-go-files-system/local-file-operations/</message> |
|
</rule> |
Two things:
- remove the custom error message here:
|
<rule ref="WordPress.WP.AlternativeFunctions.file_system_read_fclose"> |
|
<message>File system operations only work on the `/tmp/` and `wp-content/uploads/` directories. To avoid unexpected results, please use helper functions like `get_temp_dir()` or `wp_get_upload_dir()` to get the proper directory path when using functions such as %s(). For more details, please see: https://docs.wpvip.com/technical-references/vip-go-files-system/local-file-operations/</message> |
|
</rule> |
- silence the error code since it's being inherited at the
WordPressVIPMinimum level:
|
<rule ref="WordPress.WP.AlternativeFunctions"> |
We can silence the error code
WordPress.WP.AlternativeFunctions.file_system_read_fclosesince it's redundant, as the error is already triggered whenfopen()is called:VIP-Coding-Standards/WordPress-VIP-Go/ruleset.xml
Lines 112 to 114 in 1fa0266
Two things:
VIP-Coding-Standards/WordPress-VIP-Go/ruleset.xml
Lines 115 to 117 in 1fa0266
WordPressVIPMinimumlevel:VIP-Coding-Standards/WordPressVIPMinimum/ruleset.xml
Line 120 in 1fa0266