HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
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,pcntl_unshare,
Upload Files
File: /var/www/html/wpmuhibbah_err/wp-content/plugins/pdf-embedder/src/Helpers/Check.php
<?php

namespace PDFEmbedder\Helpers;

/**
 * Helper methods to perform various checks across the plugin.
 *
 * @since 4.7.0
 */
class Check {

	/**
	 * Check whether the string is json-encoded.
	 *
	 * @since 4.7.0
	 *
	 * @param string $json A string.
	 *
	 * @return bool
	 */
	public static function is_json( $json ): bool {

		return (
			is_string( $json ) &&
			is_array( json_decode( $json, true ) ) &&
			json_last_error() === JSON_ERROR_NONE
		);
	}

	/**
     * Check whether the site is in the debug mode.
	 *
	 * @since 4.7.0
	 */
	public static function is_debug(): bool {

		return defined( 'WP_DEBUG' ) && WP_DEBUG;
	}

	/**
	 * Check whether the site is in the script debug mode.
	 *
	 * @since 4.8.0
	 */
	public static function is_script_debug(): bool {

		return defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
	}

	/**
	 * Check whether the site is in the heartbeat mode.
	 *
	 * @since 4.8.0
	 */
	public static function is_heartbeat(): bool {

		// phpcs:ignore WordPress.Security.NonceVerification.Missing
		return wp_doing_ajax() && isset( $_POST['action'] ) && $_POST['action'] === 'heartbeat';
	}

	/**
	 * We can't use is_attachment() here to process only PDF attachment pages files.
	 *
	 * @since 4.9.0
	 */
	public static function is_pdf_attachment(): bool {

		global $post;

		return isset( $post, $post->post_type, $post->post_mime_type ) &&
			$post->post_type === 'attachment' && $post->post_mime_type === 'application/pdf' &&
			is_singular();
	}
}