Submit
Path:
~
/
home
/
getwphos
/
www
/
deerguard
/
wp-content
/
plugins
/
wp-security-audit-log
/
classes
/
WPSensors
/
File Content:
class-wp-request-sensor.php
<?php /** * Sensor: Request * * Request sensor class file. * * @since 4.6.0 * @package wsal * @subpackage sensors */ declare(strict_types=1); namespace WSAL\WP_Sensors; use WSAL\Helpers\Settings_Helper; use WSAL\Controllers\Alert_Manager; // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( '\WSAL\WP_Sensors\WP_Request_Sensor' ) ) { /** * Writes the Request.log.php file. * * @package wsal * @subpackage sensors */ class WP_Request_Sensor { /** * Environment Variables. * * @var array */ private static $env_vars = array(); /** * Inits the main hooks * * @return void * * @since 4.5.0 */ public static function init() { if ( Settings_Helper::is_request_logging_enabled() ) { add_action( 'shutdown', array( __CLASS__, 'event_shutdown' ) ); } } /** * Fires just before PHP shuts down execution. * * @since 4.5.0 */ public static function event_shutdown() { // Filter global arrays for security. $post_array = filter_input_array( INPUT_POST ); $server_array = filter_input_array( INPUT_SERVER ); // get the custom logging path from settings. $custom_logging_path = Settings_Helper::get_working_dir_path_static(); if ( is_wp_error( $custom_logging_path ) ) { return; } $file = $custom_logging_path . 'Request.log.php'; $request_method = isset( $server_array['REQUEST_METHOD'] ) ? \sanitize_text_field( \wp_unslash( $server_array['REQUEST_METHOD'] ) ) : false; $request_uri = isset( $server_array['REQUEST_URI'] ) ? \sanitize_text_field( \wp_unslash( $server_array['REQUEST_URI'] ) ) : false; $line = '[' . gmdate( 'Y-m-d H:i:s' ) . '] ' . $request_method . ' ' . $request_uri . ' ' . ( ! empty( $post_array ) ? str_pad( PHP_EOL, 24 ) . json_encode( $post_array ) : '' ) // phpcs:ignore WordPress.WP.AlternativeFunctions.json_encode_json_encode . ( ! empty( self::$env_vars ) ? str_pad( PHP_EOL, 24 ) . json_encode( self::$env_vars ) : '' ) // phpcs:ignore WordPress.WP.AlternativeFunctions.json_encode_json_encode . PHP_EOL; if ( ! file_exists( $file ) && ! file_put_contents( $file, '<' . '?php die(\'Access Denied\'); ?>' . PHP_EOL ) ) { // phpcs:ignore Alert_Manager::log_error( 'Could not initialize request log file', array( 'file' => $file, ) ); return; } $f = fopen( $file, 'a' ); if ( $f ) { if ( ! fwrite( $f, $line ) ) { Alert_Manager::log_warn( 'Could not write to log file', array( 'file' => $file, ) ); } if ( ! fclose( $f ) ) { Alert_Manager::log_warn( 'Could not close log file', array( 'file' => $file, ) ); } } else { Alert_Manager::log_warn( 'Could not open log file', array( 'file' => $file, ) ); } } /** * Sets $envvars element with key and value. * * @param mixed $name - Key name of the variable. * @param mixed $value - Value of the variable. */ public static function set_var( $name, $value ) { self::$env_vars[ $name ] = $value; } /** * Copy data array into $envvars array. * * @param array $data - Data array. */ public static function set_vars( $data ) { foreach ( $data as $name => $value ) { self::set_var( $name, $value ); } } } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
Alerts
---
0755
Helpers
---
0755
.DS_Store
6148 bytes
0644
class-acf-meta-sensor.php
5398 bytes
0644
class-acf-sensor.php
18555 bytes
0644
class-bbpress-sensor.php
27193 bytes
0644
class-bbpress-system-sensor.php
3777 bytes
0644
class-bbpress-user-sensor.php
11135 bytes
0644
class-gravity-forms-sensor.php
49475 bytes
0644
class-main-wp-sensor.php
14131 bytes
0644
class-mainwp-server-sensor.php
26058 bytes
0644
class-memberpress-sensor.php
52670 bytes
0644
class-multisite-sign-up-sensor.php
3722 bytes
0644
class-rank-math-sensor.php
11911 bytes
0644
class-redirection-sensor.php
14254 bytes
0644
class-tablepress-sensor.php
17655 bytes
0644
class-termly-sensor.php
9341 bytes
0644
class-woocommerce-public-sensor.php
24098 bytes
0644
class-woocommerce-sensor-helper-second.php
103733 bytes
0644
class-woocommerce-sensor-helper-third.php
4406 bytes
0644
class-woocommerce-sensor-helper.php
98594 bytes
0644
class-woocommerce-sensor.php
48936 bytes
0644
class-wp-2fa-sensor.php
11628 bytes
0644
class-wp-comments-sensor.php
7104 bytes
0644
class-wp-content-sensor.php
58785 bytes
0644
class-wp-database-sensor.php
17912 bytes
0644
class-wp-files-sensor.php
4531 bytes
0644
class-wp-log-in-out-sensor.php
20101 bytes
0644
class-wp-menus-sensor.php
24986 bytes
0644
class-wp-metadata-sensor.php
23063 bytes
0644
class-wp-multisite-sensor.php
13562 bytes
0644
class-wp-plugins-themes-sensor.php
37203 bytes
0644
class-wp-register-sensor.php
3808 bytes
0644
class-wp-request-sensor.php
3390 bytes
0644
class-wp-system-sensor.php
45784 bytes
0644
class-wp-user-profile-sensor.php
21796 bytes
0644
class-wp-widgets-sensor.php
10878 bytes
0644
class-wpforms-sensor.php
52009 bytes
0644
class-yoast-seo-sensor.php
71603 bytes
0644
index.php
58 bytes
0644
N4ST4R_ID | Naxtarrr