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/wpprotonperinggit/wp-content/plugins/rafflepress/app/standalone.php
<?php

function rafflepress_lite_standalone_redirect() {
	try {
		global $wpdb;
		$wpdb->suppress_errors = true;
		$tablename             = $wpdb->prefix . 'rafflepress_giveaways';
		$path                  = rtrim( ltrim( $_SERVER['REQUEST_URI'], '/' ), '/' );
		$path                  = preg_replace( '/\?.*/', '', $path );

		$url = home_url();

		$r = array_intersect( explode( '/', $path ), explode( '/', $url ) );

		$path = str_replace( $r, '', $path );

		$path = str_replace( '/', '', $path );

		if ( ! empty( $path ) ) {
			$sql         = "SELECT id FROM $tablename WHERE slug = %s";
			$safe_sql    = $wpdb->prepare( $sql, $path );
			$giveaway_id = $wpdb->get_var( $safe_sql );

			if ( ! empty( $giveaway_id ) ) {
				$rafflepress_id = $giveaway_id;

				$c = ob_get_contents();
				if ( $c ) {
					@ob_end_clean();
				}

				header( 'Cache-Control: no-cache, no-store, must-revalidate,max-age=0' ); // HTTP 1.1.
				header( 'Cache-Control: post-check=0, pre-check=0', false );
				header( 'Pragma: no-cache' ); // HTTP 1.0.
				header( 'Expires: 0 ' );
				header( 'HTTP/1.1 200 OK' );
				require_once RAFFLEPRESS_PLUGIN_PATH . 'resources/views/rafflepress-giveaway.php';
				exit();
			}
		}
	} catch ( Exception $e ) {
		//echo 'Caught exception: ',  $e->getMessage(), "\n";
	}
}
add_action( 'template_redirect', 'rafflepress_lite_standalone_redirect' );