HEX
Server: Apache/2.4.29 (Ubuntu)
System: Linux bareserver 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
User: root (0)
PHP: 7.2.24-0ubuntu0.18.04.17
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/html/site/newsite/wp-content/plugins/jupiterx-core/includes/utilities/options.php
<?php
/**
 * JupiterX_Core Utilities is a set of tools to ease building applications.
 *
 * @package JupiterX_Core\Utilities
 *
 * @since 1.18.0
 */

if ( ! function_exists( 'jupiterx_core_get_option' ) ) {
	/**
	 * Get option from options storage. This is duplicate of jupiterx_get_option.
	 *
	 * @since 1.18.0
	 *
	 * @param string  $option  Option name.
	 * @param boolean $default Default value.
	 *
	 * @return mixed Value set for the option.
	 */
	function jupiterx_core_get_option( $option, $default = false ) {
		$options = get_option( 'jupiterx', [] );

		if ( ! isset( $options[ $option ] ) ) {
			return $default;
		}

		return $options[ $option ];
	}
}

if ( ! function_exists( 'jupiterx_core_update_option' ) ) {
	/**
	 * Update option from options storage. This is duplicate of jupiterx_update_option.
	 *
	 * @param string $option Option name.
	 * @param mixed  $value  Update value.
	 *
	 * @return boolean False if value was not updated and true if value was updated.
	 */
	function jupiterx_core_update_option( $option, $value ) {
		$options = get_option( 'jupiterx', [] );

		// No need to update the same value.
		if ( isset( $options[ $option ] ) && $value === $options[ $option ] ) {
			return false;
		}

		// Update the option.
		$options[ $option ] = $value;
		update_option( 'jupiterx', $options );

		return true;
	}
}

if ( ! function_exists( 'jupiterx_core_is_registered' ) ) {
	/**
	 * Check Jupiter X is registered. This is duplicate of jupiterx_is_registered.
	 *
	 * @since 1.18.0
	 *
	 * @return boolean
	 */
	function jupiterx_core_is_registered() {
		return ! ( empty( jupiterx_core_get_api_key() ) && empty( jupiterx_core_get_option( 'envato_purchase_code_5177775', '' ) ) );
	}
}

if ( ! function_exists( 'jupiterx_core_get_api_key' ) ) {
	/**
	 * Get Jupiter X API key. This is duplicate of jupiterx_get_api_key.
	 *
	 * @since 1.18.0
	 *
	 * @return mixed
	 */
	function jupiterx_core_get_api_key() {
		$api_key = jupiterx_core_get_option( 'api_key' );

		if ( empty( $api_key ) ) {
			return null;
		}

		return $api_key;
	}
}