Giter VIP home page Giter VIP logo

Comments (5)

YahnisElsts avatar YahnisElsts commented on June 22, 2024

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.

from wp-update-server.

timbadur avatar timbadur commented on June 22, 2024

hey,

I double checked everything.
I updated all: plugin-update-checker, wp-update-server, WP-CLI.
The plugins are now listed in CLI update list as expected!
But im still missing updates for my own themes.
additional info: i use a multisite wordpress; all of my own plugins are enabled in the main site - but in wp you cant enable all themes at once.
I included PUC in the theme's function.php.
Do you have a clue?

Greetings :)

from wp-update-server.

YahnisElsts avatar YahnisElsts commented on June 22, 2024

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).

from wp-update-server.

timbadur avatar timbadur commented on June 22, 2024

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:
https://make.wordpress.org/cli/handbook/commands-cookbook/#effectively-reusing-wp-cli-internal-apis

is there a chance that u can add wp-cli-support for plugin-update-checker and update-server?

from wp-update-server.

YahnisElsts avatar YahnisElsts commented on June 22, 2024

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.

is there a chance that u can add wp-cli-support for plugin-update-checker and update-server?

What kind of CLI features are you looking for?

from wp-update-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.