<?php

/**
 * Minimal Freemius stand-in used when the real SDK can't initialize.
 *
 * @package CardOracle
 * @since 1.2.6
 */
// Exit if accessed directly.
if ( !defined( 'ABSPATH' ) && !defined( 'CARD_ORACLE_TESTING' ) ) {
    exit;
}
if ( !class_exists( 'Card_Oracle_FS_Safe_Stub' ) ) {
    /**
     * Free-mode fallback used when the Freemius SDK cannot be initialized.
     *
     * Only implements the method surface that Card Oracle actually calls so
     * the plugin keeps running in free mode without locking up wp-admin if
     * the SDK throws during bootstrap.
     *
     * @since 1.2.6
     */
    class Card_Oracle_FS_Safe_Stub {
        /**
         * No license registration when the SDK is unavailable.
         *
         * @return bool
         */
        public function is_registered() {
            return false;
        }

        /**
         * Fall back to the wp.org plugin page when we can't build a real upgrade URL.
         *
         * @return string
         */
        public function get_upgrade_url() {
            return 'https://wordpress.org/plugins/card-oracle/';
        }

        /**
         * Silent no-op so the plugin can still register its own hooks.
         *
         * @param string   $tag           Hook name.
         * @param callable $callback      Callback.
         * @param int      $priority      Priority.
         * @param int      $accepted_args Argument count.
         * @return void
         */
        public function add_action(
            $tag,
            $callback = null,
            $priority = 10,
            $accepted_args = 1
        ) {
        }

        /**
         * Silent no-op filter registration.
         *
         * @param string   $tag           Hook name.
         * @param callable $callback      Callback.
         * @param int      $priority      Priority.
         * @param int      $accepted_args Argument count.
         * @return void
         */
        public function add_filter(
            $tag,
            $callback = null,
            $priority = 10,
            $accepted_args = 1
        ) {
        }

        /**
         * Silent no-op for the SDK reuse path.
         *
         * @param bool   $is_premium                    Premium flag.
         * @param string $caller_main_file_and_constants Caller file.
         * @return void
         */
        public function set_basename( $is_premium, $caller_main_file_and_constants ) {
        }

    }

}