Skip to content

Commit

Permalink
Prettier run (#749)
Browse files Browse the repository at this point in the history
Co-authored-by: Timotei <[email protected]>
  • Loading branch information
timotei-litespeed and Tymotey committed Sep 20, 2024
1 parent 525bf17 commit 137e347
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion assets/css/litespeed.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
19 changes: 9 additions & 10 deletions src/cloud.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand Down Expand Up @@ -182,7 +182,6 @@ public function link_qc()
return;
}


$data = array(
'wp_ts' => time(),
);
Expand Down Expand Up @@ -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));
}

Expand All @@ -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'));
Expand All @@ -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;
}
Expand Down Expand Up @@ -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();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/debug2.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down
4 changes: 2 additions & 2 deletions src/lang.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -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') .
' ' .
Expand Down
3 changes: 2 additions & 1 deletion src/object-cache.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down

0 comments on commit 137e347

Please sign in to comment.