From 2b632627201712ba0189cf21199ebba1226620c1 Mon Sep 17 00:00:00 2001 From: Christian Cordiviola Date: Mon, 17 Mar 2025 12:50:13 +0100 Subject: [PATCH 1/5] populate state/country billing information --- www/assets/js/country-list/country-list.js | 10 ++++-- .../update-payment-confirm-address.php | 31 +++++-------------- 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/www/assets/js/country-list/country-list.js b/www/assets/js/country-list/country-list.js index ba833df1b1..e1a71f2d23 100644 --- a/www/assets/js/country-list/country-list.js +++ b/www/assets/js/country-list/country-list.js @@ -2,7 +2,7 @@ ((window) => { class CountrySelector { - constructor(selector, subdivisionSelector, isoCompliantJsonBlob) { + constructor(selector, subdivisionSelector, isoCompliantJsonBlob, initialCountry, initialState) { this.countryList = isoCompliantJsonBlob; this.countries = Object.keys(this.countryList).map((code) => { return { @@ -22,9 +22,12 @@ this.countrySelector = selector; this.subdivisionSelector = subdivisionSelector; + this.countrySelector.value = initialCountry; // Fill in subdivisions - this.fillSubdivision(this.countries[0].code); + this.fillSubdivision(initialCountry ?? this.countries[0].code); + + this.subdivisionSelector.value = initialState; // Attach listener this.countrySelector.addEventListener("change", (e) => { @@ -47,6 +50,7 @@ } fillSubdivision(countryCode) { + this.subdivisionSelector.value = undefined; const divisions = this.getSubdivisions(countryCode); const opts = Object.keys(divisions).map((key) => { return new Option(divisions[key], key); @@ -60,4 +64,4 @@ } window.CountrySelector = CountrySelector; -})(window); +})(window); \ No newline at end of file diff --git a/www/templates/account/billing/update-payment-confirm-address.php b/www/templates/account/billing/update-payment-confirm-address.php index d079476de8..9e56aae39a 100644 --- a/www/templates/account/billing/update-payment-confirm-address.php +++ b/www/templates/account/billing/update-payment-confirm-address.php @@ -31,11 +31,8 @@
- - - @@ -83,18 +67,19 @@ From 7156ef77c9b8af9ebdfb779101c2038a9d939833 Mon Sep 17 00:00:00 2001 From: Christian Cordiviola Date: Mon, 24 Mar 2025 16:01:28 +0100 Subject: [PATCH 2/5] fix formatting --- www/jsonResult.php | 22 +++++++-------- www/testStatus.inc | 68 +++++++++++++++++++++++++--------------------- 2 files changed, 48 insertions(+), 42 deletions(-) diff --git a/www/jsonResult.php b/www/jsonResult.php index 852ac67c68..9a88a6fe16 100644 --- a/www/jsonResult.php +++ b/www/jsonResult.php @@ -62,8 +62,8 @@ if ($ret['statusCode'] == 200) { $protocol = getUrlProtocol(); - $host = $_SERVER['HTTP_HOST']; - $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); + $host = $_SERVER['HTTP_HOST']; + $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); $urlStart = "$protocol://$host$uri"; $testInfo = TestInfo::fromValues($id, $testPath, $test); @@ -107,14 +107,14 @@ function getRequestInfoFlags() { $getFlags = array( - "average" => JsonResultGenerator::WITHOUT_AVERAGE, - "standard" => JsonResultGenerator::WITHOUT_STDDEV, - "median" => JsonResultGenerator::WITHOUT_MEDIAN, - "runs" => JsonResultGenerator::WITHOUT_RUNS, - "requests" => JsonResultGenerator::WITHOUT_REQUESTS, - "console" => JsonResultGenerator::WITHOUT_CONSOLE, - "lighthouse" => JsonResultGenerator::WITHOUT_LIGHTHOUSE, - "rv" => JsonResultGenerator::WITHOUT_REPEAT_VIEW + "average" => JsonResultGenerator::WITHOUT_AVERAGE, + "standard" => JsonResultGenerator::WITHOUT_STDDEV, + "median" => JsonResultGenerator::WITHOUT_MEDIAN, + "runs" => JsonResultGenerator::WITHOUT_RUNS, + "requests" => JsonResultGenerator::WITHOUT_REQUESTS, + "console" => JsonResultGenerator::WITHOUT_CONSOLE, + "lighthouse" => JsonResultGenerator::WITHOUT_LIGHTHOUSE, + "rv" => JsonResultGenerator::WITHOUT_REPEAT_VIEW ); $infoFlags = array(); @@ -127,4 +127,4 @@ function getRequestInfoFlags() $infoFlags[] = JsonResultGenerator::BASIC_INFO_ONLY; } return $infoFlags; -} +} \ No newline at end of file diff --git a/www/testStatus.inc b/www/testStatus.inc index 6290d415f2..6eff858d23 100644 --- a/www/testStatus.inc +++ b/www/testStatus.inc @@ -10,14 +10,14 @@ $testQueue = array(); $testInfoJson = null; /** -* Get the status of the given test ID (and return the info in an array) -* -*/ + * Get the status of the given test ID (and return the info in an array) + * + */ function GetTestStatus($id, $includePosition = true) { $testServer = GetServerForTest($id); if (isset($testServer)) { - // Proxy the status through the server that actually owns the test + // Proxy the status through the server that actually owns the test $pos = $includePosition ? '1' : '0'; $status = json_decode(http_fetch("{$testServer}testStatus.php?test=$id&pos=$pos"), true); if (is_array($status) && isset($status['data'])) { @@ -30,7 +30,7 @@ function GetTestStatus($id, $includePosition = true) } $testPath = './' . GetTestPath($id); - // Fast-path for pending tests when we don't need to know the queue position (avoid test and location locks) + // Fast-path for pending tests when we don't need to know the queue position (avoid test and location locks) if (file_exists("$testPath/test.scheduled") && !file_exists("$testPath/.archived")) { $ret = array('statusCode' => 101, 'statusText' => 'Test pending', 'id' => $id); $status = GetSchedulerTestStatus($id); @@ -47,10 +47,12 @@ function GetTestStatus($id, $includePosition = true) $ret['statusText'] = "Waiting at the front of the queue..."; } } else { - $ret = array('statusCode' => 100, - 'statusText' => 'Test just started', - 'startTime' => gmdate("m/d/y G:i:s"), - 'id' => $id); + $ret = array( + 'statusCode' => 100, + 'statusText' => 'Test just started', + 'startTime' => gmdate("m/d/y G:i:s"), + 'id' => $id + ); } } return $ret; @@ -71,10 +73,12 @@ function GetTestStatus($id, $includePosition = true) @unlink("$testPath/test.requeued"); @unlink("$testPath/test.running"); } else { - $ret = array('statusCode' => 100, - 'statusText' => 'Test just started', - 'startTime' => gmdate("m/d/y G:i:s", filemtime("$testPath/test.running")), - 'id' => $id); + $ret = array( + 'statusCode' => 100, + 'statusText' => 'Test just started', + 'startTime' => gmdate("m/d/y G:i:s", filemtime("$testPath/test.running")), + 'id' => $id + ); $testInfoJson = GetTestInfo($id); PopulateTestInfoJson($ret, $testInfoJson); if ($elapsed == 0) { @@ -98,10 +102,12 @@ function GetTestStatus($id, $includePosition = true) return $ret; } } elseif (is_file("$testPath/test.complete") || file_exists("$testPath/.archived")) { - $ret = array('statusCode' => 200, - 'statusText' => 'Test Complete', - 'id' => $id, - 'completeTime' => gmdate("m/d/y G:i:s", filemtime("$testPath/test.complete"))); + $ret = array( + 'statusCode' => 200, + 'statusText' => 'Test Complete', + 'id' => $id, + 'completeTime' => gmdate("m/d/y G:i:s", filemtime("$testPath/test.complete")) + ); $testInfoJson = GetTestInfo($id); PopulateTestInfoJson($ret, $testInfoJson); return $ret; @@ -152,7 +158,7 @@ function GetTestStatus($id, $includePosition = true) } if ( (array_key_exists('started', $testInfoJson) && - $testInfoJson['started']) || + $testInfoJson['started']) || isset($test['test']['completeTime']) ) { $ret['startTime'] = isset($test['test']['startTime']) ? $test['test']['startTime'] : $now; @@ -174,9 +180,9 @@ function GetTestStatus($id, $includePosition = true) } else { $ret['statusCode'] = 100; if ($elapsed == 0) { - $ret['statusText'] = "Test just started"; + $ret['statusText'] = "Test just started"; } elseif ($elapsed == 1) { - $ret['statusText'] = "Test Started $elapsed second ago"; + $ret['statusText'] = "Test Started $elapsed second ago"; } elseif ($elapsed < 60) { $ret['statusText'] = "Test Started $elapsed seconds ago"; } else { @@ -241,7 +247,7 @@ function GetTestStatus($id, $includePosition = true) $rvRuns = 0; for ($run = 1; $run <= $runs; $run++) { if (gz_is_file("$testPath/{$run}_IEWPG.txt") || gz_is_file("$testPath/{$run}_devtools.json.txt")) { - $fvRuns++; + $fvRuns++; } if (gz_is_file("$testPath/{$run}_Cached_IEWPG.txt") || gz_is_file("$testPath/{$run}_Cached_devtools.json.txt")) { $rvRuns++; @@ -261,14 +267,14 @@ function GetTestStatus($id, $includePosition = true) $ret['statusText'] = "Completed {$ret['testsCompleted']} of {$ret['testsExpected']} tests"; } - // TODO: Add actual summary-result information + // TODO: Add actual summary-result information } } else { if ($includePosition && array_key_exists('workdir', $testInfoJson)) { $count = FindJobPosition($testInfoJson['location'], $testInfoJson['workdir'], $id); if ($count >= 0) { - $ret['statusCode'] = 101; - $ret['behindCount'] = $count; + $ret['statusCode'] = 101; + $ret['behindCount'] = $count; if ($count > 1) { $ret['statusText'] = "Waiting behind $count other tests..."; } elseif ($count == 1) { @@ -286,7 +292,7 @@ function GetTestStatus($id, $includePosition = true) $ret['statusCode'] = 401; $ret['statusText'] = 'Test request not found'; - // Force the test to end - something went Very Wrong (tm) + // Force the test to end - something went Very Wrong (tm) $lock = LockTest($id); if ($lock) { $testInfoJson = GetTestInfo($id); @@ -295,7 +301,7 @@ function GetTestStatus($id, $includePosition = true) $test = file_get_contents("$testPath/testinfo.ini"); $date = gmdate("m/d/y G:i:s", $now); - // Update the completion time if it isn't already set + // Update the completion time if it isn't already set if (!strpos($test, 'completeTime')) { $complete = "[test]\r\ncompleteTime=$date"; $out = str_replace('[test]', $complete, $test); @@ -334,10 +340,10 @@ function GetTestStatusText($id) } /** -* Check the status of a batch test -* -* @param mixed $status -*/ + * Check the status of a batch test + * + * @param mixed $status + */ function GetBatchStatus(&$status) { $dirty = false; @@ -469,7 +475,7 @@ function array2xml($array, $xml = false) foreach ($array as $key => $value) { if (is_array($value)) { - //get children + //get children array2xml($value, $xml->addChild($key)); } else { $xml->addChild($key, $value); From dfa949c38993f608bd0900153f9d7d87be1f0677 Mon Sep 17 00:00:00 2001 From: Christian Cordiviola Date: Mon, 24 Mar 2025 17:39:33 +0100 Subject: [PATCH 3/5] update location label for pro --- www/templates/account/includes/signup.php | 2 +- www/templates/account/plans/upgrade-plan.php | 4 ++-- www/templates/account/signup/step-1.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/www/templates/account/includes/signup.php b/www/templates/account/includes/signup.php index d98d8117dd..883c03b773 100644 --- a/www/templates/account/includes/signup.php +++ b/www/templates/account/includes/signup.php @@ -31,7 +31,7 @@ Locations 30 - 40 * + 35 * diff --git a/www/templates/account/plans/upgrade-plan.php b/www/templates/account/plans/upgrade-plan.php index 021b43c053..9374818083 100644 --- a/www/templates/account/plans/upgrade-plan.php +++ b/www/templates/account/plans/upgrade-plan.php @@ -202,8 +202,8 @@ Locations 30 - 40* - 40* + 35* + 35* diff --git a/www/templates/account/signup/step-1.php b/www/templates/account/signup/step-1.php index 1006deb7c7..abe4066ea5 100644 --- a/www/templates/account/signup/step-1.php +++ b/www/templates/account/signup/step-1.php @@ -190,8 +190,8 @@ Locations 30 - 40* - 40* + 35* + 35* From 3a5d28acc106509c9a5423fecf7b35281cdadcba Mon Sep 17 00:00:00 2001 From: Christian Cordiviola Date: Mon, 24 Mar 2025 18:58:29 +0100 Subject: [PATCH 4/5] add + --- www/templates/account/includes/signup.php | 2 +- www/templates/account/plans/upgrade-plan.php | 4 ++-- www/templates/account/signup/step-1.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/www/templates/account/includes/signup.php b/www/templates/account/includes/signup.php index 883c03b773..5b04d6a87f 100644 --- a/www/templates/account/includes/signup.php +++ b/www/templates/account/includes/signup.php @@ -31,7 +31,7 @@ Locations 30 - 35 * + 35+* diff --git a/www/templates/account/plans/upgrade-plan.php b/www/templates/account/plans/upgrade-plan.php index 9374818083..c3e21d33be 100644 --- a/www/templates/account/plans/upgrade-plan.php +++ b/www/templates/account/plans/upgrade-plan.php @@ -202,8 +202,8 @@ Locations 30 - 35* - 35* + 35+* + 35+* diff --git a/www/templates/account/signup/step-1.php b/www/templates/account/signup/step-1.php index abe4066ea5..dc2cf32217 100644 --- a/www/templates/account/signup/step-1.php +++ b/www/templates/account/signup/step-1.php @@ -190,8 +190,8 @@ Locations 30 - 35* - 35* + 35+* + 35+* From 0fc9d114158ee9c5ce4dc59fcaedf7d320db244d Mon Sep 17 00:00:00 2001 From: Leonardo Bartoli <142893024+lbartoli79@users.noreply.github.com> Date: Wed, 26 Mar 2025 19:25:40 +0100 Subject: [PATCH 5/5] Update constants.inc --- www/constants.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/constants.inc b/www/constants.inc index b6a355c4b8..6dbc8fc451 100644 --- a/www/constants.inc +++ b/www/constants.inc @@ -13,7 +13,7 @@ define('SETTINGS_PATH', realpath(WWW_PATH . '/settings/')); define('TEMP_DIR', realpath(WWW_PATH . '/tmp/')); define('OE_PATH', realpath(WWW_PATH . '/experiments/')); -define('WPT_SALT', '2502'); // used to force assets hash +define('WPT_SALT', '2503'); // used to force assets hash define('VER_WEBPAGETEST', '21.07'); // webpagetest version define('VER_TYPOGRAPHY_CSS', @md5_file(ASSETS_PATH . '/css/typography.css') . WPT_SALT); // version of the typography css file define('VER_LAYOUT_CSS', @md5_file(ASSETS_PATH . '/css/layout.css') . WPT_SALT); // version of the layout css file