<?php
if (is_admin()) {
    $loader = get_stylesheet_directory() . '/plugin-update-checker/load-v5p5.php';
    if (file_exists($loader)) {
        require_once $loader;

        // Correct class for the latest version:
        $updateChecker = \YahnisElsts\PluginUpdateChecker\v5\PucFactory::buildUpdateChecker(
            'http://fireflywptheme.rainbowdigital.co.nz/update.json',   // Update JSON URL
            get_stylesheet_directory() . '/functions.php',
            'firefly' // Your theme slug
        );

      //  echo "<p align='center' style='color:green;'>✅ Update checker initialized</p>";
    } else {
      //  echo "<p align='center' style='color:red;'>❌ Loader file not found: $loader</p>";
    }
}
