diff --git a/composer.json b/composer.json index 38a8d8870..d749ca2bf 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,8 @@ ], "require": { "cleantalk/spbct-heuristic-analyser": "*", - "cleantalk/spbct-signatures-analyser": "*" + "cleantalk/spbct-signatures-analyser": "*", + "cleantalk/spbct-helpers": "*" }, "require-dev": { "vimeo/psalm": "^4.8", diff --git a/inc/spbc-admin.php b/inc/spbc-admin.php index 919a5bee3..b4acd0cf0 100644 --- a/inc/spbc-admin.php +++ b/inc/spbc-admin.php @@ -7,6 +7,7 @@ use CleantalkSP\SpbctWP\Escape; use CleantalkSP\SpbctWP\Scanner\DBTrigger\DBTriggerService; use CleantalkSP\SpbctWP\Settings\SettingsGeneralReact; +use CleantalkSP\SpbctWP\SpbcDevLogger; use CleantalkSP\SpbctWP\VulnerabilityAlarm\Dto\PluginReport; use CleantalkSP\SpbctWP\Firewall\View as FirewallView; use CleantalkSP\SpbctWP\VulnerabilityAlarm\Dto\ThemeReport; @@ -604,7 +605,7 @@ function spbc_admin_log_action() try { spbc_write_timer($secure_cookies); } catch (Exception $e) { - error_log($e->getMessage()); + SpbcDevLogger::write($e->getMessage()); } } @@ -631,7 +632,7 @@ function spbc_admin_log_action() try { spbc_set_secure_cookies($cookies_arr); } catch (Exception $e) { - error_log($e->getMessage()); + SpbcDevLogger::write($e->getMessage()); } } diff --git a/inc/spbc-settings.php b/inc/spbc-settings.php index e848cca07..f0478e7f5 100644 --- a/inc/spbc-settings.php +++ b/inc/spbc-settings.php @@ -3980,6 +3980,15 @@ function spbc_field_debug() $output = print_r($debug, true); $output = str_replace("\n", "
", $output); $output = preg_replace("/[^\S]{4}/", "    ", $output); + $spbc->dev_log; // This is the lazy load the `dev_log` property into the State + if ( ! empty($spbc->dev_log) ) { + echo 'Dev log:' . "
"; + $dev_log = $spbc->dev_log; + $dev_log_output = print_r($dev_log, true); + $dev_log_output = str_replace("\n", "
", $dev_log_output); + $dev_log_output = preg_replace("/[^\S]{4}/", "    ", $dev_log_output); + $output .= $dev_log_output; + } echo "
"; echo $output . "