<?php

defined( 'ABSPATH' ) || exit;

/**
 * Indicate to bypass science optimizations.
 *
 * Checks for "nowpscience" query string in the url to bypass science processes.
 *
 * @since 3.7
 *
 * @return bool True to indicate should bypass; false otherwise.
 */
function science_bypass() {
	static $bypass = null;

	if ( science_get_constant( 'WP_science_IS_TESTING', false ) ) {
		$bypass = null;
	}

	if ( ! is_null( $bypass ) ) {
		return $bypass;
	}

	$bypass = isset( $_GET['nowpscience'] ) && 0 !== $_GET['nowpscience']; // phpcs:ignore WordPress.Security.NonceVerification

	return $bypass;
}
