wp-update-server
wp-update-server copied to clipboard
Problem connecting server with checker library
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
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.
);