Skip to content

Commit b031f4c

Browse files
authored
Merge pull request #3128 from catchpoint/master
Promote to prod
2 parents 841004d + ee21ade commit b031f4c

File tree

6 files changed

+213
-94
lines changed

6 files changed

+213
-94
lines changed

www/assets/css/account.css

Lines changed: 108 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ body.theme-b {
422422
min-height: 30px;
423423
border-right: 1px solid rgb(204, 204, 204);
424424
}
425+
425426
.upgrade-plan-feature-list li:nth-child(odd) {
426427
background-color: #f4f4f4;
427428
}
@@ -1451,6 +1452,10 @@ table.sortable th:not([aria-sort]) button:hover span::after {
14511452
text-align: left;
14521453
}
14531454

1455+
.comparison-table thead tr {
1456+
height: 1px;
1457+
}
1458+
14541459
.comparison-table thead th {
14551460
vertical-align: bottom;
14561461
}
@@ -1510,6 +1515,10 @@ table.sortable th:not([aria-sort]) button:hover span::after {
15101515
padding: 0.8em;
15111516
width: 25%;
15121517
}
1518+
.comparison-table tr .info {
1519+
white-space: normal;
1520+
line-height: 0.9;
1521+
}
15131522

15141523
.account-upgrade-comparison-table {
15151524
width: 100%;
@@ -1543,23 +1552,32 @@ table.sortable th:not([aria-sort]) button:hover span::after {
15431552
}
15441553
}
15451554

1546-
@media screen and (max-width: 768px) {
1555+
@media screen and (max-width: 968px) {
1556+
.comparison-table thead tr {
1557+
height: unset;
1558+
}
1559+
15471560
.comparison-table tr {
15481561
display: flex;
15491562
flex-flow: row wrap;
15501563
justify-content: space-around;
15511564
}
15521565

1566+
.comparison-table tr.prices td {
1567+
margin: auto;
1568+
}
1569+
15531570
.signup-step-1-content {
15541571
margin: -39px auto 0;
15551572
padding: 0;
15561573
}
15571574

1575+
.comparison-table tbody th,
15581576
.comparison-table tbody td,
15591577
.comparison-table thead th {
15601578
display: block;
15611579
width: 33%;
1562-
font-size: 1rem;
1580+
font-size: 0.9rem;
15631581
box-sizing: border-box;
15641582
position: relative;
15651583
}
@@ -1572,6 +1590,11 @@ table.sortable th:not([aria-sort]) button:hover span::after {
15721590
left: 22%;
15731591
}
15741592

1593+
.comparison-table tbody tr,
1594+
.comparison-table tbody tr:nth-child(odd) {
1595+
background-color: white;
1596+
}
1597+
15751598
.comparison-table thead th:first-child {
15761599
display: none;
15771600
}
@@ -1595,6 +1618,13 @@ table.sortable th:not([aria-sort]) button:hover span::after {
15951618
background-color: white;
15961619
display: flex;
15971620
}
1621+
1622+
.comparison-table tbody tr:last-of-type td {
1623+
height: 105px;
1624+
display: flex;
1625+
flex-direction: column;
1626+
justify-content: flex-end;
1627+
}
15981628
}
15991629

16001630
@media screen and (max-width: 370px) {
@@ -1684,11 +1714,11 @@ table.sortable th:not([aria-sort]) button:hover span::after {
16841714
}
16851715

16861716
.comparison-table .signup-button > div {
1687-
line-height: 0.5;
1717+
line-height: 0.85;
16881718
}
16891719
.comparison-table .signup-button > div > small {
16901720
font-weight: 400;
1691-
font-size: small;
1721+
font-size: smaller;
16921722
}
16931723
.comparison-table .signup-button .unit,
16941724
span.unit {
@@ -1726,14 +1756,18 @@ tr.custom-plan-mobile {
17261756
display: inline-block;
17271757
width: auto;
17281758
}
1759+
#pro-plan-form {
1760+
margin-top: 1rem;
1761+
}
17291762
#pro-plan-form label {
17301763
width: 75px;
17311764
margin-right: 0.2rem;
17321765
text-align: right;
17331766
}
17341767
#pro-plan-form select {
1735-
width: 150px;
1768+
width: 90px;
17361769
margin-bottom: 0.2rem;
1770+
padding: 0.25em 0.75em;
17371771
}
17381772

17391773
.pro-plans .pro-plans-header,
@@ -1744,6 +1778,7 @@ tr.custom-plan-mobile {
17441778
border: 1px solid #fff;
17451779
padding: 1em;
17461780
vertical-align: top;
1781+
line-height: 1.3;
17471782
}
17481783
.card-section .pro-plans-header,
17491784
.card-section .expert-plan-header {
@@ -1798,17 +1833,63 @@ th.expert-plan {
17981833
padding-top: 2%;
17991834
}
18001835

1801-
@media (max-width: 1176px) {
1802-
.pro-plans form > div:not(.hidden) {
1803-
width: 47%;
1836+
.signup-hed-price {
1837+
color: #ffc830;
1838+
font-weight: 700;
1839+
font-size: 2rem;
1840+
}
1841+
1842+
.signup-special-price {
1843+
color: #ffc830;
1844+
font-weight: 700;
1845+
font-size: 1.5rem;
1846+
line-height: 1.25;
1847+
margin-bottom: 1rem;
1848+
}
1849+
1850+
@media (max-width: 700px) {
1851+
.signup-special-price {
1852+
font-size: 1.15rem;
1853+
}
1854+
1855+
#pro-plan-form {
1856+
margin-top: 0.5rem;
1857+
}
1858+
1859+
#submit-pro-plan {
1860+
white-space: normal;
1861+
line-height: 0.85;
18041862
}
18051863
}
18061864

1807-
@media (max-width: 860px) {
1808-
.pro-plans form div > *:not(.hidden) {
1809-
display: block;
1810-
width: auto;
1811-
text-align: left;
1865+
@media (max-width: 620px) {
1866+
.signup-special-price {
1867+
font-size: 0.9rem;
1868+
}
1869+
1870+
.expert-plan-header .heading {
1871+
font-size: 0.95rem;
1872+
}
1873+
1874+
#pro-plan-form label {
1875+
width: 56px;
1876+
font-size: 0.75rem;
1877+
}
1878+
1879+
#pro-plan-form select {
1880+
width: 70px;
1881+
font-size: 0.75rem;
1882+
}
1883+
1884+
span.upsell {
1885+
font-size: 0.8rem;
1886+
line-height: 1.25;
1887+
}
1888+
1889+
1890+
.comparison-table tr td,
1891+
.comparison-table tr th {
1892+
padding: 0.8em 0;
18121893
}
18131894
}
18141895

@@ -1917,20 +1998,6 @@ p sup {
19171998
left: -14px;
19181999
}
19192000

1920-
.signup-hed-price {
1921-
color: #ffc830;
1922-
font-weight: 700;
1923-
font-size: 2rem;
1924-
}
1925-
1926-
.signup-special-price {
1927-
color: #ffc830;
1928-
font-weight: 700;
1929-
font-size: 1.5rem;
1930-
line-height: 1.25;
1931-
margin-bottom: 1rem;
1932-
}
1933-
19342001
ul.bulleted-list {
19352002
list-style: disc;
19362003
margin-left: 2rem;
@@ -1973,10 +2040,9 @@ ul.bulleted-list {
19732040
background-repeat: no-repeat;
19742041
}
19752042
.comparison-table tr:last-child td:last-child .button {
1976-
display: block;
1977-
margin-top: 1rem;
2043+
display: inline-block;
19782044
}
1979-
2045+
19802046
.FAQ {
19812047
padding: 0 1.5rem 1.5rem;
19822048
}
@@ -1991,8 +2057,18 @@ ul.bulleted-list {
19912057
}
19922058

19932059
.comparison-table .signup-button {
1994-
padding: 0.7em 1em;
2060+
padding: 0.7em 0.9em;
19952061
font-size: 0.85em;
2062+
line-height: 0.9;
2063+
border-radius: 1.0rem;
2064+
}
2065+
2066+
#submit-expert-plan {
2067+
white-space: normal;
2068+
}
2069+
2070+
.signup-button {
2071+
border-radius: 1.5rem;
19962072
}
19972073
}
19982074

@@ -2495,4 +2571,4 @@ form:invalid button[type="submit"] {
24952571
pointer-events: none;
24962572
cursor: auto;
24972573
}
2498-
/** END APiKeyForm **/
2574+
/** END APiKeyForm **/

www/common/AttachUser.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,14 @@
114114
}
115115
}
116116

117-
if ($user->isPaid() || $user->isApiUser()) {
118-
//calculate based on paid priority
119-
$user->setUserPriority((int)Util::getSetting('paid_priority', 0));
117+
if ($user->isApiUser()) {
118+
$user->setUserPriority((int) Util::getSetting('api_priority', 7));
119+
} elseif ($user->isPaid()) {
120+
$user->setUserPriority((int) Util::getSetting('paid_priority', 6));
121+
} elseif ($user->isFree()) {
122+
$user->setUserPriority((int) Util::getSetting('user_priority', 8));
120123
} else {
121-
$user->setUserPriority((int)Util::getSetting('user_priority', 0));
124+
$user->setUserPriority((int) Util::getSetting('anon_priority', 9));
122125
}
123126

124127
$user_email = $user->getEmail();

www/runtest.php

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
}
147147
if (array_key_exists('resubmit', $_POST)) {
148148
$test = GetTestInfo(trim($_POST['resubmit']));
149-
if (array_key_exists('key', $test)){
149+
if (array_key_exists('key', $test)) {
150150
$test['key'] = null;
151151
}
152152
if ($test) {
@@ -221,7 +221,7 @@
221221
$is_private = 0;
222222

223223
$is_private_api_call = !empty($user_api_key) && !empty($req_private) &&
224-
((int)$req_private == 1 || $req_private == 'true');
224+
((int)$req_private == 1 || $req_private == 'true');
225225
$is_private_web_call = $isPaid && ($_POST['private'] == 'on');
226226

227227
if ($is_private_api_call || $is_private_web_call) {
@@ -671,7 +671,7 @@
671671
if ((isset($test['batch']) && $test['batch']) || (isset($test['batch_locations']) && $test['batch_locations'])) {
672672
$test['priority'] = intval(GetSetting('bulk_priority', 7));
673673
} elseif ($_SERVER['REQUEST_METHOD'] == 'GET' || $xml || $json) {
674-
$test['priority'] = intval(GetSetting('api_priority', 5));
674+
$test['priority'] = intval(GetSetting('api_priority', 7));
675675
}
676676
}
677677

@@ -900,6 +900,13 @@ function buildSelfHost($hosts)
900900
return $selfHostScript;
901901
}
902902

903+
$isFree = !is_null($request_context->getUser()) && $request_context->getUser()->isFree();
904+
905+
// Allow free user to run test only if email is verified
906+
if ($isFree && !$request_context->getUser()->isVerified()) {
907+
$errorTitle = 'Email address is not verified';
908+
$error = 'Please verify your email address to use WebPageTest.';
909+
}
903910

904911
if (!strlen($error) && CheckIp($test) && CheckUrl($test['url']) && CheckRateLimit($test, $error, $errorTitle)) {
905912
$total_runs = Util::getRunCount($test['runs'], $test['fvonly'], $test['lighthouse'], $test['type']);
@@ -1628,7 +1635,7 @@ function ValidateKey(&$test, &$error, $key = null)
16281635
) {
16291636
$test['location'] = $keys[$key]['default location'];
16301637
}
1631-
$api_priority = intval(GetSetting('api_priority', 5));
1638+
$api_priority = intval(GetSetting('api_priority', 7));
16321639
$test['priority'] = $api_priority;
16331640
if (isset($keys[$key]['priority'])) {
16341641
$test['priority'] = intval($keys[$key]['priority']);
@@ -1719,9 +1726,8 @@ function ValidateKey(&$test, &$error, $key = null)
17191726
// Store the account info with the test
17201727
$test['accountId'] = $account['accountId'];
17211728
$test['contactId'] = $account['contactId'];
1722-
// success. See if there is a priority override for redis-based API tests
1723-
if (Util::getSetting('paid_priority')) {
1724-
$test['priority'] = intval(Util::getSetting('paid_priority'));
1729+
if (Util::getSetting('api_priority')) {
1730+
$test['priority'] = intval(Util::getSetting('api_priority'));
17251731
}
17261732
} else {
17271733
$error = 'The test request will exceed the remaining test balance for the given API key';
@@ -1827,9 +1833,24 @@ function ValidateParameters(&$test, $locations, &$error, $destination_url = null
18271833

18281834
// make sure on/off options are explicitly 1 or 0
18291835
$values = array(
1830-
'private', 'web10', 'ignoreSSL', 'tcpdump', 'standards', 'lighthouse',
1831-
'timeline', 'swrender', 'netlog', 'spdy3', 'noscript', 'fullsizevideo',
1832-
'blockads', 'sensitive', 'pngss', 'bodies', 'htmlbody', 'pss_advanced',
1836+
'private',
1837+
'web10',
1838+
'ignoreSSL',
1839+
'tcpdump',
1840+
'standards',
1841+
'lighthouse',
1842+
'timeline',
1843+
'swrender',
1844+
'netlog',
1845+
'spdy3',
1846+
'noscript',
1847+
'fullsizevideo',
1848+
'blockads',
1849+
'sensitive',
1850+
'pngss',
1851+
'bodies',
1852+
'htmlbody',
1853+
'pss_advanced',
18331854
'noheaders'
18341855
);
18351856
foreach ($values as $value) {
@@ -3555,7 +3576,7 @@ function CheckRateLimit($test, &$error, &$errorTitle)
35553576

35563577
$errorTemplate = "<p>Don't worry! You can keep testing for free once you log in, which will give you access to other excellent features like:</p>";
35573578
$errorTitleTemplate = "You've reached the limit for";
3558-
3579+
35593580
if (!$passesMonthly) {
35603581
$errorTitle = "{$errorTitleTemplate} this month";
35613582
$error = $errorTemplate;

www/src/User.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ public function isPaid(): bool
8989
($this->payment_status == 'ACTIVE' || $this->isPendingCancelation());
9090
}
9191

92+
public function isFree(): bool
93+
{
94+
return !$this->isPaid() && !$this->isAnon();
95+
}
96+
9297
public function setPaidClient(bool $is_paid): void
9398
{
9499
$this->is_paid_cp_client = $is_paid;

0 commit comments

Comments
 (0)