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

Build extension updater class #400

Closed
5 tasks done
fjarrett opened this issue Apr 9, 2014 · 14 comments
Closed
5 tasks done

Build extension updater class #400

fjarrett opened this issue Apr 9, 2014 · 14 comments
Assignees

Comments

@fjarrett
Copy link
Contributor

fjarrett commented Apr 9, 2014

As first discussed in https://github.com/x-team/wp-stream-reports/issues/5, we need to include an updater inside core Stream that will handle updates for extensions from a centralized class.

This should integrate with the work being done on #396.

  • Always check for updates, even if there is no license key.
  • New version details should always be viewable, even if there is no license key.
  • Show an alternate message in plugins screen if an update is available but no key is found (see screenshot below).
  • Don't display the update in the Dashboard > Updates screen if there is no license key.
  • Display a wp_die message if an update is attempted on an extension but the license ke is invalid or does not exist. The message should be relevant to the error that occurred (e.g. You have reached your site limit for automatic updates).

screen shot 2014-04-09 at 5 34 10 pm

c3mdigital pushed a commit that referenced this issue Apr 10, 2014
- Add admin_menu callback to admin
- Added require_once for extension file to WP_Stream
- Created base WP_Stream_Extension class
- Skeleton class methods to handle displaying, activating, downloading, authorizing premium extensions
- Should update routine #400 be initiated here?
c3mdigital pushed a commit that referenced this issue Apr 12, 2014
…dates

- skeleton check_for_extension_updates method
- #400 could use this?
@shadyvb
Copy link
Contributor

shadyvb commented Apr 17, 2014

Always check for updates, even if there is no license key.> New version details should always be viewable, even if there is no license key.
New version details should always be viewable, even if there is no license key.

I think this is what's happening currently.

Don't display the update in the Dashboard > Updates screen if there is no license key.

This means we will have to use an alternate store to keep version updates separately from WP update API, which i think we should try to avoid. Instead, showing the notice/error if the user tries to update a premium extension, as in:

Display a wp_die message if an update is attempted on an extension but the license key is invalid or does not exist.
The message should be relevant to the error that occurred (e.g. You have reached your site limit for automatic updates).

should be sufficient to remind the user he needs to connect the site to his premium account, and would work using the standard update api integration of WP, for stability.

@fjarrett What do you think ?

@fjarrett
Copy link
Contributor Author

@shadyvb I totally agree. Sounds great!

@fjarrett
Copy link
Contributor Author

@shadyvb Will it be possible for this to be delivered today? Hoping to start thorough testing tonight with the whole team.

@fjarrett
Copy link
Contributor Author

@shadyvb When can we start testing this?

@shadyvb
Copy link
Contributor

shadyvb commented Apr 24, 2014

@fjarrett I'll start cracking at this right now, been waiting for @c3mdigital to give the green light but seems he's got a lot on his plate.
I'll be working on the old updater.php.

@shadyvb
Copy link
Contributor

shadyvb commented Apr 24, 2014

@fjarrett This is as far as i can get with the notice, since the text is hardcoded, i can only add to it.

automatic-update-notice

@shadyvb
Copy link
Contributor

shadyvb commented Apr 24, 2014

@fjarrett FYI, Now the update won't be attempted to begin with, if there is no license key, as there won't be a package URL that WordPress can attempt to download.
This change also hides any updates from dashboard>updates if no license key exists.

@shadyvb
Copy link
Contributor

shadyvb commented Apr 24, 2014

@fjarrett Since WordPress is handling download of package URLs automatically, i don't think i have a chance of tapping into the process and providing meaningful error messages.

@shadyvb
Copy link
Contributor

shadyvb commented Apr 24, 2014

Scratch that, found upgrader_source_selection, trying to utilize it..

@fjarrett
Copy link
Contributor Author

@shadyvb So are you saying we won't be able to show updates are available at all unless a license key is in the DB? The hope would be that merely checking for the latest version would not require any authentication.

@shadyvb
Copy link
Contributor

shadyvb commented Apr 24, 2014

No, the update will show ( as in the screenshot ) but users won't be able to actually hit 'Update' because there is no package url, ie: WordPress does not know where to update this from. Which is actually what we need.

@fjarrett
Copy link
Contributor Author

@shadyvb OK got it.

@shadyvb
Copy link
Contributor

shadyvb commented Apr 24, 2014

@fjarrett I don't think the last Task can be done, have dived in the code and WP does not offer proper actions/filters to hook into the download process if things go bad.
Also i think it is not good to wp_die in such cases, since the user might be bulk-updating stuff and this would break the process.

If you agree, I'll issue a PR to get this one finished, finally.

@shadyvb
Copy link
Contributor

shadyvb commented Apr 24, 2014

@fjarrett PR issued #450

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