Skip to content

Commit 7838c93

Browse files
authored
chore: Replacing Plugin Updater Service (#341)
* Replaced old updater service with the new WPE Updater service. fixes #337 * Fixed PHPStan issues * PHPCS fixes
1 parent fcca872 commit 7838c93

File tree

9 files changed

+305
-367
lines changed

9 files changed

+305
-367
lines changed

.changeset/witty-falcons-type.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@wpengine/wp-graphql-content-blocks": minor
3+
---
4+
5+
Replaced old plugin service to use the WPE updater service for checking for updates. The new API endpoint will be https://wpe-plugin-updates.wpengine.com/wp-graphql-content-blocks/info.json
6+

includes/PluginUpdater/UpdateCallbacks.php

Lines changed: 0 additions & 183 deletions
This file was deleted.

includes/PluginUpdater/UpdateFunctions.php

Lines changed: 0 additions & 154 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
/**
3+
* Plugin upgrade checker
4+
*
5+
* @package WPGraphQL\ContentBlocks\Updates
6+
*/
7+
8+
declare(strict_types=1);
9+
10+
namespace WPGraphQL\ContentBlocks\Updates;
11+
12+
if ( ! function_exists( 'wp_graphql_content_blocks_check_for_upgrades' ) ) {
13+
/**
14+
* Checks for plugin upgrades
15+
*/
16+
function wp_graphql_content_blocks_check_for_upgrades(): void {
17+
$properties = [
18+
'plugin_slug' => 'wp-graphql-content-blocks',
19+
'plugin_basename' => WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_PATH,
20+
];
21+
22+
require_once __DIR__ . '/PluginUpdater.php';
23+
new PluginUpdater( $properties );
24+
}
25+
26+
add_action( 'admin_init', __NAMESPACE__ . '\wp_graphql_content_blocks_check_for_upgrades' );
27+
}

0 commit comments

Comments
 (0)