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.22k stars 403 forks source link

[Ask] How to showing confirmation box for Update Available #510

Closed wickborlan closed 1 year ago

wickborlan commented 1 year ago

Hello,

Previously, thanks for the great plugin

Next, I have a little problem with my settings and maybe my expectations also. On my setting below, the plugin is working properly, when I push to bitbucket, the theme on my WordPress dashboard is also affected (version changed).

But the update is directly working, my expectation there is an update with my theme, the system should show a yellow notification update first, then I can click the confirmation link, like this :

my expectation Screen Shot 2022-12-25 at 18 04 03

my theme condition Screen Shot 2022-12-25 at 18 06 54

================== function.php

require 'plugin-update-checker-5.0/plugin-update-checker.php';
    use YahnisElsts\PluginUpdateChecker\v5\PucFactory;

    $myUpdateChecker = PucFactory::buildUpdateChecker(
        'https://bitbucket.org/xxx/peekha',
        __FILE__,
        'peekha'
    );

    //Optional: Set the branch that contains the stable release.
    $myUpdateChecker->setBranch('master');

readme.txt

=== Peekha ===
Contributors: Peekha
Tags: clean, simple, company profile, hotel, resort, landing page
Requires at least: 4.7
Stable tag: 1.0.10
Version: 1.0.10
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

== Description ==
Peekha is a Wordpress Multipurpose Landing Page Theme. 

== Changelog ==

= 1.0.10 =
* A change since the previous version.

= 1.0.9 =
* A change since the previous version.
* Another change.

style.css

/*!
  Theme Name: Peekha
  Author: Peekha Team
  Author URI: http://peekha.com
  Theme URI:
  Description: Peekha is a Wordpress Multipurpose Landing Page Theme. 
  Version: 1.0.10
  Tags: landing page, HTML5, CSS3, company profile, hotel, resort
  License: MIT
  License URI: http://opensource.org/licenses/mit-license.php
*/

theme folder structure Screen Shot 2022-12-25 at 18 08 06

Thanks

YahnisElsts commented 1 year ago

I wonder if this could be unrelated to the update checker. As a test, please comment out all the update checker code, but leave the rest of the code the same. Then push a new version. Does anything happen?

Also, is there anything on the site - like a plugin or some other code in the theme - that tries to control automatic updates? There are ways to enable automatic updates even if the user hasn't explicitly enable them, which would be another possible explanation for how an update can get installed without you seeing a notification.

wickborlan commented 1 year ago

wow .. very nice .. its works like my expectation

Screen Shot 2022-12-26 at 08 20 06

previously I also install wppusher plugin, I deactivate the plugin, push the change to repo .. then the notification showed up

many thanks, @YahnisElsts

YahnisElsts commented 1 year ago

Well, I didn't entirely understand that, but it sounds like the issue has been resolved. If not, feel free to reopen it.