Skip to content
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

Problem connecting server with checker library #105

Open
slimanehma opened this issue Mar 4, 2023 · 1 comment
Open

Problem connecting server with checker library #105

slimanehma opened this issue Mar 4, 2023 · 1 comment

Comments

@slimanehma
Copy link

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

@YahnisElsts
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants