Skip to content

Commit

Permalink
chore: Replacing Plugin Updater Service (#341)
Browse files Browse the repository at this point in the history
* Replaced old updater service with the new WPE Updater service. fixes  #337

* Fixed PHPStan issues

* PHPCS fixes
  • Loading branch information
colinmurphy authored Feb 6, 2025
1 parent fcca872 commit 7838c93
Show file tree
Hide file tree
Showing 9 changed files with 305 additions and 367 deletions.
6 changes: 6 additions & 0 deletions .changeset/witty-falcons-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@wpengine/wp-graphql-content-blocks": minor
---

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

183 changes: 0 additions & 183 deletions includes/PluginUpdater/UpdateCallbacks.php

This file was deleted.

154 changes: 0 additions & 154 deletions includes/PluginUpdater/UpdateFunctions.php

This file was deleted.

27 changes: 27 additions & 0 deletions includes/Updates/CheckForUpgrades.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* Plugin upgrade checker
*
* @package WPGraphQL\ContentBlocks\Updates
*/

declare(strict_types=1);

namespace WPGraphQL\ContentBlocks\Updates;

if ( ! function_exists( 'wp_graphql_content_blocks_check_for_upgrades' ) ) {
/**
* Checks for plugin upgrades
*/
function wp_graphql_content_blocks_check_for_upgrades(): void {
$properties = [
'plugin_slug' => 'wp-graphql-content-blocks',
'plugin_basename' => WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_PATH,
];

require_once __DIR__ . '/PluginUpdater.php';
new PluginUpdater( $properties );
}

add_action( 'admin_init', __NAMESPACE__ . '\wp_graphql_content_blocks_check_for_upgrades' );
}
Loading

0 comments on commit 7838c93

Please sign in to comment.