How get JSON from external API on every page load if not existing in transient?

What is the best option to fetch the different online statuses automatically “on-the-fly” in real time? What is the most efficient way of fetching (external) data like these? Optimally everything happens “on-the-fly” as soon as the source differ from the site. At least it should run a check every page update. -What about caching? I … Read more

WordPress Rest API Escapes Returned URLs Forward Slash

This is no different to when & in raw HTML is displayed as &, it’s standard JSON encoding, and is resolved by decoding the JSON. Any application that is unable to handle this has probably forgotten to parse the JSON response. For example: const url = JSON.parse( ‘”https:\/\/s.w.org\/plugins\/geopattern-icon\/action-scheduler.svg”‘ ); console.log( url ); Will print the … Read more

oneOf two possible objects in WP REST API?

Aight got it, the crucial missing thing was that you have to provide this part here: ‘type’ => ‘object’ twice; once when declaring the variable’s type, and once again when defining the possibilities. Otherwise, validation fails; so a proper example would be: ‘args’ => [ ‘data’ => [ ‘type’ => ‘object’, ‘oneOf’ => [ [ … Read more