Skip to content

Instantly share code, notes, and snippets.

@tivnet
Last active February 1, 2021 17:49
Show Gist options
  • Save tivnet/b122c4309cee549db144f7e4b9e71b93 to your computer and use it in GitHub Desktop.
Save tivnet/b122c4309cee549db144f7e4b9e71b93 to your computer and use it in GitHub Desktop.
WooCommerce API Manager: Fix 2
<?php
// plugins/woocommerce-api-manager/includes/class-wc-am-update-api.php
// Add `$response->tested` to show "100% compatible" on the Updates page.
case 'pluginupdatecheck':
$response->id = $post_id;
$response->slug = ! empty( $this->slug ) ? $this->slug : $slug;
$response->plugin = $plugin_name;
$response->new_version = $api_data[ '_api_new_version' ];
$response->url = $api_data[ '_api_plugin_url' ];
// Add this line:
$response->tested = $api_data[ '_api_tested_up_to' ];
$response->package = $download_link;
break;
...
@cultivatecrm
Copy link

We're having a similar problem. Basically when you go to the update page in WP, it says it's compatibility is "Unknown" so we edited the code to make it say that it is 100% compatible with current version of WordPress in order to get plugins updates to push out and work. I don't like having to modifying the API code, but we needed it working and spent hours playing with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment