-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Check for inactive theme updates #75
Comments
This is somewhat trickier than I first thought. Since a theme needs to be active for its codebase to be loaded (including the bundled updater), an event would need to be scheduled to loop through installed themes, which would then fire off an async request for each theme. The listener for the loopback request would filter the active theme to load its codebase, then trigger the update check process that the theme would hook into to check for its own updates. I researched a few updaters and aside from WordPress.org, inactive WooCommerce and Envato themes are already handled by their respective updater plugins (the updaters aren't bundled in the themes). That leaves themes using the EDD updater, Genesis, and other custom updaters. WordPress calls The EDD updater appears to only run during admin requests, so the async loopback listener would probably have to mimic an admin request. As an aside, does that mean EDD doesn't check for updates during cron events? Considering all the gotchas, I'm wondering if this is a worthwhile pursuit. Is anyone using SatisPress to make multiple themes available through Composer? Also, making this a generic plugin independent of SatisPress might be a better route. That would make the functionality optional, but it could also provide security benefits for users that have a bunch of inactive themes and want to be aware of updates. |
GitHub Updater manages inactive theme updates. I also have a setting to allow for using remote management services which basically also runs the code on Feel free to borrow whatever code you may need. |
@afragen Thanks! I have some stuff in a local branch, but haven't tested it much. Do you have a link to where GitHub Updater handles updates for inactive themes? Also, have you run across issues with themes not updating if the code wasn't run on |
@bradyvercher GitHub Updater runs through the list of installed plugins and themes looking for the appropriate headers (eg. Take a look at the Remote Management tab in GitHub Updater. The settings all do the same thing. They add I also have a filter so you can add you pages of your choice. The above uses this filter. The only times I've seen issues with plugins/themes not running on This works for GitHub Updater because there is no bundled updater with the plugins/themes. FWIW, I also have a plugin to automatically add plugins/themes to GitHub Updater even if they don't contain the required headers. https://github.com/afragen/github-updater-additions |
@bradyvercher, any news on that?
Yes. Currently, we have installed 4 premium themes. |
@bradyvercher Could a way around this be scripting WP-CLI to cycle through the list of installed plugins and activate / update / deactivate them one by one? |
@binaryfire It might be possible to do something with WP-CLI, but that would add an extra dependency and a manual step, which I'd like to avoid. I've kept this issue open to gauge interest. Are you running into issues managing multiple premium themes? |
@bradyvercher Sorry about the delay in replying. Yeah, managing multiple premium themes has been an issue. Right now I've scripted a daily activation / deactivation cycle using WP-CLI as a workaround |
Many commercial themes bundle their updaters, so a theme needs to be active in order for it to hook into the update process. WordPress is never aware of new releases for inactive themes, so updates can't be cached and made available to Composer, which means SatisPress is really only beneficial for a single theme at a time.
I'm thinking it might be possible to run a background process that cycles through the themes, filters the active theme, and checks for updates without affecting which theme is actually active for visitors to the site.
The text was updated successfully, but these errors were encountered: