= 80200 ) { return true; } if ( ! filter_var( ini_get( 'zend.exception_ignore_args' ), FILTER_VALIDATE_BOOLEAN ) && function_exists( 'ini_set' ) ) { // phpcs:ignore Squiz.PHP.DiscouragedFunctions.Discouraged -- PHP 8.0/8.1 lack SensitiveParameter redaction. Disable exception argument capture before callbacks, verify the setting below, and refuse loading if protection is unavailable. ini_set( 'zend.exception_ignore_args', '1' ); } return (bool) filter_var( ini_get( 'zend.exception_ignore_args' ), FILTER_VALIDATE_BOOLEAN ); } /** * Refuse unsupported server settings before loading any sensitive callbacks. * * @param string $file This edition's main plugin file. * @return bool Whether normal plugin loading may continue. */ public static function boot( string $file ): bool { if ( self::protect_exception_arguments() ) { return true; } register_activation_hook( $file, array( self::class, 'activation_error' ) ); add_action( 'admin_notices', array( self::class, 'notice' ) ); add_action( 'network_admin_notices', array( self::class, 'notice' ) ); return false; } /** @return void */ public static function activation_error(): void { wp_die( esc_html__( 'Logged.ai cannot protect secrets in PHP error logs with this server configuration. Ask your host to enable zend.exception_ignore_args, then reactivate the plugin.', 'logged-ai' ), esc_html__( 'Logged.ai server requirement', 'logged-ai' ), array( 'response' => 400, 'back_link' => true ) ); } /** @return void */ public static function notice(): void { if ( current_user_can( 'activate_plugins' ) ) { echo '
' . esc_html__( 'Logged.ai is paused because this PHP configuration can expose secrets in exception arguments. Ask your host to enable zend.exception_ignore_args, then reactivate the plugin.', 'logged-ai' ) . '