![github-actions[bot]](/assets/img/avatar_default.png)
* Create rule S6349 * Update rule description * Address review suggestion Co-authored-by: hendrik-buchwald-sonarsource <64110887+hendrik-buchwald-sonarsource@users.noreply.github.com> Co-authored-by: pynicolas <pynicolas@users.noreply.github.com> Co-authored-by: Pierre-Yves Nicolas <pierre-yves.nicolas@sonarsource.com> Co-authored-by: Karim El Ouerghemmi <64004037+karim-ouerghemmi-sonarsource@users.noreply.github.com> Co-authored-by: hendrik-buchwald-sonarsource <64110887+hendrik-buchwald-sonarsource@users.noreply.github.com>
18 lines
679 B
Plaintext
18 lines
679 B
Plaintext
WordPress relies a lot on the configuration located in a file named `wp-config.php`. This file contains mostly `define` statements and each of them creates a constant for a given WordPress option. However, no warning appears if an option is misspelled: the statement simply defines a constant which is never used.
|
|
|
|
This rule raises an issue when a file named `wp-config.php` defines a constant whose name is slightly different from a known WordPress option.
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
define( 'DISALLOW_FILE_MOD', true ); // Noncompliant
|
|
define( 'Disallow_File_Mods', true ); // Noncompliant
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
define( 'DISALLOW_FILE_MODS', true );
|
|
----
|
|
|