wp-update-server icon indicating copy to clipboard operation
wp-update-server copied to clipboard

Problem connecting server with checker library

Open slimanehma opened this issue 2 years ago • 1 comments

Welcome When I try to install the update server with the update checker, an error occurs I suspect that the error is because the version of the library in the server is behind the version in the checker library As the code refers to any version number 4($MyUpdateChecker = Puc_v4_Factory::buildUpdateChecker( ), but the checker files are version number 5 please explain

slimanehma avatar Mar 04 '23 06:03 slimanehma

The code sample in the server documentation is indeed outdated, but you can just use the correct code from the update checker documentation. You can pass the same arguments in the same order to PucFactory::buildUpdateChecker(). Something like this:

require 'path/to/plugin-update-checker/plugin-update-checker.php';
use YahnisElsts\PluginUpdateChecker\v5\PucFactory;

$MyUpdateChecker = PucFactory::buildUpdateChecker(
	'http://example.com/wp-update-server/?action=get_metadata&slug=plugin-directory-name', //Metadata URL.
	__FILE__, //Full path to the main plugin file.
	'plugin-directory-name' //Plugin slug. Usually, it's the same as the name of the directory.
);

YahnisElsts avatar Mar 04 '23 09:03 YahnisElsts