From 137e3475ef6909e79b242a808bb69ffa929e3b80 Mon Sep 17 00:00:00 2001 From: Tim <162806658+timotei-litespeed@users.noreply.github.com> Date: Fri, 20 Sep 2024 19:55:16 +0300 Subject: [PATCH] Prettier run (#749) Co-authored-by: Timotei --- assets/css/litespeed.css | 2 +- src/cloud.cls.php | 19 +++++++++---------- src/debug2.cls.php | 2 +- src/lang.cls.php | 4 ++-- src/object-cache.cls.php | 3 ++- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/assets/css/litespeed.css b/assets/css/litespeed.css index 84703e5c6..112b5d3b1 100644 --- a/assets/css/litespeed.css +++ b/assets/css/litespeed.css @@ -1209,7 +1209,7 @@ h3 .litespeed-learn-more { } .rtl .litespeed-switch { - flex-direction: row-reverse; + flex-direction: row-reverse; } .litespeed-switch input:checked:active + label { diff --git a/src/cloud.cls.php b/src/cloud.cls.php index 0287346ad..738fca998 100644 --- a/src/cloud.cls.php +++ b/src/cloud.cls.php @@ -140,7 +140,7 @@ public function init_qc() return; } - self::debug("echo succeeded"); + self::debug('echo succeeded'); // Load seperate thread echoed data from storage if (empty($echobox['wpapi_ts']) || empty($echobox['wpapi_signature_b64'])) { @@ -182,7 +182,6 @@ public function link_qc() return; } - $data = array( 'wp_ts' => time(), ); @@ -285,12 +284,12 @@ public function wp_rest_echo() $diff = time() - $_POST['wpapi_ts']; if (abs($diff) > 86400) { - self::debugErr("WPAPI echo data timeout [diff] " . $diff); + self::debugErr('WPAPI echo data timeout [diff] ' . $diff); return self::err('Echo data expired'); } $signature_b64 = $this->_sign_b64($_POST['wpapi_ts']); - self::debug("Response to echo [signature_b64] " . $signature_b64); + self::debug('Response to echo [signature_b64] ' . $signature_b64); return self::ok(array('signature_b64' => $signature_b64)); } @@ -310,7 +309,7 @@ private function _validate_signature($signature_b64, $data, $from_wpapi = false) $signature = base64_decode($signature_b64); $is_valid = sodium_crypto_sign_verify_detached($signature, $data, $cloud_pk); } catch (\SodiumException $e) { - self::debugErr("Decryption failed: " . $e->getMessage()); + self::debugErr('Decryption failed: ' . $e->getMessage()); return false; } self::debug('Signature validation result: ' . ($is_valid ? 'true' : 'false')); @@ -334,21 +333,21 @@ public function finish_qc_activation() ); $is_valid = $this->_validate_signature($_GET['qc_signature_b64'], implode('', $data_to_validate_signature)); if (!$is_valid) { - self::debugErr("Failed to validate qc activation data"); + self::debugErr('Failed to validate qc activation data'); Admin_Display::error(sprintf(__('Failed to validate %s activation data.', 'litespeed-cache'), 'QUIC.cloud')); return; } - self::debug("QC activation status: " . $_GET['qc_activated']); + self::debug('QC activation status: ' . $_GET['qc_activated']); if (!in_array($_GET['qc_activated'], array('anonymous', 'linked', 'cdn'))) { - self::debugErr("Failed to parse qc activation status"); + self::debugErr('Failed to parse qc activation status'); Admin_Display::error(sprintf(__('Failed to parse %s activation status.', 'litespeed-cache'), 'QUIC.cloud')); return; } $diff = time() - $_GET['qc_ts']; if (abs($diff) > 86400) { - self::debugErr("QC activation data timeout [diff] " . $diff); + self::debugErr('QC activation data timeout [diff] ' . $diff); Admin_Display::error(sprintf(__('%s activation data expired.', 'litespeed-cache'), 'QUIC.cloud')); return; } @@ -389,7 +388,7 @@ public function reset_qc() Admin_Display::success(sprintf(__('Reset %s activation successfully.', 'litespeed-cache'), 'QUIC.cloud')); wp_redirect(get_admin_url(null, 'admin.php?page=litespeed')); - exit; + exit(); } /** diff --git a/src/debug2.cls.php b/src/debug2.cls.php index 14bf6bf2f..a2e103c7c 100644 --- a/src/debug2.cls.php +++ b/src/debug2.cls.php @@ -89,7 +89,7 @@ public static function FilePath($type) if ($type == 'debug.purge') { $type = 'purge'; } - $key = defined('AUTH_KEY') ? AUTH_KEY : md5(__FILE__); + $key = defined('AUTH_KEY') ? AUTH_KEY : md5(__FILE__); $rand = substr(md5(substr($key, -16)), -16); return $type . $rand . '.log'; } diff --git a/src/lang.cls.php b/src/lang.cls.php index 6c8bf6cba..0dd1883fa 100644 --- a/src/lang.cls.php +++ b/src/lang.cls.php @@ -46,12 +46,12 @@ public static function maybe_translate($raw_string) { $map = array( 'auto_alias_failed_cdn' => - __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain, due to potential CDN conflict.', 'litespeed-cache') . + __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain, due to potential CDN conflict.', 'litespeed-cache') . ' ' . Doc::learn_more('https://quic.cloud/docs/cdn/dns/how-to-setup-domain-alias/', false, false, false, true), 'auto_alias_failed_uid' => - __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain.', 'litespeed-cache') . + __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain.', 'litespeed-cache') . ' ' . __('Alias is in use by another QUIC.cloud account.', 'litespeed-cache') . ' ' . diff --git a/src/object-cache.cls.php b/src/object-cache.cls.php index fdf135be4..0ccbf72e5 100644 --- a/src/object-cache.cls.php +++ b/src/object-cache.cls.php @@ -350,7 +350,8 @@ private function _connect() $failed = true; } restore_error_handler(); - } else { // Connect to Memcached + } else { + // Connect to Memcached if ($this->_cfg_persistent) { $this->_conn = new \Memcached($this->_get_mem_id());