Plugin Directory

Changeset 3458280


Ignore:
Timestamp:
02/10/2026 05:22:57 PM (7 weeks ago)
Author:
hostspa
Message:

1.5.14
Fix to allow config downloads

Location:
fastcache-by-host-it
Files:
7 edited
186 copied

Legend:

Unmodified
Added
Removed
  • fastcache-by-host-it/tags/1.5.14/README.txt

    r3458209 r3458280  
    55Tested up to: 6.9.1
    66Requires PHP: 8.0
    7 Stable Tag: 1.5.13
     7Stable Tag: 1.5.14
    88License: GPL-2.0+
    99License URI: http://www.gnu.org/licenses/gpl-2.0.txt
     
    132132
    133133== Changelog ==
     1341.5.14
     135Fix to enable download of configs.
     136
    1341371.5.13
    135138Security Improvements
  • fastcache-by-host-it/tags/1.5.14/fastcache.php

    r3458209 r3458280  
    1717 * Plugin URI:        https://fastcache.host.it/wordpress/
    1818 * Description:       Abilita il tuo sito Wordpress alla prima vera CDN realizzata PER Wordpress e configurata AD-HOC per il tuo sito. Il massimo della velocità senza difficoltà di setup.
    19  * Version:           1.5.13
     19 * Version:           1.5.14
    2020 * Author:            Host.it
    2121 * Author URI:        https://fastcache.host.it/
     
    4545define ( '_WP_EXEC', '1' );
    4646define ( '_FASTCACHE_EXEC', 1 );
    47 define ( 'FASTCACHE_VERSION', '1.5.13' );
     47define ( 'FASTCACHE_VERSION', '1.5.14' );
    4848define ( 'FASTCACHE_FILE_PATH', __FILE__ );
    4949
     
    8282register_uninstall_hook(__FILE__, 'mainFastCachePluginUninstall');
    8383add_action('upgrader_process_complete', function($upgrader, $options) {
     84    if ($options['action'] !== 'update' || $options['type'] !== 'plugin') {
     85        return;
     86    }
    8487
    85     if ($options['action'] !== 'update') return;
    86     if ($options['type'] !== 'plugin') return;
     88    $target_plugin = plugin_basename(__FILE__);
     89    $updated_plugins = [];
    8790
    88     if (!empty($options['plugins'])) {
    89         foreach ($options['plugins'] as $plugin) {
    90             if ($plugin === plugin_basename(__FILE__)) {
     91    if (isset($options['plugins']) && is_array($options['plugins'])) {
     92        $updated_plugins = $options['plugins'];
     93    } elseif (isset($options['plugin'])) {
     94        $updated_plugins = [ $options['plugin'] ];
     95    }
    9196
    92                 mainFastCachePluginUpdate();
     97    if (in_array($target_plugin, $updated_plugins)) {
     98        mainFastCachePluginUpdate();
     99    }
     100}, 10, 2);
    93101
    94             }
    95         }
    96     }
     102/**
     103 * Handle background automatic updates
     104 */
     105add_action('automatic_updates_complete', function($update_results) {
     106    $target_plugin = plugin_basename(__FILE__);
    97107
    98 }, 10, 2);
     108    if (!isset($update_results['plugin']) || !is_array($update_results['plugin'])) {
     109        return;
     110    }
     111
     112    foreach ($update_results['plugin'] as $update_result) {
     113        // $update_result is often an object containing the result and item details
     114        $plugin_item = isset($update_result->item) ? $update_result->item : null;
     115        $plugin_path = '';
     116
     117        if (is_object($plugin_item) && isset($plugin_item->plugin)) {
     118            $plugin_path = $plugin_item->plugin;
     119        } elseif (is_object($update_result) && isset($update_result->plugin)) {
     120            $plugin_path = $update_result->plugin;
     121        }
     122
     123        if ($plugin_path === $target_plugin && $update_result->result === true) {
     124            mainFastCachePluginUpdate();
     125            break;
     126        }
     127    }
     128}, 10, 1);
    99129/**
    100130 * Initialize and run plugin
  • fastcache-by-host-it/tags/1.5.14/src/Admin.php

    r3458155 r3458280  
    2222use FastCache\Platform\Utility;
    2323use FastCache\Core\FileRetriever;
     24use FastCache\Core\Admin\InOutConfig;
    2425
    2526abstract class Admin
     
    3940        add_action( 'admin_bar_menu', [ __CLASS__, 'addMenuToAdminBar' ], 100 );
    4041        add_action( 'admin_init', [ __CLASS__, 'checkMessages' ] );
     42        add_action( 'admin_init', [ __CLASS__, 'handleEarlyTasks' ] );
    4143       
    4244        add_action ( 'admin_action_update',  [ __CLASS__, 'updateSettings' ]);
     
    306308    }
    307309   
     310    public static function handleEarlyTasks()
     311    {
     312        $page = isset($_GET['page']) ? $_GET['page'] : '';
     313        $task = isset($_GET['task']) ? $_GET['task'] : '';
     314       
     315        if ($page === 'fastcache' && $task === 'downloadconfig') {
     316            if (!isset($_GET['_wpnonce']) || !wp_verify_nonce($_GET['_wpnonce'], 'downloadconfig')) {
     317                wp_die(__('Not authorized'));
     318            }
     319            InOutConfig::export();
     320        }
     321    }
     322   
    308323    public static function checkMessages()
    309324    {
  • fastcache-by-host-it/tags/1.5.14/vendor/composer/autoload_classmap.php

    r3417545 r3458280  
    146146    'FastCache\\Core\\Admin\\Json' => $baseDir . '/src/Core/Admin/Json.php',
    147147    'FastCache\\Core\\Admin\\MultiSelectItems' => $baseDir . '/src/Core/Admin/MultiSelectItems.php',
     148    'FastCache\\Core\\Admin\\InOutConfig' => $baseDir . '/src/Core/Admin/InOutConfig.php',
    148149    'FastCache\\Core\\Admin\\Tasks' => $baseDir . '/src/Core/Admin/Tasks.php',
    149150    'FastCache\\Core\\Browser' => $baseDir . '/src/Core/Browser.php',
  • fastcache-by-host-it/tags/1.5.14/vendor/composer/autoload_static.php

    r3417545 r3458280  
    199199        'FastCache\\Core\\Admin\\Json' => __DIR__ . '/../..' . '/src/Core/Admin/Json.php',
    200200        'FastCache\\Core\\Admin\\MultiSelectItems' => __DIR__ . '/../..' . '/src/Core/Admin/MultiSelectItems.php',
     201        'FastCache\\Core\\Admin\\InOutConfig' => __DIR__ . '/../..' . '/src/Core/Admin/InOutConfig.php',
    201202        'FastCache\\Core\\Admin\\Tasks' => __DIR__ . '/../..' . '/src/Core/Admin/Tasks.php',
    202203        'FastCache\\Core\\Browser' => __DIR__ . '/../..' . '/src/Core/Browser.php',
  • fastcache-by-host-it/trunk/README.txt

    r3458209 r3458280  
    55Tested up to: 6.9.1
    66Requires PHP: 8.0
    7 Stable Tag: 1.5.13
     7Stable Tag: 1.5.14
    88License: GPL-2.0+
    99License URI: http://www.gnu.org/licenses/gpl-2.0.txt
     
    132132
    133133== Changelog ==
     1341.5.14
     135Fix to allow config downloads
     136
    1341371.5.13
    135138Security Improvements
  • fastcache-by-host-it/trunk/fastcache.php

    r3458209 r3458280  
    1717 * Plugin URI:        https://fastcache.host.it/wordpress/
    1818 * Description:       Abilita il tuo sito Wordpress alla prima vera CDN realizzata PER Wordpress e configurata AD-HOC per il tuo sito. Il massimo della velocità senza difficoltà di setup.
    19  * Version:           1.5.13
     19 * Version:           1.5.14
    2020 * Author:            Host.it
    2121 * Author URI:        https://fastcache.host.it/
     
    4545define ( '_WP_EXEC', '1' );
    4646define ( '_FASTCACHE_EXEC', 1 );
    47 define ( 'FASTCACHE_VERSION', '1.5.13' );
     47define ( 'FASTCACHE_VERSION', '1.5.14' );
    4848define ( 'FASTCACHE_FILE_PATH', __FILE__ );
    4949
     
    8282register_uninstall_hook(__FILE__, 'mainFastCachePluginUninstall');
    8383add_action('upgrader_process_complete', function($upgrader, $options) {
     84    if ($options['action'] !== 'update' || $options['type'] !== 'plugin') {
     85        return;
     86    }
    8487
    85     if ($options['action'] !== 'update') return;
    86     if ($options['type'] !== 'plugin') return;
     88    $target_plugin = plugin_basename(__FILE__);
     89    $updated_plugins = [];
    8790
    88     if (!empty($options['plugins'])) {
    89         foreach ($options['plugins'] as $plugin) {
    90             if ($plugin === plugin_basename(__FILE__)) {
     91    if (isset($options['plugins']) && is_array($options['plugins'])) {
     92        $updated_plugins = $options['plugins'];
     93    } elseif (isset($options['plugin'])) {
     94        $updated_plugins = [ $options['plugin'] ];
     95    }
    9196
    92                 mainFastCachePluginUpdate();
     97    if (in_array($target_plugin, $updated_plugins)) {
     98        mainFastCachePluginUpdate();
     99    }
     100}, 10, 2);
    93101
    94             }
    95         }
    96     }
     102/**
     103 * Handle background automatic updates
     104 */
     105add_action('automatic_updates_complete', function($update_results) {
     106    $target_plugin = plugin_basename(__FILE__);
    97107
    98 }, 10, 2);
     108    if (!isset($update_results['plugin']) || !is_array($update_results['plugin'])) {
     109        return;
     110    }
     111
     112    foreach ($update_results['plugin'] as $update_result) {
     113        // $update_result is often an object containing the result and item details
     114        $plugin_item = isset($update_result->item) ? $update_result->item : null;
     115        $plugin_path = '';
     116
     117        if (is_object($plugin_item) && isset($plugin_item->plugin)) {
     118            $plugin_path = $plugin_item->plugin;
     119        } elseif (is_object($update_result) && isset($update_result->plugin)) {
     120            $plugin_path = $update_result->plugin;
     121        }
     122
     123        if ($plugin_path === $target_plugin && $update_result->result === true) {
     124            mainFastCachePluginUpdate();
     125            break;
     126        }
     127    }
     128}, 10, 1);
    99129/**
    100130 * Initialize and run plugin
  • fastcache-by-host-it/trunk/src/Admin.php

    r3458155 r3458280  
    2222use FastCache\Platform\Utility;
    2323use FastCache\Core\FileRetriever;
     24use FastCache\Core\Admin\InOutConfig;
    2425
    2526abstract class Admin
     
    3940        add_action( 'admin_bar_menu', [ __CLASS__, 'addMenuToAdminBar' ], 100 );
    4041        add_action( 'admin_init', [ __CLASS__, 'checkMessages' ] );
     42        add_action( 'admin_init', [ __CLASS__, 'handleEarlyTasks' ] );
    4143       
    4244        add_action ( 'admin_action_update',  [ __CLASS__, 'updateSettings' ]);
     
    306308    }
    307309   
     310    public static function handleEarlyTasks()
     311    {
     312        $page = isset($_GET['page']) ? $_GET['page'] : '';
     313        $task = isset($_GET['task']) ? $_GET['task'] : '';
     314       
     315        if ($page === 'fastcache' && $task === 'downloadconfig') {
     316            if (!isset($_GET['_wpnonce']) || !wp_verify_nonce($_GET['_wpnonce'], 'downloadconfig')) {
     317                wp_die(__('Not authorized'));
     318            }
     319            InOutConfig::export();
     320        }
     321    }
     322   
    308323    public static function checkMessages()
    309324    {
  • fastcache-by-host-it/trunk/vendor/composer/autoload_classmap.php

    r3417545 r3458280  
    146146    'FastCache\\Core\\Admin\\Json' => $baseDir . '/src/Core/Admin/Json.php',
    147147    'FastCache\\Core\\Admin\\MultiSelectItems' => $baseDir . '/src/Core/Admin/MultiSelectItems.php',
     148    'FastCache\\Core\\Admin\\InOutConfig' => $baseDir . '/src/Core/Admin/InOutConfig.php',
    148149    'FastCache\\Core\\Admin\\Tasks' => $baseDir . '/src/Core/Admin/Tasks.php',
    149150    'FastCache\\Core\\Browser' => $baseDir . '/src/Core/Browser.php',
  • fastcache-by-host-it/trunk/vendor/composer/autoload_static.php

    r3417545 r3458280  
    199199        'FastCache\\Core\\Admin\\Json' => __DIR__ . '/../..' . '/src/Core/Admin/Json.php',
    200200        'FastCache\\Core\\Admin\\MultiSelectItems' => __DIR__ . '/../..' . '/src/Core/Admin/MultiSelectItems.php',
     201        'FastCache\\Core\\Admin\\InOutConfig' => __DIR__ . '/../..' . '/src/Core/Admin/InOutConfig.php',
    201202        'FastCache\\Core\\Admin\\Tasks' => __DIR__ . '/../..' . '/src/Core/Admin/Tasks.php',
    202203        'FastCache\\Core\\Browser' => __DIR__ . '/../..' . '/src/Core/Browser.php',
Note: See TracChangeset for help on using the changeset viewer.