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

Plugin Update Error #528

Closed AhmadRaza9 closed 1 year ago

AhmadRaza9 commented 1 year ago

@YahnisElsts Hi, I use this code

`require 'plugin-update-checker/plugin-update-checker.php';

use YahnisElsts\PluginUpdateChecker\v5\PucFactory; $UpdateChecker = PucFactory::buildUpdateChecker( 'https://github.com/AhmadRaza9/cptpress/', FILE, 'cptpress' ); // $UpdateChecker->setBranch('main'); $UpdateChecker->getVcsApi()->enableReleaseAssets();`

I get plugin update but when I click on update they give me an error (update plugin fails they don't remove the plugin folder but remove my all plugins files)

I don't use plugin.json only I use the above code.

YahnisElsts commented 1 year ago

As I mentioned in the other thread, make sure that the plugin folder - and the plugin files - are not open in another application when you're trying to install an update. This could mean having a file open in a text editor or IDE, having the directory open in a console window, having a .svn directory in the plugin folder, etc. If something is holding one of the files/directories open, WordPress may fail to delete the old plugin version, and then the whole update will fail.

Another possibility is that the folder doesn't have the correct permissions, but this problem is less common in my experience.

AhmadRaza9 commented 1 year ago

@YahnisElsts

Thanks for your reply.

Yes, it's work. when I close my ide the WordPress update my plugin successfully

YahnisElsts commented 1 year ago

Good to hear, sounds like the issue has been resolved. I'll close it now.