<?php

class Eca_Socialnotify_Cf7_General_Helper {
    private static $instance = null;

    public function get_plugin_options($key = '', $default = '') {
        $options = get_option('eca_socialnotify_cf7_options');

        if (!empty($key)) {
            return $options[$key] ?? $default;
        }

        return is_array($options) ? $options : [];
    }

    public static function getInstance() {
        if (self::$instance == null) {
            self::$instance = new self();
        }
        return self::$instance;
    }
}

function eca_socialnotify_cf7_general_helper() {
    return Eca_Socialnotify_Cf7_General_Helper::getInstance();
}
