Uname: Linux p3plzcpnl499967.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
Software: Apache
PHP version: 8.2.30 [ PHP INFO ] PHP os: Linux
Server Ip: 208.109.40.231
Your Ip: 216.73.216.26
User: nayff91c5tsx (10005085) | Group: nayff91c5tsx (10005085)
Safe Mode: OFF
Disable Function:
NONE

name : remote-api.php
<?php
/**
 * Workflows UI
 */
namespace Croblock\Workflows;

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	die;
}

class Remote_API {

	protected $api_url = 'https://api.crocoblock.com/interactive-tutorials/tutorials.json';

	/**
	 * Set API url for current instance
	 */
	public function set_api_url( $api_url = '' ) {
		$this->api_url = $api_url;
	}

	/**
	 * Remote retrieve items
	 * 
	 * @return [type] [description]
	 */
	public function get_items() {

		$workflows = [];
		$response  = wp_remote_get( $this->api_url );

		if ( ! $response || is_wp_error( $response ) ) {
			return $workflows;
		}

		$body = wp_remote_retrieve_body( $response );

		if ( ! $body ) {
			return $workflows;
		}

		$workflows = json_decode( $body, true );

		return $workflows;

	}

}
© 2026 GrazzMean