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

Azure Devops Support #488

Open dvalley56 opened 2 years ago

dvalley56 commented 2 years ago

For azure devops

Before I start I want to give all credits to the original author I don't know where to submit this. Hope everything is cool.

I changed/added the following files

-  plugin-update-checker\load-v4p11.php (added a new line)
- plugin-update-checker\Puc\v4p11\Vcs\AzureDevOpsApi.php (added this file)
- plugin-update-checker\Puc\v4p11\Vcs\Api.php (hard coded slug around line 305)

I know we shouldn't had code values, but I was making this for myself.

require dirname(FILE) . '/Puc/v4p11/Factory.php'; require dirname(FILE) . '/Puc/v4/Factory.php';

//Register classes defined in this version with the factory. foreach ( array( 'Plugin_UpdateChecker' => 'Puc_v4p11_Plugin_UpdateChecker', 'Vcs_PluginUpdateChecker' => 'Puc_v4p11_Vcs_PluginUpdateChecker', //added this line 'AzureDevOpsApi' => 'Puc_v4p11_Vcs_AzureDevOpsApi', ) as $pucGeneralClass => $pucVersionedClass ) { Puc_v4_Factory::addVersion($pucGeneralClass, $pucVersionedClass, '4.11'); //Also add it to the minor-version factory in case the major-version factory //was already defined by another, older version of the update checker. Puc_v4p11_Factory::addVersion($pucGeneralClass, $pucVersionedClass, '4.11'); }


-  plugin-update-checker\Puc\v4p11\Vcs\Api.php (hard coded slug around line 305)
            .
            .
            .
    public function setSlug($slug) {
        // $this->slug = $slug;
        /*
            replace below with our slug, it would generally be your plugin file name without the extension
            eg my_plugin.php -> my_plugin (without .php)
        */

        $this->slug = '';
    }
            .
            .
            .


-  plugin-update-checker\Puc\v4p11\Vcs\AzureDevOpsApi.php (added this file)

 I am sharing link for the whole file for anyone who wants to refer. You can find the file in that
 I have added comments for reference

You can contact me anytime here (I don't know if we can message here ) or at instagram @dvalley56

Complete code
[link for the edited code](https://github.com/dvalley56/plugin-update-checker)

Note: My root of the repo is a folder which contains file

my_plugin 
               |
               -> plugin-update-checker
               -> my_plugin.php

Some asked me in my previous issue to share the code. I dont know how to tag you mate @rolltidehero
[rolltidehero](https://github.com/rolltidehero)