Opened 3 years ago

Closed 2 years ago

#5564 closed enhancement (wontfix) secret-key service output does not follow coding standards

Reported by: johnpgreen's profile johnpgreen Owned by:
Milestone: Priority: normal
Component: API Keywords: close


The output generated by the secret-key service ( outputs PHP that doesn't conform to the WordPress PHP Coding Standards.

Specifically, "[u]nless otherwise specified, parentheses should have spaces inside of them." (

Change History (5)

#1 @dd32
3 years ago

  • Component changed from General to API
  • Keywords close added

IMHO: The salt API should never be used directly, but it exists for legacy reasons. It's primarily only used by those who create a wp-config.php file manually, and even then I question how many actually use it.

Unfortunately the output cannot be changed, as WordPress expects it to be in the current format:

Actually, I guess I could fix the API output.. but it would require violating a different coding standards rule, SECURE_AUTH_SALT would have to live without having a space after the comma in the define().

While I could bump the version to 1.2 it doesn't seem to serve much purpose in doing so, as it should be rare that the API is needed anymore.

#2 follow-up: @johnpgreen
3 years ago

Ok, I think I may be confused.

If this only exists for legacy reasons, why is it still referenced in wp-config-sample.php in the WordPress download?

What is the modern alternative to the API?

#3 in reply to: ↑ 2 @dd32
3 years ago

Replying to johnpgreen:

What is the modern alternative to the API?

Using wp-admin/setup-config.php :)

It still exists within wp-config-sample.php for those who setup their wp-config files manually. Ideally, one would not rely upon a remote API to generate these keys though, and would simply replace put your unique phrase here with "random junk" dlfksghjarsel524w09e80e9d u30jqc3iw3a-ds0c3j9m9-cj (a keyboard mash) which is arguably as secure, if not more so, than using the remote API.

#4 @johnpgreen
3 years ago

Gotcha. Thanks, Dion!

#5 @dd32
2 years ago

  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.