From c2225ca187bd37875be17d78bae38be080e68c49 Mon Sep 17 00:00:00 2001 From: Leonardo Bartoli Date: Thu, 5 Dec 2024 11:28:43 +0100 Subject: [PATCH 1/6] Change queue priorities --- www/common/AttachUser.php | 11 +++++++---- www/runtest.php | 36 +++++++++++++++++++++++++----------- www/src/User.php | 5 +++++ 3 files changed, 37 insertions(+), 15 deletions(-) diff --git a/www/common/AttachUser.php b/www/common/AttachUser.php index 7755b98e33..d07ed9b0c1 100644 --- a/www/common/AttachUser.php +++ b/www/common/AttachUser.php @@ -114,11 +114,14 @@ } } - if ($user->isPaid() || $user->isApiUser()) { - //calculate based on paid priority - $user->setUserPriority((int)Util::getSetting('paid_priority', 0)); + if ($user->isApiUser()) { + $user->setUserPriority((int) Util::getSetting('api_priority', 7)); + } else if ($user->isPaid()) { + $user->setUserPriority((int) Util::getSetting('paid_priority', 6)); + } else if ($user->isFree()) { + $user->setUserPriority((int) Util::getSetting('user_priority', 8)); } else { - $user->setUserPriority((int)Util::getSetting('user_priority', 0)); + $user->setUserPriority((int) Util::getSetting('anon_priority', 9)); } $user_email = $user->getEmail(); diff --git a/www/runtest.php b/www/runtest.php index 485ec2770b..ea14f1eb4e 100644 --- a/www/runtest.php +++ b/www/runtest.php @@ -146,7 +146,7 @@ } if (array_key_exists('resubmit', $_POST)) { $test = GetTestInfo(trim($_POST['resubmit'])); - if (array_key_exists('key', $test)){ + if (array_key_exists('key', $test)) { $test['key'] = null; } if ($test) { @@ -221,7 +221,7 @@ $is_private = 0; $is_private_api_call = !empty($user_api_key) && !empty($req_private) && - ((int)$req_private == 1 || $req_private == 'true'); + ((int)$req_private == 1 || $req_private == 'true'); $is_private_web_call = $isPaid && ($_POST['private'] == 'on'); if ($is_private_api_call || $is_private_web_call) { @@ -671,7 +671,7 @@ if ((isset($test['batch']) && $test['batch']) || (isset($test['batch_locations']) && $test['batch_locations'])) { $test['priority'] = intval(GetSetting('bulk_priority', 7)); } elseif ($_SERVER['REQUEST_METHOD'] == 'GET' || $xml || $json) { - $test['priority'] = intval(GetSetting('api_priority', 5)); + $test['priority'] = intval(GetSetting('api_priority', 7)); } } @@ -1628,7 +1628,7 @@ function ValidateKey(&$test, &$error, $key = null) ) { $test['location'] = $keys[$key]['default location']; } - $api_priority = intval(GetSetting('api_priority', 5)); + $api_priority = intval(GetSetting('api_priority', 7)); $test['priority'] = $api_priority; if (isset($keys[$key]['priority'])) { $test['priority'] = intval($keys[$key]['priority']); @@ -1719,9 +1719,8 @@ function ValidateKey(&$test, &$error, $key = null) // Store the account info with the test $test['accountId'] = $account['accountId']; $test['contactId'] = $account['contactId']; - // success. See if there is a priority override for redis-based API tests - if (Util::getSetting('paid_priority')) { - $test['priority'] = intval(Util::getSetting('paid_priority')); + if (Util::getSetting('api_priority')) { + $test['priority'] = intval(Util::getSetting('api_priority')); } } else { $error = 'The test request will exceed the remaining test balance for the given API key'; @@ -1827,9 +1826,24 @@ function ValidateParameters(&$test, $locations, &$error, $destination_url = null // make sure on/off options are explicitly 1 or 0 $values = array( - 'private', 'web10', 'ignoreSSL', 'tcpdump', 'standards', 'lighthouse', - 'timeline', 'swrender', 'netlog', 'spdy3', 'noscript', 'fullsizevideo', - 'blockads', 'sensitive', 'pngss', 'bodies', 'htmlbody', 'pss_advanced', + 'private', + 'web10', + 'ignoreSSL', + 'tcpdump', + 'standards', + 'lighthouse', + 'timeline', + 'swrender', + 'netlog', + 'spdy3', + 'noscript', + 'fullsizevideo', + 'blockads', + 'sensitive', + 'pngss', + 'bodies', + 'htmlbody', + 'pss_advanced', 'noheaders' ); foreach ($values as $value) { @@ -3555,7 +3569,7 @@ function CheckRateLimit($test, &$error, &$errorTitle) $errorTemplate = "

Don't worry! You can keep testing for free once you log in, which will give you access to other excellent features like:

"; $errorTitleTemplate = "You've reached the limit for"; - + if (!$passesMonthly) { $errorTitle = "{$errorTitleTemplate} this month"; $error = $errorTemplate; diff --git a/www/src/User.php b/www/src/User.php index 589b73fe2a..8bf27cda3d 100644 --- a/www/src/User.php +++ b/www/src/User.php @@ -89,6 +89,11 @@ public function isPaid(): bool ($this->payment_status == 'ACTIVE' || $this->isPendingCancelation()); } + public function isFree(): bool + { + return !$this->isPaid() && !$this->isAnon(); + } + public function setPaidClient(bool $is_paid): void { $this->is_paid_cp_client = $is_paid; From aac9ae1106bc8c819b6715588a58765e2a153470 Mon Sep 17 00:00:00 2001 From: Leonardo Bartoli Date: Thu, 5 Dec 2024 12:00:25 +0100 Subject: [PATCH 2/6] Implements linter hints --- www/common/AttachUser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/common/AttachUser.php b/www/common/AttachUser.php index d07ed9b0c1..015cba42ca 100644 --- a/www/common/AttachUser.php +++ b/www/common/AttachUser.php @@ -116,9 +116,9 @@ if ($user->isApiUser()) { $user->setUserPriority((int) Util::getSetting('api_priority', 7)); - } else if ($user->isPaid()) { + } elseif ($user->isPaid()) { $user->setUserPriority((int) Util::getSetting('paid_priority', 6)); - } else if ($user->isFree()) { + } elseif ($user->isFree()) { $user->setUserPriority((int) Util::getSetting('user_priority', 8)); } else { $user->setUserPriority((int) Util::getSetting('anon_priority', 9)); From bf0f7902cdde608fdca9afb2589be3db428a6718 Mon Sep 17 00:00:00 2001 From: Leonardo Bartoli Date: Fri, 6 Dec 2024 12:37:09 +0100 Subject: [PATCH 3/6] Allow free users to run test only if they have a verified email --- www/runtest.php | 35 +++++++++++++++++++++++++++++------ www/src/User.php | 5 +++++ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/www/runtest.php b/www/runtest.php index 485ec2770b..5f520b38aa 100644 --- a/www/runtest.php +++ b/www/runtest.php @@ -146,7 +146,7 @@ } if (array_key_exists('resubmit', $_POST)) { $test = GetTestInfo(trim($_POST['resubmit'])); - if (array_key_exists('key', $test)){ + if (array_key_exists('key', $test)) { $test['key'] = null; } if ($test) { @@ -221,7 +221,7 @@ $is_private = 0; $is_private_api_call = !empty($user_api_key) && !empty($req_private) && - ((int)$req_private == 1 || $req_private == 'true'); + ((int)$req_private == 1 || $req_private == 'true'); $is_private_web_call = $isPaid && ($_POST['private'] == 'on'); if ($is_private_api_call || $is_private_web_call) { @@ -900,6 +900,14 @@ function buildSelfHost($hosts) return $selfHostScript; } +$isFree = !is_null($request_context->getUser()) && $request_context->getUser()->isFree(); + +// Allow free user to run test only if email is verified +if ($isFree && !$request_context->getUser()->isVerified()) { + $errorTitle = 'Email address is not verified'; + $error = 'Please verify your email address to use WebPageTest.'; +} + if (!strlen($error) && CheckIp($test) && CheckUrl($test['url']) && CheckRateLimit($test, $error, $errorTitle)) { $total_runs = Util::getRunCount($test['runs'], $test['fvonly'], $test['lighthouse'], $test['type']); @@ -1827,9 +1835,24 @@ function ValidateParameters(&$test, $locations, &$error, $destination_url = null // make sure on/off options are explicitly 1 or 0 $values = array( - 'private', 'web10', 'ignoreSSL', 'tcpdump', 'standards', 'lighthouse', - 'timeline', 'swrender', 'netlog', 'spdy3', 'noscript', 'fullsizevideo', - 'blockads', 'sensitive', 'pngss', 'bodies', 'htmlbody', 'pss_advanced', + 'private', + 'web10', + 'ignoreSSL', + 'tcpdump', + 'standards', + 'lighthouse', + 'timeline', + 'swrender', + 'netlog', + 'spdy3', + 'noscript', + 'fullsizevideo', + 'blockads', + 'sensitive', + 'pngss', + 'bodies', + 'htmlbody', + 'pss_advanced', 'noheaders' ); foreach ($values as $value) { @@ -3555,7 +3578,7 @@ function CheckRateLimit($test, &$error, &$errorTitle) $errorTemplate = "

Don't worry! You can keep testing for free once you log in, which will give you access to other excellent features like:

"; $errorTitleTemplate = "You've reached the limit for"; - + if (!$passesMonthly) { $errorTitle = "{$errorTitleTemplate} this month"; $error = $errorTemplate; diff --git a/www/src/User.php b/www/src/User.php index 589b73fe2a..8bf27cda3d 100644 --- a/www/src/User.php +++ b/www/src/User.php @@ -89,6 +89,11 @@ public function isPaid(): bool ($this->payment_status == 'ACTIVE' || $this->isPendingCancelation()); } + public function isFree(): bool + { + return !$this->isPaid() && !$this->isAnon(); + } + public function setPaidClient(bool $is_paid): void { $this->is_paid_cp_client = $is_paid; From a188ff8c3de5f974f4cbf830942d7c7eebbc1202 Mon Sep 17 00:00:00 2001 From: Leonardo Bartoli Date: Fri, 6 Dec 2024 12:39:19 +0100 Subject: [PATCH 4/6] Revert formatting changes --- www/runtest.php | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/www/runtest.php b/www/runtest.php index 5f520b38aa..884f3b8cf6 100644 --- a/www/runtest.php +++ b/www/runtest.php @@ -146,7 +146,7 @@ } if (array_key_exists('resubmit', $_POST)) { $test = GetTestInfo(trim($_POST['resubmit'])); - if (array_key_exists('key', $test)) { + if (array_key_exists('key', $test)){ $test['key'] = null; } if ($test) { @@ -221,7 +221,7 @@ $is_private = 0; $is_private_api_call = !empty($user_api_key) && !empty($req_private) && - ((int)$req_private == 1 || $req_private == 'true'); + ((int)$req_private == 1 || $req_private == 'true'); $is_private_web_call = $isPaid && ($_POST['private'] == 'on'); if ($is_private_api_call || $is_private_web_call) { @@ -908,7 +908,6 @@ function buildSelfHost($hosts) $error = 'Please verify your email address to use WebPageTest.'; } - if (!strlen($error) && CheckIp($test) && CheckUrl($test['url']) && CheckRateLimit($test, $error, $errorTitle)) { $total_runs = Util::getRunCount($test['runs'], $test['fvonly'], $test['lighthouse'], $test['type']); $hasRunsAvailable = !is_null($request_context->getUser()) && $request_context->getUser()->hasEnoughRemainingRuns($total_runs); @@ -1835,24 +1834,9 @@ function ValidateParameters(&$test, $locations, &$error, $destination_url = null // make sure on/off options are explicitly 1 or 0 $values = array( - 'private', - 'web10', - 'ignoreSSL', - 'tcpdump', - 'standards', - 'lighthouse', - 'timeline', - 'swrender', - 'netlog', - 'spdy3', - 'noscript', - 'fullsizevideo', - 'blockads', - 'sensitive', - 'pngss', - 'bodies', - 'htmlbody', - 'pss_advanced', + 'private', 'web10', 'ignoreSSL', 'tcpdump', 'standards', 'lighthouse', + 'timeline', 'swrender', 'netlog', 'spdy3', 'noscript', 'fullsizevideo', + 'blockads', 'sensitive', 'pngss', 'bodies', 'htmlbody', 'pss_advanced', 'noheaders' ); foreach ($values as $value) { @@ -3578,7 +3562,7 @@ function CheckRateLimit($test, &$error, &$errorTitle) $errorTemplate = "

Don't worry! You can keep testing for free once you log in, which will give you access to other excellent features like:

"; $errorTitleTemplate = "You've reached the limit for"; - + if (!$passesMonthly) { $errorTitle = "{$errorTitleTemplate} this month"; $error = $errorTemplate; From a8455dbad1b0b300696e4095929c440ba5bfa629 Mon Sep 17 00:00:00 2001 From: Leonardo Bartoli Date: Mon, 9 Dec 2024 10:46:16 +0100 Subject: [PATCH 5/6] Update comparison table --- www/templates/account/plans/upgrade-plan.php | 45 +++++++------- www/templates/account/signup/step-1.php | 63 +++++++++++--------- 2 files changed, 61 insertions(+), 47 deletions(-) diff --git a/www/templates/account/plans/upgrade-plan.php b/www/templates/account/plans/upgrade-plan.php index 016596eeb8..93ed9519d5 100644 --- a/www/templates/account/plans/upgrade-plan.php +++ b/www/templates/account/plans/upgrade-plan.php @@ -88,8 +88,9 @@
- + - - - + + + @@ -178,7 +179,7 @@ No - @@ -193,7 +194,7 @@ No - @@ -201,8 +202,8 @@ - + @@ -318,7 +319,7 @@ Yes - @@ -349,7 +350,7 @@ Yes - @@ -396,14 +397,14 @@ Yes - - @@ -475,7 +476,7 @@ No - @@ -490,20 +491,20 @@ No - - - - @@ -512,11 +513,15 @@ diff --git a/www/templates/account/signup/step-1.php b/www/templates/account/signup/step-1.php index cd2f8f8946..80f45742a7 100644 --- a/www/templates/account/signup/step-1.php +++ b/www/templates/account/signup/step-1.php @@ -71,7 +71,7 @@ - + - - - + + + @@ -162,7 +167,7 @@ No - @@ -177,7 +182,7 @@ No - @@ -185,8 +190,8 @@ - + @@ -302,7 +307,7 @@ Yes - @@ -333,7 +338,7 @@ Yes - @@ -380,14 +385,14 @@ Yes - - @@ -459,7 +464,7 @@ No - @@ -474,20 +479,20 @@ No - - - - @@ -496,11 +501,15 @@ From e05dfe0c788f728964e25e4b63369936ab193263 Mon Sep 17 00:00:00 2001 From: Leonardo Bartoli Date: Mon, 9 Dec 2024 10:54:00 +0100 Subject: [PATCH 6/6] Update stylesheet --- www/assets/css/account.css | 140 ++++++++++++++++++++++++++++--------- 1 file changed, 108 insertions(+), 32 deletions(-) diff --git a/www/assets/css/account.css b/www/assets/css/account.css index ddf88dbc96..6c511f1d79 100644 --- a/www/assets/css/account.css +++ b/www/assets/css/account.css @@ -422,6 +422,7 @@ body.theme-b { min-height: 30px; border-right: 1px solid rgb(204, 204, 204); } + .upgrade-plan-feature-list li:nth-child(odd) { background-color: #f4f4f4; } @@ -1451,6 +1452,10 @@ table.sortable th:not([aria-sort]) button:hover span::after { text-align: left; } +.comparison-table thead tr { + height: 1px; +} + .comparison-table thead th { vertical-align: bottom; } @@ -1510,6 +1515,10 @@ table.sortable th:not([aria-sort]) button:hover span::after { padding: 0.8em; width: 25%; } +.comparison-table tr .info { + white-space: normal; + line-height: 0.9; +} .account-upgrade-comparison-table { width: 100%; @@ -1543,23 +1552,32 @@ table.sortable th:not([aria-sort]) button:hover span::after { } } -@media screen and (max-width: 768px) { +@media screen and (max-width: 968px) { + .comparison-table thead tr { + height: unset; + } + .comparison-table tr { display: flex; flex-flow: row wrap; justify-content: space-around; } + .comparison-table tr.prices td { + margin: auto; + } + .signup-step-1-content { margin: -39px auto 0; padding: 0; } + .comparison-table tbody th, .comparison-table tbody td, .comparison-table thead th { display: block; width: 33%; - font-size: 1rem; + font-size: 0.9rem; box-sizing: border-box; position: relative; } @@ -1572,6 +1590,11 @@ table.sortable th:not([aria-sort]) button:hover span::after { left: 22%; } + .comparison-table tbody tr, + .comparison-table tbody tr:nth-child(odd) { + background-color: white; + } + .comparison-table thead th:first-child { display: none; } @@ -1595,6 +1618,13 @@ table.sortable th:not([aria-sort]) button:hover span::after { background-color: white; display: flex; } + + .comparison-table tbody tr:last-of-type td { + height: 105px; + display: flex; + flex-direction: column; + justify-content: flex-end; + } } @media screen and (max-width: 370px) { @@ -1684,11 +1714,11 @@ table.sortable th:not([aria-sort]) button:hover span::after { } .comparison-table .signup-button > div { - line-height: 0.5; + line-height: 0.85; } .comparison-table .signup-button > div > small { font-weight: 400; - font-size: small; + font-size: smaller; } .comparison-table .signup-button .unit, span.unit { @@ -1726,14 +1756,18 @@ tr.custom-plan-mobile { display: inline-block; width: auto; } +#pro-plan-form { + margin-top: 1rem; +} #pro-plan-form label { width: 75px; margin-right: 0.2rem; text-align: right; } #pro-plan-form select { - width: 150px; + width: 90px; margin-bottom: 0.2rem; + padding: 0.25em 0.75em; } .pro-plans .pro-plans-header, @@ -1744,6 +1778,7 @@ tr.custom-plan-mobile { border: 1px solid #fff; padding: 1em; vertical-align: top; + line-height: 1.3; } .card-section .pro-plans-header, .card-section .expert-plan-header { @@ -1798,17 +1833,63 @@ th.expert-plan { padding-top: 2%; } -@media (max-width: 1176px) { - .pro-plans form > div:not(.hidden) { - width: 47%; +.signup-hed-price { + color: #ffc830; + font-weight: 700; + font-size: 2rem; +} + +.signup-special-price { + color: #ffc830; + font-weight: 700; + font-size: 1.5rem; + line-height: 1.25; + margin-bottom: 1rem; +} + +@media (max-width: 700px) { + .signup-special-price { + font-size: 1.15rem; + } + + #pro-plan-form { + margin-top: 0.5rem; + } + + #submit-pro-plan { + white-space: normal; + line-height: 0.85; } } -@media (max-width: 860px) { - .pro-plans form div > *:not(.hidden) { - display: block; - width: auto; - text-align: left; +@media (max-width: 620px) { + .signup-special-price { + font-size: 0.9rem; + } + + .expert-plan-header .heading { + font-size: 0.95rem; + } + + #pro-plan-form label { + width: 56px; + font-size: 0.75rem; + } + + #pro-plan-form select { + width: 70px; + font-size: 0.75rem; + } + + span.upsell { + font-size: 0.8rem; + line-height: 1.25; + } + + + .comparison-table tr td, + .comparison-table tr th { + padding: 0.8em 0; } } @@ -1917,20 +1998,6 @@ p sup { left: -14px; } -.signup-hed-price { - color: #ffc830; - font-weight: 700; - font-size: 2rem; -} - -.signup-special-price { - color: #ffc830; - font-weight: 700; - font-size: 1.5rem; - line-height: 1.25; - margin-bottom: 1rem; -} - ul.bulleted-list { list-style: disc; margin-left: 2rem; @@ -1973,10 +2040,9 @@ ul.bulleted-list { background-repeat: no-repeat; } .comparison-table tr:last-child td:last-child .button { - display: block; - margin-top: 1rem; + display: inline-block; } - + .FAQ { padding: 0 1.5rem 1.5rem; } @@ -1991,8 +2057,18 @@ ul.bulleted-list { } .comparison-table .signup-button { - padding: 0.7em 1em; + padding: 0.7em 0.9em; font-size: 0.85em; + line-height: 0.9; + border-radius: 1.0rem; + } + + #submit-expert-plan { + white-space: normal; + } + + .signup-button { + border-radius: 1.5rem; } } @@ -2495,4 +2571,4 @@ form:invalid button[type="submit"] { pointer-events: none; cursor: auto; } -/** END APiKeyForm **/ +/** END APiKeyForm **/ \ No newline at end of file
+
Compare Plans
Starter Plan @@ -115,9 +116,9 @@
Monthly Test Runs300As per planAs per contract300As per planAs per contract
+ Ask your account team
+ Ask your account team
Locations 3040* 40*40*
+ Coming Soon
+ Coming Soon
- Coming soon + + Coming Soon
Scripted Test + (limited to 3 steps) Yes + Ask your account team
+ Ask your account team
Support + Forums + Dedicated Support + Assigned CSM team
-
Need a custom plan?
- +
+
Need a custom plan?
+ +
- +
Price
@@ -83,25 +83,30 @@
Sign up for a Pro Plan - + Sign up for an Expert Plan
Monthly Test Runs300As per planAs per contract300As per planAs per contract
+ Ask your account team
+ Ask your account team
Locations 3040* 40*40*
+ Coming Soon
+ Coming Soon
- Coming soon + + Coming Soon
Scripted Test + (limited to 3 steps) Yes + Ask your account team
+ Ask your account team
Support + Forums + Dedicated Support + Assigned CSM team
-
Need a custom plan?
- +
+
Need a custom plan?
+ +
- +