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

Fixes some coding standards #3

Merged
merged 3 commits into from
Jan 12, 2018
Merged

Fixes some coding standards #3

merged 3 commits into from
Jan 12, 2018

Conversation

thejimbirch
Copy link
Contributor

This fixes some WordPress coding errors found in Issue #2 , primarily formatting and commenting errors.

The following errors and warnings still exist:

FILE: /Users/thejimbirch/Sites/xeno-dashboard/includes/admin.php
----------------------------------------------------------------------
FOUND 24 ERRORS AND 12 WARNINGS AFFECTING 23 LINES
----------------------------------------------------------------------
   1 | ERROR   | Class file names should be based on the class name
     |         | with "class-" prepended. Expected
     |         | class-xeno-dashboard-admin.php, but found admin.php.
  21 | ERROR   | Function name "create_Xeno_Dashboard_Admin" is not
     |         | in snake case format, try
     |         | "create_xeno_dashboard_admin"
  92 | ERROR   | Missing function doc comment
  93 | ERROR   | Missing function doc comment
  98 | ERROR   | Missing parameter name
 111 | ERROR   | Missing parameter name
 124 | ERROR   | Missing parameter name
 152 | ERROR   | Missing parameter name
 173 | ERROR   | Expected next thing to be an escaping function (see
     |         | Codex for 'Data Validation'), not 'ltrim'
 174 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 174 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 174 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 174 | ERROR   | Expected next thing to be an escaping function (see
     |         | Codex for 'Data Validation'), not '$o'
 183 | ERROR   | Missing parameter name
 205 | ERROR   | Expected next thing to be an escaping function (see
     |         | Codex for 'Data Validation'), not 'ltrim'
 206 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 206 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 206 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 206 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 206 | ERROR   | Expected next thing to be an escaping function (see
     |         | Codex for 'Data Validation'), not '$o'
 215 | ERROR   | Missing parameter name
 234 | ERROR   | Expected next thing to be an escaping function (see
     |         | Codex for 'Data Validation'), not 'ltrim'
 235 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 235 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 235 | ERROR   | Expected next thing to be an escaping function (see
     |         | Codex for 'Data Validation'), not '$o'
 255 | WARNING | Detected access of super global var $_REQUEST,
     |         | probably needs manual inspection.
 255 | WARNING | Processing form data without nonce verification.
 255 | WARNING | Detected access of super global var $_REQUEST,
     |         | probably needs manual inspection.
 255 | ERROR   | Missing wp_unslash() before sanitization.
 255 | ERROR   | Detected usage of a non-sanitized input variable:
     |         | $_REQUEST
 257 | ERROR   | Expected next thing to be an escaping function (see
     |         | Codex for 'Data Validation'), not '__'
 261 | ERROR   | Expected next thing to be an escaping function (see
     |         | Codex for 'Data Validation'), not '__'
 266 | ERROR   | Expected next thing to be an escaping function (see
     |         | Codex for 'Data Validation'), not '__'
 303 | ERROR   | Missing parameter name
 312 | ERROR   | Expected next thing to be an escaping function (see
     |         | Codex for 'Data Validation'), not '__'
 328 | ERROR   | Missing function doc comment
----------------------------------------------------------------------


FILE: /Users/thejimbirch/Sites/xeno-dashboard/includes/jira.php
----------------------------------------------------------------------
FOUND 40 ERRORS AND 17 WARNINGS AFFECTING 46 LINES
----------------------------------------------------------------------
   1 | ERROR   | Class file names should be based on the class name
     |         | with "class-" prepended. Expected
     |         | class-xeno-dashboard-jira.php, but found jira.php.
  13 | ERROR   | Function name "create_Xeno_Dashboard_Jira" is not in
     |         | snake case format, try "create_xeno_dashboard_jira"
  13 | ERROR   | Missing function doc comment
  28 | ERROR   | Missing @var tag in member variable comment
  36 | ERROR   | Missing @var tag in member variable comment
  44 | ERROR   | Missing parameter name
  51 | ERROR   | Assignments must be the first block of code on a
     |         | line
  51 | ERROR   | Assignments must be the first block of code on a
     |         | line
  56 | ERROR   | Assignments must be the first block of code on a
     |         | line
  56 | ERROR   | Assignments must be the first block of code on a
     |         | line
  57 | ERROR   | Assignments must be the first block of code on a
     |         | line
  57 | ERROR   | Assignments must be the first block of code on a
     |         | line
  58 | ERROR   | Assignments must be the first block of code on a
     |         | line
  58 | ERROR   | Assignments must be the first block of code on a
     |         | line
  59 | ERROR   | Assignments must be the first block of code on a
     |         | line
  59 | ERROR   | Assignments must be the first block of code on a
     |         | line
  60 | ERROR   | Assignments must be the first block of code on a
     |         | line
  60 | ERROR   | Assignments must be the first block of code on a
     |         | line
  61 | ERROR   | Assignments must be the first block of code on a
     |         | line
  61 | ERROR   | Assignments must be the first block of code on a
     |         | line
  76 | ERROR   | Missing parameter name
  81 | ERROR   | Assignments must be the first block of code on a
     |         | line
  81 | ERROR   | Assignments must be the first block of code on a
     |         | line
  84 | WARNING | Found: !=. Use strict comparisons (=== or !==).
  90 | ERROR   | Assignments must be the first block of code on a
     |         | line
  96 | ERROR   | Missing parameter name
 107 | ERROR   | Variable "Xeno_Dashboard_Updates" is not in valid
     |         | snake_case format
 110 | ERROR   | Variable "Xeno_Dashboard_Updates" is not in valid
     |         | snake_case format
 113 | ERROR   | Variable "Xeno_Dashboard_Updates" is not in valid
     |         | snake_case format
 116 | ERROR   | Variable "Xeno_Dashboard_Updates" is not in valid
     |         | snake_case format
 135 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 144 | ERROR   | Doc comment for parameter "$string" missing
 147 | ERROR   | Missing parameter name
 153 | WARNING | json_encode() is discouraged. Use wp_json_encode()
     |         | instead.
 167 | ERROR   | Superfluous parameter comment
 189 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 218 | WARNING | json_encode() is discouraged. Use wp_json_encode()
     |         | instead.
 238 | ERROR   | Doc comment for parameter "$url" missing
 238 | ERROR   | Doc comment for parameter "$data" missing
 242 | ERROR   | Missing parameter name
 243 | ERROR   | Missing parameter name
 248 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 249 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 250 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 251 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 252 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 253 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 254 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 255 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 256 | WARNING | This comment is 50% valid code; is this commented
     |         | out code?
 256 | ERROR   | Inline comments must end in full-stops, exclamation
     |         | marks, or question marks
 257 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 258 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 266 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 267 | ERROR   | Inline comments must end in full-stops, exclamation
     |         | marks, or question marks
 275 | ERROR   | Missing parameter name
 286 | ERROR   | Missing parameter name
----------------------------------------------------------------------


FILE: /Users/thejimbirch/Sites/xeno-dashboard/includes/rest.php
----------------------------------------------------------------------
FOUND 42 ERRORS AND 16 WARNINGS AFFECTING 48 LINES
----------------------------------------------------------------------
   1 | ERROR   | Class file names should be based on the class name
     |         | with "class-" prepended. Expected
     |         | class-xeno-dasboard-rest-controller.php, but found
     |         | rest.php.
  15 | ERROR   | Function name "create_Xeno_Dasboard_REST_Controller"
     |         | is not in snake case format, try
     |         | "create_xeno_dasboard_r_e_s_t_controller"
  15 | ERROR   | Missing function doc comment
  29 | ERROR   | Missing @var tag in member variable comment
  44 | ERROR   | Missing parameter name
  58 | ERROR   | Missing parameter name
  66 | ERROR   | Assignments must be the first block of code on a
     |         | line
  66 | ERROR   | Assignments must be the first block of code on a
     |         | line
  67 | ERROR   | Assignments must be the first block of code on a
     |         | line
  67 | ERROR   | Assignments must be the first block of code on a
     |         | line
  68 | ERROR   | Assignments must be the first block of code on a
     |         | line
  68 | ERROR   | Assignments must be the first block of code on a
     |         | line
  69 | ERROR   | Assignments must be the first block of code on a
     |         | line
  69 | ERROR   | Assignments must be the first block of code on a
     |         | line
  70 | ERROR   | Assignments must be the first block of code on a
     |         | line
  70 | ERROR   | Assignments must be the first block of code on a
     |         | line
  71 | ERROR   | Assignments must be the first block of code on a
     |         | line
  71 | ERROR   | Assignments must be the first block of code on a
     |         | line
  78 | ERROR   | Missing parameter name
  99 | ERROR   | Missing parameter name
 100 | ERROR   | Function return type is void, but function contains
     |         | return statement
 104 | ERROR   | Assignments must be the first block of code on a
     |         | line
 104 | ERROR   | Assignments must be the first block of code on a
     |         | line
 107 | WARNING | Found: !=. Use strict comparisons (=== or !==).
 113 | ERROR   | Assignments must be the first block of code on a
     |         | line
 119 | ERROR   | Missing parameter name
 153 | ERROR   | Parameter comment must end with a full stop
 170 | WARNING | Not using strict comparison for in_array; supply
     |         | true for third argument.
 178 | ERROR   | Variable "Xeno_Dashboard_Slack" is not in valid
     |         | snake_case format
 179 | ERROR   | Variable "Xeno_Dashboard_Slack" is not in valid
     |         | snake_case format
 194 | ERROR   | Missing parameter name
 207 | ERROR   | Variable "Xeno_Dashboard_Updates" is not in valid
     |         | snake_case format
 210 | ERROR   | Variable "Xeno_Dashboard_Updates" is not in valid
     |         | snake_case format
 213 | ERROR   | Variable "Xeno_Dashboard_Updates" is not in valid
     |         | snake_case format
 216 | ERROR   | Variable "Xeno_Dashboard_Updates" is not in valid
     |         | snake_case format
 219 | ERROR   | Variable "Xeno_Dashboard_Updates" is not in valid
     |         | snake_case format
 233 | ERROR   | Parameter comment must end with a full stop
 252 | ERROR   | Parameter comment must end with a full stop
 278 | WARNING | urlencode() should only be used when dealing with
     |         | legacy applications rawurlencode() should now be
     |         | used instead. See
     |         | http://php.net/manual/en/function.rawurlencode.php
     |         | and http://www.faqs.org/rfcs/rfc3986.html
 312 | ERROR   | Missing parameter name
 313 | ERROR   | Missing parameter name
 320 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 321 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 322 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 323 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 324 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 324 | WARNING | json_encode() is discouraged. Use wp_json_encode()
     |         | instead.
 325 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 326 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 327 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 329 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 330 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 332 | WARNING | This comment is 54% valid code; is this commented
     |         | out code?
 332 | ERROR   | Inline comments must end in full-stops, exclamation
     |         | marks, or question marks
 335 | WARNING | Using cURL functions is highly discouraged. Use
     |         | wp_remote_get() instead.
 336 | ERROR   | Inline comments must end in full-stops, exclamation
     |         | marks, or question marks
 344 | ERROR   | Missing parameter name
 356 | ERROR   | Missing parameter name
----------------------------------------------------------------------


FILE: /Users/thejimbirch/Sites/xeno-dashboard/includes/secure.php
----------------------------------------------------------------------
FOUND 5 ERRORS AND 2 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------
  11 | ERROR   | Missing parameter name
  22 | ERROR   | Assignments must be the first block of code on a
     |         | line
  88 | WARNING | Found: !=. Use strict comparisons (=== or !==).
  93 | ERROR   | Assignments must be the first block of code on a
     |         | line
 117 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 120 | ERROR   | Doc comment for parameter "$str" missing
 124 | ERROR   | Assignments must be the first block of code on a
     |         | line
----------------------------------------------------------------------


FILE: /Users/thejimbirch/Sites/xeno-dashboard/includes/slack.php
----------------------------------------------------------------------
FOUND 21 ERRORS AND 9 WARNINGS AFFECTING 22 LINES
----------------------------------------------------------------------
   1 | ERROR   | Class file names should be based on the class name
     |         | with "class-" prepended. Expected
     |         | class-xeno-dashboard-slack.php, but found slack.php.
  31 | ERROR   | Missing @var tag in member variable comment
  37 | ERROR   | Missing parameter name
  46 | ERROR   | Assignments must be the first block of code on a
     |         | line
  46 | ERROR   | Assignments must be the first block of code on a
     |         | line
  54 | ERROR   | Assignments must be the first block of code on a
     |         | line
  54 | ERROR   | Assignments must be the first block of code on a
     |         | line
  55 | ERROR   | Assignments must be the first block of code on a
     |         | line
  55 | ERROR   | Assignments must be the first block of code on a
     |         | line
  62 | ERROR   | Missing parameter name
  71 | ERROR   | Expected next thing to be an escaping function (like
     |         | esc_html_e() or esc_attr_e()), not '_e'
  76 | ERROR   | Doc comment for parameter "$type" missing
  76 | ERROR   | Doc comment for parameter "$updates_only" missing
  79 | ERROR   | Missing parameter name
  92 | ERROR   | Variable "Xeno_Dashboard_Updates" is not in valid
     |         | snake_case format
  95 | WARNING | Found: ==. Use strict comparisons (=== or !==).
  95 | WARNING | Found: ==. Use strict comparisons (=== or !==).
  96 | ERROR   | Variable "Xeno_Dashboard_Updates" is not in valid
     |         | snake_case format
 100 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 100 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 101 | ERROR   | Variable "Xeno_Dashboard_Updates" is not in valid
     |         | snake_case format
 105 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 105 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 106 | ERROR   | Variable "Xeno_Dashboard_Updates" is not in valid
     |         | snake_case format
 127 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 139 | ERROR   | Doc comment for parameter "$the_fields" missing
 139 | ERROR   | Doc comment for parameter "$vulnerable" missing
 142 | ERROR   | Doc comment for parameter $args does not match
     |         | actual variable name $the_fields
 208 | WARNING | json_encode() is discouraged. Use wp_json_encode()
     |         | instead.
 223 | WARNING | Found: !=. Use strict comparisons (=== or !==).
----------------------------------------------------------------------


FILE: /Users/thejimbirch/Sites/xeno-dashboard/includes/updates.php
----------------------------------------------------------------------
FOUND 23 ERRORS AND 6 WARNINGS AFFECTING 24 LINES
----------------------------------------------------------------------
   1 | ERROR   | Class file names should be based on the class name
     |         | with "class-" prepended. Expected
     |         | class-xeno-dashboard-updates.php, but found
     |         | updates.php.
  23 | ERROR   | Missing parameter name
  35 | ERROR   | Doc comment for parameter "$data" missing
  35 | ERROR   | Doc comment for parameter "$only_available" missing
  38 | ERROR   | Doc comment for parameter $request does not match
     |         | actual variable name $data
  75 | WARNING | Found: !=. Use strict comparisons (=== or !==).
  79 | ERROR   | A gettext call containing placeholders was found,
     |         | but was not accompanied by a "translators:" comment
     |         | on the line above to clarify the meaning of the
     |         | placeholders.
  86 | ERROR   | A gettext call containing placeholders was found,
     |         | but was not accompanied by a "translators:" comment
     |         | on the line above to clarify the meaning of the
     |         | placeholders.
  95 | ERROR   | Doc comment for parameter "$data" missing
  95 | ERROR   | Doc comment for parameter "$only_available" missing
  98 | ERROR   | Doc comment for parameter $request does not match
     |         | actual variable name $data
 142 | ERROR   | A gettext call containing placeholders was found,
     |         | but was not accompanied by a "translators:" comment
     |         | on the line above to clarify the meaning of the
     |         | placeholders.
 163 | ERROR   | A gettext call containing placeholders was found,
     |         | but was not accompanied by a "translators:" comment
     |         | on the line above to clarify the meaning of the
     |         | placeholders.
 172 | ERROR   | Doc comment for parameter "$data" missing
 172 | ERROR   | Doc comment for parameter "$only_available" missing
 172 | ERROR   | Doc comment for parameter "$active_only" missing
 175 | ERROR   | Doc comment for parameter $request does not match
     |         | actual variable name $data
 211 | ERROR   | A gettext call containing placeholders was found,
     |         | but was not accompanied by a "translators:" comment
     |         | on the line above to clarify the meaning of the
     |         | placeholders.
 227 | ERROR   | A gettext call containing placeholders was found,
     |         | but was not accompanied by a "translators:" comment
     |         | on the line above to clarify the meaning of the
     |         | placeholders.
 239 | ERROR   | Parameter comment must end with a full stop
 297 | ERROR   | Parameter comment must end with a full stop
 299 | ERROR   | Parameter comment must end with a full stop
 301 | ERROR   | Parameter comment must end with a full stop
 316 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 316 | WARNING | Found: ==. Use strict comparisons (=== or !==).
 325 | WARNING | wp_remote_get() is highly discouraged, please use
     |         | vip_safe_wp_remote_get() instead.
 342 | WARNING | Found: !=. Use strict comparisons (=== or !==).
 351 | ERROR   | Use Yoda Condition checks, you must.
 376 | WARNING | Found: ==. Use strict comparisons (=== or !==).
----------------------------------------------------------------------


FILE: /Users/thejimbirch/Sites/xeno-dashboard/xeno-dashboard.php
----------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
 30 | ERROR | Doc comment for parameter "$setting" missing
 30 | ERROR | Doc comment for parameter "$denifed" missing
 54 | ERROR | Assignments must be the first block of code on a line
 54 | ERROR | Assignments must be the first block of code on a line
 57 | ERROR | Expected next thing to be an escaping function (see
    |       | Codex for 'Data Validation'), not '$colors'
 65 | ERROR | Function name "sendTestEmail" is not in snake case
    |       | format, try "send_test_email"
 65 | ERROR | You must use "/**" style comments for a function
    |       | comment
----------------------------------------------------------------------

@michaelpporter
Copy link
Contributor

the module has changed a bit, we might need to run the cleanup again.

@thejimbirch
Copy link
Contributor Author

Getting this back on track.

Merged in upstream bringing my branch up to date.
Ran WP CBF updating simple formatting issues.

There are still a lot of work to do, but this PR will keep it moving.

@michaelpporter
Copy link
Contributor

Clean up looks good.

@michaelpporter michaelpporter merged commit 8a1fadc into xenomedia:master Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants