Improve remote logger

This commit is contained in:
Chi-Hsuan Huang 2024-09-16 16:08:54 +08:00
parent 7b5c52dd5d
commit cd7c29fa15
2 changed files with 5 additions and 5 deletions

View File

@ -247,7 +247,7 @@ class RemoteLogger extends \WC_Log_Handler {
'headers' => array(
'Content-Type' => 'application/json',
),
'blocking' => false,
'blocking' => true,
)
);

View File

@ -46,7 +46,7 @@ trait UseNonBuiltInFunctions {
)
);
return null;
return 'Unable to retrieve';
}
}
@ -134,7 +134,7 @@ trait UseNonBuiltInFunctions {
'_default' => $_default,
)
);
return 'Unable to retrieve';
return false;
}
}
@ -160,7 +160,7 @@ trait UseNonBuiltInFunctions {
'transient' => $transient,
)
);
return 'Unable to retrieve';
return false;
}
}
@ -344,7 +344,7 @@ trait UseNonBuiltInFunctions {
*/
private function get_wc_version() {
try {
return Constants::get_constant( 'WC_VERSION' );
return Constants::get_constant( 'WC_VERSION' ) ?? 'unknown';
} catch ( \Throwable $e ) {
$this->log_wrapper_error(
__FUNCTION__,