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

PHPCS #16

Open
jayhill90 opened this issue Jun 29, 2019 · 2 comments
Open

PHPCS #16

jayhill90 opened this issue Jun 29, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@jayhill90
Copy link
Owner

Ensure we're following all WordPress Code Standards where possible

@jayhill90 jayhill90 added the enhancement New feature or request label Jun 29, 2019
@jayhill90 jayhill90 self-assigned this Jun 29, 2019
@jayhill90
Copy link
Owner Author

$ phpcs ./ --standard=WordPress

FILE: /Users/jay.hill/development/testinprod/wp-content/plugins/genesis-generator/Gruntfile.js
----------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------
 1 | ERROR | Missing file doc comment
 5 | ERROR | Inline comments must end in full-stops, exclamation marks, or question marks
----------------------------------------------------------------------------------------------


FILE: /Users/jay.hill/development/testinprod/wp-content/plugins/genesis-generator/inc/class-iterator.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------
 75 | WARNING | file_get_contents() is discouraged. Use wp_remote_get() for remote URLs instead.
 77 | WARNING | File operations should use WP_Filesystem methods instead of direct PHP filesystem calls. Found: file_put_contents()
------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/jay.hill/development/testinprod/wp-content/plugins/genesis-generator/tests/test-generator.php
----------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------
  6 | ERROR | There must be exactly one blank line after the file comment
 11 | ERROR | There must be no blank lines after the class comment
 26 | ERROR | Missing doc comment for function data_replace_genesis()
----------------------------------------------------------------------------------------------------------


FILE: /Users/jay.hill/development/testinprod/wp-content/plugins/genesis-generator/tests/bootstrap.php
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 15 | WARNING | Using the WPCS native whitelist comments is deprecated. Please use the PHPCS native "phpcs:ignore Standard.Category.SniffName.ErrorCode" annotations instead.
    |         | Found: // WPCS: XSS ok.
    |         | 
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 750ms; Memory: 10MB

@jayhill90
Copy link
Owner Author

FILE: /Users/jay.hill/development/testinprod/wp-content/plugins/genesis-generator/Gruntfile.js
----------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------
 1 | ERROR | Missing file doc comment
 5 | ERROR | Inline comments must end in full-stops, exclamation marks, or question marks
----------------------------------------------------------------------------------------------


FILE: /Users/jay.hill/development/testinprod/wp-content/plugins/genesis-generator/inc/class-iterator.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------
 75 | WARNING | file_get_contents() is discouraged. Use wp_remote_get() for remote URLs instead.
 77 | WARNING | File operations should use WP_Filesystem methods instead of direct PHP filesystem calls. Found: file_put_contents()
------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/jay.hill/development/testinprod/wp-content/plugins/genesis-generator/tests/bootstrap.php
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 15 | WARNING | Using the WPCS native whitelist comments is deprecated. Please use the PHPCS native "phpcs:ignore Standard.Category.SniffName.ErrorCode" annotations instead.
    |         | Found: // WPCS: XSS ok.
    |         | 
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 615ms; Memory: 10MB

Almost there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant