<?php

if (! defined('ABSPATH')) {
    exit;
} class PufferGo_Runtime
{
    public static function attach($handle)
    {
        if (empty($handle)) {
            return;
        } wp_localize_script($handle, 'puffergoRuntime', self::get_data());
    }

    public static function get_data()
    {
        return array('pluginVersion' => defined('PUFFERGO_CORE_VERSION') ? PUFFERGO_CORE_VERSION : '0', 'isLocalMode' => self::is_local_mode(), 'cacheScope' => substr(md5(site_url()), 0, 8), );
    }

    public static function is_local_mode()
    {
        return function_exists('wp_get_environment_type') && 'local' === wp_get_environment_type();
    }
}
