Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Check in progress just spins #149

Closed
sflwa opened this issue Mar 20, 2019 · 7 comments
Closed

Check in progress just spins #149

sflwa opened this issue Mar 20, 2019 · 7 comments

Comments

@sflwa
Copy link

sflwa commented Mar 20, 2019

I've tried running this on a couple of different sites (each on a different host / provider) and the check in progress just spins - I don't get the spinning mouse icon just the box - is this a PHP issue??

@timelsass
Copy link
Member

I'm sorry to hear you're having issues @sflwa! it's not very easy to diagnose the issue without more information - if it is a PHP issue, output from your php error logs would help diagnose the problem. Theme Sniffer does also require PHP7 - so if those sites aren't running 7.0+ PHP then that could be a reason. There's a few reasons why it can get stuck with just the spinner going.

Probably the most common scenario right now is if PHPCS runs into issues with parsing - usually from encountering minfied CSS/JS or a timeout in PHP. If you're running PHP7+, then I would suggest trying the scan and checking the box to scan only PHP files and see if that works. Also, check your browser's console for any errors being output there.

@sflwa
Copy link
Author

sflwa commented Mar 24, 2019 via email

@timelsass
Copy link
Member

Ah thanks so much for posting back those logs! That makes things more clear 😃 PHPCS is a command line tool, and triggering scripts like phpcs or wp-cli is usually handled via shell_exec calls. This is commonly disabled by hosts for security reasons. I think maybe we should add another check in activation to catch this to prevent use in those cases. Great catch @sflwa!

@timelsass
Copy link
Member

timelsass commented Mar 24, 2019

Hey @sflwa - I have sent a PR that addresses this error. It doesn't fix the fact that the plugin won't work if the environment doesn't meet the plugin's requirements, but it will prevent activation of the plugin, so you won't run into this situation.

This is the built version with that change if you wanted to test:
theme-sniffer.zip

@sflwa
Copy link
Author

sflwa commented Mar 24, 2019 via email

@timelsass
Copy link
Member

Haha, yeah, I'm not a fan of the notice displaying the fatal from a user side of things either ( it does this for incompatible PHP versions as well ). I'm glad that PR takes care of it in your environment!

I guess part of the reasoning for the notice might be this tool is geared towards technical users and developers, so some of them may find the trace useful for debugging/fixing. I think another reason might be since it's an exception on plugin activation that's also preventing extra code from having to be added just to create and handle making an admin notice since core handles exceptions. @dingo-d any thoughts or input?

dingo-d added a commit that referenced this issue Mar 25, 2019
@dingo-d
Copy link
Member

dingo-d commented Mar 25, 2019

The error on activation is something that is controlled by WordPress I think (not sure if the stack trace will show if the debug is disabled).

I've merged the PR and this will be solved in the next version.

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

No branches or pull requests

3 participants