You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, I want to tank you because this plugin works amazingly good that I create a custom post type with custom fields to have an endpoint to use it as a plugin's repository. Everything worked well until I try to see the details of my second plugin.
When I click on "View version x.x details" this is what I get.
The first plugin that I create works just fine.
All the validations to show the updates works just fine.
Do you have any ideas of how could I fix this?
The text was updated successfully, but these errors were encountered:
Hi, @lajennylove. I struggled with this as well. I combined Misha's tutorial with this thread on StackExchange, which explicitly says that information for multiple plugins can be added to the JSON output. The way Misha's code (and the code on StackExchange) is written, it's only expecting a single JSON object with a key of your_plugin_folder/your_plugin_filename.php. If, say, you added multiple items to an array in PHP and json_encode() it, a JSON array of objects would be produced. In other words, with one item your JSON looks like this...
{ "plugin_folder/plugin_filename.php" : ... }
...but with multiple items, your JSON looks like this...
It's an array of objects, not an object. So what can you do? Well, there are a few options:
Have a single JSON file (or PHP-powered file generating JSON) for each plugin.
If your JSON is being dynamically generated by PHP, pass a query string to the UpdateURI to ask it to only return output for a single asset.
Adjust the code that parses the JSON to loop over this array and identify and retrieve the correct asset's details.
On another note, it's no longer necessary to use the transients API. Two new filters handle that component natively and they support plugins and themes, respectively: update_plugins_{$hostname} (since 5.8) and update_themes_{$hostname} (since 6.1).
Hello there!
First, I want to tank you because this plugin works amazingly good that I create a custom post type with custom fields to have an endpoint to use it as a plugin's repository. Everything worked well until I try to see the details of my second plugin.
When I click on "View version x.x details" this is what I get.
The first plugin that I create works just fine.
All the validations to show the updates works just fine.
Do you have any ideas of how could I fix this?
The text was updated successfully, but these errors were encountered: