<?php

namespace Linksy\SearchAndReplace\Plugli\Standard\Helpers;

class Utils
{
    public static function error_log($data, $key = null)
    {
        $log = ['details' => $data];
        if (!empty($key)) {
            $log['key'] = $key;
        }
        error_log(print_r($log, \true));
    }
    public static function json_file_decode($json_path)
    {
        $config = [];
        if (file_exists($json_path)) {
            $config = file_get_contents($json_path);
            $config = json_decode($config, \true);
        }
        return $config;
    }
    public static function is_plugin_active($plugin)
    {
        if (!is_multisite()) {
            if (function_exists('Linksy\SearchAndReplace\Linksy\is_plugin_active')) {
                return is_plugin_active($plugin);
            }
            return in_array($plugin, (array) get_option('active_plugins', []), \true);
        }
        $plugins = get_blog_option(get_current_blog_id(), 'active_plugins');
        if (in_array($plugin, $plugins)) {
            return \true;
        }
        return is_plugin_active_for_network($plugin);
    }
}
