#31530 closed task (blessed) (fixed)
Shiny Updates: Installing themes
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Upgrade/Install | Keywords: | shiny-updates |
Focuses: | ui, javascript, administration | Cc: |
Description
Branched from #29820.
This ticket is for tracking the creation of shiny updates theme installing, on theme-install.php
.
Attachments (5)
Change History (18)
#2
@
10 years ago
For the record: happened to be in a live Hangout with @pento, so we chatted, and confirmed the above. We're going with separate plugin/theme specific AJAX actions, to keep with the existing standard and allow for discrete flexibilities. Will keep the same theme with other functions/methods we need to add in other places, like install_theme_install_status()
.
I'm off for the next 3 days, but I'll tackle that over the 3 next ones, if no one else has grabbed the ball and ran with it by then (feel free to). :)
#3
@
10 years ago
31530-01-add-theme-id.diff adds a descriptive id
to the div used to encapsulate all of a single theme's data in the Appearance screen. Covers PHP and JS/Backbone.
This will allow us to target a card, to easily find its activate or update button(s), as is done for the plugins and their cards in trunk/src/wp-admin/js/updates.js?rev=31594#L199.
Labeled the patch as -01-
, as it'd need to be applied 1st.
@
10 years ago
Same as 31530-01-add-theme-id.diff but also adds the standard theme-install
class on the Install button for themes, as is done .further down in tmpl-theme-preview
and in trunk/src/wp-admin/includes/class-wp-theme-install-list-table.php. Helps with JS targeting of install button.
#4
@
10 years ago
31530-01-add-theme-id.2.diff is the same as its previous equivalent, but also adds a distinctive (and standard) class to help targeting the install button in a theme's "card". We otherwise only had button-primary
, but it's also sometimes used for other actions, so not unique/contextual.
@
10 years ago
Work in progress for AJAX theme install, to show where I'm going with this, and discuss. Screenshots: https://cloudup.com/cYjd7oIeDp7
#5
@
10 years ago
31530-theme-install-workinprogress.diff shows where I'm at and going with AJAX theme install, so we can discuss. This code will currently install a theme "via AJAX" when clicking on the install button on a theme, in theme search results.
Screenshots: https://cloudup.com/cYjd7oIeDp7
The is-installed
class is added to the theme's card upon success, which makes the "Install[ing|ed!]" button disappear (existing behavior). Backbone currently sets a "Already installed" banner for installed themes, which we'll need to trigger upon successful install (ideally the Backbone code would do that automatically upon adding the is-installed
class to the card).
Note that since it's to show progress, 31530-theme-install-workinprogress.diff includes 31530-01-add-theme-id.2.diff
@
10 years ago
Continuation of 31530-theme-install-workinprogress.diff, starting to add update functionality. Not as easy as install, see upcoming comment.
#6
@
10 years ago
31530-theme-install-and-update-workinprogress.diff is the continuation of 31530-theme-install-workinprogress.diff, starting to add update functionality, where I have to stop today.
Not as easy to integrate as install was, because we'll need to add a button ("Update Now"), rather than hijack one ("Install"). This will need extra styling, Backbone handling (since it renders post document.ready
), etc.
Again, a work in progress to be reviewed and discussed. Target is MVP of theme install/update for Beta 1 (Wednesday). :)
This ticket was mentioned in Slack in #core by pento. View the logs.
10 years ago
#10
@
10 years ago
At the 11 March Dev chat, it was decided to scale back shiny updates to just focus on plugins for 4.2 with themes getting the updates in a future release. There is already a solid base to work off of here and we are well positioned for 4.3.
This ticket was mentioned in Slack in #core by georgestephanis. View the logs.
10 years ago
#13
@
9 years ago
Once we finally circle back to adding theme installation to the Customizer, we'll need the theme-install process to be "shiny"; I'll see if I can run with the work that was started here if that ends up happening for 4.5.
In the Customizer, UI is expected to be "Install & Preview" as primary and "Install" as secondary, with installed themes being a tab of the theme browser. Both would trigger an ajax theme installation.
I've started looking into this and #31529. I started with the AJAX actions.
wp_ajax_install_plugin()
(src) can easily either be ported to a theme-specific version, or be refactored into one function to handle both plugins and themes. I'd venture a theme-specific instance is a better way to go, in case either diverges, and since it's what's done in a lot of plugins/themes related code in WP.The only process in
wp_ajax_install_plugin()
that currently can't be ported by simply changing 'plugin' for 'theme' in that function is the call toinstall_plugin_install_status()
, which we'll need an equivalent of. The closest in themes, currently, isget_theme_update_available()
(also usesget_site_transient('update_themes')
, asinstall_plugin_install_status()
usesget_site_transient('update_plugins')
).Other small difference: the
themes_api()
definition is in theme.php, not theme-install.php and unlikeplugins_api()
, which lives in plugin-install.php.I haven't looked into the details of the
wp_ajax_update_plugin()
(aka #31529), but since it also uses code that has a theme equivalent (updates transient,Plugin_Upgrader
vsTheme_Upgrader
), the same is quite likely.Any thoughts on:
install_theme_install_status()
function in theme-install.php based oninstall_plugin_install_status()
?Once we have functional AJAX actions for the themes, the rest is mainly UX, right? Swapping install buttons for updates, having both use the AJAX actions instead of going to up the updates page, etc.