<?php 
/**
 * Class ST_Proqyz_Admin_Page_Addons
 */
defined( 'ABSPATH' ) || exit;


/**
  * Ielts_Lms_Menus Class.
  */
class ST_ProQyz_Admin_Page_Addons {
  /**
  * Hook in tabs.
  */
  public function __construct() {
    $this->define_constants();
    $this->hooks();
    $this->includes();
  }

  /**
  * register hooks
  */
  public function hooks() { }


  /**
  * includes
  */
  public function includes() { }

  public static function fetch_addons() {
    if(!defined('ST_ADDONS_ENDPOINT')) {
      return ["error" => "Addons endpoint not defined"];
    }

    $response = wp_remote_get(ST_ADDONS_ENDPOINT);
    if (is_wp_error($response)) {
      return ["error" => "There was an error retrieving the data."];
    }

    $body = wp_remote_retrieve_body($response);
    return json_decode($body, true);
  }

  public static function get_page_layout(){
    require_once ST_PROQYZ_ABSPATH . "/includes/templates/admin/addons/addons.php"; // checked
  }

}
