-
Notifications
You must be signed in to change notification settings - Fork 177
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
WP CLI doesnt detect updates for plugins and themes #63
Comments
Make sure that you're using the latest versions of plugin-update-checker and WP-CLI. I think some older PUC releases had a bug where updates wouldn't be visible to WP-CLI, but that should be fixed in the current version. |
hey, I double checked everything. Greetings :) |
Unfortunately, only the active theme will be able to detect updates. The update checker doesn't work when it's part of an inactive theme or plugin. To work around that, you would need to create a separate plugin that checks for updates for all of the themes (i.e. one update checker instance per theme). |
well, i tried something. maybe someone else could help this too. (i run this only actively, ie on click on a button in the backend. not all the time per page load) if (is_multisite()) {
$sites = get_sites();
foreach ($sites as $site) {
$active_theme_in_blog = get_blog_option( $site->blog_id, 'current_theme' );
$themes = wp_get_themes( array(
'errors' => null, // null: return all themes, ignoring if they have errors
'allowed' => true, // true: return only allowed themes for a site
'blog_id' => $site->blog_id
) );
foreach ( $themes as $theme ) {
if ( $theme->name === $active_theme_in_blog ) {
// check update with $theme
$MyUpdateChecker = Puc_v4_Factory::buildUpdateChecker(
'http://localhost/wp-update/?action=get_metadata&slug=' . $theme->template,
$theme->get_template_directory() . '/style.css',
$theme->template
);
$MyUpdateChecker->checkForUpdates();
}
}
}
} later i will try to add an own a wp-cli methodfor actively checking for theme-udpates. here is a nice piece of code what can be used for it. i think it can be well re-written to find themes and start an update-check: is there a chance that u can add wp-cli-support for plugin-update-checker and update-server? |
That looks like it might not work. Just checking for updates is not enough, the update checker also needs to be active to display update notifications and install updates.
What kind of CLI features are you looking for? |
i run mostly my wordpress updates semi-automated with the WP-CLI
when i use this WP-CLI commands:
wp plugin update --all --dry-run
wp theme update --all --dry-run
it lists only updates for default plugins/themes, but not for those i hosted on wp-update-server.
can you confirm this? or did i configured something wrong?
Greetings :)
The text was updated successfully, but these errors were encountered: