fetch( is_array( $request ) ? $request : [] ); } /** * The site's stored Templately credential, or an empty string when not connected. * * Read through one accessor so the "no credential ⇒ no attempt" rule (FR-015) has a * single definition, and so the value has exactly one place it can be logged from — * which is nowhere. */ public static function credential(): string { $api_key = Options::get_instance()->get( 'api_key' ); return is_string( $api_key ) ? trim( $api_key ) : ''; } /** * Whether anything can answer the archive filter right now. * * The honest "is this feature on" test. A disabled module never ran `init_hooks()`, * so its listener is absent; the dev mock declares a dependency on this module, so it * is skipped alongside. `class_exists()` cannot tell you this — the autoloader * namespace is registered for inactive modules too. */ public static function is_live(): bool { return false !== has_filter( self::ARCHIVE_FILTER ); } /** * Seconds an acquisition attempt may take. */ public static function timeout(): int { $timeout = (int) apply_filters( self::TIMEOUT_FILTER, self::DEFAULT_TIMEOUT ); return $timeout > 0 ? $timeout : self::DEFAULT_TIMEOUT; } }