YahnisElsts / plugin-update-checker

A custom update checker for WordPress plugins. Useful if you don't want to host your project in the official WP repository, but would still like it to support automatic updates. Despite the name, it also works with themes.
MIT License
2.21k stars 403 forks source link

Report a bug #557

Closed mehdi-najaran closed 7 months ago

mehdi-najaran commented 7 months ago

Hello . I have used your project on my personal plugin.

And I have installed it on different sites and there were no problems

Until one of the sites faces a WordPress error after installation and activation.

Error text:

YahnisElsts\P\v\P\UpdateChecker::__construct()
wp-content/plugins/my-plugin-name/include/update-checker/Puc/v5p3/PucFactory.php:122
YahnisElsts\P\v\PucFactory::buildUpdateChecker()
wp-content/plugins/my-plugin-name/include/setup-plugin.php:12
dw_auto_update_setup()
wp-includes/class-wp-hook.php:324
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:348
WP_Hook::do_action()
wp-includes/plugin.php:517
do_action()
wp-settings.php:506
require_once()
wp-config.php:182
require_once()
wp-load.php:50
require_once()
wp-blog-header.php:13
require()
index.php:17
YahnisElsts commented 7 months ago

Probably an obvious question: does the Ui.php file exist in /Puc/v5p3/Plugin?

mehdi-najaran commented 7 months ago

Yes, as I said above, on a large number of sites it was without problems and the project worked without errors

It is like this only on 2-3 sites

Untitled-3

YahnisElsts commented 7 months ago

Could be a namespace-related bug. Please try this: open that file and replace line 4

if ( !class_exists('Ui', false) ):

with this:

if ( !class_exists(Ui::class, false) ):

(Edit: Also, the reason why I asked about missing files is that there have been a few rare cases where some file is in fact missing unexpectedly, e.g. due to a failed upload.)

mehdi-najaran commented 7 months ago

Yes, problem solved