-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathUserExperience_GeneralPage_View.php
More file actions
260 lines (246 loc) · 9.25 KB
/
Copy pathUserExperience_GeneralPage_View.php
File metadata and controls
260 lines (246 loc) · 9.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<?php
/**
* File: UserExperience_GeneralPage_View.php
*
* @package W3TC
*/
namespace W3TC;
if ( ! defined( 'W3TC' ) ) {
die();
}
$config = Dispatcher::config();
?>
<?php
Util_Ui::postbox_header_tabs(
esc_html__( 'User Experience', 'w3-total-cache' ),
esc_html__(
'User Experience (UX) is a setting that focuses on enhancing the overall browsing experience for visitors
of your website. By enabling this feature, you can optimize your website\'s performance by minimizing
load times, reducing server requests, and delivering content more efficiently. This ultimately leads
to faster page loading, improved user satisfaction, and increased engagement, resulting in a speedier
and more enjoyable WordPress website.',
'w3-total-cache'
),
'',
'userexperience',
Util_UI::admin_url( 'admin.php?page=w3tc_userexperience' )
);
Util_Ui::config_overloading_button( array( 'key' => 'lazyload.configuration_overloaded' ) );
?>
<table class="form-table">
<?php
Util_Ui::config_item(
array(
'key' => 'lazyload.enabled',
'control' => 'checkbox',
'checkbox_label' => esc_html__( 'Lazy Load Images', 'w3-total-cache' ),
'label_class' => 'w3tc_single_column',
'description' => esc_html__( 'Defer loading offscreen images.', 'w3-total-cache' ),
)
);
Util_Ui::config_item_pro(
array(
'key' => 'lazyload_googlemaps_general_settings',
'control' => 'none',
'label_class' => 'w3tc_single_column',
'none_label' => esc_html__( 'Lazy Load Google Maps', 'w3-total-cache' ),
'excerpt' => wp_kses(
sprintf(
// translators: 1 opening HTML strong tag, 2 closing HTML strong tag, 3 opening HTML strong tag, 4 closing HTML strong tag,
// translators: 5 opening HTML a tag to W3TC User Experience page, 6 closing HTML a tag.
__(
'In addition to lazy loading images, with %1$sW3 Total Cache Pro%2$s you can lazy load %3$sGoogle Maps%4$s! More information and settings can be found on the %5$sUser Experience page%6$s.',
'w3-total-cache'
),
'<strong>',
'</strong>',
'<strong>',
'</strong>',
'<a href="' . Util_Ui::admin_url( 'admin.php?page=w3tc_userexperience#lazy-loading' ) . '">',
'</a>'
),
array(
'a' => array(
'href' => array(),
),
'strong' => array(),
)
),
'description' => array(),
'show_learn_more' => false,
'intro_label' => __( 'Potential Google PageSpeed Gain', 'w3-total-cache' ),
'score' => '+10',
'score_label' => __( 'Points', 'w3-total-cache' ),
'score_description' => __( 'In a recent test, using the Lazy Load Google Maps feature added 10 points to the Google PageSpeed mobile score!', 'w3-total-cache' ),
'score_link' => 'https://www.boldgrid.com/support/w3-total-cache/pagespeed-tests/lazy-load-maps/?utm_source=w3tc&utm_medium=lazy-load-maps&utm_campaign=proof'
)
);
Util_Ui::config_item_extension_enabled(
array(
'extension_id' => 'user-experience-emoji',
'checkbox_label' => esc_html__( 'Disable Emoji', 'w3-total-cache' ),
'description' => esc_html__( 'Remove emojis support from your website.', 'w3-total-cache' ),
'label_class' => 'w3tc_single_column',
)
);
Util_Ui::config_item_extension_enabled(
array(
'extension_id' => 'user-experience-defer-scripts',
'checkbox_label' => esc_html__( 'Delay Scripts', 'w3-total-cache' ),
'description' => __(
'Delay the loading of specified internal/external JavaScript sources on your pages separate from Minify.',
'w3-total-cache'
) . (
UserExperience_DeferScripts_Extension::is_enabled()
? wp_kses(
sprintf(
// translators: 1 opening HTML a tag to W3TC User Experience page, 2 closing HTML a tag.
__(
' Settings can be found on the %1$sUser Experience page%2$s.',
'w3-total-cache'
),
'<a href="' . Util_Ui::admin_url( 'admin.php?page=w3tc_userexperience#defer-scripts' ) . '">',
'</a>'
),
array(
'a' => array(
'href' => array(),
),
)
)
: ''
),
'label_class' => 'w3tc_single_column',
'pro' => true,
'disabled' => ! Util_Environment::is_w3tc_pro( $config ) ? true : false,
'show_learn_more' => false,
'intro_label' => __( 'Potential Google PageSpeed Gain', 'w3-total-cache' ),
'score' => '+18',
'score_label' => __( 'Points', 'w3-total-cache' ),
'score_description' => __( 'In a recent test, using the Delay Scripts feature added 18 points on mobile devices to the Google PageSpeed score!', 'w3-total-cache' ),
'score_link' => 'https://www.boldgrid.com/support/w3-total-cache/pagespeed-tests/delay-scripts-test/?utm_source=w3tc&utm_medium=defer-js&utm_campaign=proof',
)
);
Util_Ui::config_item_extension_enabled(
array(
'extension_id' => 'user-experience-remove-cssjs',
'checkbox_label' => esc_html__( 'Remove Unwanted/Unused CSS/JS', 'w3-total-cache' ),
'description' => __(
'Removes specified CSS/JS tags from the homepage or on a per page basis.',
'w3-total-cache'
) . (
UserExperience_Remove_CssJs_Extension::is_enabled()
? wp_kses(
sprintf(
// translators: 1 opening HTML a tag to W3TC User Experience page, 2 closing HTML a tag.
__(
' Settings can be found on the %1$sUser Experience page%2$s.',
'w3-total-cache'
),
'<a href="' . Util_Ui::admin_url( 'admin.php?page=w3tc_userexperience#remove-cssjs' ) . '">',
'</a>'
),
array(
'a' => array(
'href' => array(),
),
)
)
: ''
),
'label_class' => 'w3tc_single_column',
'pro' => true,
'disabled' => ! Util_Environment::is_w3tc_pro( $config ) ? true : false,
'show_learn_more' => false,
'intro_label' => __( 'Potential Google PageSpeed Gain', 'w3-total-cache' ),
'score' => '+27',
'score_label' => __( 'Points', 'w3-total-cache' ),
'score_description' => __( 'In one recent test, removing unused CSS and JS added over 27 points to the Google PageSpeed score!', 'w3-total-cache' ),
'score_link' => 'https://www.boldgrid.com/support/w3-total-cache/pagespeed-tests/remove-scripts/?utm_source=w3tc&utm_medium=remove-css-js&utm_campaign=proof',
)
);
Util_Ui::config_item_extension_enabled(
array(
'extension_id' => 'user-experience-partytown',
'checkbox_label' => esc_html__( 'Enable PartyTown', 'w3-total-cache' ),
'description' => __(
'This feature allows you to optimize third-party scripts by offloading them to web workers using PartyTown.',
'w3-total-cache'
) . (
UserExperience_PartyTown_Extension::is_enabled()
? wp_kses(
sprintf(
// translators: 1 opening HTML a tag to W3TC User Experience page, 2 closing HTML a tag.
__(
' Settings can be found on the %1$sUser Experience page%2$s.',
'w3-total-cache'
),
'<a href="' . Util_Ui::admin_url( 'admin.php?page=w3tc_userexperience#partytown' ) . '">',
'</a>'
),
array(
'a' => array(
'href' => array(),
),
)
)
: ''
),
'label_class' => 'w3tc_single_column',
'pro' => true,
'disabled' => ! Util_Environment::is_w3tc_pro( $config ) ? true : false,
'show_learn_more' => true,
)
);
Util_Ui::config_item_extension_enabled(
array(
'extension_id' => 'user-experience-preload-requests',
'checkbox_label' => esc_html__( 'Preload Requests', 'w3-total-cache' ),
'description' => __(
'DNS prefetching, pre-connecting, and preloading are essential web optimization techniques that enhance website performance by proactively resolving network-related tasks.',
'w3-total-cache'
) . (
UserExperience_Preload_Requests_Extension::is_enabled()
? wp_kses(
sprintf(
// translators: 1 opening HTML a tag to W3TC User Experience page, 2 closing HTML a tag.
__(
' Settings can be found on the %1$sUser Experience page%2$s.',
'w3-total-cache'
),
'<a href="' . Util_Ui::admin_url( 'admin.php?page=w3tc_userexperience#preload-requests' ) . '">',
'</a>'
),
array(
'a' => array(
'href' => array(),
),
)
)
: ''
),
'label_class' => 'w3tc_single_column',
'pro' => true,
'disabled' => ! Util_Environment::is_w3tc_pro( $config ) ? true : false,
)
);
Util_Ui::config_item_extension_enabled(
array(
'extension_id' => 'user-experience-oembed',
'checkbox_label' => esc_html__( 'Disable wp-embed script', 'w3-total-cache' ),
'description' => esc_html__( 'Remove wp-embed.js script from your website. oEmbed functionality still works but you will not be able to embed other WordPress posts on your pages.', 'w3-total-cache' ),
'label_class' => 'w3tc_single_column',
)
);
Util_Ui::config_item(
array(
'key' => 'jquerymigrate.disabled',
'control' => 'checkbox',
'checkbox_label' => esc_html__( 'Disable jquery-migrate on the front-end', 'w3-total-cache' ),
'label_class' => 'w3tc_single_column',
'description' => esc_html__( 'Remove jquery-migrate support from your website front-end.', 'w3-total-cache' ),
)
);
?>
</table>
<?php Util_Ui::postbox_footer(); ?>