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.25k stars 410 forks source link

Problem Updating Theme #428

Closed mehmetsarr closed 3 years ago

mehmetsarr commented 3 years ago

Hello, I am not able to update wordpress theme on github? Can you help me?

YahnisElsts commented 3 years ago

There is not enough information to say if I can help you. Can you elaborate on the issue at all? What have you tried and what were the results?

mehmetsarr commented 3 years ago

I placed the following code in my theme's functions.php file. When I add a new update from Github Releases, the update does not occur.

//Update
require_once get_template_directory() .'/plugin-update-checker/plugin-update-checker.php';
$myUpdateChecker = Puc_v4_Factory::buildUpdateChecker(
    'https://github.com/name-repo/wp-theme-name',
    __FILE__,
    'wp-theme-name'
);

$myUpdateChecker->getVcsApi()->enableReleaseAssets();
$myUpdateChecker->setBranch('main');

$myUpdateChecker->setAuthentication('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');
YahnisElsts commented 3 years ago

The code looks fine to me, assuming that all the edited-out values like the repository URL are correct.

I would recommend installing the Debug Bar plugin. Then take a look at the debug information in the "PUC (slug)" panel in the Debug Bar. Does it show the right information for your theme? Also, try clicking the "Check Now" button in the same panel to make PUC check for updates immediately. Does it show any errors?

mehmetsarr commented 3 years ago

I found the solution. While I was updating, the style.css in the repo was not working because I did not update the version. Thank you.

YahnisElsts commented 3 years ago

All right, I will close the issue now.