Open manobalas opened 3 years ago
It sounds like the update information is not filtered correctly when you try to install the update. There are multiple things that could cause that, but there's not enough information to guess what exactly is going on.
Can you post the code that you use to initialize the update checker? If it contains private information, feel free to edit it out. Also, if you're doing anything advanced such as trying to load the update checker only if certain conditions are met, please post that code too.
Here is the code
if(is_admin() && strpos($_SERVER['PHP_SELF'], 'themes.php') !== false)
{
require get_template_directory() . '/plugin-update-checker/plugin-update-checker.php';
$myUpdateChecker = Puc_v4_Factory::buildUpdateChecker(
'https://github.com/username/repo-name',
__FILE__,
get_template()
);
$myUpdateChecker->setAuthentication('ghp_xxxxxxxxxxxxxxxxxxxxxxxx');
$myUpdateChecker->setBranch('main');
$myUpdateChecker->checkForUpdates();
}
I'm guessing that you might need to remove that themes.php
condition. At least some (or maybe most) ways of installing updates will run a different PHP file.
On an related note, these conditions you're using will prevent periodic update checks because the update checker won't be loaded in Cron jobs. They may also prevent users from installing updates with third-party tools such as WP-CLI, ManageWP, and so on.
When I'm updating, I'm getting this error, can you please check it..