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

Issue with EDD_SL_Plugin_Updater? #18

Closed
mgibbs189 opened this issue Aug 9, 2018 · 17 comments
Closed

Issue with EDD_SL_Plugin_Updater? #18

mgibbs189 opened this issue Aug 9, 2018 · 17 comments

Comments

@mgibbs189
Copy link
Member

Update notifications do not appear when certain EDD_SL_Plugin_Updater-based plugins (such as WP Recipe Maker Premium) are active.

EDD_SL_Plugin Updater.php

@afragen
Copy link
Contributor

afragen commented Aug 9, 2018

Have you checked to see whether this is an issue with GitHub Updater? I haven’t seen it.

@mgibbs189
Copy link
Member Author

@afragen No, and I haven't seen this one before either.

@mgibbs189
Copy link
Member Author

For this issue, the request itself is happening successfully... but for some reason the transient is getting wiped...

@blogtutor
Copy link

Hey @afragen - I'm the one who reported this to @mgibbs189 ... thanks for jumping in. :)

I have integrated GitHub Updater Lite into my plugin, and have it installed on four sites. Each of them is having issues with the update notifications. On a dev site I set up, I found that if I deactivate WP Recipe Maker Premium (which uses the EDD updater), the notification will show up on my plugin immediately. If I reactivate WPRM, the notification will disappear after a few minutes (and a few page refreshes).

I have the plugin installed on a few other (live) sites, which also have other premium plugins installed. On those sites, when I deactivated WPRM Premium, the update didn't show up... but since they're live sites I didn't deactivate the other premium plugins.

My hunch is that the update check is working correctly, but when the page is returned the update notification itself is being filtered out, so it doesn't actually display.

I'm happy to give you access to my dev site if you'd like to poke around on it.

Thanks!

@afragen
Copy link
Contributor

afragen commented Aug 9, 2018

@blogtutor can you ensure that the most recent EDD_SL_Plugin _Updater is being used.

Easier to debug locally.

Have you tried using GitHub Updater by adding the additional header to you plugin and see if it has an issue. It would be easier to know if the issue is on both plugins/frameworks or just one.

@mgibbs189
Copy link
Member Author

I think @afragen is referring to these steps to test the "main" GHU plugin:

  1. Download https://github.com/afragen/github-updater/archive/8.2.1.zip
  2. Extract and rename the folder to "github-updater"
  3. Copy the folder into /plugins/ and activate
  4. In your custom plugin, rename the plugin tag from:

GitHub URI

to

GitHub Plugin URI

@afragen
Copy link
Contributor

afragen commented Aug 9, 2018

FYI, I’ve added an activation hook to correctly rename the plugin. Got tired of the issue, though after initial activation you’ll see a notice that the plugin doesn’t exist as it was successfully renamed.

@afragen
Copy link
Contributor

afragen commented Aug 9, 2018

But otherwise, what Matt said. 😉

@blogtutor
Copy link

Just installed the full Github Updater plugin, following Matt's instructions -- and the update notification showed up! WP Recipe Maker Premium is still active...

As for getting the latest version of the EDD updater script... I'm not sure where to find that? I just pulled the PHP file (which Matt attached in the issue above) directly from the WPRM plugin files.

@afragen
Copy link
Contributor

afragen commented Aug 9, 2018

Can you send me copies of the plugins in question? I can try to replicate locally.

@blogtutor
Copy link

Sure, will email you in just a moment. Thanks!

@afragen
Copy link
Contributor

afragen commented Aug 9, 2018

@mgibbs189 how do you load github-updater-lite within FacetWP. It’s not just a simple include_once in your main plugin file, is it?

I know the instructions say to include it before plugins_loaded. I see that @blogtutor is only using an include_once in his main plugin file. Does this need to be wrapped in a filter like

add_action( ‘init’, function() {
    include_once( .... );
);

@blogtutor
Copy link

blogtutor commented Aug 9, 2018

@afragen Matt already had me give that a try... didn't help. This is what I had added:

add_action( 'init', function() {
    include( dirname( __FILE__ ) . '/github-updater.php' );
});

@afragen
Copy link
Contributor

afragen commented Aug 10, 2018

@mgibbs189 @blogtutor
So in following the update process it seems that at some times $transient->checked may be empty and when empty the github-updater-lite transient set is returned early. I couldn't figure out how this was empty but it was.

if ( empty( $transient->checked ) ) {
return $transient;
}

I actually don't think there's any need for this check and removing it seems to ensure that github-updater-lite is always able to set the transient correctly. In fact, if the version_compare fails then the transient is returned unmodified. I do understand wanting to exit early, but in this case I think it's what's causing the issue.

@blogtutor
Copy link

@afragen I just commented out those three lines on my dev site, clicked over to the updates page and sure enough it immediately showed an update available for my plugin! (WP Recipe Maker was still active.)

So unless @mgibbs189 has a reason to keep those in there, it seems like you've found the solution! :)

@mgibbs189
Copy link
Member Author

@afragen Oh wow, awesome job with troubleshooting! And thanks for confirming @blogtutor 😄

@blogtutor
Copy link

@afragen @mgibbs189 HUGE thanks to you both! I've been stuck on this for over a month... so excited I can finally move forward. Have a great weekend! 😃

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

3 participants