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

BUG: Cant edit PHP Files in WP Backend with this Plugin enabled (WP 4.9) #120

Closed
mhsdesign opened this issue Jan 18, 2022 · 1 comment
Closed

Comments

@mhsdesign
Copy link

Plugin version

Shared Counts: 1.3.0
WordPress: 4.9.19

Maybe it will just be resolved by updating WP, but nevertheless i wanted to share this:

Current Behavior

When this plugin is activated and i want to php files in the WP backend, i get this error:

Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.

Expected Behavior

That i can edit php files in the WP Backend editor.

Possible Solution

I seems that on my WP version, this Plugin is interfering with the Wordpress it makes for PHP files. Disabling the Plugin temporary helps.

@billerickson
Copy link
Collaborator

Yes, this is a known issue but likely cannot be resolved if you are retrieving share counts.

Querying third party APIs for shared count data and updating the database can be time consuming. To ensure this does not impact the website's load time, we call fastcgi_finish_request() before checking if shared counts need to be updated, which finishes the request to the client.

Unfortunately, this means that WordPress can't check for PHP errors because code continues to run after the request is complete.

I do have a partial solution though. If you're only using Shared Counts for the social share buttons and are not retrieving share data from third party sources, there's no reason for us to call fastcgi_finish_request().

I just committed code that disables this code if the count source is set to 'none', which allows the theme file editor to continue working in that instance. This will be available in the next plugin release.

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

No branches or pull requests

2 participants