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

Envato Fatal Error #182

Closed
timnolte opened this issue Aug 10, 2022 · 4 comments
Closed

Envato Fatal Error #182

timnolte opened this issue Aug 10, 2022 · 4 comments

Comments

@timnolte
Copy link

timnolte commented Aug 10, 2022

Our SatisPress instance has started having a fatal error due to the Envato integration.

Fatal error: Uncaught TypeError: Return value of SatisPress\Integration\EnvatoMarket::filter_package_download_url() must be of the type string, bool returned in public/wp-content/plugins/satispress/src/Integration/EnvatoMarket.php:59
Stack trace:
#0 public/wp/wp-includes/class-wp-hook.php(309): SatisPress\Integration\EnvatoMarket->filter_package_download_url(false)
#1 public/wp/wp-includes/plugin.php(191): WP_Hook->apply_filters('https://satispr...', Array)
#2 public/wp-content/plugins/satispress/src/Archiver.php(196): apply_filters('satispress_pack...', 'https://satispr...', Object(SatisPress\Release))
#3 public/wp-content/plugins/satispress/src/ReleaseManag in public/wp-content/plugins/satispress/src/Integration/EnvatoMarket.php on line 59

WordPress: 6.0.1
PHP: 7.4
SatisPress Plugin: 1.0.4
Envato Market Plugin: 2.0.7

@timnolte
Copy link
Author

timnolte commented Aug 10, 2022

Some more details is that I see now that one of the plugins that was supposed to be updated from Envato must have tried to download a bunch of times and kept failing. When I logged into Envato/CodeCanyon the download page says that there were attempts to download the plugin 20 times just today and hit the maximum download limit. It seems like there are major problems with how Envato downloads are happening.

The plugin that seems to be causing this is: https://codecanyon.net/item/media-folders-manager-for-wordpress/21715379

I removed the single item token setup for that 1 plugin and now the site is not throwing that error anymore on the plugins page and when using the WP-CLI for plugin activities.

Now, this could also be due to our setup. We have a setup where WordPress Core/SatisPress/other functional plugins are installed and managed via Composer. However, all of the other plugins are managed the normal through the Dashboard. However, our setup requires that files(like manually installed plugins) are installed in a shared files space that lives beyond site deployments when there are Composer updates. This means that every plugin that we are serving via SatisPress, and having auto-updated are symbolic linked directories and can't be deleted. In general, this has worked fine as the SatisPress packages have been captured but the running plugin on the SatisPress site doesn't get updated and requires a manual install/update.

@bradyvercher
Copy link
Member

SatisPress hooks into the WordPress update process, so it doesn't trigger any events of its own. My guess is the fatal error prevents the core transient from being saved, which causes the update process to run more often than it should.

I don't have time to look into this for a little bit, but this line probably needs to account for the download() method returning a boolean. That should prevent the fatal error and the excessive download attempts. If you can test and submit a PR, I'll review it and get that merged for you.

You'll probably need to debug why Envato isn't allowing that particular plugin to be downloaded, though.

@timnolte
Copy link
Author

@bradyvercher so today I went to go check the downloads and after downloading the plugin found that there was a bogus __MACOSX folder in the zip archive. I'm pretty sure this is breaking the update/download process. I've seen this happen for other premium plugins when apparently their deployment process is just zipping up some code on their local computer. 😱

I can take a look at the line you mentioned probably get a PR opened for that. The zip file with bad folder in it I'm not sure the best course of action for that. I've notified the plugin author that they need to fix their packaging. Thanks!

BjornKraft added a commit to Angrycreative/satispress that referenced this issue Jul 27, 2023
cristianuibar added a commit to cristianuibar/satispress that referenced this issue Apr 15, 2024
bradyvercher pushed a commit that referenced this issue Oct 9, 2024
@bradyvercher
Copy link
Member

I believe this should be good to go after #182.

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