File tree Expand file tree Collapse file tree 2 files changed +43
-1
lines changed
Expand file tree Collapse file tree 2 files changed +43
-1
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ // Copyright 2024 Catchpoint Systems Inc.
4+ // Use of this source code is governed by the Polyform Shield 1.0.0 license that can be
5+ // found in the LICENSE.md file.
6+ include 'common.inc ' ;
7+
8+ use WebPageTest \Util ;
9+
10+ if (!isset ($ request_context )) {
11+ header ("Location: / " );
12+ return ;
13+ }
14+
15+ $ user = $ request_context ->getUser ();
16+ if (is_null ($ user )) {
17+ header ("Location: / " );
18+ return ;
19+ }
20+
21+ if ($ user ->isAnon ()) {
22+ header ("Location: / " );
23+ return ;
24+ }
25+
26+ if ($ user ->isFree () && !Util::getSetting ('cp_portal_enable_free ' )) {
27+ header ("Location: / " );
28+ return ;
29+ }
30+
31+ if ($ user ->isPaid () && !Util::getSetting ('cp_portal_enable_pro ' )) {
32+ header ("Location: / " );
33+ return ;
34+ }
35+
36+ $ value = isset ($ req_value ) ? (bool ) $ req_value : true ;
37+ $ client = $ request_context ->getClient ();
38+ $ portal_enabled = $ client ->enablePortalPreview ($ value );
39+ $ location = $ portal_enabled ? Util::getSetting ('cp_portal_url ' ) : '/ ' ;
40+
41+ header ('Location: ' . $ location );
42+ return ;
Original file line number Diff line number Diff line change 6060 <li >What is checked: Checked to see if it is hosted on a known CDN (CNAME mapped to a known CDN network).
6161 80% of the static resources need to be served from a CDN for the overall page to be considered using a CDN.
6262 The current list of known CDN's is
63- <a href =" https://github.com/WPO-Foundation/wptagent /blob/master/internal/optimization_checks.py#L48 " >here</a >.
63+ <a href =" https://github.com/catchpoint/WebPageTest.agent /blob/master/internal/optimization_checks.py#L67 " >here</a >.
6464 </li >
6565 </ul >
6666 </dd >
You can’t perform that action at this time.
0 commit comments