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

Internal.Exception -- function update_current_version() should be removed. #242

Open
WraithKenny opened this issue Nov 22, 2019 · 0 comments

Comments

@WraithKenny
Copy link

{
	"resource": "/Users/wraithkenny/Projects/dev/some-theme/tgmpa/class-tgm-plugin-activation.php",
	"owner": "_generated_diagnostic_collection_name_#3",
	"severity": 8,
	"message": "An error occurred during processing; checking has been aborted. The error message was: file_get_contents(https://api.github.com/repos/TGMPA/TGM-Plugin-Activation/releases/latest): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden\\r\\n in /Users/wraithkenny/Projects/dev/vendor/wptrt/wpthemereview/WPThemeReview/Sniffs/Plugins/CorrectTGMPAVersionSniff.php on line 482\n(Internal.Exception)",
	"source": "phpcs",
	"startLineNumber": 1,
	"startColumn": 1,
	"endLineNumber": 1,
	"endColumn": 2
}

There are several problems with the update_current_version() function. (WPThemeReview/Sniffs/Plugins/CorrectTGMPAVersionSniff.php)

  • It's kind of a huge waste to request and parse an external file just to get a version number that hasn't changed in years,
  • It takes forever, and means that on-type error checking slows to a crawl, and crashes after the rate limit,
  • Probably dangerous, or at least looks scary. No one is expecting their phpcs to be randomly requesting downloads of external files and potential execution on each and every run.

There is no actual need to retain this function. It should be replaced with '2.6.1' and if TGMPA ever updates, it should be updated in the sniff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants