Skip to content

Commit

Permalink
add wp plugin update checker
Browse files Browse the repository at this point in the history
  • Loading branch information
anteprimorac committed Nov 28, 2023
1 parent 22774f2 commit 4e7d8c0
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 2 deletions.
3 changes: 2 additions & 1 deletion wordpress-plugin/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"guzzlehttp/guzzle": "^7.3",
"guzzlehttp/psr7": "^1.7 || ^2.0",
"illuminate/validation": "^8.83",
"woocommerce/action-scheduler": "^3.7"
"woocommerce/action-scheduler": "^3.7",
"yahnis-elsts/plugin-update-checker": "^5.3"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "*",
Expand Down
48 changes: 47 additions & 1 deletion wordpress-plugin/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions wordpress-plugin/medusawp.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
require_once plugin_dir_path( __FILE__ ) . '/vendor/autoload.php';
require_once plugin_dir_path( __FILE__ ) . '/functions.php';

\MedusaWP\Updater::init( __FILE__ );

/**
* The code that runs during plugin activation.
Expand Down
20 changes: 20 additions & 0 deletions wordpress-plugin/src/Updater.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* Fired during plugin activation
*
* @package MedusaWP
*/

namespace MedusaWP;

use YahnisElsts\PluginUpdateChecker\v5\PucFactory;

class Updater {
public static function init( string $full_path ) {
$update_checker = PucFactory::buildUpdateChecker(
'https://github.com/Agilo/medusa-wp-wordpress-plugin',
$full_path,
'medusawp'
);
}
}

0 comments on commit 4e7d8c0

Please sign in to comment.