Giter Site home page Giter Site logo

Comments (3)

YahnisElsts avatar YahnisElsts commented on May 16, 2024

Chances are, the apparent connection between the download_url and the folder name is a red herring. The WordPress update installer doesn't care what the URL is as long as it points to a valid ZIP file with the right directory structure. Also, I use dynamic download URLs for one of my plugins and have never encountered this problem despite having more than 10,000 active installs and 5+ new releases in the past year.

Here are a few things to check first:

1. The plugin slug
Make sure to pass the correct plugin slug to the update checker constructor. The slug should match the desired plugin folder name, and it should match the slug value in the JSON data (if any). If you omit the slug, the update checker will try to determine it automatically and occasionally get it wrong.

Example (direct initialization):

$myUpdateChecker = new PluginUpdateChecker(
    'http://example.com/metadata-url-here', //Metadata URL
    __FILE__,  //Main plugin file name
    'plugin-slug'
);

Example (factory):

$myUpdateChecker = PucFactory::buildUpdateChecker(
    'http://example.com/metadata-url-here', //Metadata URL
    __FILE__,  //Main plugin file name
    'plugin-slug'
);

2. The update ZIP file layout

The root of the ZIP file must contain a single folder whose name matches your plugin slug. All plugin files should go in that folder. For example:

/plugin-slug
    /includes
    ...other files...
    plugin-slug.php
    readme.txt

Any other folder/directory layout - like putting all plugin files at the root of the ZIP file - will typically result in the update installer leaving the folder name at the default value, which just happens to be index.tmp.

from plugin-update-checker.

baden03 avatar baden03 commented on May 16, 2024

Thank you for your quick reply. The problem was--in fact--that I zipped up the files, not the plugin folder. Once I zipped up the FOLDER all was good in the plugin updating neighborhood.

Your plugin is really quite something special. Thank you for sharing it.

from plugin-update-checker.

YahnisElsts avatar YahnisElsts commented on May 16, 2024

Sure, glad to help.

from plugin-update-checker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.