Version Description
- Add: Implement a new UI interface.
- Fix: Duplicate script while using the option Move JS Files to Footer.
- Fix: Improvise the optimization of WordPress core functions to clean the database correctly.
- Fix: Implement condition in .htaccess rules while disable "mod_env.
- Fix: Compatibility issue with Facebook For WooCommerce plugin.
Download this release
Release Info
Developer | adeelkhan |
Plugin | Breeze – WordPress Cache Plugin |
Version | 2.0.0 |
Comparing to | |
See all releases |
Code changes from version 1.2.6 to 2.0.0
- assets/css/breeze-admin-global.css +36 -0
- assets/css/breeze-admin-global.css.map +1 -0
- assets/css/breeze-admin.css +936 -0
- assets/css/breeze-admin.css.map +1 -0
- assets/css/breeze-fonts.css +56 -0
- assets/css/breeze-fonts.css.map +1 -0
- assets/css/notice.css +0 -24
- assets/css/style.css +0 -372
- assets/css/topbar.css +0 -6
- assets/fonts/proximanova-black-webfont.woff +0 -0
- assets/fonts/proximanova-black-webfont.woff2 +0 -0
- assets/fonts/proximanova-bold-webfont.woff +0 -0
- assets/fonts/proximanova-bold-webfont.woff2 +0 -0
- assets/fonts/proximanova-extrabold-webfont.woff +0 -0
- assets/fonts/proximanova-extrabold-webfont.woff2 +0 -0
- assets/fonts/proximanova-light-webfont.woff +0 -0
- assets/fonts/proximanova-light-webfont.woff2 +0 -0
- assets/fonts/proximanova-lightitalic-webfont.woff +0 -0
- assets/fonts/proximanova-lightitalic-webfont.woff2 +0 -0
- assets/fonts/proximanova-regular-webfont.woff +0 -0
- assets/fonts/proximanova-regular-webfont.woff2 +0 -0
- assets/fonts/proximanova-regularitalic-webfont.woff +0 -0
- assets/fonts/proximanova-regularitalic-webfont.woff2 +0 -0
- assets/fonts/proximanova-semibold-webfont.woff +0 -0
- assets/fonts/proximanova-semibold-webfont.woff2 +0 -0
- assets/fonts/proximanova-semibolditalic-webfont.woff +0 -0
- assets/fonts/proximanova-semibolditalic-webfont.woff2 +0 -0
- assets/images/advanced-active.png +0 -0
- assets/images/advanced.png +0 -0
- assets/images/all_transients.png +0 -0
- assets/images/auto_drafts.png +0 -0
- assets/images/basic-active.png +0 -0
- assets/images/basic.png +0 -0
- assets/images/cdn-active.png +0 -0
- assets/images/cdn.png +0 -0
- assets/images/clean_optimizer.png +0 -0
- assets/images/database-active.png +0 -0
- assets/images/database.png +0 -0
- assets/images/expired_transients.png +0 -0
- assets/images/faq-active.png +0 -0
- assets/images/faq.png +0 -0
- assets/images/faqs-active.png +0 -0
- assets/images/faqs.png +0 -0
- assets/images/file-active.png +0 -0
- assets/images/file.png +0 -0
- assets/images/optimize_tables.png +0 -0
- assets/images/post_revisions.png +0 -0
- assets/images/preload-active.png +0 -0
- assets/images/preload.png +0 -0
- assets/images/spam_comments.png +0 -0
- assets/images/tools-active.png +0 -0
- assets/images/tools.png +0 -0
- assets/images/trackbacks_pingbacks.png +0 -0
- assets/images/trashed_comments.png +0 -0
- assets/images/trashed_posts.png +0 -0
- assets/images/varnish-active.png +0 -0
- assets/images/varnish.png +0 -0
- assets/js/breeze-backend.js +0 -185
- assets/js/breeze-configuration.js +0 -351
- assets/js/breeze-lazy-load.js +0 -763
- assets/js/breeze-lazy-load.min.js +0 -1
- assets/js/breeze-main.js +1208 -0
- assets/js/breeze-main.min.js +4 -0
- assets/js/breeze-prefetch-links.js +0 -81
- assets/js/js-front-end/breeze-lazy-load.min.js +4 -0
- assets/js/js-front-end/breeze-prefetch-links.min.js +4 -0
- breeze.php +31 -26
- inc/breeze-admin.php +144 -72
- inc/breeze-configuration.php +597 -284
- inc/cache/config-cache.php +33 -21
- inc/cache/execute-cache.php +27 -13
- inc/cache/purge-cache.php +13 -16
- inc/cache/purge-per-time.php +11 -8
- inc/cache/purge-varnish.php +22 -12
- inc/cdn-integration/breeze-cdn-integration.php +6 -5
- inc/class-breeze-disable-emoji-option.php +3 -2
- inc/class-breeze-lazy-load.php +1 -1
- inc/class-breeze-options-reader.php +128 -0
- inc/class-breeze-prefetch.php +3 -3
- inc/class-breeze-preload-fonts.php +5 -5
- inc/helpers.php +180 -3
- inc/minification/breeze-js-deferred-loading.php +4 -1
- inc/minification/breeze-minify-main.php +89 -122
- inc/wp-cli/class-breeze-settings-import-export.php +421 -5
- inc/wp-cli/class-breeze-wp-cli-core.php +5 -1
- readme.txt +10 -1
- views/breeze-setting-views.php +135 -110
- views/option-tabs-loader.php +40 -0
- views/option-tabs/advanced-tab.php +151 -0
- views/option-tabs/basic-tab.php +327 -0
- views/option-tabs/cdn-tab.php +197 -0
- views/option-tabs/database-tab.php +175 -0
- views/option-tabs/faq-tab.php +195 -0
- views/option-tabs/file-tab.php +603 -0
- views/option-tabs/preload-tab.php +140 -0
- views/option-tabs/tools-tab.php +97 -0
- views/option-tabs/varnish-tab.php +134 -0
- views/tabs/advanced.php +0 -448
- views/tabs/basic.php +0 -232
- views/tabs/cdn.php +0 -97
- views/tabs/database.php +0 -117
- views/tabs/faq.php +0 -169
- views/tabs/import_export.php +0 -37
- views/tabs/varnish.php +0 -50
assets/css/breeze-admin-global.css
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#breeze-plugins-notice .button {
|
2 |
+
text-decoration: none;
|
3 |
+
line-height: 20px;
|
4 |
+
height: 18px;
|
5 |
+
transform: scale(0.9);
|
6 |
+
}
|
7 |
+
#breeze-plugins-notice .button:hover {
|
8 |
+
text-decoration: none;
|
9 |
+
line-height: 20px;
|
10 |
+
height: 18px;
|
11 |
+
transform: scale(0.9);
|
12 |
+
}
|
13 |
+
#breeze-plugins-notice li {
|
14 |
+
line-height: 18px;
|
15 |
+
}
|
16 |
+
#breeze-plugins-notice .text-error {
|
17 |
+
color: #dc3232;
|
18 |
+
}
|
19 |
+
#breeze-plugins-notice ul {
|
20 |
+
list-style: disc;
|
21 |
+
padding-left: 10px;
|
22 |
+
}
|
23 |
+
|
24 |
+
#wp-admin-bar-breeze-topbar * {
|
25 |
+
cursor: pointer !important;
|
26 |
+
}
|
27 |
+
|
28 |
+
#wp-admin-bar-breeze-topbar *:hover {
|
29 |
+
color: #00b9eb !important;
|
30 |
+
}
|
31 |
+
|
32 |
+
.breeze-box *, ::after, ::before {
|
33 |
+
box-sizing: unset;
|
34 |
+
}
|
35 |
+
|
36 |
+
/*# sourceMappingURL=breeze-admin-global.css.map */
|
assets/css/breeze-admin-global.css.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"sourceRoot":"","sources":["file:///Users/mihaiirodiu/Local-Lightning/wp56subfolders/app/public/wp-content/plugins/breeze/grunt-assets/files_scss/breeze-admin-global.scss"],"names":[],"mappings":"AACE;EACE;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;;AAIJ;EACE;;AAGF;EACE;;AAGF;EACE;EACA;;;AAKJ;EACE;;;AAEF;EACE;;;AAGF;EACE","file":"breeze-admin-global.css"}
|
assets/css/breeze-admin.css
ADDED
@@ -0,0 +1,936 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@charset "UTF-8";
|
2 |
+
/*!
|
3 |
+
Project: Breeze – WordPress Cache Plugin
|
4 |
+
Author: Cloudways
|
5 |
+
URL: https://wordpress.org/plugins/breeze/
|
6 |
+
*/
|
7 |
+
/*
|
8 |
+
Makes the image responsive ready
|
9 |
+
*/
|
10 |
+
/*
|
11 |
+
Centers the object based on it's columns
|
12 |
+
*/
|
13 |
+
/*
|
14 |
+
Rem is similar to the em value, but instead of being relative to the parent element it’s relative to the font-size set in the <html>.
|
15 |
+
It has all the benefits of em but you don’t get issues with e.g (compounding) since rem is only relative to the html element.
|
16 |
+
The bad part is there’s no support for rem units in IE8 and below. But with this mixin we can create a fallback to pixels when rem isn’t supported.
|
17 |
+
|
18 |
+
@include font-size(14px)
|
19 |
+
*/
|
20 |
+
/*
|
21 |
+
@include keyframes(slide-down) {
|
22 |
+
0% { opacity: 1; }
|
23 |
+
90% { opacity: 0; }
|
24 |
+
}
|
25 |
+
|
26 |
+
.element {
|
27 |
+
width: 100px;
|
28 |
+
height: 100px;
|
29 |
+
background: black;
|
30 |
+
@include animation('slide-down 5s 3');
|
31 |
+
}
|
32 |
+
|
33 |
+
*/
|
34 |
+
/*
|
35 |
+
a {
|
36 |
+
color: gray;
|
37 |
+
@include transition(color .3s ease);
|
38 |
+
&:hover {
|
39 |
+
color: black;
|
40 |
+
}
|
41 |
+
}
|
42 |
+
*/
|
43 |
+
.on-off-checkbox {
|
44 |
+
width: 160px;
|
45 |
+
height: 28px;
|
46 |
+
}
|
47 |
+
.on-off-checkbox.settings-switcher {
|
48 |
+
width: 420px;
|
49 |
+
height: 40px;
|
50 |
+
font-weight: bold;
|
51 |
+
font-size: 14px;
|
52 |
+
text-transform: uppercase;
|
53 |
+
}
|
54 |
+
@media only screen and (max-width: 418px) {
|
55 |
+
.on-off-checkbox.settings-switcher {
|
56 |
+
width: 97.5%;
|
57 |
+
font-size: 0.91em;
|
58 |
+
}
|
59 |
+
}
|
60 |
+
.on-off-checkbox input.br-box {
|
61 |
+
display: none;
|
62 |
+
}
|
63 |
+
.on-off-checkbox input.br-box + label {
|
64 |
+
height: 100%;
|
65 |
+
width: 100%;
|
66 |
+
}
|
67 |
+
.on-off-checkbox input.br-box + label > .status-switch {
|
68 |
+
cursor: pointer;
|
69 |
+
width: 100%;
|
70 |
+
height: 100%;
|
71 |
+
position: relative;
|
72 |
+
background-color: #42526E;
|
73 |
+
color: white;
|
74 |
+
font-weight: 600;
|
75 |
+
transition: all 0.5s ease;
|
76 |
+
padding: 0;
|
77 |
+
border-radius: 3px;
|
78 |
+
}
|
79 |
+
.on-off-checkbox input.br-box + label > .status-switch:before, .on-off-checkbox input.br-box + label > .status-switch:after {
|
80 |
+
border-radius: 3px;
|
81 |
+
height: calc(100% - 4px);
|
82 |
+
width: calc(50% - 3px);
|
83 |
+
display: flex;
|
84 |
+
align-items: center;
|
85 |
+
position: absolute;
|
86 |
+
justify-content: center;
|
87 |
+
transition: all 0.2s ease;
|
88 |
+
box-sizing: unset;
|
89 |
+
}
|
90 |
+
.on-off-checkbox input.br-box + label > .status-switch:before {
|
91 |
+
background-color: #42526E;
|
92 |
+
border-top: solid 2px #42526E;
|
93 |
+
border-bottom: solid 2px #42526E;
|
94 |
+
color: #FFFFFF;
|
95 |
+
left: 2px;
|
96 |
+
z-index: 10;
|
97 |
+
content: attr(data-unchecked);
|
98 |
+
}
|
99 |
+
.on-off-checkbox input.br-box + label > .status-switch:after {
|
100 |
+
right: 2px;
|
101 |
+
content: attr(data-checked);
|
102 |
+
background-color: #FFFFFF;
|
103 |
+
color: #42526E;
|
104 |
+
border-top: solid 2px #42526E;
|
105 |
+
border-bottom: solid 2px #42526E;
|
106 |
+
border-top-left-radius: 0;
|
107 |
+
border-bottom-left-radius: 0;
|
108 |
+
}
|
109 |
+
.on-off-checkbox input.br-box:checked + label > .status-switch {
|
110 |
+
background-color: #11ACDF;
|
111 |
+
}
|
112 |
+
.on-off-checkbox input.br-box:checked + label > .status-switch:after {
|
113 |
+
left: 2px;
|
114 |
+
content: attr(data-unchecked);
|
115 |
+
color: #11ACDF;
|
116 |
+
border-top-right-radius: 0;
|
117 |
+
border-bottom-right-radius: 0;
|
118 |
+
border-top-left-radius: 3px;
|
119 |
+
border-bottom-left-radius: 3px;
|
120 |
+
border-top: solid 2px #11ACDF;
|
121 |
+
border-bottom: solid 2px #11ACDF;
|
122 |
+
}
|
123 |
+
.on-off-checkbox input.br-box:checked + label > .status-switch:before {
|
124 |
+
color: #ffffff;
|
125 |
+
background-color: #11ACDF;
|
126 |
+
left: 50%;
|
127 |
+
content: attr(data-checked);
|
128 |
+
border-top: solid 2px #11ACDF;
|
129 |
+
border-bottom: solid 2px #11ACDF;
|
130 |
+
}
|
131 |
+
.on-off-checkbox input.br-box:disabled + label > .status-switch {
|
132 |
+
background-color: #42526E;
|
133 |
+
opacity: 0.6;
|
134 |
+
}
|
135 |
+
.on-off-checkbox input.br-box:disabled + label > .status-switch:after {
|
136 |
+
right: 2px;
|
137 |
+
content: attr(data-checked);
|
138 |
+
background-color: #FFFFFF;
|
139 |
+
color: #42526E;
|
140 |
+
border-top: solid 2px #42526E;
|
141 |
+
border-bottom: solid 2px #42526E;
|
142 |
+
}
|
143 |
+
.on-off-checkbox input.br-box:disabled + label > .status-switch:before {
|
144 |
+
border-top: solid 2px #42526E;
|
145 |
+
border-bottom: solid 2px #42526E;
|
146 |
+
background-color: #42526E;
|
147 |
+
color: #FFFFFF;
|
148 |
+
left: 2px;
|
149 |
+
z-index: 10;
|
150 |
+
content: attr(data-unchecked);
|
151 |
+
}
|
152 |
+
|
153 |
+
.br-loader-spinner {
|
154 |
+
display: inline-block;
|
155 |
+
position: relative;
|
156 |
+
width: 80px;
|
157 |
+
height: 80px;
|
158 |
+
left: 0;
|
159 |
+
right: 0;
|
160 |
+
top: 0;
|
161 |
+
bottom: 0;
|
162 |
+
margin: auto;
|
163 |
+
}
|
164 |
+
@media only screen and (max-width: 632px) {
|
165 |
+
.br-loader-spinner {
|
166 |
+
top: 20px;
|
167 |
+
}
|
168 |
+
}
|
169 |
+
|
170 |
+
.loading_tab:before {
|
171 |
+
content: "Loading Settings Tab...";
|
172 |
+
width: 300px;
|
173 |
+
position: absolute;
|
174 |
+
left: -40px;
|
175 |
+
}
|
176 |
+
|
177 |
+
.switch-to-settings:before {
|
178 |
+
content: "Switching Settings...";
|
179 |
+
width: 300px;
|
180 |
+
position: absolute;
|
181 |
+
left: -100px;
|
182 |
+
}
|
183 |
+
|
184 |
+
.saving_settings:before {
|
185 |
+
content: "Saving Settings and Clearing Cache...";
|
186 |
+
width: 300px;
|
187 |
+
position: absolute;
|
188 |
+
left: -90px;
|
189 |
+
}
|
190 |
+
|
191 |
+
.import_settings:before {
|
192 |
+
content: "Importing Settings...";
|
193 |
+
width: 300px;
|
194 |
+
position: absolute;
|
195 |
+
left: -18px;
|
196 |
+
}
|
197 |
+
|
198 |
+
.br-loader-spinner div {
|
199 |
+
position: absolute;
|
200 |
+
top: 33px;
|
201 |
+
width: 13px;
|
202 |
+
height: 13px;
|
203 |
+
border-radius: 50%;
|
204 |
+
background: #11ACDF;
|
205 |
+
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
206 |
+
}
|
207 |
+
|
208 |
+
.br-loader-spinner div:nth-child(1) {
|
209 |
+
left: 8px;
|
210 |
+
animation: loader-spinner1 0.6s infinite;
|
211 |
+
}
|
212 |
+
|
213 |
+
.br-loader-spinner div:nth-child(2) {
|
214 |
+
left: 8px;
|
215 |
+
animation: loader-spinner2 0.6s infinite;
|
216 |
+
}
|
217 |
+
|
218 |
+
.br-loader-spinner div:nth-child(3) {
|
219 |
+
left: 32px;
|
220 |
+
animation: loader-spinner2 0.6s infinite;
|
221 |
+
}
|
222 |
+
|
223 |
+
.br-loader-spinner div:nth-child(4) {
|
224 |
+
left: 56px;
|
225 |
+
animation: loader-spinner3 0.6s infinite;
|
226 |
+
}
|
227 |
+
|
228 |
+
@keyframes loader-spinner1 {
|
229 |
+
0% {
|
230 |
+
transform: scale(0);
|
231 |
+
}
|
232 |
+
100% {
|
233 |
+
transform: scale(1);
|
234 |
+
}
|
235 |
+
}
|
236 |
+
@keyframes loader-spinner3 {
|
237 |
+
0% {
|
238 |
+
transform: scale(1);
|
239 |
+
}
|
240 |
+
100% {
|
241 |
+
transform: scale(0);
|
242 |
+
}
|
243 |
+
}
|
244 |
+
@keyframes loader-spinner2 {
|
245 |
+
0% {
|
246 |
+
transform: translate(0, 0);
|
247 |
+
}
|
248 |
+
100% {
|
249 |
+
transform: translate(24px, 0);
|
250 |
+
}
|
251 |
+
}
|
252 |
+
body {
|
253 |
+
background: #E5E5E5;
|
254 |
+
}
|
255 |
+
|
256 |
+
.change-settings-use {
|
257 |
+
font-family: "Proxima Nova", "Helvetica", "Verdana", "Arial";
|
258 |
+
-webkit-font-smoothing: antialiased;
|
259 |
+
}
|
260 |
+
|
261 |
+
.breeze-box {
|
262 |
+
display: -webkit-box;
|
263 |
+
display: -moz-box;
|
264 |
+
display: -ms-flexbox;
|
265 |
+
display: -webkit-flex;
|
266 |
+
display: flex;
|
267 |
+
width: 99%;
|
268 |
+
font-size: 16px;
|
269 |
+
font-size: 1rem;
|
270 |
+
-webkit-box-direction: normal;
|
271 |
+
-webkit-box-orient: horizontal;
|
272 |
+
-moz-box-direction: normal;
|
273 |
+
-moz-box-orient: horizontal;
|
274 |
+
-webkit-flex-direction: row;
|
275 |
+
-ms-flex-direction: row;
|
276 |
+
flex-direction: row;
|
277 |
+
font-family: "Proxima Nova", "Helvetica", "Verdana", "Arial";
|
278 |
+
-webkit-font-smoothing: antialiased;
|
279 |
+
/**
|
280 |
+
Menu CSS
|
281 |
+
*/
|
282 |
+
/**
|
283 |
+
Options CSS
|
284 |
+
*/
|
285 |
+
}
|
286 |
+
@media only screen and (max-width: 632px) {
|
287 |
+
.breeze-box {
|
288 |
+
-webkit-box-direction: normal;
|
289 |
+
-webkit-box-orient: vertical;
|
290 |
+
-moz-box-direction: normal;
|
291 |
+
-moz-box-orient: vertical;
|
292 |
+
-webkit-flex-direction: column;
|
293 |
+
-ms-flex-direction: column;
|
294 |
+
flex-direction: column;
|
295 |
+
width: 98%;
|
296 |
+
}
|
297 |
+
}
|
298 |
+
.breeze-box .br-menu {
|
299 |
+
width: 20%;
|
300 |
+
min-width: 20%;
|
301 |
+
display: -webkit-inline-box;
|
302 |
+
display: -moz-inline-box;
|
303 |
+
display: -webkit-inline-flex;
|
304 |
+
display: -ms-inline-flexbox;
|
305 |
+
display: inline-flex;
|
306 |
+
-webkit-box-direction: normal;
|
307 |
+
-webkit-box-orient: vertical;
|
308 |
+
-moz-box-direction: normal;
|
309 |
+
-moz-box-orient: vertical;
|
310 |
+
-webkit-flex-direction: column;
|
311 |
+
-ms-flex-direction: column;
|
312 |
+
flex-direction: column;
|
313 |
+
}
|
314 |
+
@media only screen and (max-width: 1268px) {
|
315 |
+
.breeze-box .br-menu {
|
316 |
+
min-width: 240px;
|
317 |
+
}
|
318 |
+
}
|
319 |
+
@media only screen and (max-width: 632px) {
|
320 |
+
.breeze-box .br-menu {
|
321 |
+
min-width: 100%;
|
322 |
+
}
|
323 |
+
}
|
324 |
+
.breeze-box .br-menu > div:not(.br-mobile-menu) {
|
325 |
+
width: 100%;
|
326 |
+
display: -webkit-box;
|
327 |
+
display: -moz-box;
|
328 |
+
display: -ms-box;
|
329 |
+
display: box;
|
330 |
+
}
|
331 |
+
@media only screen and (max-width: 632px) {
|
332 |
+
.breeze-box .br-menu > div:not(.br-mobile-menu):not(.br-logo):not(.br-mobile-menu) {
|
333 |
+
display: none;
|
334 |
+
}
|
335 |
+
}
|
336 |
+
.breeze-box .br-logo {
|
337 |
+
background-image: url("../images/breez-logo200x46.png");
|
338 |
+
height: 70px;
|
339 |
+
background-repeat: no-repeat;
|
340 |
+
background-position: center center;
|
341 |
+
margin-bottom: 20px;
|
342 |
+
}
|
343 |
+
.breeze-box .br-link {
|
344 |
+
text-indent: 20px;
|
345 |
+
font-style: normal;
|
346 |
+
font-weight: bold;
|
347 |
+
font-size: 14px;
|
348 |
+
line-height: 62px;
|
349 |
+
/* identical to box height */
|
350 |
+
text-transform: uppercase;
|
351 |
+
color: #091E42;
|
352 |
+
border-bottom: 1px solid #D8D8D8;
|
353 |
+
cursor: pointer;
|
354 |
+
position: relative;
|
355 |
+
}
|
356 |
+
.breeze-box .br-link.br-hide {
|
357 |
+
display: none !important;
|
358 |
+
}
|
359 |
+
.breeze-box .br-link:hover {
|
360 |
+
background-color: #f3f2f2;
|
361 |
+
}
|
362 |
+
.breeze-box .br-link a {
|
363 |
+
color: #091E42;
|
364 |
+
text-decoration: none;
|
365 |
+
width: 100%;
|
366 |
+
display: block;
|
367 |
+
}
|
368 |
+
.breeze-box .br-link a:focus {
|
369 |
+
box-shadow: none;
|
370 |
+
}
|
371 |
+
.breeze-box .br-link.br-active {
|
372 |
+
background-color: #FFFFFF;
|
373 |
+
color: #11ACDF;
|
374 |
+
}
|
375 |
+
.breeze-box .br-link.br-active a {
|
376 |
+
background-color: #FFFFFF;
|
377 |
+
color: #11ACDF;
|
378 |
+
}
|
379 |
+
.breeze-box .br-link img {
|
380 |
+
margin-right: 15px;
|
381 |
+
vertical-align: middle;
|
382 |
+
height: auto;
|
383 |
+
display: inline-block;
|
384 |
+
width: 20px;
|
385 |
+
max-width: 20px;
|
386 |
+
}
|
387 |
+
.breeze-box .br-options {
|
388 |
+
position: relative;
|
389 |
+
-webkit-box-flex: 1;
|
390 |
+
-moz-box-flex: 1;
|
391 |
+
-webkit-flex-grow: 1;
|
392 |
+
-ms-flex: 1;
|
393 |
+
flex-grow: 1;
|
394 |
+
display: -webkit-inline-box;
|
395 |
+
display: -moz-inline-box;
|
396 |
+
display: -webkit-inline-flex;
|
397 |
+
display: -ms-inline-flexbox;
|
398 |
+
display: inline-flex;
|
399 |
+
background-color: #FFFFFF;
|
400 |
+
padding: 0 26px;
|
401 |
+
-webkit-box-direction: normal;
|
402 |
+
-webkit-box-orient: vertical;
|
403 |
+
-moz-box-direction: normal;
|
404 |
+
-moz-box-orient: vertical;
|
405 |
+
-webkit-flex-direction: column;
|
406 |
+
-ms-flex-direction: column;
|
407 |
+
flex-direction: column;
|
408 |
+
}
|
409 |
+
.breeze-box .br-options section {
|
410 |
+
width: 100%;
|
411 |
+
}
|
412 |
+
.breeze-box .br-options section .br-section-title {
|
413 |
+
border-bottom: 1px solid #D8D8D8;
|
414 |
+
color: #091E42;
|
415 |
+
font-weight: 600;
|
416 |
+
font-size: 24px;
|
417 |
+
font-size: 1.5rem;
|
418 |
+
line-height: 90px;
|
419 |
+
width: 100%;
|
420 |
+
}
|
421 |
+
.breeze-box .br-options section .br-section-title img {
|
422 |
+
margin-right: 15px;
|
423 |
+
vertical-align: middle;
|
424 |
+
-webkit-filter: opacity(1) drop-shadow(0 0 0 #11ACDF);
|
425 |
+
-moz-filter: opacity(1) drop-shadow(0 0 0 #11ACDF);
|
426 |
+
filter: opacity(1) drop-shadow(0 0 0 #11ACDF);
|
427 |
+
}
|
428 |
+
.breeze-box .br-options section .br-option-item {
|
429 |
+
display: -webkit-box;
|
430 |
+
display: -moz-box;
|
431 |
+
display: -ms-flexbox;
|
432 |
+
display: -webkit-flex;
|
433 |
+
display: flex;
|
434 |
+
margin: 22px 0;
|
435 |
+
border-bottom: 1px solid #D8D8D8;
|
436 |
+
}
|
437 |
+
@media only screen and (max-width: 900px) {
|
438 |
+
.breeze-box .br-options section .br-option-item {
|
439 |
+
-webkit-box-direction: normal;
|
440 |
+
-webkit-box-orient: vertical;
|
441 |
+
-moz-box-direction: normal;
|
442 |
+
-moz-box-orient: vertical;
|
443 |
+
-webkit-flex-direction: column;
|
444 |
+
-ms-flex-direction: column;
|
445 |
+
flex-direction: column;
|
446 |
+
}
|
447 |
+
}
|
448 |
+
.breeze-box .br-options section .br-option-item .br-label {
|
449 |
+
display: -webkit-inline-box;
|
450 |
+
display: -moz-inline-box;
|
451 |
+
display: -webkit-inline-flex;
|
452 |
+
display: -ms-inline-flexbox;
|
453 |
+
display: inline-flex;
|
454 |
+
-webkit-box-direction: normal;
|
455 |
+
-webkit-box-orient: horizontal;
|
456 |
+
-moz-box-direction: normal;
|
457 |
+
-moz-box-orient: horizontal;
|
458 |
+
-webkit-flex-direction: row;
|
459 |
+
-ms-flex-direction: row;
|
460 |
+
flex-direction: row;
|
461 |
+
width: 200px;
|
462 |
+
min-width: 200px;
|
463 |
+
font-weight: 500;
|
464 |
+
}
|
465 |
+
@media only screen and (max-width: 1164px) {
|
466 |
+
.breeze-box .br-options section .br-option-item .br-label {
|
467 |
+
max-width: 110px;
|
468 |
+
min-width: 110px;
|
469 |
+
}
|
470 |
+
}
|
471 |
+
@media only screen and (max-width: 900px) {
|
472 |
+
.breeze-box .br-options section .br-option-item .br-label {
|
473 |
+
max-width: 100%;
|
474 |
+
min-width: 100%;
|
475 |
+
padding-bottom: 10px;
|
476 |
+
}
|
477 |
+
}
|
478 |
+
.breeze-box .br-options section .br-option-item .br-label .br-option-text {
|
479 |
+
font-style: normal;
|
480 |
+
font-weight: 600;
|
481 |
+
font-size: 16px;
|
482 |
+
line-height: 19px;
|
483 |
+
color: #091E42;
|
484 |
+
margin-top: 7px;
|
485 |
+
}
|
486 |
+
.breeze-box .br-options section .br-option-item .br-option {
|
487 |
+
-webkit-box-flex: 1;
|
488 |
+
-moz-box-flex: 1;
|
489 |
+
-webkit-flex-grow: 1;
|
490 |
+
-ms-flex: 1;
|
491 |
+
flex-grow: 1;
|
492 |
+
display: -webkit-inline-box;
|
493 |
+
display: -moz-inline-box;
|
494 |
+
display: -webkit-inline-flex;
|
495 |
+
display: -ms-inline-flexbox;
|
496 |
+
display: inline-flex;
|
497 |
+
padding-left: 40px;
|
498 |
+
-webkit-box-direction: normal;
|
499 |
+
-webkit-box-orient: vertical;
|
500 |
+
-moz-box-direction: normal;
|
501 |
+
-moz-box-orient: vertical;
|
502 |
+
-webkit-flex-direction: column;
|
503 |
+
-ms-flex-direction: column;
|
504 |
+
flex-direction: column;
|
505 |
+
padding-right: 20px;
|
506 |
+
}
|
507 |
+
@media only screen and (max-width: 900px) {
|
508 |
+
.breeze-box .br-options section .br-option-item .br-option {
|
509 |
+
padding-left: 0;
|
510 |
+
}
|
511 |
+
}
|
512 |
+
.breeze-box .br-options section .br-option-item .br-option textarea {
|
513 |
+
border: solid 1px #D8D8D8;
|
514 |
+
width: 100%;
|
515 |
+
}
|
516 |
+
.breeze-box .br-options section .br-option-item .br-note {
|
517 |
+
display: block;
|
518 |
+
margin-top: 13px;
|
519 |
+
}
|
520 |
+
.breeze-box .br-options section .br-option-item .br-note-no-margin {
|
521 |
+
margin-top: 0;
|
522 |
+
}
|
523 |
+
.breeze-box .br-options section .br-option-item p:not(.br-important) {
|
524 |
+
color: #42526E;
|
525 |
+
}
|
526 |
+
.breeze-box .br-options section .br-option-item p {
|
527 |
+
font-size: 14px;
|
528 |
+
}
|
529 |
+
.breeze-box .br-options section .br-option-group {
|
530 |
+
margin-top: 20px;
|
531 |
+
padding: 20px 0;
|
532 |
+
}
|
533 |
+
.breeze-box .br-options section .br-option-group .section-title {
|
534 |
+
font-style: normal;
|
535 |
+
font-weight: 600;
|
536 |
+
font-size: 22px;
|
537 |
+
line-height: 27px;
|
538 |
+
/* identical to box height */
|
539 |
+
color: #091E42;
|
540 |
+
}
|
541 |
+
.breeze-box .br-options section .br-option-group .br-option-item {
|
542 |
+
background-color: #FCFCFD;
|
543 |
+
margin: 0;
|
544 |
+
padding: 22px 0 22px 22px;
|
545 |
+
border-left: solid 1px #D8D8D8;
|
546 |
+
border-right: solid 1px #D8D8D8;
|
547 |
+
}
|
548 |
+
.breeze-box .br-options section .br-option-group .br-top {
|
549 |
+
border-top: solid 1px #D8D8D8;
|
550 |
+
margin-top: 10px;
|
551 |
+
}
|
552 |
+
.breeze-box .br-options .br-submit {
|
553 |
+
margin: 20px 0 40px 0;
|
554 |
+
}
|
555 |
+
.breeze-box .br-options .br-submit input {
|
556 |
+
width: 123px;
|
557 |
+
height: 35px;
|
558 |
+
background: #11ACDF;
|
559 |
+
border-radius: 4px;
|
560 |
+
border: 1px solid #11ACDF;
|
561 |
+
color: #FFFFFF;
|
562 |
+
}
|
563 |
+
.breeze-box .simple-btn {
|
564 |
+
width: 123px;
|
565 |
+
height: 35px;
|
566 |
+
line-height: 35px;
|
567 |
+
background: #11ACDF;
|
568 |
+
border-radius: 4px;
|
569 |
+
border: 1px solid #11ACDF;
|
570 |
+
color: #FFFFFF;
|
571 |
+
text-align: center;
|
572 |
+
text-decoration: none;
|
573 |
+
cursor: pointer;
|
574 |
+
}
|
575 |
+
.breeze-box .simple-btn[disabled] {
|
576 |
+
background: #97d7ed;
|
577 |
+
border: 1px solid #97d7ed;
|
578 |
+
}
|
579 |
+
.breeze-box .cta-cleanall {
|
580 |
+
margin-left: 10px;
|
581 |
+
}
|
582 |
+
.breeze-box .br-blue-button {
|
583 |
+
display: inline-block;
|
584 |
+
text-decoration: none;
|
585 |
+
font-size: 13px;
|
586 |
+
line-height: 2.7;
|
587 |
+
min-height: 30px;
|
588 |
+
margin: 0;
|
589 |
+
padding: 0 10px;
|
590 |
+
cursor: pointer;
|
591 |
+
border-width: 1px;
|
592 |
+
border-style: solid;
|
593 |
+
-webkit-appearance: none;
|
594 |
+
border-radius: 3px;
|
595 |
+
white-space: nowrap;
|
596 |
+
box-sizing: border-box;
|
597 |
+
background: #11ACDF;
|
598 |
+
border-color: #11ACDF;
|
599 |
+
color: #fff;
|
600 |
+
text-decoration: none;
|
601 |
+
text-shadow: none;
|
602 |
+
width: fit-content;
|
603 |
+
}
|
604 |
+
.breeze-box .br-blue-button[disabled] {
|
605 |
+
background: #97d7ed;
|
606 |
+
border: 1px solid #97d7ed;
|
607 |
+
}
|
608 |
+
.breeze-box .br-blue-button-reverse {
|
609 |
+
display: inline-block;
|
610 |
+
text-decoration: none;
|
611 |
+
font-size: 13px;
|
612 |
+
line-height: 2.7;
|
613 |
+
min-height: 30px;
|
614 |
+
margin: 0;
|
615 |
+
padding: 0 10px;
|
616 |
+
cursor: pointer;
|
617 |
+
border-width: 1px;
|
618 |
+
border-style: solid;
|
619 |
+
-webkit-appearance: none;
|
620 |
+
border-radius: 3px;
|
621 |
+
white-space: nowrap;
|
622 |
+
box-sizing: border-box;
|
623 |
+
background: #FCFCFD;
|
624 |
+
border-color: #11ACDF;
|
625 |
+
color: #11ACDF;
|
626 |
+
text-decoration: none;
|
627 |
+
text-shadow: none;
|
628 |
+
width: fit-content;
|
629 |
+
font-weight: 600;
|
630 |
+
}
|
631 |
+
.breeze-box #file-selected {
|
632 |
+
color: darkgreen;
|
633 |
+
}
|
634 |
+
.breeze-box #faq-content {
|
635 |
+
margin: 20px;
|
636 |
+
width: 100%;
|
637 |
+
}
|
638 |
+
.breeze-box .faq-block {
|
639 |
+
border-bottom: 1px solid;
|
640 |
+
border-color: #eee transparent;
|
641 |
+
padding-bottom: 10px;
|
642 |
+
}
|
643 |
+
.breeze-box .faq-question {
|
644 |
+
cursor: pointer;
|
645 |
+
margin: 0;
|
646 |
+
padding: 1em 0;
|
647 |
+
}
|
648 |
+
.breeze-box .faq-question:focus {
|
649 |
+
outline: none;
|
650 |
+
}
|
651 |
+
.breeze-box .faq-answer * {
|
652 |
+
font-size: 14px;
|
653 |
+
}
|
654 |
+
.breeze-box #breeze_import_settings {
|
655 |
+
color: transparent;
|
656 |
+
width: 120px;
|
657 |
+
}
|
658 |
+
.breeze-box #breeze_import_settings::-webkit-file-upload-button {
|
659 |
+
visibility: hidden;
|
660 |
+
}
|
661 |
+
.breeze-box .br-input-container {
|
662 |
+
display: flex;
|
663 |
+
width: 100%;
|
664 |
+
}
|
665 |
+
.breeze-box .br-input-item {
|
666 |
+
display: inline-block;
|
667 |
+
max-width: 140px;
|
668 |
+
}
|
669 |
+
.breeze-box #breeze_import_settings::before {
|
670 |
+
content: "Choose File";
|
671 |
+
display: inline-block;
|
672 |
+
background: #FCFCFD;
|
673 |
+
border: 1px solid #11ACDF;
|
674 |
+
border-radius: 3px;
|
675 |
+
padding: 10px 20px;
|
676 |
+
outline: none;
|
677 |
+
white-space: nowrap;
|
678 |
+
-webkit-user-select: none;
|
679 |
+
cursor: pointer;
|
680 |
+
font-weight: 700;
|
681 |
+
font-size: 12px;
|
682 |
+
color: #11ACDF;
|
683 |
+
width: 64px;
|
684 |
+
height: 15px;
|
685 |
+
}
|
686 |
+
.breeze-box #breeze_import_settings {
|
687 |
+
display: none;
|
688 |
+
}
|
689 |
+
.breeze-box .br-label-for-file::before {
|
690 |
+
content: "Choose File";
|
691 |
+
display: inline-block;
|
692 |
+
background: #FCFCFD;
|
693 |
+
border: 1px solid #11ACDF;
|
694 |
+
border-radius: 3px;
|
695 |
+
padding: 10px 20px;
|
696 |
+
outline: none;
|
697 |
+
white-space: nowrap;
|
698 |
+
-webkit-user-select: none;
|
699 |
+
cursor: pointer;
|
700 |
+
font-weight: 700;
|
701 |
+
font-size: 12px;
|
702 |
+
color: #11ACDF;
|
703 |
+
width: 64px;
|
704 |
+
height: 15px;
|
705 |
+
}
|
706 |
+
.breeze-box #breeze_import_settings::file-selector-button {
|
707 |
+
visibility: hidden;
|
708 |
+
}
|
709 |
+
.breeze-box .br-space {
|
710 |
+
clear: both;
|
711 |
+
height: 20px;
|
712 |
+
display: block;
|
713 |
+
}
|
714 |
+
.breeze-box .br-file-text {
|
715 |
+
display: inline-block;
|
716 |
+
max-width: 120px;
|
717 |
+
width: 120px;
|
718 |
+
margin-top: 12px;
|
719 |
+
font-size: 12px;
|
720 |
+
font-weight: 600;
|
721 |
+
color: #42526E;
|
722 |
+
margin-left: 30px;
|
723 |
+
}
|
724 |
+
.breeze-box #breeze_import_settings:hover::before {
|
725 |
+
border-color: black;
|
726 |
+
}
|
727 |
+
.breeze-box #breeze_import_settings:active {
|
728 |
+
outline: 0;
|
729 |
+
}
|
730 |
+
.breeze-box #breeze_import_settings:active::before {
|
731 |
+
background: -webkit-linear-gradient(top, #e3e3e3, #f9f9f9);
|
732 |
+
}
|
733 |
+
.breeze-box .breeze-list-url .breeze-input-group {
|
734 |
+
white-space: nowrap;
|
735 |
+
}
|
736 |
+
.breeze-box .breeze-input-group .breeze-input-url {
|
737 |
+
width: 80%;
|
738 |
+
margin-bottom: 5px;
|
739 |
+
}
|
740 |
+
@media only screen and (max-width: 632px) {
|
741 |
+
.breeze-box .breeze-input-group .breeze-input-url {
|
742 |
+
width: 80%;
|
743 |
+
}
|
744 |
+
}
|
745 |
+
.breeze-box .breeze-input-group span {
|
746 |
+
vertical-align: sub;
|
747 |
+
cursor: pointer;
|
748 |
+
color: gray;
|
749 |
+
}
|
750 |
+
.breeze-box .breeze-input-group span.sort-handle {
|
751 |
+
cursor: move;
|
752 |
+
}
|
753 |
+
.breeze-box .breeze-input-group span.sort-handle span.moveUp:before,
|
754 |
+
.breeze-box .breeze-input-group span.sort-handle span.moveDown:before {
|
755 |
+
font-size: 30px;
|
756 |
+
margin-left: -7px;
|
757 |
+
}
|
758 |
+
.breeze-box .br-db-boxes {
|
759 |
+
display: grid;
|
760 |
+
margin-top: 40px;
|
761 |
+
margin-bottom: 20px;
|
762 |
+
grid-template-columns: repeat(auto-fill, minmax(33%, 1fr));
|
763 |
+
}
|
764 |
+
@media only screen and (max-width: 1164px) {
|
765 |
+
.breeze-box .br-db-boxes {
|
766 |
+
grid-template-columns: repeat(auto-fill, minmax(50%, 1fr));
|
767 |
+
}
|
768 |
+
}
|
769 |
+
@media only screen and (max-width: 720px) {
|
770 |
+
.breeze-box .br-db-boxes {
|
771 |
+
grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
|
772 |
+
}
|
773 |
+
}
|
774 |
+
.breeze-box .br-db-boxes > * {
|
775 |
+
border: solid 2px #D8D8D8;
|
776 |
+
background-color: #F4F3F9;
|
777 |
+
border-radius: 5px;
|
778 |
+
padding: 15px;
|
779 |
+
margin: 10px;
|
780 |
+
}
|
781 |
+
.breeze-box span.br-has {
|
782 |
+
color: #FF5656;
|
783 |
+
font-weight: bold;
|
784 |
+
}
|
785 |
+
.breeze-box .br-db-item {
|
786 |
+
color: #091E42;
|
787 |
+
cursor: pointer;
|
788 |
+
}
|
789 |
+
.breeze-box .br-db-item h3 {
|
790 |
+
font-weight: 600;
|
791 |
+
margin-top: 8px;
|
792 |
+
margin-bottom: 8px;
|
793 |
+
}
|
794 |
+
@media only screen and (max-width: 1164px) {
|
795 |
+
.breeze-box .br-db-item h3 {
|
796 |
+
font-size: 100%;
|
797 |
+
}
|
798 |
+
}
|
799 |
+
.breeze-box .br-db-item a {
|
800 |
+
color: #11ACDF;
|
801 |
+
text-decoration: none;
|
802 |
+
font-size: 14px;
|
803 |
+
position: relative;
|
804 |
+
font-weight: 600;
|
805 |
+
}
|
806 |
+
.breeze-box .br-db-item a:after {
|
807 |
+
border-top: solid 1px #11ACDF;
|
808 |
+
position: absolute;
|
809 |
+
content: " ";
|
810 |
+
width: 100%;
|
811 |
+
left: 0;
|
812 |
+
top: 100%;
|
813 |
+
}
|
814 |
+
.breeze-box .br-db-item .opac {
|
815 |
+
opacity: 0.5;
|
816 |
+
filter: alpha(opacity=0.5);
|
817 |
+
}
|
818 |
+
.breeze-box .br-db-item img {
|
819 |
+
max-width: 40px;
|
820 |
+
}
|
821 |
+
.breeze-box .br-db-selected {
|
822 |
+
border: solid 2px #11ACDF;
|
823 |
+
}
|
824 |
+
.breeze-box #optimize-selected-services {
|
825 |
+
display: none;
|
826 |
+
}
|
827 |
+
.breeze-box .br-submit-save {
|
828 |
+
cursor: pointer;
|
829 |
+
pointer-events: all;
|
830 |
+
}
|
831 |
+
.breeze-box .ui-accordion-header:after {
|
832 |
+
font-family: dashicons;
|
833 |
+
content: "\f347";
|
834 |
+
float: right;
|
835 |
+
}
|
836 |
+
.breeze-box .ui-accordion-header[aria-expanded=true]:after {
|
837 |
+
content: "\f343";
|
838 |
+
}
|
839 |
+
.breeze-box .br-overlay-disable {
|
840 |
+
position: absolute;
|
841 |
+
background-color: #000000ad;
|
842 |
+
width: 100%;
|
843 |
+
height: auto;
|
844 |
+
z-index: 9999;
|
845 |
+
left: 0;
|
846 |
+
right: 0;
|
847 |
+
top: 0;
|
848 |
+
bottom: 0;
|
849 |
+
margin: auto;
|
850 |
+
color: white;
|
851 |
+
vertical-align: middle;
|
852 |
+
font-size: 20px;
|
853 |
+
text-align: center;
|
854 |
+
padding-top: 25%;
|
855 |
+
font-weight: 600;
|
856 |
+
-webkit-font-smoothing: antialiased;
|
857 |
+
}
|
858 |
+
.breeze-box input[name=cache-ttl] {
|
859 |
+
width: 170px;
|
860 |
+
}
|
861 |
+
.breeze-box .br-notice {
|
862 |
+
color: #ff0000 !important;
|
863 |
+
}
|
864 |
+
.breeze-box p.br-important {
|
865 |
+
color: #ef6813;
|
866 |
+
}
|
867 |
+
.breeze-box .br-subtitle {
|
868 |
+
font-size: 16px;
|
869 |
+
}
|
870 |
+
.breeze-box .is-invalid-url {
|
871 |
+
border: solid 2px orangered;
|
872 |
+
}
|
873 |
+
.breeze-box input[type=text] {
|
874 |
+
width: 80%;
|
875 |
+
border: 1px solid rgba(119, 131, 151, 0.4);
|
876 |
+
box-sizing: border-box;
|
877 |
+
border-radius: 4px;
|
878 |
+
height: 40px;
|
879 |
+
color: #42526E;
|
880 |
+
font-size: 14px;
|
881 |
+
line-height: 17px;
|
882 |
+
}
|
883 |
+
|
884 |
+
/* <--- END MAIN */
|
885 |
+
span.br-important {
|
886 |
+
color: #ef6813;
|
887 |
+
}
|
888 |
+
|
889 |
+
.br-global-text-settings {
|
890 |
+
font-size: 14px;
|
891 |
+
}
|
892 |
+
|
893 |
+
.br-show {
|
894 |
+
display: inline-block;
|
895 |
+
}
|
896 |
+
|
897 |
+
.br-hide {
|
898 |
+
display: none;
|
899 |
+
}
|
900 |
+
|
901 |
+
.br-inherit-wait {
|
902 |
+
position: absolute;
|
903 |
+
background-color: #000000ad;
|
904 |
+
width: 100%;
|
905 |
+
height: auto;
|
906 |
+
z-index: 9999;
|
907 |
+
left: 0;
|
908 |
+
right: 0;
|
909 |
+
top: 0;
|
910 |
+
bottom: 0;
|
911 |
+
margin: auto;
|
912 |
+
color: white;
|
913 |
+
vertical-align: middle;
|
914 |
+
font-size: 20px;
|
915 |
+
text-align: center;
|
916 |
+
padding-top: 25%;
|
917 |
+
font-weight: 600;
|
918 |
+
-webkit-font-smoothing: antialiased;
|
919 |
+
}
|
920 |
+
|
921 |
+
.br-mobile-menu {
|
922 |
+
display: none;
|
923 |
+
}
|
924 |
+
@media only screen and (max-width: 632px) {
|
925 |
+
.br-mobile-menu {
|
926 |
+
display: block;
|
927 |
+
width: 97.5%;
|
928 |
+
font-size: 20px;
|
929 |
+
padding: 20px 0 20px 10px;
|
930 |
+
background-color: white;
|
931 |
+
border-bottom: solid 1px #D8D8D8;
|
932 |
+
margin-bottom: 10px;
|
933 |
+
}
|
934 |
+
}
|
935 |
+
|
936 |
+
/*# sourceMappingURL=breeze-admin.css.map */
|
assets/css/breeze-admin.css.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"sourceRoot":"","sources":["file:///Users/mihaiirodiu/Local-Lightning/wp56subfolders/app/public/wp-content/plugins/breeze/grunt-assets/files_scss/breeze-admin.scss","file:///Users/mihaiirodiu/Local-Lightning/wp56subfolders/app/public/wp-content/plugins/breeze/grunt-assets/files_scss/_mixins.scss","file:///Users/mihaiirodiu/Local-Lightning/wp56subfolders/app/public/wp-content/plugins/breeze/grunt-assets/files_scss/_checkbox.scss","file:///Users/mihaiirodiu/Local-Lightning/wp56subfolders/app/public/wp-content/plugins/breeze/grunt-assets/files_scss/_loading-spinner.scss","file:///Users/mihaiirodiu/Local-Lightning/wp56subfolders/app/public/wp-content/plugins/breeze/grunt-assets/node_modules/compass-mixins/lib/compass/css3/_shared.scss","file:///Users/mihaiirodiu/Local-Lightning/wp56subfolders/app/public/wp-content/plugins/breeze/grunt-assets/node_modules/compass-mixins/lib/compass/css3/_filter.scss"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;ACSA;AAAA;AAAA;AAUA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAkBA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAoCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AChFA;EACE;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;;AD0YF;EC/YA;IAOI;IACA;;;AAIJ;EACE;;AAGA;EACE;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EAEE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAIF;EACE;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;;AAMN;EACE;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAKJ;EACE;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AC1HR;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AFoYA;EE7YF;IAWI;;;;AAIF;EACE;EACA;EACA;EACA;;;AAKF;EACE;EACA;EACA;EACA;;;AAKF;EACE;EACA;EACA;EACA;;;AAKF;EACE;EACA;EACA;EACA;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;IACE;;EAEF;IACE;;;AAIJ;EACE;IACE;;EAEF;IACE;;;AAIJ;EACE;IACE;;EAEF;IACE;;;AH1FJ;EACE;;;AAGF;EACE;EACA;;;AAGF;ECiJE;EACA;EACA;EACA;EACA;EDnJA;ECgBA,WDfmB;ECgBnB;EAuLE;EACA;EACA;EACA;EAEF,wBD3MwB;EC4MxB,oBD5MwB;EC6MxB,gBD7MwB;EACxB;EACA;AAKA;AAAA;AAAA;AA0FA;AAAA;AAAA;;ACkRA;EDvXF;ICgMI;IACA;IACA;IACA;IAYF,wBDvM0B;ICwM1B,oBDxM0B;ICyM1B,gBDzM0B;IACxB;;;AAKF;EACE;EACA;EC0IF;EACA;EACA;EACA;EACA;EAkCE;EACA;EACA;EACA;EAYF,wBDtL0B;ECuL1B,oBDvL0B;ECwL1B,gBDxL0B;;AC6U1B;EDxVA;IAII;;;ACqWJ;EDzWA;IAOI;;;AAOJ;EACE;EIrBqD;EAEA;EACA;EAEA;;AH0WvD;EDvVE;IAEI;;;AAMN;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;AACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;;AAEA;EACE;;AAIJ;EACE;EACA;;AAEA;EACE;EACA;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;;AAQJ;EACE;ECkJF,kBDjJqB;ECkJrB,eDlJqB;ECmJrB,mBDnJqB;ECoJrB,UDpJqB;ECqJrB,WDrJqB;ECgDrB;EACA;EACA;EACA;EACA;EDlDE;EACA;ECmFA;EACA;EACA;EACA;EAYF,wBDjG0B;ECkG1B,oBDlG0B;ECmG1B,gBDnG0B;;AAExB;EACE;;AAEA;EACE;EACA;EACA;ECpGN,WDqGyB;ECpGzB;EDqGM;EACA;;AAEA;EACE;EACA;EItI+C,gBCI7C;EDFgD,aCEhD;EDCqD,QCDrD;;ALwIN;ECcJ;EACA;EACA;EACA;EACA;EDhBM;EACA;;AC4ON;ED/OI;IC6DF;IACA;IACA;IACA;IAYF,wBDvEgC;ICwEhC,oBDxEgC;ICyEhC,gBDzEgC;;;AAG1B;ECeN;EACA;EACA;EACA;EACA;EA4CE;EACA;EACA;EACA;EAEF,wBDlEgC;ECmEhC,oBDnEgC;ECoEhC,gBDpEgC;EACxB;EACA;EACA;;AC4NR;EDjOM;IAOI;IACA;;;AC+NV;EDvOM;IAYI;IACA;IACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAIJ;ECqFN,kBDpF2B;ECqF3B,eDrF2B;ECsF3B,mBDtF2B;ECuF3B,UDvF2B;ECwF3B,WDxF2B;ECb3B;EACA;EACA;EACA;EACA;EDWQ;ECuBN;EACA;EACA;EACA;EAYF,wBDrCgC;ECsChC,oBDtCgC;ECuChC,gBDvCgC;EACxB;;ACuMR;ED5MM;IAOI;;;AAGF;EACE;EACA;;AAIJ;EACE;EACA;;AAGF;EACE;;AAGF;EACE;;AAEF;EACE;;AAIJ;EACE;EACA;;AAEA;EACE;EACA;EACA;EACA;AACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAIF;EACE;EACA;;AAUN;EACE;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AASN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;;AAGF;EACE;;AASF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAGF;EACE;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;AAIF;EACE;EACA;;AAGF;EACE;;AAGF;EACE;EACA;;AAEF;EACE;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;AAGF;EACE;;AAIF;EACE;;AAGF;EACE;EACA;;ACrFF;EDmFA;IAII;;;AAIJ;EACE;EACA;EACA;;AAGF;EACE;;AAGF;AAAA;EAEE;EACA;;AAGF;EACE;EACA;EACA;EACA;;AC1HF;EDsHA;IAMI;;;ACrGJ;ED+FA;IASI;;;AAIJ;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;AAEA;EACE;EACA;EACA;;ACvJJ;EDoJE;IAKI;;;AAIJ;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAIJ;EACE;EACA;;AAGF;EACE;;AAIJ;EACE;;AAGF;EACE;;AAGF;EACE;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAIF;EACE;;AAGF;EACE;;AAGF;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;AAEF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;;AC9RA;ED6RF;IAGI;IACA;IACA;IACA;IACA;IACA;IACA","file":"breeze-admin.css"}
|
assets/css/breeze-fonts.css
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@font-face {
|
2 |
+
font-family: "Proxima Nova";
|
3 |
+
src: url("../fonts/proximanova-black-webfont.woff2") format("woff2"), url("../fonts/proximanova-black-webfont.woff") format("woff");
|
4 |
+
font-weight: normal;
|
5 |
+
font-style: normal;
|
6 |
+
}
|
7 |
+
@font-face {
|
8 |
+
font-family: "Proxima Nova";
|
9 |
+
src: url("../fonts/proximanova-bold-webfont.woff2") format("woff2"), url("../fonts/proximanova-bold-webfont.woff") format("woff");
|
10 |
+
font-weight: bold;
|
11 |
+
font-style: normal;
|
12 |
+
}
|
13 |
+
@font-face {
|
14 |
+
font-family: "Proxima Nova";
|
15 |
+
src: url("../fonts/proximanova-extrabold-webfont.woff2") format("woff2"), url("../fonts/proximanova-extrabold-webfont.woff") format("woff");
|
16 |
+
font-weight: bolder;
|
17 |
+
font-style: normal;
|
18 |
+
}
|
19 |
+
@font-face {
|
20 |
+
font-family: "Proxima Nova";
|
21 |
+
src: url("../fonts/proximanova-light-webfont.woff2") format("woff2"), url("../fonts/proximanova-light-webfont.woff") format("woff");
|
22 |
+
font-weight: 200;
|
23 |
+
font-style: normal;
|
24 |
+
}
|
25 |
+
@font-face {
|
26 |
+
font-family: "Proxima Nova";
|
27 |
+
src: url("../fonts/proximanova-lightitalic-webfont.woff2") format("woff2"), url("../fonts/proximanova-lightitalic-webfont.woff") format("woff");
|
28 |
+
font-weight: 200;
|
29 |
+
font-style: italic;
|
30 |
+
}
|
31 |
+
@font-face {
|
32 |
+
font-family: "Proxima Nova";
|
33 |
+
src: url("../fonts/proximanova-regular-webfont.woff2") format("woff2"), url("../fonts/proximanova-regular-webfont.woff") format("woff");
|
34 |
+
font-weight: 400;
|
35 |
+
font-style: normal;
|
36 |
+
}
|
37 |
+
@font-face {
|
38 |
+
font-family: "Proxima Nova";
|
39 |
+
src: url("../fonts/proximanova-regularitalic-webfont.woff2") format("woff2"), url("../fonts/proximanova-regularitalic-webfont.woff") format("woff");
|
40 |
+
font-weight: normal;
|
41 |
+
font-style: italic;
|
42 |
+
}
|
43 |
+
@font-face {
|
44 |
+
font-family: "Proxima Nova";
|
45 |
+
src: url("../fonts/proximanova-semibold-webfont.woff2") format("woff2"), url("../fonts/proximanova-semibold-webfont.woff") format("woff");
|
46 |
+
font-weight: 700;
|
47 |
+
font-style: normal;
|
48 |
+
}
|
49 |
+
@font-face {
|
50 |
+
font-family: "Proxima Nova";
|
51 |
+
src: url("../fonts/proximanova-semibolditalic-webfont.woff2") format("woff2"), url("../fonts/proximanova-semibolditalic-webfont.woff") format("woff");
|
52 |
+
font-weight: 700;
|
53 |
+
font-style: italic;
|
54 |
+
}
|
55 |
+
|
56 |
+
/*# sourceMappingURL=breeze-fonts.css.map */
|
assets/css/breeze-fonts.css.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"sourceRoot":"","sources":["file:///Users/mihaiirodiu/Local-Lightning/wp56subfolders/app/public/wp-content/plugins/breeze/grunt-assets/files_scss/breeze-fonts.scss"],"names":[],"mappings":"AACA;EACE;EACA;EAEA;EACA;;AAIF;EACE;EACA;EAEA;EACA;;AAIF;EACE;EACA;EAEA;EACA;;AAIF;EACE;EACA;EAEA;EACA;;AAIF;EACE;EACA;EAEA;EACA;;AAIF;EACE;EACA;EAEA;EACA;;AAGF;EACE;EACA;EAEA;EACA;;AAGF;EACE;EACA;EAEA;EACA;;AAIF;EACE;EACA;EAEA;EACA","file":"breeze-fonts.css"}
|
assets/css/notice.css
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
#breeze-plugins-notice {
|
2 |
-
/*padding: 10px 12px;*/
|
3 |
-
}
|
4 |
-
|
5 |
-
#breeze-plugins-notice .button,
|
6 |
-
#breeze-plugins-notice .button:hover {
|
7 |
-
text-decoration: none;
|
8 |
-
line-height: 20px;
|
9 |
-
height: 18px;
|
10 |
-
transform: scale(0.9);
|
11 |
-
}
|
12 |
-
|
13 |
-
#breeze-plugins-notice li {
|
14 |
-
line-height: 18px;
|
15 |
-
}
|
16 |
-
|
17 |
-
#breeze-plugins-notice .text-error {
|
18 |
-
color: #dc3232;
|
19 |
-
}
|
20 |
-
|
21 |
-
#breeze-plugins-notice ul{
|
22 |
-
list-style: disc;
|
23 |
-
padding-left: 10px;
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/style.css
DELETED
@@ -1,372 +0,0 @@
|
|
1 |
-
.breeze-input-group .blur {
|
2 |
-
opacity: 0.5;
|
3 |
-
cursor: not-allowed;
|
4 |
-
}
|
5 |
-
|
6 |
-
.breeze-notice {
|
7 |
-
background-color: #FFF;
|
8 |
-
padding: 10px;
|
9 |
-
margin: 15px 0 15px 0;
|
10 |
-
border: 1px solid #CCC;
|
11 |
-
}
|
12 |
-
|
13 |
-
.breeze-header {
|
14 |
-
width: 200px;
|
15 |
-
}
|
16 |
-
|
17 |
-
.breeze-header .breeze-logo {
|
18 |
-
background-image: url("../images/breez-logo200x46.png");
|
19 |
-
height: 70px;
|
20 |
-
background-repeat: no-repeat;
|
21 |
-
}
|
22 |
-
|
23 |
-
.breeze-header a {
|
24 |
-
text-decoration: none;
|
25 |
-
color: #000;
|
26 |
-
}
|
27 |
-
|
28 |
-
#breeze-inherit-settings-toggle .radio-field {
|
29 |
-
margin-bottom: 20px;
|
30 |
-
}
|
31 |
-
#breeze-inherit-settings-toggle .radio-field input,
|
32 |
-
#breeze-inherit-settings-toggle .radio-field strong {
|
33 |
-
vertical-align: bottom;
|
34 |
-
}
|
35 |
-
#breeze-inherit-settings-toggle.loading .radio-field {
|
36 |
-
opacity: 0.4;
|
37 |
-
pointer-events: none;
|
38 |
-
}
|
39 |
-
#breeze-inherit-settings-toggle label {
|
40 |
-
display: block;
|
41 |
-
margin-bottom: 5px;
|
42 |
-
}
|
43 |
-
#breeze-inherit-settings-toggle .radio-field strong {
|
44 |
-
font-weight: 500;
|
45 |
-
}
|
46 |
-
#breeze-inherit-settings-toggle .radio-field.active strong:after {
|
47 |
-
content: ' [ACTIVE]';
|
48 |
-
font-weight: bold;
|
49 |
-
}
|
50 |
-
#breeze-inherit-settings-toggle small {
|
51 |
-
display: block;
|
52 |
-
font-size: inherit;
|
53 |
-
margin-left: 24px;
|
54 |
-
max-width: 804px;
|
55 |
-
}
|
56 |
-
#breeze-inherit-settings-toggle p.disclaimer {
|
57 |
-
display: none;
|
58 |
-
color: #ff0000;
|
59 |
-
}
|
60 |
-
|
61 |
-
#breeze-tabs.tabs-hidden .nav-tab.inactive,
|
62 |
-
#breeze-tabs.tabs-hidden .nav-tab.inactive:not(.active):hover {
|
63 |
-
color: #888;
|
64 |
-
background: #f4f4f4;
|
65 |
-
}
|
66 |
-
|
67 |
-
#breeze-tabs-content.tabs-hidden .tab-pane.inactive,
|
68 |
-
#breeze-tabs-content.tabs-hidden .tab-pane.inactive .tab-child {
|
69 |
-
min-height: 180px;
|
70 |
-
position: relative;
|
71 |
-
}
|
72 |
-
#breeze-tabs-content.tabs-hidden .tab-pane.inactive .tab-child:after {
|
73 |
-
content: '';
|
74 |
-
position: absolute;
|
75 |
-
top: 0;
|
76 |
-
left: 0;
|
77 |
-
right: 0;
|
78 |
-
bottom: 0;
|
79 |
-
background-color: #fff;
|
80 |
-
background-color: rgba( 255, 255, 255, 0.95 );
|
81 |
-
}
|
82 |
-
#breeze-tabs-content .tab-pane .hidden-text {
|
83 |
-
display: none;
|
84 |
-
}
|
85 |
-
#breeze-tabs-content.tabs-hidden .tab-pane.inactive .hidden-text {
|
86 |
-
position: absolute;
|
87 |
-
top: 100px;
|
88 |
-
left: 0;
|
89 |
-
right: 0;
|
90 |
-
text-align: center;
|
91 |
-
color: #ff0000;
|
92 |
-
display: block;
|
93 |
-
}
|
94 |
-
#tab-content-database .tab-child {
|
95 |
-
padding-bottom: 0;
|
96 |
-
}
|
97 |
-
#breeze-database-optimize {
|
98 |
-
margin-top: 5px;
|
99 |
-
}
|
100 |
-
#breeze-database-optimize[disabled] {
|
101 |
-
color: #fff !important;
|
102 |
-
border-color: #ddd !important;
|
103 |
-
background-color: #e0e0e0 !important;
|
104 |
-
text-shadow: none !important;
|
105 |
-
}
|
106 |
-
|
107 |
-
#breeze-tabs {
|
108 |
-
border-bottom: none;
|
109 |
-
}
|
110 |
-
|
111 |
-
#breeze-tabs .nav-tab.active {
|
112 |
-
background-color: #FFF;
|
113 |
-
color: #464646;
|
114 |
-
}
|
115 |
-
|
116 |
-
.tab-child {
|
117 |
-
overflow: hidden;
|
118 |
-
background: #fff;
|
119 |
-
border: 1px solid #CCC;
|
120 |
-
padding: 10px 10px 30px 10px
|
121 |
-
}
|
122 |
-
|
123 |
-
#breeze-tabs-content .tab-pane {
|
124 |
-
display: none;
|
125 |
-
float: left;
|
126 |
-
width: 80%;
|
127 |
-
}
|
128 |
-
|
129 |
-
#breeze-tabs-content .tab-pane.active {
|
130 |
-
display: block
|
131 |
-
}
|
132 |
-
|
133 |
-
.tab-content {
|
134 |
-
overflow: auto;
|
135 |
-
}
|
136 |
-
|
137 |
-
.tabs-below > .nav-tabs,
|
138 |
-
.tabs-right > .nav-tabs,
|
139 |
-
.tabs-left > .nav-tabs {
|
140 |
-
border-bottom: 0;
|
141 |
-
}
|
142 |
-
|
143 |
-
.tab-content > .tab-pane {
|
144 |
-
display: none;
|
145 |
-
}
|
146 |
-
|
147 |
-
.tab-content > .active {
|
148 |
-
display: block;
|
149 |
-
}
|
150 |
-
|
151 |
-
.breeze-form .multisite-inherit-disclaimer {
|
152 |
-
margin-top: 35px;
|
153 |
-
margin-bottom: 0;
|
154 |
-
color: #ff0000;
|
155 |
-
}
|
156 |
-
|
157 |
-
.breeze-form .multisite-inherit-disclaimer + .submit {
|
158 |
-
margin-top: 0;
|
159 |
-
}
|
160 |
-
|
161 |
-
.breeze-form .submit {
|
162 |
-
margin-top: 35px;
|
163 |
-
}
|
164 |
-
|
165 |
-
/*Table*/
|
166 |
-
#breeze-tabs-content table tr td:first-child {
|
167 |
-
width: 20%;
|
168 |
-
font-weight: bold;
|
169 |
-
}
|
170 |
-
|
171 |
-
#breeze-tabs-content table tr td.last-td {
|
172 |
-
font-weight: normal;
|
173 |
-
padding-top: 30px;
|
174 |
-
}
|
175 |
-
|
176 |
-
#breeze-tabs-content table tr td {
|
177 |
-
vertical-align: top;
|
178 |
-
padding: 3px;
|
179 |
-
}
|
180 |
-
|
181 |
-
#breeze-tabs-content table ul {
|
182 |
-
margin: 0;
|
183 |
-
}
|
184 |
-
|
185 |
-
#breeze-tabs-content table tr td label {
|
186 |
-
vertical-align: top;
|
187 |
-
}
|
188 |
-
|
189 |
-
#breeze-tabs-content table tr td.input-middle {
|
190 |
-
vertical-align: middle;
|
191 |
-
}
|
192 |
-
|
193 |
-
.breeze-top-notice {
|
194 |
-
margin: 10px 0 5px 0;
|
195 |
-
}
|
196 |
-
|
197 |
-
.breeze-top-notice p {
|
198 |
-
padding-left: 15px;
|
199 |
-
font-size: 15px;
|
200 |
-
font-weight: 400;
|
201 |
-
margin: 0;
|
202 |
-
}
|
203 |
-
|
204 |
-
.breeze_tool_tip {
|
205 |
-
vertical-align: middle !important;
|
206 |
-
}
|
207 |
-
|
208 |
-
.ui-accordion-header:after {
|
209 |
-
font-family: dashicons;
|
210 |
-
content: "\f347";
|
211 |
-
float: right;
|
212 |
-
}
|
213 |
-
|
214 |
-
.ui-accordion-header[aria-expanded='true']:after {
|
215 |
-
content: "\f343";
|
216 |
-
}
|
217 |
-
|
218 |
-
.tab-child textarea {
|
219 |
-
width: 95%;
|
220 |
-
max-width: 630px;
|
221 |
-
}
|
222 |
-
|
223 |
-
.breeze-list-url .breeze-input-group {
|
224 |
-
white-space: nowrap;
|
225 |
-
}
|
226 |
-
|
227 |
-
.breeze-input-group .breeze-input-url {
|
228 |
-
width: 85%;
|
229 |
-
max-width: 560px;
|
230 |
-
}
|
231 |
-
|
232 |
-
.breeze-input-group span {
|
233 |
-
vertical-align: text-bottom;
|
234 |
-
cursor: pointer;
|
235 |
-
}
|
236 |
-
|
237 |
-
.breeze-input-group span.sort-handle {
|
238 |
-
cursor: move;
|
239 |
-
}
|
240 |
-
|
241 |
-
.breeze-input-group span.sort-handle span.moveUp:before,
|
242 |
-
.breeze-input-group span.sort-handle span.moveDown:before {
|
243 |
-
font-size: 30px;
|
244 |
-
margin-left: -7px;
|
245 |
-
}
|
246 |
-
|
247 |
-
/*Style for FAQ tab*/
|
248 |
-
#breeze-tabs-content #tab-content-faq {
|
249 |
-
width: 100%;
|
250 |
-
}
|
251 |
-
|
252 |
-
#faq-content {
|
253 |
-
margin: 20px;
|
254 |
-
}
|
255 |
-
|
256 |
-
.faq-block {
|
257 |
-
border: 1px solid;
|
258 |
-
border-color: #eee transparent;
|
259 |
-
padding-bottom: 10px;
|
260 |
-
}
|
261 |
-
|
262 |
-
.faq-question {
|
263 |
-
cursor: pointer;
|
264 |
-
margin: 0;
|
265 |
-
padding: 1em 0;
|
266 |
-
}
|
267 |
-
|
268 |
-
.faq-question:focus {
|
269 |
-
outline: none;
|
270 |
-
}
|
271 |
-
|
272 |
-
.faq-answer * {
|
273 |
-
font-size: 14px;
|
274 |
-
}
|
275 |
-
|
276 |
-
/*Right-side content*/
|
277 |
-
#breeze-and-cloudways {
|
278 |
-
display: none;
|
279 |
-
float: left;
|
280 |
-
max-width: calc(20% - 20px);
|
281 |
-
margin-left: 20px;
|
282 |
-
}
|
283 |
-
|
284 |
-
#breeze-and-cloudways .rs-title {
|
285 |
-
padding: 0 5px 10px;
|
286 |
-
margin: 0;
|
287 |
-
border-bottom: 1px solid #11acdf;
|
288 |
-
color: #11acdf;
|
289 |
-
font-size: 20px;
|
290 |
-
line-height: 120%;
|
291 |
-
margin-bottom: 15px;
|
292 |
-
}
|
293 |
-
|
294 |
-
#breeze-and-cloudways .rs-content {
|
295 |
-
margin-bottom: 15px;
|
296 |
-
}
|
297 |
-
|
298 |
-
#breeze-and-cloudways .rs-content:not(:last-child) {
|
299 |
-
padding-bottom: 15px;
|
300 |
-
border-bottom: 1px solid #ccc;
|
301 |
-
}
|
302 |
-
|
303 |
-
#breeze-and-cloudways .rs-content p {
|
304 |
-
color: #000;
|
305 |
-
margin: 0 0 15px;
|
306 |
-
}
|
307 |
-
|
308 |
-
#breeze-and-cloudways .rs-content h4 {
|
309 |
-
margin: 0 0 5px;
|
310 |
-
color: #000;
|
311 |
-
}
|
312 |
-
|
313 |
-
#breeze-and-cloudways .rs-content ul {
|
314 |
-
list-style: disc;
|
315 |
-
margin: 15px 0 15px 20px;
|
316 |
-
color: #000;
|
317 |
-
font-weight: 500;
|
318 |
-
}
|
319 |
-
|
320 |
-
#breeze-and-cloudways .rs-content ul li {
|
321 |
-
margin-bottom: 10px;
|
322 |
-
}
|
323 |
-
|
324 |
-
#breeze-and-cloudways .rs-content button a {
|
325 |
-
color: #fff;
|
326 |
-
text-decoration: none;
|
327 |
-
}
|
328 |
-
|
329 |
-
.wp-core-ui .button-primary.focus, .wp-core-ui .button-primary.breeze-submit-btn:focus{
|
330 |
-
box-shadow:none;
|
331 |
-
}
|
332 |
-
|
333 |
-
#breeze_import_settings {
|
334 |
-
color: transparent;
|
335 |
-
width: 140px;
|
336 |
-
}
|
337 |
-
#breeze_import_settings::-webkit-file-upload-button {
|
338 |
-
visibility: hidden;
|
339 |
-
}
|
340 |
-
#breeze_import_settings::before {
|
341 |
-
content: 'Select JSON file';
|
342 |
-
color: black;
|
343 |
-
display: inline-block;
|
344 |
-
background: -webkit-linear-gradient(top, #f9f9f9, #e3e3e3);
|
345 |
-
border: 1px solid #999;
|
346 |
-
border-radius: 3px;
|
347 |
-
padding: 5px 8px;
|
348 |
-
outline: none;
|
349 |
-
white-space: nowrap;
|
350 |
-
-webkit-user-select: none;
|
351 |
-
cursor: pointer;
|
352 |
-
text-shadow: 1px 1px #fff;
|
353 |
-
font-weight: 700;
|
354 |
-
font-size: 10pt;
|
355 |
-
}
|
356 |
-
#breeze_import_settings:hover::before {
|
357 |
-
border-color: black;
|
358 |
-
}
|
359 |
-
#breeze_import_settings:active {
|
360 |
-
outline: 0;
|
361 |
-
}
|
362 |
-
#breeze_import_settings:active::before {
|
363 |
-
background: -webkit-linear-gradient(top, #e3e3e3, #f9f9f9);
|
364 |
-
}
|
365 |
-
|
366 |
-
.file_green{
|
367 |
-
color: darkgreen;
|
368 |
-
}
|
369 |
-
|
370 |
-
.file_red{
|
371 |
-
color:darkred;
|
372 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/topbar.css
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
#wp-admin-bar-breeze-topbar * {
|
2 |
-
cursor: pointer !important;
|
3 |
-
}
|
4 |
-
#wp-admin-bar-breeze-topbar *:hover {
|
5 |
-
color: #00b9eb !important;
|
6 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
assets/fonts/proximanova-black-webfont.woff
ADDED
Binary file
|
assets/fonts/proximanova-black-webfont.woff2
ADDED
Binary file
|
assets/fonts/proximanova-bold-webfont.woff
ADDED
Binary file
|
assets/fonts/proximanova-bold-webfont.woff2
ADDED
Binary file
|
assets/fonts/proximanova-extrabold-webfont.woff
ADDED
Binary file
|
assets/fonts/proximanova-extrabold-webfont.woff2
ADDED
Binary file
|
assets/fonts/proximanova-light-webfont.woff
ADDED
Binary file
|
assets/fonts/proximanova-light-webfont.woff2
ADDED
Binary file
|
assets/fonts/proximanova-lightitalic-webfont.woff
ADDED
Binary file
|
assets/fonts/proximanova-lightitalic-webfont.woff2
ADDED
Binary file
|
assets/fonts/proximanova-regular-webfont.woff
ADDED
Binary file
|
assets/fonts/proximanova-regular-webfont.woff2
ADDED
Binary file
|
assets/fonts/proximanova-regularitalic-webfont.woff
ADDED
Binary file
|
assets/fonts/proximanova-regularitalic-webfont.woff2
ADDED
Binary file
|
assets/fonts/proximanova-semibold-webfont.woff
ADDED
Binary file
|
assets/fonts/proximanova-semibold-webfont.woff2
ADDED
Binary file
|
assets/fonts/proximanova-semibolditalic-webfont.woff
ADDED
Binary file
|
assets/fonts/proximanova-semibolditalic-webfont.woff2
ADDED
Binary file
|
assets/images/advanced-active.png
ADDED
Binary file
|
assets/images/advanced.png
ADDED
Binary file
|
assets/images/all_transients.png
ADDED
Binary file
|
assets/images/auto_drafts.png
ADDED
Binary file
|
assets/images/basic-active.png
ADDED
Binary file
|
assets/images/basic.png
ADDED
Binary file
|
assets/images/cdn-active.png
ADDED
Binary file
|
assets/images/cdn.png
ADDED
Binary file
|
assets/images/clean_optimizer.png
ADDED
Binary file
|
assets/images/database-active.png
ADDED
Binary file
|
assets/images/database.png
ADDED
Binary file
|
assets/images/expired_transients.png
ADDED
Binary file
|
assets/images/faq-active.png
ADDED
Binary file
|
assets/images/faq.png
ADDED
Binary file
|
assets/images/faqs-active.png
ADDED
Binary file
|
assets/images/faqs.png
ADDED
Binary file
|
assets/images/file-active.png
ADDED
Binary file
|
assets/images/file.png
ADDED
Binary file
|
assets/images/optimize_tables.png
ADDED
Binary file
|
assets/images/post_revisions.png
ADDED
Binary file
|
assets/images/preload-active.png
ADDED
Binary file
|
assets/images/preload.png
ADDED
Binary file
|
assets/images/spam_comments.png
ADDED
Binary file
|
assets/images/tools-active.png
ADDED
Binary file
|
assets/images/tools.png
ADDED
Binary file
|
assets/images/trackbacks_pingbacks.png
ADDED
Binary file
|
assets/images/trashed_comments.png
ADDED
Binary file
|
assets/images/trashed_posts.png
ADDED
Binary file
|
assets/images/varnish-active.png
ADDED
Binary file
|
assets/images/varnish.png
ADDED
Binary file
|
assets/js/breeze-backend.js
DELETED
@@ -1,185 +0,0 @@
|
|
1 |
-
jQuery( document ).ready( function ( $ ) {
|
2 |
-
|
3 |
-
var $compatibility_warning = $( '#breeze-plugins-notice' );
|
4 |
-
if ( $compatibility_warning.length ) {
|
5 |
-
$( document ).on( 'click tap', '.notice-dismiss', function () {
|
6 |
-
$.ajax( {
|
7 |
-
type: "POST",
|
8 |
-
url: ajaxurl,
|
9 |
-
data: { action: "compatibility_warning_close", 'breeze_close_warning': '1' },
|
10 |
-
dataType: "json", // xml, html, script, json, jsonp, text
|
11 |
-
success: function ( data ) {
|
12 |
-
|
13 |
-
},
|
14 |
-
error: function ( jqXHR, textStatus, errorThrown ) {
|
15 |
-
|
16 |
-
},
|
17 |
-
// called when the request finishes (after success and error callbacks are executed)
|
18 |
-
complete: function ( jqXHR, textStatus ) {
|
19 |
-
|
20 |
-
}
|
21 |
-
} );
|
22 |
-
} );
|
23 |
-
}
|
24 |
-
|
25 |
-
// Topbar action
|
26 |
-
$( '#wp-admin-bar-breeze-purge-varnish-group' ).click( function () {
|
27 |
-
breeze_purgeVarnish_callAjax();
|
28 |
-
} );
|
29 |
-
$( '#wp-admin-bar-breeze-purge-file-group' ).click( function () {
|
30 |
-
breeze_purgeFile_callAjax();
|
31 |
-
} );
|
32 |
-
// Varnish clear button
|
33 |
-
$( '#purge-varnish-button' ).click( function () {
|
34 |
-
breeze_purgeVarnish_callAjax();
|
35 |
-
} );
|
36 |
-
|
37 |
-
//clear cache by button
|
38 |
-
function breeze_purgeVarnish_callAjax() {
|
39 |
-
$.ajax( {
|
40 |
-
url: ajaxurl,
|
41 |
-
dataType: 'json',
|
42 |
-
method: 'POST',
|
43 |
-
data: {
|
44 |
-
action: 'breeze_purge_varnish',
|
45 |
-
is_network: $( 'body' ).hasClass( 'network-admin' ),
|
46 |
-
security: breeze_token_name.breeze_purge_varnish
|
47 |
-
},
|
48 |
-
success: function ( res ) {
|
49 |
-
current = location.href;
|
50 |
-
if ( res.clear ) {
|
51 |
-
var div = '<div id="message" class="notice notice-success" style="margin-top:10px; margin-bottom:10px;padding: 10px;"><strong>Varnish Cache has been purged.</strong></div>';
|
52 |
-
//backend
|
53 |
-
$( "#wpbody .wrap h1" ).after( div );
|
54 |
-
setTimeout( function () {
|
55 |
-
location.reload();
|
56 |
-
}, 2000 );
|
57 |
-
} else {
|
58 |
-
window.location.href = current + "breeze-msg=purge-fail";
|
59 |
-
location.reload();
|
60 |
-
}
|
61 |
-
}
|
62 |
-
} );
|
63 |
-
}
|
64 |
-
|
65 |
-
function breeze_purgeFile_callAjax() {
|
66 |
-
$.ajax( {
|
67 |
-
url: ajaxurl,
|
68 |
-
dataType: 'json',
|
69 |
-
method: 'POST',
|
70 |
-
data: {
|
71 |
-
action: 'breeze_purge_file',
|
72 |
-
security: breeze_token_name.breeze_purge_cache
|
73 |
-
},
|
74 |
-
success: function ( res ) {
|
75 |
-
current = location.href;
|
76 |
-
res = parseFloat( res );
|
77 |
-
|
78 |
-
window.location.href = current + "#breeze-msg=success-cleancache&file=" + res;
|
79 |
-
location.reload();
|
80 |
-
}
|
81 |
-
} );
|
82 |
-
}
|
83 |
-
|
84 |
-
function getParameterByName( name, url ) {
|
85 |
-
if ( !url ) url = window.location.href;
|
86 |
-
name = name.replace( /[\[\]]/g, "\\$&" );
|
87 |
-
var regex = new RegExp( "[?&]" + name + "(=([^&#]*)|&|#|$)" ),
|
88 |
-
results = regex.exec( url );
|
89 |
-
if ( !results ) return null;
|
90 |
-
if ( !results[ 2 ] ) return '';
|
91 |
-
return decodeURIComponent( results[ 2 ].replace( /\+/g, " " ) );
|
92 |
-
}
|
93 |
-
|
94 |
-
var url = location.href;
|
95 |
-
var fileClean = parseFloat( getParameterByName( 'file', url ) );
|
96 |
-
|
97 |
-
$( window ).on( 'load', function () {
|
98 |
-
var patt = /wp-admin/i;
|
99 |
-
if ( patt.test( url ) ) {
|
100 |
-
//backend
|
101 |
-
var div = '';
|
102 |
-
if ( url.indexOf( "msg=success-cleancache" ) > 0 && !isNaN( fileClean ) ) {
|
103 |
-
if ( fileClean > 0 ) {
|
104 |
-
div = '<div id="message" class="notice notice-success" style="margin-top:10px; margin-bottom:10px;padding: 10px;"><strong>Internal cache has been purged: ' + fileClean + 'Kb cleaned</strong></div>';
|
105 |
-
} else {
|
106 |
-
div = '<div id="message" class="notice notice-success" style="margin-top:10px; margin-bottom:10px;padding: 10px;"><strong>Internal cache has been purged.</strong></div>';
|
107 |
-
|
108 |
-
}
|
109 |
-
|
110 |
-
$( "#wpbody .wrap h1" ).after( div );
|
111 |
-
|
112 |
-
var url_return = url.split( 'breeze-msg' );
|
113 |
-
setTimeout( function () {
|
114 |
-
window.location = url_return[ 0 ];
|
115 |
-
location.reload();
|
116 |
-
}, 2000 );
|
117 |
-
}
|
118 |
-
} else {
|
119 |
-
//frontend
|
120 |
-
}
|
121 |
-
|
122 |
-
} );
|
123 |
-
|
124 |
-
$( '#breeze-hide-install-msg' ).unbind( 'click' ).click( function () {
|
125 |
-
$( this ).closest( 'div.notice' ).fadeOut();
|
126 |
-
} )
|
127 |
-
|
128 |
-
|
129 |
-
function current_url_clean() {
|
130 |
-
var query_search = location.search;
|
131 |
-
if ( query_search.indexOf( 'breeze_purge=1' ) !== -1 && query_search.indexOf( '_wpnonce' ) !== -1 ) {
|
132 |
-
var params = new URLSearchParams( location.search );
|
133 |
-
params.delete( 'breeze_purge' )
|
134 |
-
params.delete( '_wpnonce' )
|
135 |
-
history.replaceState( null, '', '?' + params + location.hash )
|
136 |
-
}
|
137 |
-
}
|
138 |
-
|
139 |
-
current_url_clean();
|
140 |
-
|
141 |
-
|
142 |
-
$( '#advanced-options-tab' ).on( 'change', '#bz-lazy-load', function () {
|
143 |
-
|
144 |
-
var native_lazy = $( '#native-lazy-option' );
|
145 |
-
if ( true === $( this ).is( ':checked' ) ) {
|
146 |
-
native_lazy.show();
|
147 |
-
} else {
|
148 |
-
native_lazy.hide();
|
149 |
-
$( '#bz-lazy-load-nat' ).attr( 'checked', false );
|
150 |
-
}
|
151 |
-
} );
|
152 |
-
|
153 |
-
var font_display_swap = $( '#font-display-swap' );
|
154 |
-
var font_display = $( '#font-display' );
|
155 |
-
var css_minification = $( '#minification-css' );
|
156 |
-
|
157 |
-
if ( css_minification.is( ':checked' ) ) {
|
158 |
-
font_display_swap.show();
|
159 |
-
} else {
|
160 |
-
font_display_swap.hide();
|
161 |
-
font_display.attr( 'checked', false );
|
162 |
-
}
|
163 |
-
$( '#basic-panel' ).on(
|
164 |
-
'change',
|
165 |
-
'#minification-css',
|
166 |
-
function () {
|
167 |
-
if ( $( this ).is( ':checked' ) ) {
|
168 |
-
font_display_swap.show();
|
169 |
-
} else {
|
170 |
-
font_display_swap.hide();
|
171 |
-
font_display.attr( 'checked', false );
|
172 |
-
}
|
173 |
-
}
|
174 |
-
);
|
175 |
-
|
176 |
-
$( '#advanced-options-tab' ).on( 'change', '#enable-js-delay', function () {
|
177 |
-
$delay_js_div = $( '#breeze-delay-js-scripts-div' );
|
178 |
-
|
179 |
-
if ( $( this ).is( ':checked' ) ) {
|
180 |
-
$delay_js_div.show();
|
181 |
-
} else {
|
182 |
-
$delay_js_div.hide();
|
183 |
-
}
|
184 |
-
} )
|
185 |
-
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/breeze-configuration.js
DELETED
@@ -1,351 +0,0 @@
|
|
1 |
-
var $valid_json = false;
|
2 |
-
jQuery(document).ready(function ($) {
|
3 |
-
// database clean tabs
|
4 |
-
$('input[name="all_control"]').click(function () {
|
5 |
-
var checked = $(this).is(':checked');
|
6 |
-
if (checked == true) {
|
7 |
-
$(".clean-data").prop("checked", true);
|
8 |
-
} else {
|
9 |
-
$(".clean-data").prop("checked", false);
|
10 |
-
}
|
11 |
-
});
|
12 |
-
|
13 |
-
$('.clean-data').click(function () {
|
14 |
-
var checked = $(this).is(':checked');
|
15 |
-
if (checked == false) {
|
16 |
-
$('input[name="all_control"]').prop('checked', false);
|
17 |
-
}
|
18 |
-
});
|
19 |
-
|
20 |
-
function initRemoveBtn() {
|
21 |
-
$('.breeze-input-group span.item-remove').unbind('click').click(function () {
|
22 |
-
var inputURL = $(this).closest('.breeze-input-group');
|
23 |
-
inputURL.fadeOut(300, function () {
|
24 |
-
inputURL.remove();
|
25 |
-
validateMoveButtons();
|
26 |
-
});
|
27 |
-
});
|
28 |
-
}
|
29 |
-
|
30 |
-
initRemoveBtn();
|
31 |
-
|
32 |
-
function initSortableHandle() {
|
33 |
-
$('.breeze-list-url').sortable({
|
34 |
-
handle: $('span.sort-handle'),
|
35 |
-
stop: validateMoveButtons
|
36 |
-
});
|
37 |
-
}
|
38 |
-
|
39 |
-
initSortableHandle();
|
40 |
-
|
41 |
-
function initMoveButtons() {
|
42 |
-
$('.sort-handle span').unbind('click').click(function (e) {
|
43 |
-
var inputGroup = $(this).parents('.breeze-input-group');
|
44 |
-
if ($(this).hasClass('moveUp')) {
|
45 |
-
inputGroup.insertBefore(inputGroup.prev());
|
46 |
-
} else {
|
47 |
-
inputGroup.insertAfter(inputGroup.next());
|
48 |
-
}
|
49 |
-
|
50 |
-
validateMoveButtons();
|
51 |
-
});
|
52 |
-
}
|
53 |
-
|
54 |
-
initMoveButtons();
|
55 |
-
|
56 |
-
function validateMoveButtons() {
|
57 |
-
var listURL = $('.breeze-list-url');
|
58 |
-
listURL.find('.breeze-input-group').find('.sort-handle').find('span').removeClass('blur');
|
59 |
-
listURL.find('.breeze-input-group:first-child').find('.moveUp').addClass('blur');
|
60 |
-
listURL.find('.breeze-input-group:last-child').find('.moveDown').addClass('blur');
|
61 |
-
}
|
62 |
-
|
63 |
-
validateMoveButtons();
|
64 |
-
|
65 |
-
$('button.add-url').unbind('click').click(function () {
|
66 |
-
var defer = $(this).attr('id').indexOf('defer') > -1;
|
67 |
-
var preload = $(this).attr('id').indexOf('preload-fonts') > -1;
|
68 |
-
var listURL = $(this).closest('td').find('.breeze-list-url');
|
69 |
-
var html = '';
|
70 |
-
var listInput = listURL.find('.breeze-input-group');
|
71 |
-
var emptyInput = false;
|
72 |
-
|
73 |
-
listInput.each(function () {
|
74 |
-
var thisInput = $(this).find('.breeze-input-url');
|
75 |
-
if (thisInput.val().trim() === '') {
|
76 |
-
thisInput.focus();
|
77 |
-
emptyInput = true;
|
78 |
-
return false;
|
79 |
-
}
|
80 |
-
});
|
81 |
-
|
82 |
-
if (emptyInput) return false;
|
83 |
-
|
84 |
-
html += '<div class="breeze-input-group">';
|
85 |
-
html += ' <span class="sort-handle">';
|
86 |
-
html += ' <span class="dashicons dashicons-arrow-up moveUp"></span>';
|
87 |
-
html += ' <span class="dashicons dashicons-arrow-down moveDown"></span>';
|
88 |
-
html += ' </span>';
|
89 |
-
html += ' <input type="text" size="98"';
|
90 |
-
html += 'class="breeze-input-url"';
|
91 |
-
if(preload){
|
92 |
-
html += 'name="breeze-preload-font[]"';
|
93 |
-
} else if (!defer) {
|
94 |
-
html += 'name="move-to-footer-js[]"';
|
95 |
-
} else {
|
96 |
-
html += 'name="defer-js[]"';
|
97 |
-
}
|
98 |
-
html += 'placeholder="Enter URL..."';
|
99 |
-
html += 'value="" />';
|
100 |
-
html += ' <span class="dashicons dashicons-no item-remove" title="Remove"></span>';
|
101 |
-
html += '</div>';
|
102 |
-
|
103 |
-
listURL.append(html);
|
104 |
-
initRemoveBtn();
|
105 |
-
initSortableHandle();
|
106 |
-
initMoveButtons();
|
107 |
-
validateMoveButtons();
|
108 |
-
});
|
109 |
-
|
110 |
-
// Change tab
|
111 |
-
$("#breeze-tabs .nav-tab").click(function (e) {
|
112 |
-
e.preventDefault();
|
113 |
-
$("#breeze-tabs .nav-tab").removeClass('active');
|
114 |
-
$(e.target).addClass('active');
|
115 |
-
id_tab = $(this).data('tab-id');
|
116 |
-
$("#tab-" + id_tab).addClass('active');
|
117 |
-
$("#breeze-tabs-content .tab-pane").removeClass('active');
|
118 |
-
$("#tab-content-" + id_tab).addClass('active');
|
119 |
-
document.cookie = 'breeze_active_tab=' + id_tab;
|
120 |
-
|
121 |
-
// Toggle right-side content
|
122 |
-
if (id_tab === 'faq') {
|
123 |
-
$('#breeze-and-cloudways').hide();
|
124 |
-
$('#faq-content').accordion({
|
125 |
-
collapsible: true,
|
126 |
-
animate: 200,
|
127 |
-
header: '.faq-question',
|
128 |
-
heightStyle: 'content'
|
129 |
-
});
|
130 |
-
} else {
|
131 |
-
$('#breeze-and-cloudways').show();
|
132 |
-
}
|
133 |
-
});
|
134 |
-
|
135 |
-
// Cookie do
|
136 |
-
function setTabFromCookie() {
|
137 |
-
active_tab = getCookie('breeze_active_tab');
|
138 |
-
if (!active_tab) {
|
139 |
-
active_tab = 'basic';
|
140 |
-
}
|
141 |
-
|
142 |
-
if ($("#tab-" + active_tab).length === 0) { // Tab not found (multisite case)
|
143 |
-
firstTab = $('#breeze-tabs').find('a:first-child');
|
144 |
-
tabType = firstTab.attr('id').replace('tab-', '');
|
145 |
-
firstTab.addClass('active');
|
146 |
-
$("#tab-content-" + tabType).addClass('active');
|
147 |
-
} else {
|
148 |
-
$("#tab-" + active_tab).addClass('active');
|
149 |
-
$("#tab-content-" + active_tab).addClass('active');
|
150 |
-
}
|
151 |
-
|
152 |
-
// Toggle right-side content
|
153 |
-
if (active_tab === 'faq') {
|
154 |
-
$('#breeze-and-cloudways').hide();
|
155 |
-
$('#faq-content').accordion({
|
156 |
-
collapsible: true,
|
157 |
-
animate: 200,
|
158 |
-
header: '.faq-question',
|
159 |
-
heightStyle: 'content'
|
160 |
-
});
|
161 |
-
} else {
|
162 |
-
$('#breeze-and-cloudways').show();
|
163 |
-
}
|
164 |
-
}
|
165 |
-
|
166 |
-
function getCookie(cname) {
|
167 |
-
var name = cname + "=";
|
168 |
-
var ca = document.cookie.split(';');
|
169 |
-
for (var i = 0; i < ca.length; i++) {
|
170 |
-
var c = ca[i];
|
171 |
-
while (c.charAt(0) == ' ') c = c.substring(1);
|
172 |
-
if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
|
173 |
-
}
|
174 |
-
return "";
|
175 |
-
}
|
176 |
-
|
177 |
-
setTabFromCookie();
|
178 |
-
|
179 |
-
// Sub-site settings toggle.
|
180 |
-
var global_tabs = [
|
181 |
-
'faq'
|
182 |
-
];
|
183 |
-
var save_settings_inherit_form_on_submit = true;
|
184 |
-
var settings_inherit_form_did_change = false;
|
185 |
-
var $settings_inherit_form = $('#breeze-inherit-settings-toggle');
|
186 |
-
if ($settings_inherit_form.length) {
|
187 |
-
$('input', $settings_inherit_form).on('change', function () {
|
188 |
-
var inherit = $(this).val() == '1';
|
189 |
-
|
190 |
-
$('#breeze-tabs').toggleClass('tabs-hidden', inherit);
|
191 |
-
$('#breeze-tabs-content').toggleClass('tabs-hidden', inherit);
|
192 |
-
|
193 |
-
$('#breeze-tabs .nav-tab').each(function () {
|
194 |
-
var tab_id = $(this).data('tab-id');
|
195 |
-
|
196 |
-
if ($.inArray(tab_id, global_tabs) === -1) {
|
197 |
-
$(this).toggleClass('inactive', inherit);
|
198 |
-
$('#breeze-tabs-content #tab-content-' + tab_id).toggleClass('inactive', inherit);
|
199 |
-
}
|
200 |
-
});
|
201 |
-
|
202 |
-
settings_inherit_form_did_change = !$(this).parents('.radio-field').hasClass('active');
|
203 |
-
|
204 |
-
$('p.disclaimer', $settings_inherit_form).toggle(settings_inherit_form_did_change);
|
205 |
-
});
|
206 |
-
|
207 |
-
$('#breeze-tabs-content form').on('submit', function (event) {
|
208 |
-
var $form = $(this);
|
209 |
-
|
210 |
-
if (save_settings_inherit_form_on_submit && settings_inherit_form_did_change) {
|
211 |
-
event.preventDefault();
|
212 |
-
|
213 |
-
$.ajax({
|
214 |
-
url: window.location,
|
215 |
-
method: 'post',
|
216 |
-
data: $settings_inherit_form.serializeArray(),
|
217 |
-
|
218 |
-
beforeSend: function () {
|
219 |
-
$settings_inherit_form.addClass('loading');
|
220 |
-
},
|
221 |
-
|
222 |
-
complete: function () {
|
223 |
-
$settings_inherit_form.removeClass('loading');
|
224 |
-
|
225 |
-
// Continue form submit.
|
226 |
-
settings_inherit_form_did_change = false;
|
227 |
-
$form.submit();
|
228 |
-
},
|
229 |
-
|
230 |
-
success: function () {
|
231 |
-
$('input:checked', $settings_inherit_form).parents('.radio-field').addClass('active').siblings().removeClass('active');
|
232 |
-
}
|
233 |
-
});
|
234 |
-
} else {
|
235 |
-
return;
|
236 |
-
}
|
237 |
-
});
|
238 |
-
}
|
239 |
-
|
240 |
-
// Database optimization.
|
241 |
-
$('#breeze-database-optimize').on('click', function (event) {
|
242 |
-
save_settings_inherit_form_on_submit = false;
|
243 |
-
});
|
244 |
-
$('#tab-content-database .submit input').on('click', function (event) {
|
245 |
-
$('#tab-content-database input[type=checkbox]').attr('checked', false);
|
246 |
-
});
|
247 |
-
|
248 |
-
function remove_query_arg(url, arg) {
|
249 |
-
var urlparts = url.split('?');
|
250 |
-
if (urlparts.length >= 2) {
|
251 |
-
var prefix = encodeURIComponent(arg) + '=';
|
252 |
-
var pars = urlparts[1].split(/[&;]/g);
|
253 |
-
|
254 |
-
for (var i = pars.length; i-- > 0;) {
|
255 |
-
if (pars[i].lastIndexOf(prefix, 0) !== -1) {
|
256 |
-
pars.splice(i, 1);
|
257 |
-
}
|
258 |
-
}
|
259 |
-
|
260 |
-
return urlparts[0] + (pars.length > 0 ? '?' + pars.join('&') : '');
|
261 |
-
}
|
262 |
-
return url;
|
263 |
-
}
|
264 |
-
|
265 |
-
// Remove notice query args from URL.
|
266 |
-
if (window.history && typeof window.history.pushState === 'function') {
|
267 |
-
var clean_url = remove_query_arg(window.location.href, 'save-settings');
|
268 |
-
clean_url = remove_query_arg(clean_url, 'database-cleanup');
|
269 |
-
window.history.pushState(null, null, clean_url);
|
270 |
-
}
|
271 |
-
|
272 |
-
/**
|
273 |
-
* Import/Export settings TAB.
|
274 |
-
*/
|
275 |
-
var $tab_import = $( '#settings-import-export' );
|
276 |
-
$tab_import.on( 'click tap', '#breeze_export_settings', function () {
|
277 |
-
$network = $( '#breeze-level' ).val();
|
278 |
-
window.location = ajaxurl + '?action=breeze_export_json&network_level=' + $network;
|
279 |
-
} );
|
280 |
-
|
281 |
-
$( '#breeze_import_btn' ).attr( 'disabled', 'disabled' );
|
282 |
-
|
283 |
-
$tab_import.on( 'change', '#breeze_import_settings', function () {
|
284 |
-
var the_file = this.files[ 0 ];
|
285 |
-
var filename_holder = $( '#file-selected' );
|
286 |
-
var filename_error = $( '#file-error' );
|
287 |
-
var breeze_import_btn = $( '#breeze_import_btn' );
|
288 |
-
|
289 |
-
filename_holder.html( the_file.name );
|
290 |
-
if ( 'application/json' !== the_file.type ) {
|
291 |
-
$valid_json = false;
|
292 |
-
filename_holder.removeClass( 'file_green file_red' ).addClass( 'file_red' );
|
293 |
-
filename_error.html( 'File must be JSON' );
|
294 |
-
breeze_import_btn.attr( 'disabled', 'disabled' );
|
295 |
-
} else {
|
296 |
-
$valid_json = true;
|
297 |
-
filename_holder.removeClass( 'file_green file_red' ).addClass( 'file_green' );
|
298 |
-
filename_error.html( '' );
|
299 |
-
breeze_import_btn.removeAttr( 'disabled' );
|
300 |
-
}
|
301 |
-
} );
|
302 |
-
|
303 |
-
$tab_import.on( 'click tap', '#breeze_import_btn', function () {
|
304 |
-
if ( true === $valid_json ) {
|
305 |
-
network = $( '#breeze-level' ).val();
|
306 |
-
var the_file = $( '#breeze_import_settings' ).get( 0 ).files[ 0 ];
|
307 |
-
|
308 |
-
var breeze_data = new FormData();
|
309 |
-
breeze_data.append( 'action', 'breeze_import_json' );
|
310 |
-
breeze_data.append( 'network_level', network );
|
311 |
-
breeze_data.append( 'breeze_import_file', the_file );
|
312 |
-
|
313 |
-
$.ajax( {
|
314 |
-
type: "POST",
|
315 |
-
url: ajaxurl,
|
316 |
-
data: breeze_data,
|
317 |
-
processData: false,
|
318 |
-
contentType: false,
|
319 |
-
enctype: 'multipart/form-data',
|
320 |
-
mimeType: 'multipart/form-data', // this too
|
321 |
-
cache: false,
|
322 |
-
dataType: 'json', // xml, html, script, json, jsonp, text
|
323 |
-
success: function ( json ) {
|
324 |
-
var filename_holder = $( '#file-selected' );
|
325 |
-
var filename_error = $( '#file-error' );
|
326 |
-
|
327 |
-
if(true == json.success){
|
328 |
-
filename_holder.removeClass( 'file_green file_red' ).addClass( 'file_green' );
|
329 |
-
filename_holder.html(json.data);
|
330 |
-
filename_error.html( '' );
|
331 |
-
alert(json.data);
|
332 |
-
window.location.reload(true);
|
333 |
-
}else{
|
334 |
-
filename_holder.removeClass( 'file_green file_red' );
|
335 |
-
filename_holder.html( '' );
|
336 |
-
filename_error.html( json.data[0].message );
|
337 |
-
}
|
338 |
-
},
|
339 |
-
error: function ( jqXHR, textStatus, errorThrown ) {
|
340 |
-
|
341 |
-
},
|
342 |
-
// called when the request finishes (after success and error callbacks are executed)
|
343 |
-
complete: function ( jqXHR, textStatus ) {
|
344 |
-
|
345 |
-
}
|
346 |
-
} );
|
347 |
-
|
348 |
-
|
349 |
-
}
|
350 |
-
} );
|
351 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/breeze-lazy-load.js
DELETED
@@ -1,763 +0,0 @@
|
|
1 |
-
/*! lazysizes - v5.3.0 */
|
2 |
-
|
3 |
-
(function(window, factory) {
|
4 |
-
var lazySizes = factory(window, window.document, Date);
|
5 |
-
if(typeof module == 'object' && module.exports){
|
6 |
-
module.exports = lazySizes;
|
7 |
-
} else if (typeof define == 'function' && define.amd) {
|
8 |
-
define(lazySizes);
|
9 |
-
} else {
|
10 |
-
window.lazySizes = lazySizes;
|
11 |
-
}
|
12 |
-
}(window, function l(window, document, Date) { // Pass in the windoe Date function also for SSR because the Date class can be lost
|
13 |
-
'use strict';
|
14 |
-
/*jshint eqnull:true */
|
15 |
-
|
16 |
-
var lazysizes, lazySizesCfg;
|
17 |
-
|
18 |
-
(function(){
|
19 |
-
var prop;
|
20 |
-
|
21 |
-
var lazySizesDefaults = {
|
22 |
-
lazyClass: 'br-lazy',
|
23 |
-
loadedClass: 'br-loaded',
|
24 |
-
loadingClass: 'br-loading',
|
25 |
-
preloadClass: 'br-preload',
|
26 |
-
errorClass: 'br-error',
|
27 |
-
//strictClass: 'lazystrict',
|
28 |
-
autosizesClass: 'br-autosizes',
|
29 |
-
fastLoadedClass: 'ls-is-cached',
|
30 |
-
iframeLoadMode: 0,
|
31 |
-
srcAttr: 'data-breeze',
|
32 |
-
srcsetAttr: 'data-brsrcset',
|
33 |
-
sizesAttr: 'data-brsizes',
|
34 |
-
//preloadAfterLoad: false,
|
35 |
-
minSize: 40,
|
36 |
-
customMedia: {},
|
37 |
-
init: true,
|
38 |
-
expFactor: 1.5,
|
39 |
-
hFac: 0.8,
|
40 |
-
loadMode: 2,
|
41 |
-
loadHidden: true,
|
42 |
-
ricTimeout: 0,
|
43 |
-
throttleDelay: 125,
|
44 |
-
};
|
45 |
-
|
46 |
-
lazySizesCfg = window.lazySizesConfig || window.lazysizesConfig || {};
|
47 |
-
|
48 |
-
for(prop in lazySizesDefaults){
|
49 |
-
if(!(prop in lazySizesCfg)){
|
50 |
-
lazySizesCfg[prop] = lazySizesDefaults[prop];
|
51 |
-
}
|
52 |
-
}
|
53 |
-
})();
|
54 |
-
|
55 |
-
if (!document || !document.getElementsByClassName) {
|
56 |
-
return {
|
57 |
-
init: function () {},
|
58 |
-
cfg: lazySizesCfg,
|
59 |
-
noSupport: true,
|
60 |
-
};
|
61 |
-
}
|
62 |
-
|
63 |
-
var docElem = document.documentElement;
|
64 |
-
|
65 |
-
var supportPicture = window.HTMLPictureElement;
|
66 |
-
|
67 |
-
var _addEventListener = 'addEventListener';
|
68 |
-
|
69 |
-
var _getAttribute = 'getAttribute';
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Update to bind to window because 'this' becomes null during SSR
|
73 |
-
* builds.
|
74 |
-
*/
|
75 |
-
var addEventListener = window[_addEventListener].bind(window);
|
76 |
-
|
77 |
-
var setTimeout = window.setTimeout;
|
78 |
-
|
79 |
-
var requestAnimationFrame = window.requestAnimationFrame || setTimeout;
|
80 |
-
|
81 |
-
var requestIdleCallback = window.requestIdleCallback;
|
82 |
-
|
83 |
-
var regPicture = /^picture$/i;
|
84 |
-
|
85 |
-
var loadEvents = ['load', 'error', 'lazyincluded', '_lazyloaded'];
|
86 |
-
|
87 |
-
var regClassCache = {};
|
88 |
-
|
89 |
-
var forEach = Array.prototype.forEach;
|
90 |
-
|
91 |
-
var hasClass = function(ele, cls) {
|
92 |
-
if(!regClassCache[cls]){
|
93 |
-
regClassCache[cls] = new RegExp('(\\s|^)'+cls+'(\\s|$)');
|
94 |
-
}
|
95 |
-
return regClassCache[cls].test(ele[_getAttribute]('class') || '') && regClassCache[cls];
|
96 |
-
};
|
97 |
-
|
98 |
-
var addClass = function(ele, cls) {
|
99 |
-
if (!hasClass(ele, cls)){
|
100 |
-
ele.setAttribute('class', (ele[_getAttribute]('class') || '').trim() + ' ' + cls);
|
101 |
-
}
|
102 |
-
};
|
103 |
-
|
104 |
-
var removeClass = function(ele, cls) {
|
105 |
-
var reg;
|
106 |
-
if ((reg = hasClass(ele,cls))) {
|
107 |
-
ele.setAttribute('class', (ele[_getAttribute]('class') || '').replace(reg, ' '));
|
108 |
-
}
|
109 |
-
};
|
110 |
-
|
111 |
-
var addRemoveLoadEvents = function(dom, fn, add){
|
112 |
-
var action = add ? _addEventListener : 'removeEventListener';
|
113 |
-
if(add){
|
114 |
-
addRemoveLoadEvents(dom, fn);
|
115 |
-
}
|
116 |
-
loadEvents.forEach(function(evt){
|
117 |
-
dom[action](evt, fn);
|
118 |
-
});
|
119 |
-
};
|
120 |
-
|
121 |
-
var triggerEvent = function(elem, name, detail, noBubbles, noCancelable){
|
122 |
-
var event = document.createEvent('Event');
|
123 |
-
|
124 |
-
if(!detail){
|
125 |
-
detail = {};
|
126 |
-
}
|
127 |
-
|
128 |
-
detail.instance = lazysizes;
|
129 |
-
|
130 |
-
event.initEvent(name, !noBubbles, !noCancelable);
|
131 |
-
|
132 |
-
event.detail = detail;
|
133 |
-
|
134 |
-
elem.dispatchEvent(event);
|
135 |
-
return event;
|
136 |
-
};
|
137 |
-
|
138 |
-
var updatePolyfill = function (el, full){
|
139 |
-
var polyfill;
|
140 |
-
if( !supportPicture && ( polyfill = (window.picturefill || lazySizesCfg.pf) ) ){
|
141 |
-
if(full && full.src && !el[_getAttribute]('srcset')){
|
142 |
-
el.setAttribute('srcset', full.src);
|
143 |
-
}
|
144 |
-
polyfill({reevaluate: true, elements: [el]});
|
145 |
-
} else if(full && full.src){
|
146 |
-
el.src = full.src;
|
147 |
-
}
|
148 |
-
};
|
149 |
-
|
150 |
-
var getCSS = function (elem, style){
|
151 |
-
return (getComputedStyle(elem, null) || {})[style];
|
152 |
-
};
|
153 |
-
|
154 |
-
var getWidth = function(elem, parent, width){
|
155 |
-
width = width || elem.offsetWidth;
|
156 |
-
|
157 |
-
while(width < lazySizesCfg.minSize && parent && !elem._lazysizesWidth){
|
158 |
-
width = parent.offsetWidth;
|
159 |
-
parent = parent.parentNode;
|
160 |
-
}
|
161 |
-
|
162 |
-
return width;
|
163 |
-
};
|
164 |
-
|
165 |
-
var rAF = (function(){
|
166 |
-
var running, waiting;
|
167 |
-
var firstFns = [];
|
168 |
-
var secondFns = [];
|
169 |
-
var fns = firstFns;
|
170 |
-
|
171 |
-
var run = function(){
|
172 |
-
var runFns = fns;
|
173 |
-
|
174 |
-
fns = firstFns.length ? secondFns : firstFns;
|
175 |
-
|
176 |
-
running = true;
|
177 |
-
waiting = false;
|
178 |
-
|
179 |
-
while(runFns.length){
|
180 |
-
runFns.shift()();
|
181 |
-
}
|
182 |
-
|
183 |
-
running = false;
|
184 |
-
};
|
185 |
-
|
186 |
-
var rafBatch = function(fn, queue){
|
187 |
-
if(running && !queue){
|
188 |
-
fn.apply(this, arguments);
|
189 |
-
} else {
|
190 |
-
fns.push(fn);
|
191 |
-
|
192 |
-
if(!waiting){
|
193 |
-
waiting = true;
|
194 |
-
(document.hidden ? setTimeout : requestAnimationFrame)(run);
|
195 |
-
}
|
196 |
-
}
|
197 |
-
};
|
198 |
-
|
199 |
-
rafBatch._lsFlush = run;
|
200 |
-
|
201 |
-
return rafBatch;
|
202 |
-
})();
|
203 |
-
|
204 |
-
var rAFIt = function(fn, simple){
|
205 |
-
return simple ?
|
206 |
-
function() {
|
207 |
-
rAF(fn);
|
208 |
-
} :
|
209 |
-
function(){
|
210 |
-
var that = this;
|
211 |
-
var args = arguments;
|
212 |
-
rAF(function(){
|
213 |
-
fn.apply(that, args);
|
214 |
-
});
|
215 |
-
}
|
216 |
-
;
|
217 |
-
};
|
218 |
-
|
219 |
-
var throttle = function(fn){
|
220 |
-
var running;
|
221 |
-
var lastTime = 0;
|
222 |
-
var gDelay = lazySizesCfg.throttleDelay;
|
223 |
-
var rICTimeout = lazySizesCfg.ricTimeout;
|
224 |
-
var run = function(){
|
225 |
-
running = false;
|
226 |
-
lastTime = Date.now();
|
227 |
-
fn();
|
228 |
-
};
|
229 |
-
var idleCallback = requestIdleCallback && rICTimeout > 49 ?
|
230 |
-
function(){
|
231 |
-
requestIdleCallback(run, {timeout: rICTimeout});
|
232 |
-
|
233 |
-
if(rICTimeout !== lazySizesCfg.ricTimeout){
|
234 |
-
rICTimeout = lazySizesCfg.ricTimeout;
|
235 |
-
}
|
236 |
-
} :
|
237 |
-
rAFIt(function(){
|
238 |
-
setTimeout(run);
|
239 |
-
}, true)
|
240 |
-
;
|
241 |
-
|
242 |
-
return function(isPriority){
|
243 |
-
var delay;
|
244 |
-
|
245 |
-
if((isPriority = isPriority === true)){
|
246 |
-
rICTimeout = 33;
|
247 |
-
}
|
248 |
-
|
249 |
-
if(running){
|
250 |
-
return;
|
251 |
-
}
|
252 |
-
|
253 |
-
running = true;
|
254 |
-
|
255 |
-
delay = gDelay - (Date.now() - lastTime);
|
256 |
-
|
257 |
-
if(delay < 0){
|
258 |
-
delay = 0;
|
259 |
-
}
|
260 |
-
|
261 |
-
if(isPriority || delay < 9){
|
262 |
-
idleCallback();
|
263 |
-
} else {
|
264 |
-
setTimeout(idleCallback, delay);
|
265 |
-
}
|
266 |
-
};
|
267 |
-
};
|
268 |
-
|
269 |
-
//based on http://modernjavascript.blogspot.de/2013/08/building-better-debounce.html
|
270 |
-
var debounce = function(func) {
|
271 |
-
var timeout, timestamp;
|
272 |
-
var wait = 99;
|
273 |
-
var run = function(){
|
274 |
-
timeout = null;
|
275 |
-
func();
|
276 |
-
};
|
277 |
-
var later = function() {
|
278 |
-
var last = Date.now() - timestamp;
|
279 |
-
|
280 |
-
if (last < wait) {
|
281 |
-
setTimeout(later, wait - last);
|
282 |
-
} else {
|
283 |
-
(requestIdleCallback || run)(run);
|
284 |
-
}
|
285 |
-
};
|
286 |
-
|
287 |
-
return function() {
|
288 |
-
timestamp = Date.now();
|
289 |
-
|
290 |
-
if (!timeout) {
|
291 |
-
timeout = setTimeout(later, wait);
|
292 |
-
}
|
293 |
-
};
|
294 |
-
};
|
295 |
-
|
296 |
-
var loader = (function(){
|
297 |
-
var preloadElems, isCompleted, resetPreloadingTimer, loadMode, started;
|
298 |
-
|
299 |
-
var eLvW, elvH, eLtop, eLleft, eLright, eLbottom, isBodyHidden;
|
300 |
-
|
301 |
-
var regImg = /^img$/i;
|
302 |
-
var regIframe = /^iframe$/i;
|
303 |
-
|
304 |
-
var supportScroll = ('onscroll' in window) && !(/(gle|ing)bot/.test(navigator.userAgent));
|
305 |
-
|
306 |
-
var shrinkExpand = 0;
|
307 |
-
var currentExpand = 0;
|
308 |
-
|
309 |
-
var isLoading = 0;
|
310 |
-
var lowRuns = -1;
|
311 |
-
|
312 |
-
var resetPreloading = function(e){
|
313 |
-
isLoading--;
|
314 |
-
if(!e || isLoading < 0 || !e.target){
|
315 |
-
isLoading = 0;
|
316 |
-
}
|
317 |
-
};
|
318 |
-
|
319 |
-
var isVisible = function (elem) {
|
320 |
-
if (isBodyHidden == null) {
|
321 |
-
isBodyHidden = getCSS(document.body, 'visibility') == 'hidden';
|
322 |
-
}
|
323 |
-
|
324 |
-
return isBodyHidden || !(getCSS(elem.parentNode, 'visibility') == 'hidden' && getCSS(elem, 'visibility') == 'hidden');
|
325 |
-
};
|
326 |
-
|
327 |
-
var isNestedVisible = function(elem, elemExpand){
|
328 |
-
var outerRect;
|
329 |
-
var parent = elem;
|
330 |
-
var visible = isVisible(elem);
|
331 |
-
|
332 |
-
eLtop -= elemExpand;
|
333 |
-
eLbottom += elemExpand;
|
334 |
-
eLleft -= elemExpand;
|
335 |
-
eLright += elemExpand;
|
336 |
-
|
337 |
-
while(visible && (parent = parent.offsetParent) && parent != document.body && parent != docElem){
|
338 |
-
visible = ((getCSS(parent, 'opacity') || 1) > 0);
|
339 |
-
|
340 |
-
if(visible && getCSS(parent, 'overflow') != 'visible'){
|
341 |
-
outerRect = parent.getBoundingClientRect();
|
342 |
-
visible = eLright > outerRect.left &&
|
343 |
-
eLleft < outerRect.right &&
|
344 |
-
eLbottom > outerRect.top - 1 &&
|
345 |
-
eLtop < outerRect.bottom + 1
|
346 |
-
;
|
347 |
-
}
|
348 |
-
}
|
349 |
-
|
350 |
-
return visible;
|
351 |
-
};
|
352 |
-
|
353 |
-
var checkElements = function() {
|
354 |
-
var eLlen, i, rect, autoLoadElem, loadedSomething, elemExpand, elemNegativeExpand, elemExpandVal,
|
355 |
-
beforeExpandVal, defaultExpand, preloadExpand, hFac;
|
356 |
-
var lazyloadElems = lazysizes.elements;
|
357 |
-
|
358 |
-
if((loadMode = lazySizesCfg.loadMode) && isLoading < 8 && (eLlen = lazyloadElems.length)){
|
359 |
-
|
360 |
-
i = 0;
|
361 |
-
|
362 |
-
lowRuns++;
|
363 |
-
|
364 |
-
for(; i < eLlen; i++){
|
365 |
-
|
366 |
-
if(!lazyloadElems[i] || lazyloadElems[i]._lazyRace){continue;}
|
367 |
-
|
368 |
-
if(!supportScroll || (lazysizes.prematureUnveil && lazysizes.prematureUnveil(lazyloadElems[i]))){unveilElement(lazyloadElems[i]);continue;}
|
369 |
-
|
370 |
-
if(!(elemExpandVal = lazyloadElems[i][_getAttribute]('data-expand')) || !(elemExpand = elemExpandVal * 1)){
|
371 |
-
elemExpand = currentExpand;
|
372 |
-
}
|
373 |
-
|
374 |
-
if (!defaultExpand) {
|
375 |
-
defaultExpand = (!lazySizesCfg.expand || lazySizesCfg.expand < 1) ?
|
376 |
-
docElem.clientHeight > 500 && docElem.clientWidth > 500 ? 500 : 370 :
|
377 |
-
lazySizesCfg.expand;
|
378 |
-
|
379 |
-
lazysizes._defEx = defaultExpand;
|
380 |
-
|
381 |
-
preloadExpand = defaultExpand * lazySizesCfg.expFactor;
|
382 |
-
hFac = lazySizesCfg.hFac;
|
383 |
-
isBodyHidden = null;
|
384 |
-
|
385 |
-
if(currentExpand < preloadExpand && isLoading < 1 && lowRuns > 2 && loadMode > 2 && !document.hidden){
|
386 |
-
currentExpand = preloadExpand;
|
387 |
-
lowRuns = 0;
|
388 |
-
} else if(loadMode > 1 && lowRuns > 1 && isLoading < 6){
|
389 |
-
currentExpand = defaultExpand;
|
390 |
-
} else {
|
391 |
-
currentExpand = shrinkExpand;
|
392 |
-
}
|
393 |
-
}
|
394 |
-
|
395 |
-
if(beforeExpandVal !== elemExpand){
|
396 |
-
eLvW = innerWidth + (elemExpand * hFac);
|
397 |
-
elvH = innerHeight + elemExpand;
|
398 |
-
elemNegativeExpand = elemExpand * -1;
|
399 |
-
beforeExpandVal = elemExpand;
|
400 |
-
}
|
401 |
-
|
402 |
-
rect = lazyloadElems[i].getBoundingClientRect();
|
403 |
-
|
404 |
-
if ((eLbottom = rect.bottom) >= elemNegativeExpand &&
|
405 |
-
(eLtop = rect.top) <= elvH &&
|
406 |
-
(eLright = rect.right) >= elemNegativeExpand * hFac &&
|
407 |
-
(eLleft = rect.left) <= eLvW &&
|
408 |
-
(eLbottom || eLright || eLleft || eLtop) &&
|
409 |
-
(lazySizesCfg.loadHidden || isVisible(lazyloadElems[i])) &&
|
410 |
-
((isCompleted && isLoading < 3 && !elemExpandVal && (loadMode < 3 || lowRuns < 4)) || isNestedVisible(lazyloadElems[i], elemExpand))){
|
411 |
-
unveilElement(lazyloadElems[i]);
|
412 |
-
loadedSomething = true;
|
413 |
-
if(isLoading > 9){break;}
|
414 |
-
} else if(!loadedSomething && isCompleted && !autoLoadElem &&
|
415 |
-
isLoading < 4 && lowRuns < 4 && loadMode > 2 &&
|
416 |
-
(preloadElems[0] || lazySizesCfg.preloadAfterLoad) &&
|
417 |
-
(preloadElems[0] || (!elemExpandVal && ((eLbottom || eLright || eLleft || eLtop) || lazyloadElems[i][_getAttribute](lazySizesCfg.sizesAttr) != 'auto')))){
|
418 |
-
autoLoadElem = preloadElems[0] || lazyloadElems[i];
|
419 |
-
}
|
420 |
-
}
|
421 |
-
|
422 |
-
if(autoLoadElem && !loadedSomething){
|
423 |
-
unveilElement(autoLoadElem);
|
424 |
-
}
|
425 |
-
}
|
426 |
-
};
|
427 |
-
|
428 |
-
var throttledCheckElements = throttle(checkElements);
|
429 |
-
|
430 |
-
var switchLoadingClass = function(e){
|
431 |
-
var elem = e.target;
|
432 |
-
|
433 |
-
if (elem._lazyCache) {
|
434 |
-
delete elem._lazyCache;
|
435 |
-
return;
|
436 |
-
}
|
437 |
-
|
438 |
-
resetPreloading(e);
|
439 |
-
addClass(elem, lazySizesCfg.loadedClass);
|
440 |
-
removeClass(elem, lazySizesCfg.loadingClass);
|
441 |
-
addRemoveLoadEvents(elem, rafSwitchLoadingClass);
|
442 |
-
triggerEvent(elem, 'lazyloaded');
|
443 |
-
};
|
444 |
-
var rafedSwitchLoadingClass = rAFIt(switchLoadingClass);
|
445 |
-
var rafSwitchLoadingClass = function(e){
|
446 |
-
rafedSwitchLoadingClass({target: e.target});
|
447 |
-
};
|
448 |
-
|
449 |
-
var changeIframeSrc = function(elem, src){
|
450 |
-
var loadMode = elem.getAttribute('data-load-mode') || lazySizesCfg.iframeLoadMode;
|
451 |
-
|
452 |
-
// loadMode can be also a string!
|
453 |
-
if (loadMode == 0) {
|
454 |
-
elem.contentWindow.location.replace(src);
|
455 |
-
} else if (loadMode == 1) {
|
456 |
-
elem.src = src;
|
457 |
-
}
|
458 |
-
};
|
459 |
-
|
460 |
-
var handleSources = function(source){
|
461 |
-
var customMedia;
|
462 |
-
|
463 |
-
var sourceSrcset = source[_getAttribute](lazySizesCfg.srcsetAttr);
|
464 |
-
|
465 |
-
if( (customMedia = lazySizesCfg.customMedia[source[_getAttribute]('data-media') || source[_getAttribute]('media')]) ){
|
466 |
-
source.setAttribute('media', customMedia);
|
467 |
-
}
|
468 |
-
|
469 |
-
if(sourceSrcset){
|
470 |
-
source.setAttribute('srcset', sourceSrcset);
|
471 |
-
}
|
472 |
-
};
|
473 |
-
|
474 |
-
var lazyUnveil = rAFIt(function (elem, detail, isAuto, sizes, isImg){
|
475 |
-
var src, srcset, parent, isPicture, event, firesLoad;
|
476 |
-
|
477 |
-
if(!(event = triggerEvent(elem, 'lazybeforeunveil', detail)).defaultPrevented){
|
478 |
-
|
479 |
-
if(sizes){
|
480 |
-
if(isAuto){
|
481 |
-
addClass(elem, lazySizesCfg.autosizesClass);
|
482 |
-
} else {
|
483 |
-
elem.setAttribute('sizes', sizes);
|
484 |
-
}
|
485 |
-
}
|
486 |
-
|
487 |
-
srcset = elem[_getAttribute](lazySizesCfg.srcsetAttr);
|
488 |
-
src = elem[_getAttribute](lazySizesCfg.srcAttr);
|
489 |
-
|
490 |
-
if(isImg) {
|
491 |
-
parent = elem.parentNode;
|
492 |
-
isPicture = parent && regPicture.test(parent.nodeName || '');
|
493 |
-
}
|
494 |
-
|
495 |
-
firesLoad = detail.firesLoad || (('src' in elem) && (srcset || src || isPicture));
|
496 |
-
|
497 |
-
event = {target: elem};
|
498 |
-
|
499 |
-
addClass(elem, lazySizesCfg.loadingClass);
|
500 |
-
|
501 |
-
if(firesLoad){
|
502 |
-
clearTimeout(resetPreloadingTimer);
|
503 |
-
resetPreloadingTimer = setTimeout(resetPreloading, 2500);
|
504 |
-
addRemoveLoadEvents(elem, rafSwitchLoadingClass, true);
|
505 |
-
}
|
506 |
-
|
507 |
-
if(isPicture){
|
508 |
-
forEach.call(parent.getElementsByTagName('source'), handleSources);
|
509 |
-
}
|
510 |
-
|
511 |
-
if(srcset){
|
512 |
-
elem.setAttribute('srcset', srcset);
|
513 |
-
} else if(src && !isPicture){
|
514 |
-
if(regIframe.test(elem.nodeName)){
|
515 |
-
changeIframeSrc(elem, src);
|
516 |
-
} else {
|
517 |
-
elem.src = src;
|
518 |
-
}
|
519 |
-
}
|
520 |
-
|
521 |
-
if(isImg && (srcset || isPicture)){
|
522 |
-
updatePolyfill(elem, {src: src});
|
523 |
-
}
|
524 |
-
}
|
525 |
-
|
526 |
-
if(elem._lazyRace){
|
527 |
-
delete elem._lazyRace;
|
528 |
-
}
|
529 |
-
removeClass(elem, lazySizesCfg.lazyClass);
|
530 |
-
|
531 |
-
rAF(function(){
|
532 |
-
// Part of this can be removed as soon as this fix is older: https://bugs.chromium.org/p/chromium/issues/detail?id=7731 (2015)
|
533 |
-
var isLoaded = elem.complete && elem.naturalWidth > 1;
|
534 |
-
|
535 |
-
if( !firesLoad || isLoaded){
|
536 |
-
if (isLoaded) {
|
537 |
-
addClass(elem, lazySizesCfg.fastLoadedClass);
|
538 |
-
}
|
539 |
-
switchLoadingClass(event);
|
540 |
-
elem._lazyCache = true;
|
541 |
-
setTimeout(function(){
|
542 |
-
if ('_lazyCache' in elem) {
|
543 |
-
delete elem._lazyCache;
|
544 |
-
}
|
545 |
-
}, 9);
|
546 |
-
}
|
547 |
-
if (elem.loading == 'lazy') {
|
548 |
-
isLoading--;
|
549 |
-
}
|
550 |
-
}, true);
|
551 |
-
});
|
552 |
-
|
553 |
-
var unveilElement = function (elem){
|
554 |
-
if (elem._lazyRace) {return;}
|
555 |
-
var detail;
|
556 |
-
|
557 |
-
var isImg = regImg.test(elem.nodeName);
|
558 |
-
|
559 |
-
//allow using sizes="auto", but don't use. it's invalid. Use data-sizes="auto" or a valid value for sizes instead (i.e.: sizes="80vw")
|
560 |
-
var sizes = isImg && (elem[_getAttribute](lazySizesCfg.sizesAttr) || elem[_getAttribute]('sizes'));
|
561 |
-
var isAuto = sizes == 'auto';
|
562 |
-
|
563 |
-
if( (isAuto || !isCompleted) && isImg && (elem[_getAttribute]('src') || elem.srcset) && !elem.complete && !hasClass(elem, lazySizesCfg.errorClass) && hasClass(elem, lazySizesCfg.lazyClass)){return;}
|
564 |
-
|
565 |
-
detail = triggerEvent(elem, 'lazyunveilread').detail;
|
566 |
-
|
567 |
-
if(isAuto){
|
568 |
-
autoSizer.updateElem(elem, true, elem.offsetWidth);
|
569 |
-
}
|
570 |
-
|
571 |
-
elem._lazyRace = true;
|
572 |
-
isLoading++;
|
573 |
-
|
574 |
-
lazyUnveil(elem, detail, isAuto, sizes, isImg);
|
575 |
-
};
|
576 |
-
|
577 |
-
var afterScroll = debounce(function(){
|
578 |
-
lazySizesCfg.loadMode = 3;
|
579 |
-
throttledCheckElements();
|
580 |
-
});
|
581 |
-
|
582 |
-
var altLoadmodeScrollListner = function(){
|
583 |
-
if(lazySizesCfg.loadMode == 3){
|
584 |
-
lazySizesCfg.loadMode = 2;
|
585 |
-
}
|
586 |
-
afterScroll();
|
587 |
-
};
|
588 |
-
|
589 |
-
var onload = function(){
|
590 |
-
if(isCompleted){return;}
|
591 |
-
if(Date.now() - started < 999){
|
592 |
-
setTimeout(onload, 999);
|
593 |
-
return;
|
594 |
-
}
|
595 |
-
|
596 |
-
|
597 |
-
isCompleted = true;
|
598 |
-
|
599 |
-
lazySizesCfg.loadMode = 3;
|
600 |
-
|
601 |
-
throttledCheckElements();
|
602 |
-
|
603 |
-
addEventListener('scroll', altLoadmodeScrollListner, true);
|
604 |
-
};
|
605 |
-
|
606 |
-
return {
|
607 |
-
_: function(){
|
608 |
-
started = Date.now();
|
609 |
-
|
610 |
-
lazysizes.elements = document.getElementsByClassName(lazySizesCfg.lazyClass);
|
611 |
-
preloadElems = document.getElementsByClassName(lazySizesCfg.lazyClass + ' ' + lazySizesCfg.preloadClass);
|
612 |
-
|
613 |
-
addEventListener('scroll', throttledCheckElements, true);
|
614 |
-
|
615 |
-
addEventListener('resize', throttledCheckElements, true);
|
616 |
-
|
617 |
-
addEventListener('pageshow', function (e) {
|
618 |
-
if (e.persisted) {
|
619 |
-
var loadingElements = document.querySelectorAll('.' + lazySizesCfg.loadingClass);
|
620 |
-
|
621 |
-
if (loadingElements.length && loadingElements.forEach) {
|
622 |
-
requestAnimationFrame(function () {
|
623 |
-
loadingElements.forEach( function (img) {
|
624 |
-
if (img.complete) {
|
625 |
-
unveilElement(img);
|
626 |
-
}
|
627 |
-
});
|
628 |
-
});
|
629 |
-
}
|
630 |
-
}
|
631 |
-
});
|
632 |
-
|
633 |
-
if(window.MutationObserver){
|
634 |
-
new MutationObserver( throttledCheckElements ).observe( docElem, {childList: true, subtree: true, attributes: true} );
|
635 |
-
} else {
|
636 |
-
docElem[_addEventListener]('DOMNodeInserted', throttledCheckElements, true);
|
637 |
-
docElem[_addEventListener]('DOMAttrModified', throttledCheckElements, true);
|
638 |
-
setInterval(throttledCheckElements, 999);
|
639 |
-
}
|
640 |
-
|
641 |
-
addEventListener('hashchange', throttledCheckElements, true);
|
642 |
-
|
643 |
-
//, 'fullscreenchange'
|
644 |
-
['focus', 'mouseover', 'click', 'load', 'transitionend', 'animationend'].forEach(function(name){
|
645 |
-
document[_addEventListener](name, throttledCheckElements, true);
|
646 |
-
});
|
647 |
-
|
648 |
-
if((/d$|^c/.test(document.readyState))){
|
649 |
-
onload();
|
650 |
-
} else {
|
651 |
-
addEventListener('load', onload);
|
652 |
-
document[_addEventListener]('DOMContentLoaded', throttledCheckElements);
|
653 |
-
setTimeout(onload, 20000);
|
654 |
-
}
|
655 |
-
|
656 |
-
if(lazysizes.elements.length){
|
657 |
-
checkElements();
|
658 |
-
rAF._lsFlush();
|
659 |
-
} else {
|
660 |
-
throttledCheckElements();
|
661 |
-
}
|
662 |
-
},
|
663 |
-
checkElems: throttledCheckElements,
|
664 |
-
unveil: unveilElement,
|
665 |
-
_aLSL: altLoadmodeScrollListner,
|
666 |
-
};
|
667 |
-
})();
|
668 |
-
|
669 |
-
|
670 |
-
var autoSizer = (function(){
|
671 |
-
var autosizesElems;
|
672 |
-
|
673 |
-
var sizeElement = rAFIt(function(elem, parent, event, width){
|
674 |
-
var sources, i, len;
|
675 |
-
elem._lazysizesWidth = width;
|
676 |
-
width += 'px';
|
677 |
-
|
678 |
-
elem.setAttribute('sizes', width);
|
679 |
-
|
680 |
-
if(regPicture.test(parent.nodeName || '')){
|
681 |
-
sources = parent.getElementsByTagName('source');
|
682 |
-
for(i = 0, len = sources.length; i < len; i++){
|
683 |
-
sources[i].setAttribute('sizes', width);
|
684 |
-
}
|
685 |
-
}
|
686 |
-
|
687 |
-
if(!event.detail.dataAttr){
|
688 |
-
updatePolyfill(elem, event.detail);
|
689 |
-
}
|
690 |
-
});
|
691 |
-
var getSizeElement = function (elem, dataAttr, width){
|
692 |
-
var event;
|
693 |
-
var parent = elem.parentNode;
|
694 |
-
|
695 |
-
if(parent){
|
696 |
-
width = getWidth(elem, parent, width);
|
697 |
-
event = triggerEvent(elem, 'lazybeforesizes', {width: width, dataAttr: !!dataAttr});
|
698 |
-
|
699 |
-
if(!event.defaultPrevented){
|
700 |
-
width = event.detail.width;
|
701 |
-
|
702 |
-
if(width && width !== elem._lazysizesWidth){
|
703 |
-
sizeElement(elem, parent, event, width);
|
704 |
-
}
|
705 |
-
}
|
706 |
-
}
|
707 |
-
};
|
708 |
-
|
709 |
-
var updateElementsSizes = function(){
|
710 |
-
var i;
|
711 |
-
var len = autosizesElems.length;
|
712 |
-
if(len){
|
713 |
-
i = 0;
|
714 |
-
|
715 |
-
for(; i < len; i++){
|
716 |
-
getSizeElement(autosizesElems[i]);
|
717 |
-
}
|
718 |
-
}
|
719 |
-
};
|
720 |
-
|
721 |
-
var debouncedUpdateElementsSizes = debounce(updateElementsSizes);
|
722 |
-
|
723 |
-
return {
|
724 |
-
_: function(){
|
725 |
-
autosizesElems = document.getElementsByClassName(lazySizesCfg.autosizesClass);
|
726 |
-
addEventListener('resize', debouncedUpdateElementsSizes);
|
727 |
-
},
|
728 |
-
checkElems: debouncedUpdateElementsSizes,
|
729 |
-
updateElem: getSizeElement
|
730 |
-
};
|
731 |
-
})();
|
732 |
-
|
733 |
-
var init = function(){
|
734 |
-
if(!init.i && document.getElementsByClassName){
|
735 |
-
init.i = true;
|
736 |
-
autoSizer._();
|
737 |
-
loader._();
|
738 |
-
}
|
739 |
-
};
|
740 |
-
|
741 |
-
setTimeout(function(){
|
742 |
-
if(lazySizesCfg.init){
|
743 |
-
init();
|
744 |
-
}
|
745 |
-
});
|
746 |
-
|
747 |
-
lazysizes = {
|
748 |
-
cfg: lazySizesCfg,
|
749 |
-
autoSizer: autoSizer,
|
750 |
-
loader: loader,
|
751 |
-
init: init,
|
752 |
-
uP: updatePolyfill,
|
753 |
-
aC: addClass,
|
754 |
-
rC: removeClass,
|
755 |
-
hC: hasClass,
|
756 |
-
fire: triggerEvent,
|
757 |
-
gW: getWidth,
|
758 |
-
rAF: rAF,
|
759 |
-
};
|
760 |
-
|
761 |
-
return lazysizes;
|
762 |
-
}
|
763 |
-
));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/breeze-lazy-load.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
!function(e,t){t=t(e,e.document,Date),"object"==typeof module&&module.exports?module.exports=t:"function"==typeof define&&define.amd?define(t):e.lazySizes=t}(window,function(n,f,s){"use strict";var m,h;if(!function(){var e,t={lazyClass:"br-lazy",loadedClass:"br-loaded",loadingClass:"br-loading",preloadClass:"br-preload",errorClass:"br-error",autosizesClass:"br-autosizes",fastLoadedClass:"ls-is-cached",iframeLoadMode:0,srcAttr:"data-breeze",srcsetAttr:"data-brsrcset",sizesAttr:"data-brsizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};for(e in h=n.lazySizesConfig||n.lazysizesConfig||{},t)e in h||(h[e]=t[e])}(),!f||!f.getElementsByClassName)return{init:function(){},cfg:h,noSupport:!0};function r(e,t){return w[t]||(w[t]=new RegExp("(\\s|^)"+t+"(\\s|$)")),w[t].test(e[C]("class")||"")&&w[t]}function c(e,t){r(e,t)||e.setAttribute("class",(e[C]("class")||"").trim()+" "+t)}function u(e,t){(t=r(e,t))&&e.setAttribute("class",(e[C]("class")||"").replace(t," "))}function z(e,t,a,n,i){var s=f.createEvent("Event");return(a=a||{}).instance=m,s.initEvent(t,!n,!i),s.detail=a,e.dispatchEvent(s),s}function y(e,t){var a;!p&&(a=n.picturefill||h.pf)?(t&&t.src&&!e[C]("srcset")&&e.setAttribute("srcset",t.src),a({reevaluate:!0,elements:[e]})):t&&t.src&&(e.src=t.src)}function g(e,t){return(getComputedStyle(e,null)||{})[t]}function i(e,t,a){for(a=a||e.offsetWidth;a<h.minSize&&t&&!e._lazysizesWidth;)a=t.offsetWidth,t=t.parentNode;return a}var a,o,t,l,d,v=f.documentElement,p=n.HTMLPictureElement,b="addEventListener",C="getAttribute",e=n[b].bind(n),A=n.setTimeout,E=n.requestAnimationFrame||A,_=n.requestIdleCallback,M=/^picture$/i,N=["load","error","lazyincluded","_lazyloaded"],w={},L=Array.prototype.forEach,x=function(t,a,e){var n=e?b:"removeEventListener";e&&x(t,a),N.forEach(function(e){t[n](e,a)})},W=(l=[],d=t=[],B._lsFlush=S,B);function S(){var e=d;for(d=t.length?l:t,o=!(a=!0);e.length;)e.shift()();a=!1}function B(e,t){a&&!t?e.apply(this,arguments):(d.push(e),o||(o=!0,(f.hidden?A:E)(S)))}function T(a,e){return e?function(){W(a)}:function(){var e=this,t=arguments;W(function(){a.apply(e,t)})}}function F(e){function t(){a=null,e()}var a,n,i=function(){var e=s.now()-n;e<99?A(i,99-e):(_||t)(t)};return function(){n=s.now(),a=a||A(i,99)}}var R,D,k,H,O,P,$,q,I,U,j,G,J,K,Q,V,X,Y,Z,ee,te,ae,ne,ie,se,re,oe,le,de,ce,ue,fe=(Z=/^img$/i,ee=/^iframe$/i,te="onscroll"in n&&!/(gle|ing)bot/.test(navigator.userAgent),ie=-1,J=ze,Q=ne=ae=0,V=h.throttleDelay,X=h.ricTimeout,Y=_&&49<X?function(){_(ye,{timeout:X}),X!==h.ricTimeout&&(X=h.ricTimeout)}:T(function(){A(ye)},!0),re=T(ge),oe=function(e){re({target:e.target})},le=T(function(t,e,a,n,i){var s,r,o,l,d;(o=z(t,"lazybeforeunveil",e)).defaultPrevented||(n&&(a?c(t,h.autosizesClass):t.setAttribute("sizes",n)),s=t[C](h.srcsetAttr),a=t[C](h.srcAttr),i&&(r=(d=t.parentNode)&&M.test(d.nodeName||"")),l=e.firesLoad||"src"in t&&(s||a||r),o={target:t},c(t,h.loadingClass),l&&(clearTimeout(k),k=A(me,2500),x(t,oe,!0)),r&&L.call(d.getElementsByTagName("source"),ve),s?t.setAttribute("srcset",s):a&&!r&&(ee.test(t.nodeName)?(n=a,0==(d=(e=t).getAttribute("data-load-mode")||h.iframeLoadMode)?e.contentWindow.location.replace(n):1==d&&(e.src=n)):t.src=a),i&&(s||r)&&y(t,{src:a})),t._lazyRace&&delete t._lazyRace,u(t,h.lazyClass),W(function(){var e=t.complete&&1<t.naturalWidth;l&&!e||(e&&c(t,h.fastLoadedClass),ge(o),t._lazyCache=!0,A(function(){"_lazyCache"in t&&delete t._lazyCache},9)),"lazy"==t.loading&&ne--},!0)}),ce=F(function(){h.loadMode=3,se()}),ue=function(){D||(s.now()-O<999?A(ue,999):(D=!0,h.loadMode=3,se(),e("scroll",pe,!0)))},{_:function(){O=s.now(),m.elements=f.getElementsByClassName(h.lazyClass),R=f.getElementsByClassName(h.lazyClass+" "+h.preloadClass),e("scroll",se,!0),e("resize",se,!0),e("pageshow",function(e){var t;!e.persisted||(t=f.querySelectorAll("."+h.loadingClass)).length&&t.forEach&&E(function(){t.forEach(function(e){e.complete&&de(e)})})}),n.MutationObserver?new MutationObserver(se).observe(v,{childList:!0,subtree:!0,attributes:!0}):(v[b]("DOMNodeInserted",se,!0),v[b]("DOMAttrModified",se,!0),setInterval(se,999)),e("hashchange",se,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach(function(e){f[b](e,se,!0)}),/d$|^c/.test(f.readyState)?ue():(e("load",ue),f[b]("DOMContentLoaded",se),A(ue,2e4)),m.elements.length?(ze(),W._lsFlush()):se()},checkElems:se=function(e){var t;(e=!0===e)&&(X=33),K||(K=!0,(t=V-(s.now()-Q))<0&&(t=0),e||t<9?Y():A(Y,t))},unveil:de=function(e){var t,a,n,i;e._lazyRace||(!(i="auto"==(n=(a=Z.test(e.nodeName))&&(e[C](h.sizesAttr)||e[C]("sizes"))))&&D||!a||!e[C]("src")&&!e.srcset||e.complete||r(e,h.errorClass)||!r(e,h.lazyClass))&&(t=z(e,"lazyunveilread").detail,i&&Ee.updateElem(e,!0,e.offsetWidth),e._lazyRace=!0,ne++,le(e,t,i,n,a))},_aLSL:pe});function me(e){ne--,e&&!(ne<0)&&e.target||(ne=0)}function he(e){return null==G&&(G="hidden"==g(f.body,"visibility")),G||!("hidden"==g(e.parentNode,"visibility")&&"hidden"==g(e,"visibility"))}function ze(){var e,t,a,n,i,s,r,o,l,d,c,u=m.elements;if((H=h.loadMode)&&ne<8&&(e=u.length)){for(t=0,ie++;t<e;t++)if(u[t]&&!u[t]._lazyRace)if(!te||m.prematureUnveil&&m.prematureUnveil(u[t]))de(u[t]);else if((r=u[t][C]("data-expand"))&&(i=+r)||(i=ae),l||(l=!h.expand||h.expand<1?500<v.clientHeight&&500<v.clientWidth?500:370:h.expand,d=(m._defEx=l)*h.expFactor,c=h.hFac,G=null,ae<d&&ne<1&&2<ie&&2<H&&!f.hidden?(ae=d,ie=0):ae=1<H&&1<ie&&ne<6?l:0),o!==i&&(P=innerWidth+i*c,$=innerHeight+i,s=-1*i,o=i),d=u[t].getBoundingClientRect(),(j=d.bottom)>=s&&(q=d.top)<=$&&(U=d.right)>=s*c&&(I=d.left)<=P&&(j||U||I||q)&&(h.loadHidden||he(u[t]))&&(D&&ne<3&&!r&&(H<3||ie<4)||function(e,t){var a,n=e,i=he(e);for(q-=t,j+=t,I-=t,U+=t;i&&(n=n.offsetParent)&&n!=f.body&&n!=v;)(i=0<(g(n,"opacity")||1))&&"visible"!=g(n,"overflow")&&(a=n.getBoundingClientRect(),i=U>a.left&&I<a.right&&j>a.top-1&&q<a.bottom+1);return i}(u[t],i))){if(de(u[t]),n=!0,9<ne)break}else!n&&D&&!a&&ne<4&&ie<4&&2<H&&(R[0]||h.preloadAfterLoad)&&(R[0]||!r&&(j||U||I||q||"auto"!=u[t][C](h.sizesAttr)))&&(a=R[0]||u[t]);a&&!n&&de(a)}}function ye(){K=!1,Q=s.now(),J()}function ge(e){var t=e.target;t._lazyCache?delete t._lazyCache:(me(e),c(t,h.loadedClass),u(t,h.loadingClass),x(t,oe),z(t,"lazyloaded"))}function ve(e){var t,a=e[C](h.srcsetAttr);(t=h.customMedia[e[C]("data-media")||e[C]("media")])&&e.setAttribute("media",t),a&&e.setAttribute("srcset",a)}function pe(){3==h.loadMode&&(h.loadMode=2),ce()}var be,Ce,Ae,Ee=(Ce=T(function(e,t,a,n){var i,s,r;if(e._lazysizesWidth=n,n+="px",e.setAttribute("sizes",n),M.test(t.nodeName||""))for(s=0,r=(i=t.getElementsByTagName("source")).length;s<r;s++)i[s].setAttribute("sizes",n);a.detail.dataAttr||y(e,a.detail)}),{_:function(){be=f.getElementsByClassName(h.autosizesClass),e("resize",Ae)},checkElems:Ae=F(function(){var e,t=be.length;if(t)for(e=0;e<t;e++)_e(be[e])}),updateElem:_e});function _e(e,t,a){var n=e.parentNode;n&&(a=i(e,n,a),(t=z(e,"lazybeforesizes",{width:a,dataAttr:!!t})).defaultPrevented||(a=t.detail.width)&&a!==e._lazysizesWidth&&Ce(e,n,t,a))}var Me=function(){!Me.i&&f.getElementsByClassName&&(Me.i=!0,Ee._(),fe._())};return A(function(){h.init&&Me()}),m={cfg:h,autoSizer:Ee,loader:fe,init:Me,uP:y,aC:c,rC:u,hC:r,fire:z,gW:i,rAF:W}});
|
|
assets/js/breeze-main.js
ADDED
@@ -0,0 +1,1208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery( document ).ready(
|
2 |
+
function ( $ ) {
|
3 |
+
|
4 |
+
var $box_container = $( '.breeze-box' );
|
5 |
+
|
6 |
+
var $compatibility_warning = $( '#breeze-plugins-notice' );
|
7 |
+
if ( $compatibility_warning.length ) {
|
8 |
+
$( document ).on(
|
9 |
+
'click tap',
|
10 |
+
'.notice-dismiss',
|
11 |
+
function () {
|
12 |
+
$.ajax(
|
13 |
+
{
|
14 |
+
type: "POST",
|
15 |
+
url: ajaxurl,
|
16 |
+
data: { action: "compatibility_warning_close", 'breeze_close_warning': '1' },
|
17 |
+
dataType: "json", // xml, html, script, json, jsonp, text
|
18 |
+
success: function ( data ) {
|
19 |
+
|
20 |
+
},
|
21 |
+
error: function ( jqXHR, textStatus, errorThrown ) {
|
22 |
+
|
23 |
+
},
|
24 |
+
// called when the request finishes (after success and error callbacks are executed)
|
25 |
+
complete: function ( jqXHR, textStatus ) {
|
26 |
+
|
27 |
+
}
|
28 |
+
}
|
29 |
+
);
|
30 |
+
}
|
31 |
+
);
|
32 |
+
}
|
33 |
+
|
34 |
+
// Topbar action
|
35 |
+
$( document ).on(
|
36 |
+
'click',
|
37 |
+
'#wp-admin-bar-breeze-purge-varnish-group',
|
38 |
+
function ( e ) {
|
39 |
+
e.preventDefault();
|
40 |
+
breeze_purgeVarnish_callAjax();
|
41 |
+
}
|
42 |
+
);
|
43 |
+
|
44 |
+
$( document ).on(
|
45 |
+
'click',
|
46 |
+
'#wp-admin-bar-breeze-purge-file-group',
|
47 |
+
function ( e ) {
|
48 |
+
e.preventDefault();
|
49 |
+
breeze_purgeFile_callAjax();
|
50 |
+
}
|
51 |
+
);
|
52 |
+
|
53 |
+
var purge_action = true;
|
54 |
+
// Varnish clear button
|
55 |
+
$( '.breeze-box' ).on(
|
56 |
+
'click',
|
57 |
+
'#purge-varnish-button',
|
58 |
+
function ( e ) {
|
59 |
+
e.preventDefault();
|
60 |
+
|
61 |
+
if ( true === purge_action ) {
|
62 |
+
purge_action = false;
|
63 |
+
$( this ).addClass( 'br-is-disabled' );
|
64 |
+
breeze_purgeVarnish_callAjax();
|
65 |
+
}
|
66 |
+
|
67 |
+
}
|
68 |
+
);
|
69 |
+
|
70 |
+
//clear cache by button
|
71 |
+
function breeze_purgeVarnish_callAjax() {
|
72 |
+
$.ajax(
|
73 |
+
{
|
74 |
+
url: ajaxurl,
|
75 |
+
dataType: 'json',
|
76 |
+
method: 'POST',
|
77 |
+
data: {
|
78 |
+
action: 'breeze_purge_varnish',
|
79 |
+
is_network: $( 'body' ).hasClass( 'network-admin' ),
|
80 |
+
security: breeze_token_name.breeze_purge_varnish
|
81 |
+
},
|
82 |
+
success: function ( res ) {
|
83 |
+
current = location.href;
|
84 |
+
if ( res.clear ) {
|
85 |
+
var div = '<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;margin-left: 0;"><p><strong>Varnish Cache has been purged.</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>';
|
86 |
+
//backend
|
87 |
+
$( "#wpbody #wpbody-content" ).prepend( div );
|
88 |
+
setTimeout(
|
89 |
+
function () {
|
90 |
+
//location.reload();
|
91 |
+
purge_action = true;
|
92 |
+
},
|
93 |
+
2000
|
94 |
+
);
|
95 |
+
|
96 |
+
} else {
|
97 |
+
window.location.href = current + "breeze-msg=purge-fail";
|
98 |
+
purge_action = true;
|
99 |
+
location.reload();
|
100 |
+
}
|
101 |
+
}
|
102 |
+
}
|
103 |
+
);
|
104 |
+
}
|
105 |
+
|
106 |
+
function breeze_purgeFile_callAjax() {
|
107 |
+
$.ajax(
|
108 |
+
{
|
109 |
+
url: ajaxurl,
|
110 |
+
dataType: 'json',
|
111 |
+
method: 'POST',
|
112 |
+
data: {
|
113 |
+
action: 'breeze_purge_file',
|
114 |
+
security: breeze_token_name.breeze_purge_cache
|
115 |
+
},
|
116 |
+
success: function ( res ) {
|
117 |
+
current = location.href;
|
118 |
+
res = parseFloat( res );
|
119 |
+
var fileClean = res;
|
120 |
+
window.location.href = current + "#breeze-msg=success-cleancache&file=" + res;
|
121 |
+
//location.reload();
|
122 |
+
if ( fileClean > 0 ) {
|
123 |
+
div = '<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;margin-left: 0;"><p><strong>Internal cache has been purged: ' + fileClean + 'Kb cleaned</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>';
|
124 |
+
} else {
|
125 |
+
div = '<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;margin-left: 0;"><p><strong>Internal cache has been purged.</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>';
|
126 |
+
|
127 |
+
}
|
128 |
+
$( "#wpbody #wpbody-content" ).prepend( div );
|
129 |
+
|
130 |
+
}
|
131 |
+
}
|
132 |
+
);
|
133 |
+
}
|
134 |
+
|
135 |
+
function getParameterByName( name, url ) {
|
136 |
+
if ( ! url ) {
|
137 |
+
url = window.location.href;
|
138 |
+
}
|
139 |
+
name = name.replace( /[\[\]]/g, "\\$&" );
|
140 |
+
var regex = new RegExp( "[?&]" + name + "(=([^&#]*)|&|#|$)" ),
|
141 |
+
results = regex.exec( url );
|
142 |
+
if ( ! results ) {
|
143 |
+
return null;
|
144 |
+
}
|
145 |
+
if ( ! results[ 2 ] ) {
|
146 |
+
return '';
|
147 |
+
}
|
148 |
+
return decodeURIComponent( results[ 2 ].replace( /\+/g, " " ) );
|
149 |
+
}
|
150 |
+
|
151 |
+
var url = location.href;
|
152 |
+
var fileClean = parseFloat( getParameterByName( 'file', url ) );
|
153 |
+
|
154 |
+
$( window ).on(
|
155 |
+
'load',
|
156 |
+
function () {
|
157 |
+
var patt = /wp-admin/i;
|
158 |
+
if ( patt.test( url ) ) {
|
159 |
+
//backend
|
160 |
+
var div = '';
|
161 |
+
if ( url.indexOf( "msg=success-cleancache" ) > 0 && ! isNaN( fileClean ) ) {
|
162 |
+
if ( fileClean > 0 ) {
|
163 |
+
div = '<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;"><p><strong>Internal cache has been purged: ' + fileClean + 'Kb cleaned</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>';
|
164 |
+
} else {
|
165 |
+
div = '<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;"><p><strong>Internal cache has been purged.</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>';
|
166 |
+
|
167 |
+
}
|
168 |
+
|
169 |
+
$( "#wpbody .wrap h1" ).after( div );
|
170 |
+
|
171 |
+
var url_return = url.split( 'breeze-msg' );
|
172 |
+
setTimeout(
|
173 |
+
function () {
|
174 |
+
window.location = url_return[ 0 ];
|
175 |
+
//location.reload();
|
176 |
+
},
|
177 |
+
2000
|
178 |
+
);
|
179 |
+
}
|
180 |
+
} else {
|
181 |
+
//frontend
|
182 |
+
}
|
183 |
+
|
184 |
+
}
|
185 |
+
);
|
186 |
+
|
187 |
+
$( '#breeze-hide-install-msg' ).unbind( 'click' ).click(
|
188 |
+
function () {
|
189 |
+
$( this ).closest( 'div.notice' ).fadeOut();
|
190 |
+
}
|
191 |
+
)
|
192 |
+
|
193 |
+
function current_url_clean() {
|
194 |
+
var query_search = location.search;
|
195 |
+
if ( query_search.indexOf( 'breeze_purge=1' ) !== -1 && query_search.indexOf( '_wpnonce' ) !== -1 ) {
|
196 |
+
var params = new URLSearchParams( location.search );
|
197 |
+
params.delete( 'breeze_purge' )
|
198 |
+
params.delete( '_wpnonce' )
|
199 |
+
history.replaceState( null, '', '?' + params + location.hash )
|
200 |
+
}
|
201 |
+
}
|
202 |
+
|
203 |
+
current_url_clean();
|
204 |
+
|
205 |
+
$box_container.on(
|
206 |
+
'change',
|
207 |
+
'#bz-lazy-load',
|
208 |
+
function () {
|
209 |
+
|
210 |
+
var native_lazy = $( '#native-lazy-option' );
|
211 |
+
if ( true === $( this ).is( ':checked' ) ) {
|
212 |
+
native_lazy.show();
|
213 |
+
} else {
|
214 |
+
native_lazy.hide();
|
215 |
+
$( '#bz-lazy-load-nat' ).attr( 'checked', false );
|
216 |
+
}
|
217 |
+
}
|
218 |
+
);
|
219 |
+
/*
|
220 |
+
var font_display_swap = $( '#font-display-swap' );
|
221 |
+
var font_display = $( '#font-display' );
|
222 |
+
var css_minification = $( '#minification-css' );
|
223 |
+
|
224 |
+
if ( css_minification.is( ':checked' ) ) {
|
225 |
+
font_display_swap.show();
|
226 |
+
} else {
|
227 |
+
font_display_swap.hide();
|
228 |
+
font_display.attr( 'checked', false );
|
229 |
+
}
|
230 |
+
*/
|
231 |
+
|
232 |
+
$box_container.on(
|
233 |
+
'change',
|
234 |
+
'#minification-css',
|
235 |
+
function () {
|
236 |
+
var font_display_swap = $( '#font-display-swap' );
|
237 |
+
var font_display = $( '#font-display' );
|
238 |
+
|
239 |
+
var include_inline_css = $( '#include-inline-css' );
|
240 |
+
var group_css = $( '#group-css' );
|
241 |
+
|
242 |
+
if ( $( this ).is( ':checked' ) ) {
|
243 |
+
font_display_swap.show();
|
244 |
+
include_inline_css.removeAttr( 'disabled' );
|
245 |
+
group_css.removeAttr( 'disabled' );
|
246 |
+
} else {
|
247 |
+
font_display_swap.hide();
|
248 |
+
font_display.removeAttr( 'checked' );
|
249 |
+
include_inline_css.removeAttr( 'checked' ).attr( 'disabled', 'disabled' );
|
250 |
+
group_css.removeAttr( 'checked' ).attr( 'disabled', 'disabled' );
|
251 |
+
|
252 |
+
}
|
253 |
+
}
|
254 |
+
);
|
255 |
+
|
256 |
+
$box_container.on(
|
257 |
+
'change',
|
258 |
+
'#minification-js',
|
259 |
+
function () {
|
260 |
+
|
261 |
+
var include_inline_js = $( '#include-inline-js' );
|
262 |
+
var group_js = $( '#group-js' );
|
263 |
+
|
264 |
+
if ( $( this ).is( ':checked' ) ) {
|
265 |
+
include_inline_js.removeAttr( 'disabled' );
|
266 |
+
group_js.removeAttr( 'disabled' );
|
267 |
+
} else {
|
268 |
+
include_inline_js.removeAttr( 'checked' ).attr( 'disabled', 'disabled' );
|
269 |
+
group_js.removeAttr( 'checked' ).attr( 'disabled', 'disabled' );
|
270 |
+
|
271 |
+
}
|
272 |
+
}
|
273 |
+
);
|
274 |
+
|
275 |
+
$box_container.on(
|
276 |
+
'change',
|
277 |
+
'#enable-js-delay',
|
278 |
+
function () {
|
279 |
+
$delay_js_div = $( '#breeze-delay-js-scripts-div' );
|
280 |
+
|
281 |
+
if ( $( this ).is( ':checked' ) ) {
|
282 |
+
$delay_js_div.show();
|
283 |
+
} else {
|
284 |
+
$delay_js_div.hide();
|
285 |
+
}
|
286 |
+
}
|
287 |
+
)
|
288 |
+
}
|
289 |
+
);
|
290 |
+
|
291 |
+
var $valid_json = false;
|
292 |
+
jQuery( document ).ready(
|
293 |
+
function ( $ ) {
|
294 |
+
var $tab_import = $( '.breeze-box' );
|
295 |
+
// database clean tabs
|
296 |
+
$( 'input[name="all_control"]' ).click(
|
297 |
+
function () {
|
298 |
+
var checked = $( this ).is( ':checked' );
|
299 |
+
if ( checked == true ) {
|
300 |
+
$( ".clean-data" ).prop( "checked", true );
|
301 |
+
} else {
|
302 |
+
$( ".clean-data" ).prop( "checked", false );
|
303 |
+
}
|
304 |
+
}
|
305 |
+
);
|
306 |
+
|
307 |
+
$( '.clean-data' ).click(
|
308 |
+
function () {
|
309 |
+
var checked = $( this ).is( ':checked' );
|
310 |
+
if ( checked == false ) {
|
311 |
+
$( 'input[name="all_control"]' ).prop( 'checked', false );
|
312 |
+
}
|
313 |
+
}
|
314 |
+
);
|
315 |
+
|
316 |
+
function initRemoveBtn() {
|
317 |
+
$tab_import.on(
|
318 |
+
'click',
|
319 |
+
'span.item-remove',
|
320 |
+
function(){
|
321 |
+
var inputURL = $( this ).closest( '.breeze-input-group' );
|
322 |
+
inputURL.fadeOut(
|
323 |
+
300,
|
324 |
+
function () {
|
325 |
+
inputURL.remove();
|
326 |
+
validateMoveButtons();
|
327 |
+
}
|
328 |
+
);
|
329 |
+
}
|
330 |
+
);
|
331 |
+
|
332 |
+
}
|
333 |
+
|
334 |
+
initRemoveBtn();
|
335 |
+
|
336 |
+
function initSortableHandle() {
|
337 |
+
$( '.breeze-list-url' ).sortable(
|
338 |
+
{
|
339 |
+
handle: $( 'span.sort-handle' ),
|
340 |
+
stop: validateMoveButtons
|
341 |
+
}
|
342 |
+
);
|
343 |
+
}
|
344 |
+
|
345 |
+
initSortableHandle();
|
346 |
+
|
347 |
+
function initMoveButtons() {
|
348 |
+
$( '.sort-handle span' ).unbind( 'click' ).click(
|
349 |
+
function ( e ) {
|
350 |
+
var inputGroup = $( this ).parents( '.breeze-input-group' );
|
351 |
+
if ( $( this ).hasClass( 'moveUp' ) ) {
|
352 |
+
inputGroup.insertBefore( inputGroup.prev() );
|
353 |
+
} else {
|
354 |
+
inputGroup.insertAfter( inputGroup.next() );
|
355 |
+
}
|
356 |
+
|
357 |
+
validateMoveButtons();
|
358 |
+
}
|
359 |
+
);
|
360 |
+
}
|
361 |
+
|
362 |
+
initMoveButtons();
|
363 |
+
|
364 |
+
function validateMoveButtons() {
|
365 |
+
var listURL = $( '.breeze-list-url' );
|
366 |
+
listURL.find( '.breeze-input-group' ).find( '.sort-handle' ).find( 'span' ).removeClass( 'blur' );
|
367 |
+
listURL.find( '.breeze-input-group:first-child' ).find( '.moveUp' ).addClass( 'blur' );
|
368 |
+
listURL.find( '.breeze-input-group:last-child' ).find( '.moveDown' ).addClass( 'blur' );
|
369 |
+
}
|
370 |
+
|
371 |
+
validateMoveButtons();
|
372 |
+
|
373 |
+
function is_valid_url(str) {
|
374 |
+
var regexp = /^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/;
|
375 |
+
if (regexp.test( str )) {
|
376 |
+
return true;
|
377 |
+
} else {
|
378 |
+
return false;
|
379 |
+
}
|
380 |
+
}
|
381 |
+
$tab_import.on(
|
382 |
+
'keyup change blur',
|
383 |
+
'.breeze-input-url',
|
384 |
+
function(){
|
385 |
+
var url_value = $( this ).val();
|
386 |
+
if ('' !== url_value) {
|
387 |
+
var is_valid = is_valid_url( url_value );
|
388 |
+
if (true === is_valid) {
|
389 |
+
$( this ).removeClass( 'is-invalid-url' )
|
390 |
+
} else {
|
391 |
+
$( this ).addClass( 'is-invalid-url' );
|
392 |
+
}
|
393 |
+
}
|
394 |
+
}
|
395 |
+
);
|
396 |
+
|
397 |
+
//$( 'button.add-url' ).unbind( 'click' ).click(
|
398 |
+
$tab_import.on(
|
399 |
+
'click',
|
400 |
+
'button.add-url',
|
401 |
+
function () {
|
402 |
+
|
403 |
+
var defer = $( this ).attr( 'id' ).indexOf( 'defer' ) > -1;
|
404 |
+
var preload = $( this ).attr( 'id' ).indexOf( 'preload-fonts' ) > -1;
|
405 |
+
var listURL = $( this ).closest( 'div.br-option' ).find( '.breeze-list-url' );
|
406 |
+
var html = '';
|
407 |
+
var listInput = listURL.find( '.breeze-input-group' );
|
408 |
+
var emptyInput = false;
|
409 |
+
|
410 |
+
listInput.each(
|
411 |
+
function () {
|
412 |
+
var thisInput = $( this ).find( '.breeze-input-url' );
|
413 |
+
if ( thisInput.val().trim() === '' ) {
|
414 |
+
thisInput.focus();
|
415 |
+
emptyInput = true;
|
416 |
+
return false;
|
417 |
+
}
|
418 |
+
}
|
419 |
+
);
|
420 |
+
|
421 |
+
if ( emptyInput ) {
|
422 |
+
return false;
|
423 |
+
}
|
424 |
+
|
425 |
+
html += '<div class="breeze-input-group">';
|
426 |
+
html += ' <input type="text" size="98"';
|
427 |
+
html += 'class="breeze-input-url"';
|
428 |
+
if ( preload ) {
|
429 |
+
html += 'name="breeze-preload-font[]"';
|
430 |
+
} else if ( ! defer ) {
|
431 |
+
html += 'name="move-to-footer-js[]"';
|
432 |
+
} else {
|
433 |
+
html += 'name="defer-js[]"';
|
434 |
+
}
|
435 |
+
html += 'placeholder="Enter URL..."';
|
436 |
+
html += 'value="" />';
|
437 |
+
html += ' <span class="sort-handle">';
|
438 |
+
html += ' <span class="dashicons dashicons-arrow-up moveUp"></span>';
|
439 |
+
html += ' <span class="dashicons dashicons-arrow-down moveDown"></span>';
|
440 |
+
html += ' </span>';
|
441 |
+
html += ' <span class="dashicons dashicons-no item-remove" title="Remove"></span>';
|
442 |
+
html += '</div>';
|
443 |
+
|
444 |
+
listURL.append( html );
|
445 |
+
initRemoveBtn();
|
446 |
+
initSortableHandle();
|
447 |
+
initMoveButtons();
|
448 |
+
validateMoveButtons();
|
449 |
+
}
|
450 |
+
);
|
451 |
+
|
452 |
+
// Change tab // TODO REMOVE
|
453 |
+
$( "#breeze-tabs .nav-tab" ).click(
|
454 |
+
function ( e ) {
|
455 |
+
e.preventDefault();
|
456 |
+
$( "#breeze-tabs .nav-tab" ).removeClass( 'active' );
|
457 |
+
$( e.target ).addClass( 'active' );
|
458 |
+
id_tab = $( this ).data( 'tab-id' );
|
459 |
+
$( "#tab-" + id_tab ).addClass( 'active' );
|
460 |
+
$( "#breeze-tabs-content .tab-pane" ).removeClass( 'active' );
|
461 |
+
$( "#tab-content-" + id_tab ).addClass( 'active' );
|
462 |
+
document.cookie = 'breeze_active_tab=' + id_tab;
|
463 |
+
|
464 |
+
// Toggle right-side content
|
465 |
+
if ( id_tab === 'faq' ) {
|
466 |
+
$( '#breeze-and-cloudways' ).hide();
|
467 |
+
$( '#faq-content' ).accordion(
|
468 |
+
{
|
469 |
+
collapsible: true,
|
470 |
+
animate: 200,
|
471 |
+
header: '.faq-question',
|
472 |
+
heightStyle: 'content'
|
473 |
+
}
|
474 |
+
);
|
475 |
+
} else {
|
476 |
+
$( '#breeze-and-cloudways' ).show();
|
477 |
+
}
|
478 |
+
}
|
479 |
+
);
|
480 |
+
|
481 |
+
// Cookie do
|
482 |
+
function setTabFromCookie() {
|
483 |
+
active_tab = getCookie( 'breeze_active_tab' );
|
484 |
+
if ( ! active_tab ) {
|
485 |
+
active_tab = 'basic';
|
486 |
+
}
|
487 |
+
|
488 |
+
if ('import_export' === active_tab) {
|
489 |
+
active_tab = 'basic';
|
490 |
+
}
|
491 |
+
|
492 |
+
if ( $( "#tab-" + active_tab ).length === 0 ) { // Tab not found (multisite case)
|
493 |
+
firstTab = $( '#breeze-tabs' ).find( 'a:first-child' );
|
494 |
+
if (firstTab.length) {
|
495 |
+
tabType = firstTab.attr( 'id' ).replace( 'tab-', '' );
|
496 |
+
firstTab.addClass( 'active' );
|
497 |
+
$( "#tab-content-" + tabType ).addClass( 'active' );
|
498 |
+
}
|
499 |
+
} else {
|
500 |
+
$( "#tab-" + active_tab ).addClass( 'active' );
|
501 |
+
$( "#tab-content-" + active_tab ).addClass( 'active' );
|
502 |
+
}
|
503 |
+
|
504 |
+
// Toggle right-side content
|
505 |
+
if ( active_tab === 'faq' ) {
|
506 |
+
$( '#breeze-and-cloudways' ).hide();
|
507 |
+
$( '#faq-content' ).accordion(
|
508 |
+
{
|
509 |
+
collapsible: true,
|
510 |
+
animate: 200,
|
511 |
+
header: '.faq-question',
|
512 |
+
heightStyle: 'content'
|
513 |
+
}
|
514 |
+
);
|
515 |
+
} else {
|
516 |
+
$( '#breeze-and-cloudways' ).show();
|
517 |
+
}
|
518 |
+
}
|
519 |
+
|
520 |
+
function getCookie( cname ) {
|
521 |
+
var name = cname + "=";
|
522 |
+
var ca = document.cookie.split( ';' );
|
523 |
+
for ( var i = 0; i < ca.length; i++ ) {
|
524 |
+
var c = ca[ i ];
|
525 |
+
while ( c.charAt( 0 ) == ' ' ) {
|
526 |
+
c = c.substring( 1 );
|
527 |
+
}
|
528 |
+
if ( c.indexOf( name ) == 0 ) {
|
529 |
+
return c.substring( name.length, c.length );
|
530 |
+
}
|
531 |
+
}
|
532 |
+
return "";
|
533 |
+
}
|
534 |
+
|
535 |
+
setTabFromCookie();
|
536 |
+
|
537 |
+
// Sub-site settings toggle.
|
538 |
+
var global_tabs = [
|
539 |
+
'faq'
|
540 |
+
];
|
541 |
+
var save_settings_inherit_form_on_submit = true;
|
542 |
+
var settings_inherit_form_did_change = false;
|
543 |
+
var $settings_inherit_form = $( '#breeze-inherit-settings-toggle' );
|
544 |
+
if ( $settings_inherit_form.length ) {
|
545 |
+
$( 'input', $settings_inherit_form ).on(
|
546 |
+
'change',
|
547 |
+
function () {
|
548 |
+
var inherit = $( this ).val() == '1';
|
549 |
+
|
550 |
+
$( '#breeze-tabs' ).toggleClass( 'tabs-hidden', inherit );
|
551 |
+
$( '#breeze-tabs-content' ).toggleClass( 'tabs-hidden', inherit );
|
552 |
+
|
553 |
+
$( '#breeze-tabs .nav-tab' ).each(
|
554 |
+
function () {
|
555 |
+
var tab_id = $( this ).data( 'tab-id' );
|
556 |
+
|
557 |
+
if ( $.inArray( tab_id, global_tabs ) === -1 ) {
|
558 |
+
$( this ).toggleClass( 'inactive', inherit );
|
559 |
+
$( '#breeze-tabs-content #tab-content-' + tab_id ).toggleClass( 'inactive', inherit );
|
560 |
+
}
|
561 |
+
}
|
562 |
+
);
|
563 |
+
|
564 |
+
settings_inherit_form_did_change = ! $( this ).parents( '.radio-field' ).hasClass( 'active' );
|
565 |
+
|
566 |
+
//$( 'p.disclaimer', $settings_inherit_form ).toggle( settings_inherit_form_did_change );
|
567 |
+
}
|
568 |
+
);
|
569 |
+
|
570 |
+
$( '#breeze-tabs-content form' ).on(
|
571 |
+
'submit',
|
572 |
+
function ( event ) {
|
573 |
+
var $form = $( this );
|
574 |
+
|
575 |
+
if ( save_settings_inherit_form_on_submit && settings_inherit_form_did_change ) {
|
576 |
+
event.preventDefault();
|
577 |
+
|
578 |
+
$.ajax(
|
579 |
+
{
|
580 |
+
url: window.location,
|
581 |
+
method: 'post',
|
582 |
+
data: $settings_inherit_form.serializeArray(),
|
583 |
+
|
584 |
+
beforeSend: function () {
|
585 |
+
$settings_inherit_form.addClass( 'loading' );
|
586 |
+
},
|
587 |
+
|
588 |
+
complete: function () {
|
589 |
+
$settings_inherit_form.removeClass( 'loading' );
|
590 |
+
|
591 |
+
// Continue form submit.
|
592 |
+
settings_inherit_form_did_change = false;
|
593 |
+
$form.submit();
|
594 |
+
},
|
595 |
+
|
596 |
+
success: function () {
|
597 |
+
$( 'input:checked', $settings_inherit_form ).parents( '.radio-field' ).addClass( 'active' ).siblings().removeClass( 'active' );
|
598 |
+
}
|
599 |
+
}
|
600 |
+
);
|
601 |
+
} else {
|
602 |
+
return;
|
603 |
+
}
|
604 |
+
}
|
605 |
+
);
|
606 |
+
}
|
607 |
+
|
608 |
+
// Database optimization.
|
609 |
+
$( '#breeze-database-optimize' ).on(
|
610 |
+
'click',
|
611 |
+
function ( event ) {
|
612 |
+
save_settings_inherit_form_on_submit = false;
|
613 |
+
}
|
614 |
+
);
|
615 |
+
$( '#tab-content-database .submit input' ).on(
|
616 |
+
'click',
|
617 |
+
function ( event ) {
|
618 |
+
$( '#tab-content-database input[type=checkbox]' ).attr( 'checked', false );
|
619 |
+
}
|
620 |
+
);
|
621 |
+
|
622 |
+
function remove_query_arg( url, arg ) {
|
623 |
+
var urlparts = url.split( '?' );
|
624 |
+
if ( urlparts.length >= 2 ) {
|
625 |
+
var prefix = encodeURIComponent( arg ) + '=';
|
626 |
+
var pars = urlparts[ 1 ].split( /[&;]/g );
|
627 |
+
|
628 |
+
for ( var i = pars.length; i-- > 0; ) {
|
629 |
+
if ( pars[ i ].lastIndexOf( prefix, 0 ) !== -1 ) {
|
630 |
+
pars.splice( i, 1 );
|
631 |
+
}
|
632 |
+
}
|
633 |
+
|
634 |
+
return urlparts[ 0 ] + ( pars.length > 0 ? '?' + pars.join( '&' ) : '' );
|
635 |
+
}
|
636 |
+
return url;
|
637 |
+
}
|
638 |
+
|
639 |
+
// Remove notice query args from URL.
|
640 |
+
if ( window.history && typeof window.history.pushState === 'function' ) {
|
641 |
+
var clean_url = remove_query_arg( window.location.href, 'save-settings' );
|
642 |
+
clean_url = remove_query_arg( clean_url, 'database-cleanup' );
|
643 |
+
window.history.pushState( null, null, clean_url );
|
644 |
+
}
|
645 |
+
|
646 |
+
/**
|
647 |
+
* Import/Export settings TAB.
|
648 |
+
*/
|
649 |
+
|
650 |
+
$tab_import.on(
|
651 |
+
'click tap',
|
652 |
+
'#breeze_export_settings',
|
653 |
+
function () {
|
654 |
+
$network = $( '#breeze-level' ).val();
|
655 |
+
window.location = ajaxurl + '?action=breeze_export_json&network_level=' + $network;
|
656 |
+
}
|
657 |
+
);
|
658 |
+
|
659 |
+
$( '#breeze_import_btn' ).attr( 'disabled', 'disabled' );
|
660 |
+
|
661 |
+
$tab_import.on(
|
662 |
+
'change',
|
663 |
+
'#breeze_import_settings',
|
664 |
+
function () {
|
665 |
+
var the_file = this.files[ 0 ];
|
666 |
+
var filename_holder = $( '#file-selected' );
|
667 |
+
var filename_error = $( '#file-error' );
|
668 |
+
var breeze_import_btn = $( '#breeze_import_btn' );
|
669 |
+
|
670 |
+
filename_holder.html( the_file.name );
|
671 |
+
if ( 'application/json' !== the_file.type ) {
|
672 |
+
$valid_json = false;
|
673 |
+
filename_holder.removeClass( 'file_green file_red' ).addClass( 'file_red' );
|
674 |
+
filename_error.html( 'File must be JSON' );
|
675 |
+
breeze_import_btn.attr( 'disabled', 'disabled' );
|
676 |
+
} else {
|
677 |
+
$valid_json = true;
|
678 |
+
filename_holder.removeClass( 'file_green file_red' ).addClass( 'file_green' );
|
679 |
+
filename_error.html( '' );
|
680 |
+
breeze_import_btn.removeAttr( 'disabled' );
|
681 |
+
}
|
682 |
+
$( '.br-file-text' ).remove();
|
683 |
+
}
|
684 |
+
);
|
685 |
+
|
686 |
+
$tab_import.on(
|
687 |
+
'click tap',
|
688 |
+
'#breeze_import_btn',
|
689 |
+
function () {
|
690 |
+
if ( true === $valid_json ) {
|
691 |
+
network = $( '#breeze-level' ).val();
|
692 |
+
var the_file = $( '#breeze_import_settings' ).get( 0 ).files[ 0 ];
|
693 |
+
|
694 |
+
var breeze_data = new FormData();
|
695 |
+
breeze_data.append( 'action', 'breeze_import_json' );
|
696 |
+
breeze_data.append( 'network_level', network );
|
697 |
+
breeze_data.append( 'breeze_import_file', the_file );
|
698 |
+
|
699 |
+
var filename_holder = $( '#file-selected' );
|
700 |
+
var filename_error = $( '#file-error' );
|
701 |
+
var import_settings = '<div class="br-loader-spinner import_settings"><div></div><div></div><div></div><div></div></div>';
|
702 |
+
filename_holder.removeClass( 'file_green file_red' ).addClass( 'file_green' );
|
703 |
+
filename_holder.html( import_settings );
|
704 |
+
$.ajax(
|
705 |
+
{
|
706 |
+
type: "POST",
|
707 |
+
url: ajaxurl,
|
708 |
+
data: breeze_data,
|
709 |
+
processData: false,
|
710 |
+
contentType: false,
|
711 |
+
enctype: 'multipart/form-data',
|
712 |
+
mimeType: 'multipart/form-data', // this too
|
713 |
+
cache: false,
|
714 |
+
dataType: 'json', // xml, html, script, json, jsonp, text
|
715 |
+
success: function ( json ) {
|
716 |
+
|
717 |
+
if ( true == json.success ) {
|
718 |
+
filename_holder.removeClass( 'file_green file_red' ).addClass( 'file_green' );
|
719 |
+
filename_holder.html( json.data );
|
720 |
+
filename_error.html( '' );
|
721 |
+
alert( json.data );
|
722 |
+
window.location.reload( true );
|
723 |
+
} else {
|
724 |
+
filename_holder.removeClass( 'file_green file_red' );
|
725 |
+
filename_holder.html( '' );
|
726 |
+
filename_error.html( json.data[ 0 ].message );
|
727 |
+
}
|
728 |
+
},
|
729 |
+
error: function ( jqXHR, textStatus, errorThrown ) {
|
730 |
+
|
731 |
+
},
|
732 |
+
// called when the request finishes (after success and error callbacks are executed)
|
733 |
+
complete: function ( jqXHR, textStatus ) {
|
734 |
+
|
735 |
+
}
|
736 |
+
}
|
737 |
+
);
|
738 |
+
|
739 |
+
}
|
740 |
+
}
|
741 |
+
);
|
742 |
+
}
|
743 |
+
);
|
744 |
+
|
745 |
+
/**
|
746 |
+
* Created by <Cloudways> on 09/11/2021.
|
747 |
+
*/
|
748 |
+
( function ( $ ) {
|
749 |
+
var selected_services = [];
|
750 |
+
|
751 |
+
setTimeout(
|
752 |
+
function () {
|
753 |
+
var found_alert = $( '#message-clear-cache-top' );
|
754 |
+
if ( found_alert.length ) {
|
755 |
+
found_alert.prependTo( '#wpbody-content' );
|
756 |
+
found_alert.show();
|
757 |
+
}
|
758 |
+
},
|
759 |
+
1000
|
760 |
+
);
|
761 |
+
|
762 |
+
$( window ).on(
|
763 |
+
'resize',
|
764 |
+
function () {
|
765 |
+
var win = $( this ); //this = window
|
766 |
+
if ( win.height() >= 632 ) {
|
767 |
+
$( '.br-link' ).removeAttr( 'style' );
|
768 |
+
}
|
769 |
+
}
|
770 |
+
);
|
771 |
+
|
772 |
+
var loader_spinner = '<div class="br-loader-spinner loading_tab"><div></div><div></div><div></div><div></div></div>';
|
773 |
+
var loader_spinner_save = '<div class="br-loader-spinner saving_settings"><div></div><div></div><div></div><div></div></div>';
|
774 |
+
|
775 |
+
$( '.breeze-box .br-link' ).on(
|
776 |
+
'click tap',
|
777 |
+
'a',
|
778 |
+
function ( e ) {
|
779 |
+
e.preventDefault();
|
780 |
+
var requested_tab = this.dataset.tabId;
|
781 |
+
var $html_area = $( '.br-options' );
|
782 |
+
active_tab = get_cookie( 'breeze_active_tab' );
|
783 |
+
if ( ! active_tab ) {
|
784 |
+
active_tab = 'basic';
|
785 |
+
}
|
786 |
+
|
787 |
+
$( '.br-link' ).removeClass( 'br-active' );
|
788 |
+
$( '.br-link' ).each(
|
789 |
+
function ( index, element ) {
|
790 |
+
// element == this
|
791 |
+
var $the_slug = element.dataset.breezeLink;
|
792 |
+
var $image = $( this ).find( 'img' );
|
793 |
+
var $image_path = $image.get( 0 ).dataset.path;
|
794 |
+
$image.attr( 'src', $image_path + $the_slug + '.png' );
|
795 |
+
}
|
796 |
+
);
|
797 |
+
|
798 |
+
var this_line = $( this ).closest( '.br-link' );
|
799 |
+
this_line.addClass( 'br-active' );
|
800 |
+
var $image = this_line.find( 'img' );
|
801 |
+
var $image_path = $image.get( 0 ).dataset.path;
|
802 |
+
$image.attr( 'src', $image_path + requested_tab + '-active.png' );
|
803 |
+
$html_area.html( loader_spinner );
|
804 |
+
|
805 |
+
var $mobile_menu_is = $( '.br-mobile-menu' ).is( ':visible' );
|
806 |
+
if ( true === $mobile_menu_is ) {
|
807 |
+
$( '.br-link' ).fadeOut();
|
808 |
+
}
|
809 |
+
|
810 |
+
$.ajax(
|
811 |
+
{
|
812 |
+
type: "GET",
|
813 |
+
url: ajaxurl,
|
814 |
+
data: { action: 'breeze_load_options_tab', 'request_tab': requested_tab, 'is-network': $( 'body' ).hasClass( 'network-admin' ) },
|
815 |
+
contentType: 'text/html; charset=UTF-8',
|
816 |
+
dataType: 'html', // xml, html, script, json, jsonp, text
|
817 |
+
success: function ( data ) {
|
818 |
+
$html_area.html( data );
|
819 |
+
},
|
820 |
+
error: function ( jqXHR, textStatus, errorThrown ) {
|
821 |
+
|
822 |
+
},
|
823 |
+
// called when the request finishes (after success and error callbacks are executed)
|
824 |
+
complete: function ( jqXHR, textStatus ) {
|
825 |
+
document.cookie = 'breeze_active_tab=' + requested_tab;
|
826 |
+
if ( 'faq' === requested_tab ) {
|
827 |
+
$( '#faq-content' ).accordion(
|
828 |
+
{
|
829 |
+
collapsible: true,
|
830 |
+
animate: 200,
|
831 |
+
header: '.faq-question',
|
832 |
+
heightStyle: 'content'
|
833 |
+
}
|
834 |
+
);
|
835 |
+
}
|
836 |
+
selected_services = [];
|
837 |
+
}
|
838 |
+
}
|
839 |
+
);
|
840 |
+
}
|
841 |
+
);
|
842 |
+
|
843 |
+
function get_cookie( cname ) {
|
844 |
+
var name = cname + "=";
|
845 |
+
var ca = document.cookie.split( ';' );
|
846 |
+
for ( var i = 0; i < ca.length; i++ ) {
|
847 |
+
var c = ca[ i ];
|
848 |
+
while ( c.charAt( 0 ) == ' ' ) {
|
849 |
+
c = c.substring( 1 );
|
850 |
+
}
|
851 |
+
if ( c.indexOf( name ) == 0 ) {
|
852 |
+
return c.substring( name.length, c.length );
|
853 |
+
}
|
854 |
+
}
|
855 |
+
return "";
|
856 |
+
}
|
857 |
+
|
858 |
+
var active_tab = get_cookie( 'breeze_active_tab' );
|
859 |
+
|
860 |
+
if ( $( '#tab-basic' ).closest( 'div.br-link' ).hasClass( 'br-hide' ) ) {
|
861 |
+
$( '#tab-faq' ).trigger( 'click' );
|
862 |
+
|
863 |
+
} else {
|
864 |
+
|
865 |
+
if ( typeof active_tab !== 'undefined' && '' !== active_tab ) {
|
866 |
+
if ('import_export' === active_tab) {
|
867 |
+
active_tab = 'basic';
|
868 |
+
}
|
869 |
+
var link_target = $( '#tab-' + active_tab );
|
870 |
+
if ( link_target.length ) {
|
871 |
+
link_target.trigger( 'click' );
|
872 |
+
}
|
873 |
+
} else {
|
874 |
+
var default_target = $( '#tab-basic' );
|
875 |
+
if ( default_target.length ) {
|
876 |
+
default_target.trigger( 'click' );
|
877 |
+
}
|
878 |
+
}
|
879 |
+
}
|
880 |
+
|
881 |
+
var $container_box = $( '.breeze-box' );
|
882 |
+
|
883 |
+
$container_box.on(
|
884 |
+
'click',
|
885 |
+
'.br-db-item',
|
886 |
+
function () {
|
887 |
+
var this_section_id = this.dataset.section;
|
888 |
+
|
889 |
+
if ( $( this ).hasClass( 'br-db-selected' ) ) {
|
890 |
+
$( this ).removeClass( 'br-db-selected' );
|
891 |
+
if ( selected_services.length ) {
|
892 |
+
var temp_array = [];
|
893 |
+
for ( var i = 0; i < selected_services.length; i++ ) {
|
894 |
+
if ( this_section_id !== selected_services[ i ] ) {
|
895 |
+
temp_array.push( selected_services[ i ] );
|
896 |
+
}
|
897 |
+
}
|
898 |
+
selected_services = temp_array;
|
899 |
+
}
|
900 |
+
} else {
|
901 |
+
$( this ).addClass( 'br-db-selected' );
|
902 |
+
selected_services.push( this_section_id );
|
903 |
+
}
|
904 |
+
|
905 |
+
var submit_services = $( '#optimize-selected-services' );
|
906 |
+
if ( selected_services.length ) {
|
907 |
+
submit_services.show();
|
908 |
+
} else {
|
909 |
+
submit_services.hide();
|
910 |
+
}
|
911 |
+
}
|
912 |
+
);
|
913 |
+
$container_box.on(
|
914 |
+
'click',
|
915 |
+
'#optimize-selected-services',
|
916 |
+
function ( e ) {
|
917 |
+
var do_task = false;
|
918 |
+
if ( selected_services.length ) {
|
919 |
+
do_task = true;
|
920 |
+
}
|
921 |
+
if ( false === do_task ) {
|
922 |
+
alert( 'Please select an options first' );
|
923 |
+
} else {
|
924 |
+
var ask_clean_start = confirm( 'Proceed to optimize the selected items?' );
|
925 |
+
|
926 |
+
if ( ask_clean_start ) {
|
927 |
+
$.ajax(
|
928 |
+
{
|
929 |
+
type: "POST",
|
930 |
+
url: ajaxurl,
|
931 |
+
data: {
|
932 |
+
action: "breeze_purge_database",
|
933 |
+
'action_type': 'custom',
|
934 |
+
'services': JSON.stringify( Object.assign( {}, selected_services ) ),
|
935 |
+
'security': breeze_token_name.breeze_purge_database,
|
936 |
+
'is-network': $( 'body' ).hasClass( 'network-admin' )
|
937 |
+
},
|
938 |
+
dataType: "JSON", // xml, html, script, json, jsonp, text
|
939 |
+
success: function ( data ) {
|
940 |
+
|
941 |
+
$( 'div.br-db-item' ).each(
|
942 |
+
function ( index, element ) {
|
943 |
+
var this_section_id = element.dataset.section;
|
944 |
+
// element == this
|
945 |
+
if ( $.inArray( this_section_id, selected_services ) !== -1 ) {
|
946 |
+
$( element ).find( 'h3' ).find( 'span' ).removeClass( 'br-has' ).html( '0' );
|
947 |
+
$( element ).removeClass( 'br-db-selected' );
|
948 |
+
}
|
949 |
+
}
|
950 |
+
);
|
951 |
+
|
952 |
+
alert( 'Optimization process finished' );
|
953 |
+
$( '#tab-database' ).trigger( 'click' );
|
954 |
+
},
|
955 |
+
error: function ( jqXHR, textStatus, errorThrown ) {
|
956 |
+
|
957 |
+
},
|
958 |
+
// called when the request finishes (after success and error callbacks are executed)
|
959 |
+
complete: function ( jqXHR, textStatus ) {
|
960 |
+
selected_services = [];
|
961 |
+
}
|
962 |
+
}
|
963 |
+
);
|
964 |
+
}
|
965 |
+
}
|
966 |
+
}
|
967 |
+
);
|
968 |
+
|
969 |
+
$container_box.on(
|
970 |
+
'click',
|
971 |
+
'.do_clean_action',
|
972 |
+
function ( e ) {
|
973 |
+
e.preventDefault();
|
974 |
+
var action_type = this.dataset.section;
|
975 |
+
var section = $( this ).closest( 'div.br-db-item' );
|
976 |
+
var section_title = section.get( 0 ).dataset.sectionTitle;
|
977 |
+
|
978 |
+
var confirm_action = confirm( 'Confirm the action to clean ' + section_title );
|
979 |
+
|
980 |
+
if ( confirm_action ) {
|
981 |
+
$( this ).addClass( 'opac' );
|
982 |
+
$.ajax(
|
983 |
+
{
|
984 |
+
type: "POST",
|
985 |
+
url: ajaxurl,
|
986 |
+
data: {
|
987 |
+
action: "breeze_purge_database",
|
988 |
+
'action_type': action_type,
|
989 |
+
'security': breeze_token_name.breeze_purge_database,
|
990 |
+
'is-network': $( 'body' ).hasClass( 'network-admin' )
|
991 |
+
},
|
992 |
+
dataType: "JSON", // xml, html, script, json, jsonp, text
|
993 |
+
success: function ( data ) {
|
994 |
+
section.find( 'h3' ).find( 'span' ).removeClass( 'br-has' ).html( '0' );
|
995 |
+
|
996 |
+
alert( 'Data for ' + section_title + ' has been cleaned' );
|
997 |
+
},
|
998 |
+
error: function ( jqXHR, textStatus, errorThrown ) {
|
999 |
+
|
1000 |
+
},
|
1001 |
+
// called when the request finishes (after success and error callbacks are executed)
|
1002 |
+
complete: function ( jqXHR, textStatus ) {
|
1003 |
+
|
1004 |
+
}
|
1005 |
+
}
|
1006 |
+
);
|
1007 |
+
}
|
1008 |
+
}
|
1009 |
+
);
|
1010 |
+
|
1011 |
+
$container_box.on(
|
1012 |
+
'change',
|
1013 |
+
'#br-clean-all',
|
1014 |
+
function ( e ) {
|
1015 |
+
var is_selected = $( this ).is( ':checked' );
|
1016 |
+
var the_action_button = $( '#br-clean-all-cta' );
|
1017 |
+
|
1018 |
+
if ( true === is_selected ) {
|
1019 |
+
the_action_button.removeAttr( 'disabled' );
|
1020 |
+
} else {
|
1021 |
+
the_action_button.attr( 'disabled', 'disabled' );
|
1022 |
+
}
|
1023 |
+
}
|
1024 |
+
);
|
1025 |
+
|
1026 |
+
$container_box.on(
|
1027 |
+
'click',
|
1028 |
+
'#br-clean-all-cta',
|
1029 |
+
function ( e ) {
|
1030 |
+
var is_disabled = $( this ).is( ':disabled' );
|
1031 |
+
|
1032 |
+
if ( false === is_disabled ) {
|
1033 |
+
var ask_clean_start = confirm( 'Proceed to clean all trashed posts and pages?' );
|
1034 |
+
|
1035 |
+
if ( ask_clean_start ) {
|
1036 |
+
$.ajax(
|
1037 |
+
{
|
1038 |
+
type: "POST",
|
1039 |
+
url: ajaxurl,
|
1040 |
+
data: {
|
1041 |
+
action: "breeze_purge_database",
|
1042 |
+
'action_type': 'all',
|
1043 |
+
'security': breeze_token_name.breeze_purge_database,
|
1044 |
+
'is-network': $( 'body' ).hasClass( 'network-admin' )
|
1045 |
+
},
|
1046 |
+
dataType: "JSON", // xml, html, script, json, jsonp, text
|
1047 |
+
success: function ( data ) {
|
1048 |
+
|
1049 |
+
$( '.br-clean-label' ).find( 'span' ).removeClass( 'br-has' ).html( '( 0 )' );
|
1050 |
+
|
1051 |
+
$( 'div.br-db-item' ).each(
|
1052 |
+
function ( index, element ) {
|
1053 |
+
// element == this
|
1054 |
+
$( element ).find( 'h3' ).find( 'span' ).removeClass( 'br-has' ).html( '0' );
|
1055 |
+
}
|
1056 |
+
);
|
1057 |
+
var enable_clean_all = $( '#br-clean-all' );
|
1058 |
+
if ( enable_clean_all.is( ':checked' ) ) {
|
1059 |
+
enable_clean_all.trigger( 'click' );
|
1060 |
+
}
|
1061 |
+
alert( 'Clean all process finished' );
|
1062 |
+
|
1063 |
+
},
|
1064 |
+
error: function ( jqXHR, textStatus, errorThrown ) {
|
1065 |
+
|
1066 |
+
},
|
1067 |
+
// called when the request finishes (after success and error callbacks are executed)
|
1068 |
+
complete: function ( jqXHR, textStatus ) {
|
1069 |
+
|
1070 |
+
}
|
1071 |
+
}
|
1072 |
+
);
|
1073 |
+
}
|
1074 |
+
}
|
1075 |
+
}
|
1076 |
+
);
|
1077 |
+
|
1078 |
+
$container_box.on(
|
1079 |
+
'click',
|
1080 |
+
'.br-mobile-menu',
|
1081 |
+
function () {
|
1082 |
+
$( '.br-link' ).fadeToggle();
|
1083 |
+
}
|
1084 |
+
);
|
1085 |
+
|
1086 |
+
$container_box.on(
|
1087 |
+
'click',
|
1088 |
+
'.br-submit-save',
|
1089 |
+
function ( e ) {
|
1090 |
+
e.preventDefault();
|
1091 |
+
|
1092 |
+
var $form = $( this ).closest( 'form' );
|
1093 |
+
var tab_is = $form.get( 0 ).dataset.section;
|
1094 |
+
|
1095 |
+
var data_send = {
|
1096 |
+
'action': 'save_settings_tab_' + tab_is,
|
1097 |
+
'security': breeze_token_name.breeze_save_options,
|
1098 |
+
'form-data': $form.serialize(),
|
1099 |
+
'is-network': $( 'body' ).hasClass( 'network-admin' )
|
1100 |
+
};
|
1101 |
+
var $html_area = $( '.br-options' );
|
1102 |
+
$html_area.html( loader_spinner_save );
|
1103 |
+
$.ajax(
|
1104 |
+
{
|
1105 |
+
type: "POST",
|
1106 |
+
url: ajaxurl,
|
1107 |
+
data: data_send,
|
1108 |
+
dataType: "JSON", // xml, html, script, json, jsonp, text
|
1109 |
+
success: function ( data ) {
|
1110 |
+
$( '#tab-' + tab_is ).trigger( 'click' );
|
1111 |
+
},
|
1112 |
+
error: function ( jqXHR, textStatus, errorThrown ) {
|
1113 |
+
|
1114 |
+
},
|
1115 |
+
// called when the request finishes (after success and error callbacks are executed)
|
1116 |
+
complete: function ( jqXHR, textStatus ) {
|
1117 |
+
|
1118 |
+
}
|
1119 |
+
}
|
1120 |
+
);
|
1121 |
+
}
|
1122 |
+
);
|
1123 |
+
|
1124 |
+
$( document ).on(
|
1125 |
+
'change',
|
1126 |
+
'#inherit-settings',
|
1127 |
+
function () {
|
1128 |
+
var is_selected = $( this ).is( ':checked' );
|
1129 |
+
var is_network = '.br-is-network';
|
1130 |
+
var is_custom = '.br-is-custom';
|
1131 |
+
var tab_is = 'inherit';
|
1132 |
+
|
1133 |
+
var nonce_is = $( this ).closest( 'div.change-settings-use' ).find( 'input#breeze_inherit_settings_nonce' ).val();
|
1134 |
+
|
1135 |
+
$( '.br-overlay-disable' ).addClass( 'br-hide' );
|
1136 |
+
|
1137 |
+
var data_send = {
|
1138 |
+
'action': 'save_settings_tab_' + tab_is,
|
1139 |
+
'is-selected': is_selected,
|
1140 |
+
'security': nonce_is,
|
1141 |
+
'is-network': $( 'body' ).hasClass( 'network-admin' )
|
1142 |
+
};
|
1143 |
+
|
1144 |
+
$(
|
1145 |
+
'<div/>',
|
1146 |
+
{
|
1147 |
+
'class': 'br-inherit-wait',
|
1148 |
+
'html': '<div class="br-loader-spinner switch-to-settings"><div></div><div></div><div></div><div></div></div>'
|
1149 |
+
}
|
1150 |
+
).appendTo( $( '#wpcontent' ) );
|
1151 |
+
|
1152 |
+
$.ajax(
|
1153 |
+
{
|
1154 |
+
type: "POST",
|
1155 |
+
url: ajaxurl,
|
1156 |
+
data: data_send,
|
1157 |
+
dataType: "JSON", // xml, html, script, json, jsonp, text
|
1158 |
+
success: function ( data ) {
|
1159 |
+
// var default_target = $( '#tab-basic' );
|
1160 |
+
// if ( default_target.length ) {
|
1161 |
+
// default_target.trigger( 'click' );
|
1162 |
+
// }
|
1163 |
+
},
|
1164 |
+
error: function ( jqXHR, textStatus, errorThrown ) {
|
1165 |
+
|
1166 |
+
},
|
1167 |
+
// called when the request finishes (after success and error callbacks are executed)
|
1168 |
+
complete: function ( jqXHR, textStatus ) {
|
1169 |
+
$( '#wpcontent' ).find( 'div.br-inherit-wait' ).remove();
|
1170 |
+
|
1171 |
+
if ( true === is_selected ) {
|
1172 |
+
// custom is enabled
|
1173 |
+
$( is_network ).removeClass( 'br-show' ).addClass( 'br-hide' );
|
1174 |
+
$( is_custom ).removeClass( 'br-hide' ).addClass( 'br-show' );
|
1175 |
+
$( '.br-link' ).removeClass( 'br-hide' );
|
1176 |
+
$( '#tab-basic' ).trigger( 'click' );
|
1177 |
+
} else {
|
1178 |
+
// network is enabled
|
1179 |
+
$( is_custom ).removeClass( 'br-show' ).addClass( 'br-hide' );
|
1180 |
+
$( is_network ).removeClass( 'br-hide' ).addClass( 'br-show' );
|
1181 |
+
$( '.br-link' ).each(
|
1182 |
+
function ( index, element ) {
|
1183 |
+
// element == this
|
1184 |
+
var data_is = element.dataset.breezeLink;
|
1185 |
+
if ( 'faq' !== data_is ) {
|
1186 |
+
$( element ).addClass( 'br-hide' );
|
1187 |
+
}
|
1188 |
+
}
|
1189 |
+
);
|
1190 |
+
$( '#tab-faq' ).trigger( 'click' );
|
1191 |
+
}
|
1192 |
+
}
|
1193 |
+
}
|
1194 |
+
);
|
1195 |
+
}
|
1196 |
+
);
|
1197 |
+
|
1198 |
+
$( document ).on(
|
1199 |
+
'click',
|
1200 |
+
'.notice-dismiss',
|
1201 |
+
function () {
|
1202 |
+
var parent = $( this ).closest( 'div.notice' );
|
1203 |
+
if ( parent.hasClass( 'breeze-notice' ) ) {
|
1204 |
+
parent.fadeOut( 'fast' ).remove();
|
1205 |
+
}
|
1206 |
+
}
|
1207 |
+
);
|
1208 |
+
} )( jQuery );
|
assets/js/breeze-main.min.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/*! Created by Cloudways
|
2 |
+
On 04-01-2022 */
|
3 |
+
|
4 |
+
jQuery(document).ready(function(n){var e=n(".breeze-box");n("#breeze-plugins-notice").length&&n(document).on("click tap",".notice-dismiss",function(){n.ajax({type:"POST",url:ajaxurl,data:{action:"compatibility_warning_close",breeze_close_warning:"1"},dataType:"json",success:function(e){},error:function(e,t,a){},complete:function(e,t){}})}),n(document).on("click","#wp-admin-bar-breeze-purge-varnish-group",function(e){e.preventDefault(),a()}),n(document).on("click","#wp-admin-bar-breeze-purge-file-group",function(e){e.preventDefault(),n.ajax({url:ajaxurl,dataType:"json",method:"POST",data:{action:"breeze_purge_file",security:breeze_token_name.breeze_purge_cache},success:function(e){current=location.href;var t=e=parseFloat(e);window.location.href=current+"#breeze-msg=success-cleancache&file="+e,div=0<t?'<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;margin-left: 0;"><p><strong>Internal cache has been purged: '+t+'Kb cleaned</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>':'<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;margin-left: 0;"><p><strong>Internal cache has been purged.</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>',n("#wpbody #wpbody-content").prepend(div)}})});var t=!0;function a(){n.ajax({url:ajaxurl,dataType:"json",method:"POST",data:{action:"breeze_purge_varnish",is_network:n("body").hasClass("network-admin"),security:breeze_token_name.breeze_purge_varnish},success:function(e){current=location.href,e.clear?(n("#wpbody #wpbody-content").prepend('<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;margin-left: 0;"><p><strong>Varnish Cache has been purged.</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>'),setTimeout(function(){t=!0},2e3)):(window.location.href=current+"breeze-msg=purge-fail",t=!0,location.reload())}})}n(".breeze-box").on("click","#purge-varnish-button",function(e){e.preventDefault(),!0===t&&(t=!1,n(this).addClass("br-is-disabled"),a())});var i,s,r,o=location.href,c=parseFloat((i="file",s=(s=o)||window.location.href,i=i.replace(/[\[\]]/g,"\\$&"),(s=new RegExp("[?&]"+i+"(=([^&#]*)|&|#|$)").exec(s))?s[2]?decodeURIComponent(s[2].replace(/\+/g," ")):"":null));n(window).on("load",function(){var e,t;/wp-admin/i.test(o)&&(e="",0<o.indexOf("msg=success-cleancache")&&!isNaN(c)&&(e=0<c?'<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;"><p><strong>Internal cache has been purged: '+c+'Kb cleaned</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>':'<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;"><p><strong>Internal cache has been purged.</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>',n("#wpbody .wrap h1").after(e),t=o.split("breeze-msg"),setTimeout(function(){window.location=t[0]},2e3)))}),n("#breeze-hide-install-msg").unbind("click").click(function(){n(this).closest("div.notice").fadeOut()}),-1!==(r=location.search).indexOf("breeze_purge=1")&&-1!==r.indexOf("_wpnonce")&&((r=new URLSearchParams(location.search)).delete("breeze_purge"),r.delete("_wpnonce"),history.replaceState(null,"","?"+r+location.hash)),e.on("change","#bz-lazy-load",function(){var e=n("#native-lazy-option");!0===n(this).is(":checked")?e.show():(e.hide(),n("#bz-lazy-load-nat").attr("checked",!1))}),e.on("change","#minification-css",function(){var e=n("#font-display-swap"),t=n("#font-display"),a=n("#include-inline-css"),i=n("#group-css");n(this).is(":checked")?(e.show(),a.removeAttr("disabled"),i.removeAttr("disabled")):(e.hide(),t.removeAttr("checked"),a.removeAttr("checked").attr("disabled","disabled"),i.removeAttr("checked").attr("disabled","disabled"))}),e.on("change","#minification-js",function(){var e=n("#include-inline-js"),t=n("#group-js");n(this).is(":checked")?(e.removeAttr("disabled"),t.removeAttr("disabled")):(e.removeAttr("checked").attr("disabled","disabled"),t.removeAttr("checked").attr("disabled","disabled"))}),e.on("change","#enable-js-delay",function(){$delay_js_div=n("#breeze-delay-js-scripts-div"),n(this).is(":checked")?$delay_js_div.show():$delay_js_div.hide()})});var $valid_json=!1;jQuery(document).ready(function(r){var e=r(".breeze-box");function o(){e.on("click","span.item-remove",function(){var e=r(this).closest(".breeze-input-group");e.fadeOut(300,function(){e.remove(),l()})})}function c(){r(".breeze-list-url").sortable({handle:r("span.sort-handle"),stop:l})}function d(){r(".sort-handle span").unbind("click").click(function(e){var t=r(this).parents(".breeze-input-group");r(this).hasClass("moveUp")?t.insertBefore(t.prev()):t.insertAfter(t.next()),l()})}function l(){var e=r(".breeze-list-url");e.find(".breeze-input-group").find(".sort-handle").find("span").removeClass("blur"),e.find(".breeze-input-group:first-child").find(".moveUp").addClass("blur"),e.find(".breeze-input-group:last-child").find(".moveDown").addClass("blur")}r('input[name="all_control"]').click(function(){1==r(this).is(":checked")?r(".clean-data").prop("checked",!0):r(".clean-data").prop("checked",!1)}),r(".clean-data").click(function(){0==r(this).is(":checked")&&r('input[name="all_control"]').prop("checked",!1)}),o(),c(),d(),l(),e.on("keyup change blur",".breeze-input-url",function(){var e=r(this).val();""!==e&&(!0==!!/^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/.test(e)?r(this).removeClass("is-invalid-url"):r(this).addClass("is-invalid-url"))}),e.on("click","button.add-url",function(){var e=-1<r(this).attr("id").indexOf("defer"),t=-1<r(this).attr("id").indexOf("preload-fonts"),a=r(this).closest("div.br-option").find(".breeze-list-url"),i="",n=a.find(".breeze-input-group"),s=!1;if(n.each(function(){var e=r(this).find(".breeze-input-url");if(""===e.val().trim())return e.focus(),!(s=!0)}),s)return!1;i+='<div class="breeze-input-group">',i+=' <input type="text" size="98"',i+='class="breeze-input-url"',i+=t?'name="breeze-preload-font[]"':e?'name="defer-js[]"':'name="move-to-footer-js[]"',i+='placeholder="Enter URL..."',i+='value="" />',i+=' <span class="sort-handle">',i+=' <span class="dashicons dashicons-arrow-up moveUp"></span>',i+=' <span class="dashicons dashicons-arrow-down moveDown"></span>',i+=" </span>",i+=' <span class="dashicons dashicons-no item-remove" title="Remove"></span>',a.append(i+="</div>"),o(),c(),d(),l()}),r("#breeze-tabs .nav-tab").click(function(e){e.preventDefault(),r("#breeze-tabs .nav-tab").removeClass("active"),r(e.target).addClass("active"),id_tab=r(this).data("tab-id"),r("#tab-"+id_tab).addClass("active"),r("#breeze-tabs-content .tab-pane").removeClass("active"),r("#tab-content-"+id_tab).addClass("active"),document.cookie="breeze_active_tab="+id_tab,"faq"===id_tab?(r("#breeze-and-cloudways").hide(),r("#faq-content").accordion({collapsible:!0,animate:200,header:".faq-question",heightStyle:"content"})):r("#breeze-and-cloudways").show()}),active_tab=function(e){for(var t=e+"=",a=document.cookie.split(";"),i=0;i<a.length;i++){for(var n=a[i];" "==n.charAt(0);)n=n.substring(1);if(0==n.indexOf(t))return n.substring(t.length,n.length)}return""}("breeze_active_tab"),active_tab=active_tab||"basic","import_export"===active_tab&&(active_tab="basic"),0===r("#tab-"+active_tab).length?(firstTab=r("#breeze-tabs").find("a:first-child"),firstTab.length&&(tabType=firstTab.attr("id").replace("tab-",""),firstTab.addClass("active"),r("#tab-content-"+tabType).addClass("active"))):(r("#tab-"+active_tab).addClass("active"),r("#tab-content-"+active_tab).addClass("active")),"faq"===active_tab?(r("#breeze-and-cloudways").hide(),r("#faq-content").accordion({collapsible:!0,animate:200,header:".faq-question",heightStyle:"content"})):r("#breeze-and-cloudways").show();var t,a=["faq"],i=!0,n=!1,s=r("#breeze-inherit-settings-toggle");function b(e,t){var a=e.split("?");if(2<=a.length){for(var i=encodeURIComponent(t)+"=",n=a[1].split(/[&;]/g),s=n.length;0<s--;)-1!==n[s].lastIndexOf(i,0)&&n.splice(s,1);return a[0]+(0<n.length?"?"+n.join("&"):"")}return e}s.length&&(r("input",s).on("change",function(){var t="1"==r(this).val();r("#breeze-tabs").toggleClass("tabs-hidden",t),r("#breeze-tabs-content").toggleClass("tabs-hidden",t),r("#breeze-tabs .nav-tab").each(function(){var e=r(this).data("tab-id");-1===r.inArray(e,a)&&(r(this).toggleClass("inactive",t),r("#breeze-tabs-content #tab-content-"+e).toggleClass("inactive",t))}),n=!r(this).parents(".radio-field").hasClass("active")}),r("#breeze-tabs-content form").on("submit",function(e){var t=r(this);i&&n&&(e.preventDefault(),r.ajax({url:window.location,method:"post",data:s.serializeArray(),beforeSend:function(){s.addClass("loading")},complete:function(){s.removeClass("loading"),n=!1,t.submit()},success:function(){r("input:checked",s).parents(".radio-field").addClass("active").siblings().removeClass("active")}}))})),r("#breeze-database-optimize").on("click",function(e){i=!1}),r("#tab-content-database .submit input").on("click",function(e){r("#tab-content-database input[type=checkbox]").attr("checked",!1)}),window.history&&"function"==typeof window.history.pushState&&(t=b(window.location.href,"save-settings"),t=b(t,"database-cleanup"),window.history.pushState(null,null,t)),e.on("click tap","#breeze_export_settings",function(){$network=r("#breeze-level").val(),window.location=ajaxurl+"?action=breeze_export_json&network_level="+$network}),r("#breeze_import_btn").attr("disabled","disabled"),e.on("change","#breeze_import_settings",function(){var e=this.files[0],t=r("#file-selected"),a=r("#file-error"),i=r("#breeze_import_btn");t.html(e.name),"application/json"!==e.type?($valid_json=!1,t.removeClass("file_green file_red").addClass("file_red"),a.html("File must be JSON"),i.attr("disabled","disabled")):($valid_json=!0,t.removeClass("file_green file_red").addClass("file_green"),a.html(""),i.removeAttr("disabled")),r(".br-file-text").remove()}),e.on("click tap","#breeze_import_btn",function(){var e,t,a,i;!0===$valid_json&&(network=r("#breeze-level").val(),e=r("#breeze_import_settings").get(0).files[0],(t=new FormData).append("action","breeze_import_json"),t.append("network_level",network),t.append("breeze_import_file",e),a=r("#file-selected"),i=r("#file-error"),a.removeClass("file_green file_red").addClass("file_green"),a.html('<div class="br-loader-spinner import_settings"><div></div><div></div><div></div><div></div></div>'),r.ajax({type:"POST",url:ajaxurl,data:t,processData:!1,contentType:!1,enctype:"multipart/form-data",mimeType:"multipart/form-data",cache:!1,dataType:"json",success:function(e){1==e.success?(a.removeClass("file_green file_red").addClass("file_green"),a.html(e.data),i.html(""),alert(e.data),window.location.reload(!0)):(a.removeClass("file_green file_red"),a.html(""),i.html(e.data[0].message))},error:function(e,t,a){},complete:function(e,t){}}))})}),function(s){var n=[];setTimeout(function(){var e=s("#message-clear-cache-top");e.length&&(e.prependTo("#wpbody-content"),e.show())},1e3),s(window).on("resize",function(){632<=s(this).height()&&s(".br-link").removeAttr("style")});function r(e){for(var t=e+"=",a=document.cookie.split(";"),i=0;i<a.length;i++){for(var n=a[i];" "==n.charAt(0);)n=n.substring(1);if(0==n.indexOf(t))return n.substring(t.length,n.length)}return""}s(".breeze-box .br-link").on("click tap","a",function(e){e.preventDefault();var a=this.dataset.tabId,t=s(".br-options");o=(o=r("breeze_active_tab"))||"basic",s(".br-link").removeClass("br-active"),s(".br-link").each(function(e,t){var a=t.dataset.breezeLink,i=s(this).find("img"),t=i.get(0).dataset.path;i.attr("src",t+a+".png")});var i=s(this).closest(".br-link");i.addClass("br-active");e=i.find("img"),i=e.get(0).dataset.path;e.attr("src",i+a+"-active.png"),t.html('<div class="br-loader-spinner loading_tab"><div></div><div></div><div></div><div></div></div>'),!0===s(".br-mobile-menu").is(":visible")&&s(".br-link").fadeOut(),s.ajax({type:"GET",url:ajaxurl,data:{action:"breeze_load_options_tab",request_tab:a,"is-network":s("body").hasClass("network-admin")},contentType:"text/html; charset=UTF-8",dataType:"html",success:function(e){t.html(e)},error:function(e,t,a){},complete:function(e,t){document.cookie="breeze_active_tab="+a,"faq"===a&&s("#faq-content").accordion({collapsible:!0,animate:200,header:".faq-question",heightStyle:"content"}),n=[]}})});var e,o=r("breeze_active_tab");s("#tab-basic").closest("div.br-link").hasClass("br-hide")?s("#tab-faq").trigger("click"):void 0!==o&&""!==o?(e=s("#tab-"+(o="import_export"===o?"basic":o))).length&&e.trigger("click"):(t=s("#tab-basic")).length&&t.trigger("click");var t=s(".breeze-box");t.on("click",".br-db-item",function(){var e=this.dataset.section;if(s(this).hasClass("br-db-selected")){if(s(this).removeClass("br-db-selected"),n.length){for(var t=[],a=0;a<n.length;a++)e!==n[a]&&t.push(n[a]);n=t}}else s(this).addClass("br-db-selected"),n.push(e);var i=s("#optimize-selected-services");n.length?i.show():i.hide()}),t.on("click","#optimize-selected-services",function(e){var t=!1;!1===(t=n.length?!0:t)?alert("Please select an options first"):confirm("Proceed to optimize the selected items?")&&s.ajax({type:"POST",url:ajaxurl,data:{action:"breeze_purge_database",action_type:"custom",services:JSON.stringify(Object.assign({},n)),security:breeze_token_name.breeze_purge_database,"is-network":s("body").hasClass("network-admin")},dataType:"JSON",success:function(e){s("div.br-db-item").each(function(e,t){var a=t.dataset.section;-1!==s.inArray(a,n)&&(s(t).find("h3").find("span").removeClass("br-has").html("0"),s(t).removeClass("br-db-selected"))}),alert("Optimization process finished"),s("#tab-database").trigger("click")},error:function(e,t,a){},complete:function(e,t){n=[]}})}),t.on("click",".do_clean_action",function(e){e.preventDefault();var e=this.dataset.section,t=s(this).closest("div.br-db-item"),a=t.get(0).dataset.sectionTitle;confirm("Confirm the action to clean "+a)&&(s(this).addClass("opac"),s.ajax({type:"POST",url:ajaxurl,data:{action:"breeze_purge_database",action_type:e,security:breeze_token_name.breeze_purge_database,"is-network":s("body").hasClass("network-admin")},dataType:"JSON",success:function(e){t.find("h3").find("span").removeClass("br-has").html("0"),alert("Data for "+a+" has been cleaned")},error:function(e,t,a){},complete:function(e,t){}}))}),t.on("change","#br-clean-all",function(e){var t=s(this).is(":checked"),a=s("#br-clean-all-cta");!0===t?a.removeAttr("disabled"):a.attr("disabled","disabled")}),t.on("click","#br-clean-all-cta",function(e){!1===s(this).is(":disabled")&&confirm("Proceed to clean all trashed posts and pages?")&&s.ajax({type:"POST",url:ajaxurl,data:{action:"breeze_purge_database",action_type:"all",security:breeze_token_name.breeze_purge_database,"is-network":s("body").hasClass("network-admin")},dataType:"JSON",success:function(e){s(".br-clean-label").find("span").removeClass("br-has").html("( 0 )"),s("div.br-db-item").each(function(e,t){s(t).find("h3").find("span").removeClass("br-has").html("0")});var t=s("#br-clean-all");t.is(":checked")&&t.trigger("click"),alert("Clean all process finished")},error:function(e,t,a){},complete:function(e,t){}})}),t.on("click",".br-mobile-menu",function(){s(".br-link").fadeToggle()}),t.on("click",".br-submit-save",function(e){e.preventDefault();var e=s(this).closest("form"),t=e.get(0).dataset.section,e={action:"save_settings_tab_"+t,security:breeze_token_name.breeze_save_options,"form-data":e.serialize(),"is-network":s("body").hasClass("network-admin")};s(".br-options").html('<div class="br-loader-spinner saving_settings"><div></div><div></div><div></div><div></div></div>'),s.ajax({type:"POST",url:ajaxurl,data:e,dataType:"JSON",success:function(e){s("#tab-"+t).trigger("click")},error:function(e,t,a){},complete:function(e,t){}})}),s(document).on("change","#inherit-settings",function(){var a=s(this).is(":checked"),i=".br-is-network",n=".br-is-custom",e=s(this).closest("div.change-settings-use").find("input#breeze_inherit_settings_nonce").val();s(".br-overlay-disable").addClass("br-hide");e={action:"save_settings_tab_inherit","is-selected":a,security:e,"is-network":s("body").hasClass("network-admin")};s("<div/>",{class:"br-inherit-wait",html:'<div class="br-loader-spinner switch-to-settings"><div></div><div></div><div></div><div></div></div>'}).appendTo(s("#wpcontent")),s.ajax({type:"POST",url:ajaxurl,data:e,dataType:"JSON",success:function(e){},error:function(e,t,a){},complete:function(e,t){s("#wpcontent").find("div.br-inherit-wait").remove(),!0===a?(s(i).removeClass("br-show").addClass("br-hide"),s(n).removeClass("br-hide").addClass("br-show"),s(".br-link").removeClass("br-hide"),s("#tab-basic").trigger("click")):(s(n).removeClass("br-show").addClass("br-hide"),s(i).removeClass("br-hide").addClass("br-show"),s(".br-link").each(function(e,t){"faq"!==t.dataset.breezeLink&&s(t).addClass("br-hide")}),s("#tab-faq").trigger("click"))}})}),s(document).on("click",".notice-dismiss",function(){var e=s(this).closest("div.notice");e.hasClass("breeze-notice")&&e.fadeOut("fast").remove()})}(jQuery);
|
assets/js/breeze-prefetch-links.js
DELETED
@@ -1,81 +0,0 @@
|
|
1 |
-
// Document ready
|
2 |
-
var ready = ( callback ) => {
|
3 |
-
if ( document.readyState != 'loading' ) {
|
4 |
-
callback();
|
5 |
-
} else {
|
6 |
-
document.addEventListener( 'DOMContentLoaded', callback );
|
7 |
-
}
|
8 |
-
}
|
9 |
-
|
10 |
-
// Timer used to whether prefetch a link or not.
|
11 |
-
var timer;
|
12 |
-
|
13 |
-
// Document ready callback.
|
14 |
-
ready(
|
15 |
-
() => {
|
16 |
-
// List of URLs to prefetch.
|
17 |
-
var prefetched_urls = [];
|
18 |
-
addEventListener(
|
19 |
-
'mouseover',
|
20 |
-
function ( e ) {
|
21 |
-
// Take in consideration only A tags.
|
22 |
-
if ( e.target instanceof HTMLAnchorElement ) {
|
23 |
-
var the_href = e.target.attributes.href.value;
|
24 |
-
|
25 |
-
timer = setTimeout(
|
26 |
-
function () {
|
27 |
-
|
28 |
-
var test_link = the_href.replace( breeze_prefetch.local_url, '' );
|
29 |
-
// Local host domain.
|
30 |
-
var local_host = new URL( breeze_prefetch.local_url ).host;
|
31 |
-
// Hovered link host domain.
|
32 |
-
var hover_host = new URL( the_href ).host;
|
33 |
-
|
34 |
-
if (
|
35 |
-
'' !== the_href.trim() &&
|
36 |
-
false === prefetched_urls.includes( the_href ) &&
|
37 |
-
local_host === hover_host &&
|
38 |
-
false === search_for_banned_links( breeze_prefetch.ignore_list, test_link )
|
39 |
-
) {
|
40 |
-
// Add to the array links that have been prefetched already.
|
41 |
-
prefetched_urls.push( the_href.trim() );
|
42 |
-
// Activate the prefetch link by adding it to the header.
|
43 |
-
var link_tag = document.createElement( 'link' );
|
44 |
-
link_tag.href = the_href;
|
45 |
-
link_tag.rel = 'prefetch';
|
46 |
-
document.head.appendChild( link_tag );
|
47 |
-
}
|
48 |
-
},
|
49 |
-
150
|
50 |
-
);
|
51 |
-
|
52 |
-
}
|
53 |
-
}
|
54 |
-
);
|
55 |
-
addEventListener(
|
56 |
-
'mouseout',
|
57 |
-
function ( e ) {
|
58 |
-
clearTimeout( timer );
|
59 |
-
}
|
60 |
-
);
|
61 |
-
} // End ready callback
|
62 |
-
);
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Finding if a link is excluded from prefetch.
|
66 |
-
*
|
67 |
-
* @param ignore_list
|
68 |
-
* @param item
|
69 |
-
* @returns {boolean}
|
70 |
-
*/
|
71 |
-
function search_for_banned_links( ignore_list, item ) {
|
72 |
-
var found = false;
|
73 |
-
if ( ignore_list.length ) {
|
74 |
-
for ( i = 0; i < ignore_list.length; i++ ) {
|
75 |
-
if ( -1 !== item.indexOf( ignore_list[ i ] ) || -1 !== ignore_list[ i ].indexOf( item ) ) {
|
76 |
-
found = true;
|
77 |
-
}
|
78 |
-
}
|
79 |
-
}
|
80 |
-
return found;
|
81 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/js-front-end/breeze-lazy-load.min.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/*! Created by Cloudways
|
2 |
+
On 04-01-2022 */
|
3 |
+
|
4 |
+
!function(e,t){t=t(e,e.document,Date);"object"==typeof module&&module.exports?module.exports=t:"function"==typeof define&&define.amd?define(t):e.lazySizes=t}(window,function(n,f,s){"use strict";var m,h;if(!function(){var e,t={lazyClass:"br-lazy",loadedClass:"br-loaded",loadingClass:"br-loading",preloadClass:"br-preload",errorClass:"br-error",autosizesClass:"br-autosizes",fastLoadedClass:"ls-is-cached",iframeLoadMode:0,srcAttr:"data-breeze",srcsetAttr:"data-brsrcset",sizesAttr:"data-brsizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};for(e in h=n.lazySizesConfig||n.lazysizesConfig||{},t)e in h||(h[e]=t[e])}(),!f||!f.getElementsByClassName)return{init:function(){},cfg:h,noSupport:!0};function c(e,t){M(e,t)||e.setAttribute("class",(e[g]("class")||"").trim()+" "+t)}function u(e,t){(t=M(e,t))&&e.setAttribute("class",(e[g]("class")||"").replace(t," "))}function z(e,t){var a;!l&&(a=n.picturefill||h.pf)?(t&&t.src&&!e[g]("srcset")&&e.setAttribute("srcset",t.src),a({reevaluate:!0,elements:[e]})):t&&t.src&&(e.src=t.src)}var a,i,t,o,r,y=f.documentElement,l=n.HTMLPictureElement,d="addEventListener",g="getAttribute",e=n[d].bind(n),v=n.setTimeout,p=n.requestAnimationFrame||v,b=n.requestIdleCallback,C=/^picture$/i,A=["load","error","lazyincluded","_lazyloaded"],E={},_=Array.prototype.forEach,M=function(e,t){return E[t]||(E[t]=new RegExp("(\\s|^)"+t+"(\\s|$)")),E[t].test(e[g]("class")||"")&&E[t]},N=function(t,a,e){var n=e?d:"removeEventListener";e&&N(t,a),A.forEach(function(e){t[n](e,a)})},w=function(e,t,a,n,i){var s=f.createEvent("Event");return(a=a||{}).instance=m,s.initEvent(t,!n,!i),s.detail=a,e.dispatchEvent(s),s},L=function(e,t){return(getComputedStyle(e,null)||{})[t]},x=function(e,t,a){for(a=a||e.offsetWidth;a<h.minSize&&t&&!e._lazysizesWidth;)a=t.offsetWidth,t=t.parentNode;return a},W=(o=[],r=t=[],B._lsFlush=S,B);function S(){var e=r;for(r=t.length?o:t,i=!(a=!0);e.length;)e.shift()();a=!1}function B(e,t){a&&!t?e.apply(this,arguments):(r.push(e),i||(i=!0,(f.hidden?v:p)(S)))}function T(a,e){return e?function(){W(a)}:function(){var e=this,t=arguments;W(function(){a.apply(e,t)})}}function F(e){function t(){var e=s.now()-n;e<99?v(t,99-e):(b||i)(i)}var a,n,i=function(){a=null,e()};return function(){n=s.now(),a=a||v(t,99)}}var R,D,k,H,O,P,$,q,I,U,j,G,J,K,Q,V,X,Y,Z,ee,te,ae,ne,ie,se,oe,re,le,de,ce,ue,fe=(Z=/^img$/i,ee=/^iframe$/i,te="onscroll"in n&&!/(gle|ing)bot/.test(navigator.userAgent),ie=-1,se=function(e){return(G=null==G?"hidden"==L(f.body,"visibility"):G)||!("hidden"==L(e.parentNode,"visibility")&&"hidden"==L(e,"visibility"))},J=he,Q=ne=ae=0,V=h.throttleDelay,X=h.ricTimeout,Y=b&&49<X?function(){b(ze,{timeout:X}),X!==h.ricTimeout&&(X=h.ricTimeout)}:T(function(){v(ze)},!0),re=T(ye),le=function(e){re({target:e.target})},de=T(function(t,e,a,n,i){var s,o,r,l,d;(r=w(t,"lazybeforeunveil",e)).defaultPrevented||(n&&(a?c(t,h.autosizesClass):t.setAttribute("sizes",n)),s=t[g](h.srcsetAttr),a=t[g](h.srcAttr),i&&(o=(d=t.parentNode)&&C.test(d.nodeName||"")),l=e.firesLoad||"src"in t&&(s||a||o),r={target:t},c(t,h.loadingClass),l&&(clearTimeout(k),k=v(me,2500),N(t,le,!0)),o&&_.call(d.getElementsByTagName("source"),ge),s?t.setAttribute("srcset",s):a&&!o&&(ee.test(t.nodeName)?(n=a,0==(d=(e=t).getAttribute("data-load-mode")||h.iframeLoadMode)?e.contentWindow.location.replace(n):1==d&&(e.src=n)):t.src=a),i&&(s||o)&&z(t,{src:a})),t._lazyRace&&delete t._lazyRace,u(t,h.lazyClass),W(function(){var e=t.complete&&1<t.naturalWidth;l&&!e||(e&&c(t,h.fastLoadedClass),ye(r),t._lazyCache=!0,v(function(){"_lazyCache"in t&&delete t._lazyCache},9)),"lazy"==t.loading&&ne--},!0)}),ue=F(function(){h.loadMode=3,oe()}),{_:function(){O=s.now(),m.elements=f.getElementsByClassName(h.lazyClass),R=f.getElementsByClassName(h.lazyClass+" "+h.preloadClass),e("scroll",oe,!0),e("resize",oe,!0),e("pageshow",function(e){var t;!e.persisted||(t=f.querySelectorAll("."+h.loadingClass)).length&&t.forEach&&p(function(){t.forEach(function(e){e.complete&&ce(e)})})}),n.MutationObserver?new MutationObserver(oe).observe(y,{childList:!0,subtree:!0,attributes:!0}):(y[d]("DOMNodeInserted",oe,!0),y[d]("DOMAttrModified",oe,!0),setInterval(oe,999)),e("hashchange",oe,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach(function(e){f[d](e,oe,!0)}),/d$|^c/.test(f.readyState)?pe():(e("load",pe),f[d]("DOMContentLoaded",oe),v(pe,2e4)),m.elements.length?(he(),W._lsFlush()):oe()},checkElems:oe=function(e){var t;(e=!0===e)&&(X=33),K||(K=!0,(t=V-(s.now()-Q))<0&&(t=0),e||t<9?Y():v(Y,t))},unveil:ce=function(e){var t,a,n,i;e._lazyRace||(!(i="auto"==(n=(a=Z.test(e.nodeName))&&(e[g](h.sizesAttr)||e[g]("sizes"))))&&D||!a||!e[g]("src")&&!e.srcset||e.complete||M(e,h.errorClass)||!M(e,h.lazyClass))&&(t=w(e,"lazyunveilread").detail,i&&Ee.updateElem(e,!0,e.offsetWidth),e._lazyRace=!0,ne++,de(e,t,i,n,a))},_aLSL:ve});function me(e){ne--,e&&!(ne<0)&&e.target||(ne=0)}function he(){var e,t,a,n,i,s,o,r,l,d,c,u=m.elements;if((H=h.loadMode)&&ne<8&&(e=u.length)){for(t=0,ie++;t<e;t++)if(u[t]&&!u[t]._lazyRace)if(!te||m.prematureUnveil&&m.prematureUnveil(u[t]))ce(u[t]);else if((o=u[t][g]("data-expand"))&&(i=+o)||(i=ae),l||(l=!h.expand||h.expand<1?500<y.clientHeight&&500<y.clientWidth?500:370:h.expand,d=(m._defEx=l)*h.expFactor,c=h.hFac,G=null,ae<d&&ne<1&&2<ie&&2<H&&!f.hidden?(ae=d,ie=0):ae=1<H&&1<ie&&ne<6?l:0),r!==i&&(P=innerWidth+i*c,$=innerHeight+i,s=-1*i,r=i),d=u[t].getBoundingClientRect(),(j=d.bottom)>=s&&(q=d.top)<=$&&(U=d.right)>=s*c&&(I=d.left)<=P&&(j||U||I||q)&&(h.loadHidden||se(u[t]))&&(D&&ne<3&&!o&&(H<3||ie<4)||function(e,t){var a,n=e,i=se(e);for(q-=t,j+=t,I-=t,U+=t;i&&(n=n.offsetParent)&&n!=f.body&&n!=y;)(i=0<(L(n,"opacity")||1))&&"visible"!=L(n,"overflow")&&(a=n.getBoundingClientRect(),i=U>a.left&&I<a.right&&j>a.top-1&&q<a.bottom+1);return i}(u[t],i))){if(ce(u[t]),n=!0,9<ne)break}else!n&&D&&!a&&ne<4&&ie<4&&2<H&&(R[0]||h.preloadAfterLoad)&&(R[0]||!o&&(j||U||I||q||"auto"!=u[t][g](h.sizesAttr)))&&(a=R[0]||u[t]);a&&!n&&ce(a)}}function ze(){K=!1,Q=s.now(),J()}function ye(e){var t=e.target;t._lazyCache?delete t._lazyCache:(me(e),c(t,h.loadedClass),u(t,h.loadingClass),N(t,le),w(t,"lazyloaded"))}function ge(e){var t,a=e[g](h.srcsetAttr);(t=h.customMedia[e[g]("data-media")||e[g]("media")])&&e.setAttribute("media",t),a&&e.setAttribute("srcset",a)}function ve(){3==h.loadMode&&(h.loadMode=2),ue()}function pe(){D||(s.now()-O<999?v(pe,999):(D=!0,h.loadMode=3,oe(),e("scroll",ve,!0)))}var be,Ce,Ae,Ee=(Ce=T(function(e,t,a,n){var i,s,o;if(e._lazysizesWidth=n,e.setAttribute("sizes",n+="px"),C.test(t.nodeName||""))for(s=0,o=(i=t.getElementsByTagName("source")).length;s<o;s++)i[s].setAttribute("sizes",n);a.detail.dataAttr||z(e,a.detail)}),{_:function(){be=f.getElementsByClassName(h.autosizesClass),e("resize",Ae)},checkElems:Ae=F(function(){var e,t=be.length;if(t)for(e=0;e<t;e++)_e(be[e])}),updateElem:_e});function _e(e,t,a){var n=e.parentNode;n&&(a=x(e,n,a),(t=w(e,"lazybeforesizes",{width:a,dataAttr:!!t})).defaultPrevented||(a=t.detail.width)&&a!==e._lazysizesWidth&&Ce(e,n,t,a))}function Me(){!Me.i&&f.getElementsByClassName&&(Me.i=!0,Ee._(),fe._())}return v(function(){h.init&&Me()}),m={cfg:h,autoSizer:Ee,loader:fe,init:Me,uP:z,aC:c,rC:u,hC:M,fire:w,gW:x,rAF:W}});
|
assets/js/js-front-end/breeze-prefetch-links.min.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/*! Created by Cloudways
|
2 |
+
On 04-01-2022 */
|
3 |
+
|
4 |
+
var timer,ready=e=>{"loading"!=document.readyState?e():document.addEventListener("DOMContentLoaded",e)};function search_for_banned_links(e,t){var r=!1;if(e.length)for(i=0;i<e.length;i++)-1===t.indexOf(e[i])&&-1===e[i].indexOf(t)||(r=!0);return r}ready(()=>{var i=[];addEventListener("mouseover",function(e){var n;e.target instanceof HTMLAnchorElement&&(n=e.target.attributes.href.value,timer=setTimeout(function(){var e=n.replace(breeze_prefetch.local_url,""),t=new URL(breeze_prefetch.local_url).host,r=new URL(n).host;""!==n.trim()&&!1===i.includes(n)&&t===r&&!1===search_for_banned_links(breeze_prefetch.ignore_list,e)&&(i.push(n.trim()),(e=document.createElement("link")).href=n,e.rel="prefetch",document.head.appendChild(e))},150))}),addEventListener("mouseout",function(e){clearTimeout(timer)})});
|
breeze.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Breeze
|
4 |
* Description: Breeze is a WordPress cache plugin with extensive options to speed up your website. All the options including Varnish Cache are compatible with Cloudways hosting.
|
5 |
-
* Version:
|
6 |
* Text Domain: breeze
|
7 |
* Domain Path: /languages
|
8 |
* Author: Cloudways
|
@@ -37,7 +37,7 @@ if ( ! defined( 'BREEZE_PLUGIN_DIR' ) ) {
|
|
37 |
define( 'BREEZE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
38 |
}
|
39 |
if ( ! defined( 'BREEZE_VERSION' ) ) {
|
40 |
-
define( 'BREEZE_VERSION', '
|
41 |
}
|
42 |
if ( ! defined( 'BREEZE_SITEURL' ) ) {
|
43 |
define( 'BREEZE_SITEURL', get_site_url() );
|
@@ -66,6 +66,8 @@ if ( ! defined( 'BREEZE_PLUGIN_URL' ) ) {
|
|
66 |
define( 'BREEZE_CACHE_DELAY', true );
|
67 |
define( 'BREEZE_CACHE_NOGZIP', true );
|
68 |
define( 'BREEZE_ROOT_DIR', str_replace( BREEZE_WP_CONTENT_NAME, '', WP_CONTENT_DIR ) );
|
|
|
|
|
69 |
|
70 |
// Compatibility checks
|
71 |
require_once BREEZE_PLUGIN_DIR . 'inc/plugin-incompatibility/class-breeze-incompatibility-plugins.php';
|
@@ -114,17 +116,13 @@ if ( is_admin() || 'cli' === php_sapi_name() ) {
|
|
114 |
);
|
115 |
|
116 |
} else {
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|| ! empty(
|
123 |
-
|| ! empty(
|
124 |
-
|| ! empty( $basic_conf['breeze-minify-html'] )
|
125 |
-
|| ! empty( $config_advanced['breeze-defer-js'] )
|
126 |
-
|| ! empty( $config_advanced['breeze-move-to-footer-js'] )
|
127 |
-
|| ! empty( $config_advanced['breeze-delay-js-scripts'] )
|
128 |
) {
|
129 |
// Call back ob start
|
130 |
ob_start( 'breeze_ob_start_callback' );
|
@@ -136,11 +134,11 @@ require_once( BREEZE_PLUGIN_DIR . 'inc/compatibility/class-breeze-shortpixel-com
|
|
136 |
|
137 |
// Call back ob start - stack
|
138 |
function breeze_ob_start_callback( $buffer ) {
|
139 |
-
|
140 |
// Get buffer from minify
|
141 |
$buffer = apply_filters( 'breeze_minify_content_return', $buffer );
|
142 |
|
143 |
-
if ( ! empty(
|
144 |
// Get buffer after remove query strings
|
145 |
$buffer = apply_filters( 'breeze_cdn_content_return', $buffer );
|
146 |
}
|
@@ -149,6 +147,7 @@ function breeze_ob_start_callback( $buffer ) {
|
|
149 |
return $buffer;
|
150 |
}
|
151 |
|
|
|
152 |
// Minify
|
153 |
|
154 |
require_once( BREEZE_PLUGIN_DIR . 'inc/minification/breeze-minify-main.php' );
|
@@ -288,7 +287,7 @@ function breeze_check_for_new_version() {
|
|
288 |
|
289 |
// This process can also be started by Wp-CLI.
|
290 |
if ( ! empty( get_option( 'breeze_new_update', '' ) ) ) {
|
291 |
-
|
292 |
// This needs to happen only once.
|
293 |
if ( class_exists( 'Breeze_Configuration' ) && method_exists( 'Breeze_Configuration', 'update_htaccess' ) ) {
|
294 |
Breeze_Configuration::update_htaccess();
|
@@ -344,6 +343,9 @@ function breeze_check_for_new_version() {
|
|
344 |
|
345 |
// If the WP install is multi-site
|
346 |
if ( is_multisite() ) {
|
|
|
|
|
|
|
347 |
$basic = get_site_option( 'breeze_basic_settings' );
|
348 |
if ( isset( $basic['breeze-disable-admin'] ) && ! is_array( $basic['breeze-disable-admin'] ) ) {
|
349 |
$all_user_roles = breeze_all_wp_user_roles();
|
@@ -365,13 +367,13 @@ function breeze_check_for_new_version() {
|
|
365 |
update_site_option( 'breeze_basic_settings', $basic );
|
366 |
}
|
367 |
|
368 |
-
$advanced_network = get_site_option( '
|
369 |
$is_advanced = get_site_option( 'breeze_advanced_settings_120' );
|
370 |
|
371 |
if ( empty( $is_advanced ) ) {
|
372 |
$advanced_network['breeze-delay-js-scripts'] = $breeze_delay_js_scripts;
|
373 |
|
374 |
-
update_site_option( '
|
375 |
update_site_option( 'breeze_advanced_settings_120', 'yes' );
|
376 |
}
|
377 |
|
@@ -384,7 +386,7 @@ function breeze_check_for_new_version() {
|
|
384 |
$advanced_network['breeze-enable-js-delay'] = '1';
|
385 |
}
|
386 |
|
387 |
-
update_site_option( '
|
388 |
}
|
389 |
|
390 |
// For multi-site we need to also reset the root config-file.
|
@@ -395,7 +397,8 @@ function breeze_check_for_new_version() {
|
|
395 |
foreach ( $blogs as $blog_data ) {
|
396 |
$blog_id = (int) $blog_data->blog_id;
|
397 |
switch_to_blog( $blog_id );
|
398 |
-
|
|
|
399 |
// if the settings are inherited, then we do not need to refresh the config file.
|
400 |
$inherit_option = get_blog_option( $blog_id, 'breeze_inherit_settings', '' );
|
401 |
if ( '' === $inherit_option ) {
|
@@ -427,14 +430,14 @@ function breeze_check_for_new_version() {
|
|
427 |
update_blog_option( $blog_id, 'breeze_basic_settings', $basic );
|
428 |
}
|
429 |
|
430 |
-
$advanced_options = get_blog_option( $blog_id, '
|
431 |
$is_advanced = get_blog_option( $blog_id, 'breeze_advanced_settings_120' );
|
432 |
|
433 |
|
434 |
if ( empty( $is_advanced ) && empty( $advanced_options['breeze-delay-js-scripts'] ) ) {
|
435 |
$advanced_options['breeze-delay-js-scripts'] = $breeze_delay_js_scripts;
|
436 |
|
437 |
-
update_blog_option( $blog_id, '
|
438 |
update_blog_option( $blog_id, 'breeze_advanced_settings_120', 'yes' );
|
439 |
}
|
440 |
|
@@ -447,7 +450,7 @@ function breeze_check_for_new_version() {
|
|
447 |
}
|
448 |
|
449 |
|
450 |
-
update_blog_option( $blog_id, '
|
451 |
}
|
452 |
|
453 |
// Refresh breeze-cache.php file
|
@@ -461,6 +464,8 @@ function breeze_check_for_new_version() {
|
|
461 |
}
|
462 |
}
|
463 |
} else {
|
|
|
|
|
464 |
// update cache for logged-in users from administrator only to all user roles.
|
465 |
$basic = get_option( 'breeze_basic_settings' );
|
466 |
if ( isset( $basic['breeze-disable-admin'] ) && ! is_array( $basic['breeze-disable-admin'] ) ) {
|
@@ -485,14 +490,14 @@ function breeze_check_for_new_version() {
|
|
485 |
}
|
486 |
|
487 |
// For single site.
|
488 |
-
$advanced = breeze_get_option( '
|
489 |
$is_advanced = get_option( 'breeze_advanced_settings_120' );
|
490 |
|
491 |
|
492 |
if ( empty( $is_advanced ) ) {
|
493 |
$advanced['breeze-delay-js-scripts'] = $breeze_delay_js_scripts;
|
494 |
|
495 |
-
breeze_update_option( '
|
496 |
breeze_update_option( 'advanced_settings_120', 'yes', true );
|
497 |
}
|
498 |
|
@@ -505,7 +510,7 @@ function breeze_check_for_new_version() {
|
|
505 |
}
|
506 |
|
507 |
|
508 |
-
breeze_update_option( '
|
509 |
}
|
510 |
// Refresh breeze-cache.php file
|
511 |
Breeze_ConfigCache::factory()->write_config_cache();
|
2 |
/**
|
3 |
* Plugin Name: Breeze
|
4 |
* Description: Breeze is a WordPress cache plugin with extensive options to speed up your website. All the options including Varnish Cache are compatible with Cloudways hosting.
|
5 |
+
* Version: 2.0.0
|
6 |
* Text Domain: breeze
|
7 |
* Domain Path: /languages
|
8 |
* Author: Cloudways
|
37 |
define( 'BREEZE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
38 |
}
|
39 |
if ( ! defined( 'BREEZE_VERSION' ) ) {
|
40 |
+
define( 'BREEZE_VERSION', '2.0.0' );
|
41 |
}
|
42 |
if ( ! defined( 'BREEZE_SITEURL' ) ) {
|
43 |
define( 'BREEZE_SITEURL', get_site_url() );
|
66 |
define( 'BREEZE_CACHE_DELAY', true );
|
67 |
define( 'BREEZE_CACHE_NOGZIP', true );
|
68 |
define( 'BREEZE_ROOT_DIR', str_replace( BREEZE_WP_CONTENT_NAME, '', WP_CONTENT_DIR ) );
|
69 |
+
// Options reader
|
70 |
+
require_once BREEZE_PLUGIN_DIR . 'inc/class-breeze-options-reader.php';
|
71 |
|
72 |
// Compatibility checks
|
73 |
require_once BREEZE_PLUGIN_DIR . 'inc/plugin-incompatibility/class-breeze-incompatibility-plugins.php';
|
116 |
);
|
117 |
|
118 |
} else {
|
119 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'cdn-active' ) )
|
120 |
+
|| ! empty( Breeze_Options_Reader::get_option_value( 'breeze-minify-js' ) )
|
121 |
+
|| ! empty( Breeze_Options_Reader::get_option_value( 'breeze-minify-css' ) )
|
122 |
+
|| ! empty( Breeze_Options_Reader::get_option_value( 'breeze-minify-html' ) )
|
123 |
+
|| ! empty( Breeze_Options_Reader::get_option_value( 'breeze-defer-js' ) )
|
124 |
+
|| ! empty( Breeze_Options_Reader::get_option_value( 'breeze-move-to-footer-js' ) )
|
125 |
+
|| ! empty( Breeze_Options_Reader::get_option_value( 'breeze-delay-js-scripts' ) )
|
|
|
|
|
|
|
|
|
126 |
) {
|
127 |
// Call back ob start
|
128 |
ob_start( 'breeze_ob_start_callback' );
|
134 |
|
135 |
// Call back ob start - stack
|
136 |
function breeze_ob_start_callback( $buffer ) {
|
137 |
+
|
138 |
// Get buffer from minify
|
139 |
$buffer = apply_filters( 'breeze_minify_content_return', $buffer );
|
140 |
|
141 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'cdn-active' ) ) ) {
|
142 |
// Get buffer after remove query strings
|
143 |
$buffer = apply_filters( 'breeze_cdn_content_return', $buffer );
|
144 |
}
|
147 |
return $buffer;
|
148 |
}
|
149 |
|
150 |
+
require_once( BREEZE_PLUGIN_DIR . 'views/option-tabs-loader.php' );
|
151 |
// Minify
|
152 |
|
153 |
require_once( BREEZE_PLUGIN_DIR . 'inc/minification/breeze-minify-main.php' );
|
287 |
|
288 |
// This process can also be started by Wp-CLI.
|
289 |
if ( ! empty( get_option( 'breeze_new_update', '' ) ) ) {
|
290 |
+
|
291 |
// This needs to happen only once.
|
292 |
if ( class_exists( 'Breeze_Configuration' ) && method_exists( 'Breeze_Configuration', 'update_htaccess' ) ) {
|
293 |
Breeze_Configuration::update_htaccess();
|
343 |
|
344 |
// If the WP install is multi-site
|
345 |
if ( is_multisite() ) {
|
346 |
+
// Migrate old network settings if needed.
|
347 |
+
breeze_migrate_old_settings( false, 0, true );
|
348 |
+
|
349 |
$basic = get_site_option( 'breeze_basic_settings' );
|
350 |
if ( isset( $basic['breeze-disable-admin'] ) && ! is_array( $basic['breeze-disable-admin'] ) ) {
|
351 |
$all_user_roles = breeze_all_wp_user_roles();
|
367 |
update_site_option( 'breeze_basic_settings', $basic );
|
368 |
}
|
369 |
|
370 |
+
$advanced_network = get_site_option( 'breeze_file_settings' );
|
371 |
$is_advanced = get_site_option( 'breeze_advanced_settings_120' );
|
372 |
|
373 |
if ( empty( $is_advanced ) ) {
|
374 |
$advanced_network['breeze-delay-js-scripts'] = $breeze_delay_js_scripts;
|
375 |
|
376 |
+
update_site_option( 'breeze_file_settings', $advanced_network );
|
377 |
update_site_option( 'breeze_advanced_settings_120', 'yes' );
|
378 |
}
|
379 |
|
386 |
$advanced_network['breeze-enable-js-delay'] = '1';
|
387 |
}
|
388 |
|
389 |
+
update_site_option( 'breeze_file_settings', $advanced_network );
|
390 |
}
|
391 |
|
392 |
// For multi-site we need to also reset the root config-file.
|
397 |
foreach ( $blogs as $blog_data ) {
|
398 |
$blog_id = (int) $blog_data->blog_id;
|
399 |
switch_to_blog( $blog_id );
|
400 |
+
// Migrate old settings if needed.
|
401 |
+
breeze_migrate_old_settings( false, $blog_id );
|
402 |
// if the settings are inherited, then we do not need to refresh the config file.
|
403 |
$inherit_option = get_blog_option( $blog_id, 'breeze_inherit_settings', '' );
|
404 |
if ( '' === $inherit_option ) {
|
430 |
update_blog_option( $blog_id, 'breeze_basic_settings', $basic );
|
431 |
}
|
432 |
|
433 |
+
$advanced_options = get_blog_option( $blog_id, 'breeze_file_settings' );
|
434 |
$is_advanced = get_blog_option( $blog_id, 'breeze_advanced_settings_120' );
|
435 |
|
436 |
|
437 |
if ( empty( $is_advanced ) && empty( $advanced_options['breeze-delay-js-scripts'] ) ) {
|
438 |
$advanced_options['breeze-delay-js-scripts'] = $breeze_delay_js_scripts;
|
439 |
|
440 |
+
update_blog_option( $blog_id, 'breeze_file_settings', $advanced_options );
|
441 |
update_blog_option( $blog_id, 'breeze_advanced_settings_120', 'yes' );
|
442 |
}
|
443 |
|
450 |
}
|
451 |
|
452 |
|
453 |
+
update_blog_option( $blog_id, 'breeze_file_settings', $advanced_options );
|
454 |
}
|
455 |
|
456 |
// Refresh breeze-cache.php file
|
464 |
}
|
465 |
}
|
466 |
} else {
|
467 |
+
// Migrate old settings if needed.
|
468 |
+
breeze_migrate_old_settings();
|
469 |
// update cache for logged-in users from administrator only to all user roles.
|
470 |
$basic = get_option( 'breeze_basic_settings' );
|
471 |
if ( isset( $basic['breeze-disable-admin'] ) && ! is_array( $basic['breeze-disable-admin'] ) ) {
|
490 |
}
|
491 |
|
492 |
// For single site.
|
493 |
+
$advanced = breeze_get_option( 'file_settings' );
|
494 |
$is_advanced = get_option( 'breeze_advanced_settings_120' );
|
495 |
|
496 |
|
497 |
if ( empty( $is_advanced ) ) {
|
498 |
$advanced['breeze-delay-js-scripts'] = $breeze_delay_js_scripts;
|
499 |
|
500 |
+
breeze_update_option( 'file_settings', $advanced, true );
|
501 |
breeze_update_option( 'advanced_settings_120', 'yes', true );
|
502 |
}
|
503 |
|
510 |
}
|
511 |
|
512 |
|
513 |
+
breeze_update_option( 'file_settings', $advanced, true );
|
514 |
}
|
515 |
// Refresh breeze-cache.php file
|
516 |
Breeze_ConfigCache::factory()->write_config_cache();
|
inc/breeze-admin.php
CHANGED
@@ -57,9 +57,9 @@ class Breeze_Admin {
|
|
57 |
add_action( 'admin_notices', array( $this, 'installing_notices' ) );
|
58 |
}
|
59 |
|
60 |
-
$
|
61 |
|
62 |
-
if ( isset( $
|
63 |
//register top bar menu
|
64 |
add_action( 'admin_bar_menu', array( $this, 'register_admin_bar_menu' ), 999 );
|
65 |
}
|
@@ -82,15 +82,18 @@ class Breeze_Admin {
|
|
82 |
* @access public
|
83 |
*/
|
84 |
public function breeze_lazy_load() {
|
85 |
-
|
86 |
$is_lazy_load_enabled = false;
|
87 |
$is_lazy_load_native = false;
|
88 |
|
89 |
-
|
90 |
-
|
|
|
|
|
|
|
91 |
}
|
92 |
-
if ( isset( $
|
93 |
-
$is_lazy_load_native = filter_var( $
|
94 |
}
|
95 |
|
96 |
if ( true === $is_lazy_load_enabled && false === $is_lazy_load_native ) {
|
@@ -98,11 +101,7 @@ class Breeze_Admin {
|
|
98 |
wp_enqueue_script( 'jquery' );
|
99 |
}
|
100 |
|
101 |
-
|
102 |
-
if ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) {
|
103 |
-
$script_load = '';
|
104 |
-
}
|
105 |
-
wp_enqueue_script( 'breeze-lazy', plugins_url( 'assets/js/breeze-lazy-load' . $script_load . '.js', dirname( __FILE__ ) ), array(), BREEZE_VERSION, true );
|
106 |
}
|
107 |
}
|
108 |
|
@@ -153,15 +152,21 @@ class Breeze_Admin {
|
|
153 |
if ( ! wp_script_is( 'jquery', 'enqueued' ) ) {
|
154 |
wp_enqueue_script( 'jquery' );
|
155 |
}
|
156 |
-
|
157 |
-
|
158 |
-
|
|
|
|
|
|
|
|
|
159 |
$current_screen = get_current_screen();
|
160 |
if ( $current_screen->base == 'settings_page_breeze' || $current_screen->base == 'settings_page_breeze-network' ) {
|
161 |
//add css
|
162 |
-
wp_enqueue_style( 'breeze-
|
|
|
|
|
163 |
//js
|
164 |
-
wp_enqueue_script( 'breeze-configuration', plugins_url( 'assets/js/breeze-configuration.js', dirname( __FILE__ ) ), array( 'jquery' ), BREEZE_VERSION, true );
|
165 |
|
166 |
// Include the required jQuery UI Core & Libraries
|
167 |
wp_enqueue_script( 'jquery-ui-core' );
|
@@ -169,12 +174,16 @@ class Breeze_Admin {
|
|
169 |
wp_enqueue_script( 'jquery-ui-accordion' );
|
170 |
wp_enqueue_script( 'jquery-ui-sortable' );
|
171 |
wp_enqueue_script( 'jquery-ui-widget' );
|
|
|
|
|
|
|
172 |
}
|
173 |
|
174 |
$token_name = array(
|
175 |
'breeze_purge_varnish' => wp_create_nonce( '_breeze_purge_varnish' ),
|
176 |
'breeze_purge_database' => wp_create_nonce( '_breeze_purge_database' ),
|
177 |
'breeze_purge_cache' => wp_create_nonce( '_breeze_purge_cache' ),
|
|
|
178 |
);
|
179 |
|
180 |
wp_localize_script( 'breeze-backend', 'breeze_token_name', $token_name );
|
@@ -342,41 +351,54 @@ class Breeze_Admin {
|
|
342 |
}
|
343 |
|
344 |
$default_basic = array(
|
345 |
-
'breeze-active'
|
346 |
-
'breeze-
|
347 |
-
'breeze-
|
348 |
-
'breeze-
|
349 |
-
'breeze-
|
350 |
-
'breeze-
|
351 |
-
'breeze-
|
352 |
-
'breeze-
|
353 |
-
'breeze-
|
354 |
-
'breeze-
|
355 |
-
|
356 |
-
'breeze-display-clean' => '1',
|
357 |
-
'breeze-include-inline-js' => '0',
|
358 |
-
'breeze-include-inline-css' => '0',
|
359 |
);
|
360 |
$basic = array_merge( $default_basic, $basic );
|
361 |
|
362 |
-
// Default
|
363 |
-
$
|
364 |
if ( empty( $advanced ) ) {
|
365 |
-
$
|
366 |
}
|
367 |
-
|
368 |
-
|
|
|
|
|
|
|
|
|
369 |
'breeze-group-css' => '0',
|
370 |
-
'breeze-group-js' => '0',
|
371 |
-
'breeze-lazy-load' => '0',
|
372 |
-
'breeze-lazy-load-native' => '0',
|
373 |
-
'breeze-preload-links' => '0',
|
374 |
'breeze-exclude-css' => array(),
|
|
|
|
|
|
|
|
|
375 |
'breeze-exclude-js' => array(),
|
376 |
'breeze-move-to-footer-js' => array(),
|
377 |
'breeze-defer-js' => array(),
|
378 |
'breeze-enable-js-delay' => '0',
|
379 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
380 |
);
|
381 |
|
382 |
$is_advanced = get_option( 'breeze_advanced_settings_120' );
|
@@ -436,13 +458,27 @@ class Breeze_Admin {
|
|
436 |
);
|
437 |
$cdn = array_merge( $default_cdn, $cdn );
|
438 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
439 |
// Varnish default
|
440 |
$varnish = breeze_get_option( 'varnish_cache' );
|
441 |
if ( empty( $varnish ) ) {
|
442 |
$varnish = array();
|
443 |
}
|
444 |
$default_varnish = array(
|
445 |
-
'auto-purge-varnish'
|
|
|
|
|
446 |
);
|
447 |
$varnish = array_merge( $default_varnish, $varnish );
|
448 |
|
@@ -465,21 +501,32 @@ class Breeze_Admin {
|
|
465 |
}
|
466 |
|
467 |
$blog_advanced = get_blog_option( (int) $blog->blog_id, 'breeze_advanced_settings', '' );
|
468 |
-
if ( empty( $blog_advanced )
|
469 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
470 |
|
471 |
if ( isset( $breeze_delay_js_scripts ) ) {
|
472 |
-
if ( empty( $
|
473 |
-
$
|
474 |
} else {
|
475 |
-
$
|
476 |
-
$
|
477 |
}
|
478 |
|
479 |
}
|
480 |
-
update_blog_option( (int) $blog->blog_id, '
|
481 |
}
|
482 |
|
|
|
483 |
$blog_cdn = get_blog_option( (int) $blog->blog_id, 'breeze_cdn_integration', '' );
|
484 |
if ( empty( $blog_cdn ) ) {
|
485 |
update_blog_option( (int) $blog->blog_id, 'breeze_cdn_integration', $cdn );
|
@@ -498,20 +545,30 @@ class Breeze_Admin {
|
|
498 |
}
|
499 |
|
500 |
$network_advanced = breeze_get_option( 'advanced_settings' );
|
501 |
-
if ( ! $network_advanced
|
502 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
503 |
|
504 |
if ( isset( $breeze_delay_js_scripts ) ) {
|
505 |
-
if ( empty( $
|
506 |
$save_advanced['breeze-delay-js-scripts'] = $breeze_delay_js_scripts;
|
507 |
} else {
|
508 |
-
$save_advanced = $
|
509 |
$save_advanced['breeze-delay-js-scripts'] = $breeze_delay_js_scripts;
|
510 |
}
|
511 |
|
512 |
}
|
513 |
|
514 |
-
breeze_update_option( '
|
515 |
}
|
516 |
|
517 |
$network_cdn = breeze_get_option( 'cdn_integration' );
|
@@ -533,19 +590,29 @@ class Breeze_Admin {
|
|
533 |
}
|
534 |
|
535 |
$singe_network_advanced = breeze_get_option( 'advanced_settings' );
|
536 |
-
if ( ! $singe_network_advanced
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
537 |
$save_advanced = $advanced;
|
538 |
|
539 |
if ( isset( $breeze_delay_js_scripts ) ) {
|
540 |
-
if ( empty( $
|
541 |
$save_advanced['breeze-delay-js-scripts'] = $breeze_delay_js_scripts;
|
542 |
} else {
|
543 |
-
$save_advanced = $
|
544 |
$save_advanced['breeze-delay-js-scripts'] = $breeze_delay_js_scripts;
|
545 |
}
|
546 |
}
|
547 |
|
548 |
-
breeze_update_option( '
|
549 |
}
|
550 |
|
551 |
$singe_network_cdn = breeze_get_option( 'cdn_integration' );
|
@@ -618,24 +685,27 @@ class Breeze_Admin {
|
|
618 |
);
|
619 |
|
620 |
// Delete NETWORK level options.
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
|
|
634 |
|
635 |
// Delete options for each sub-blog.
|
636 |
foreach ( $sites as $blog_id ) {
|
637 |
switch_to_blog( $blog_id );
|
638 |
delete_option( 'breeze_basic_settings' );
|
|
|
|
|
639 |
delete_option( 'breeze_advanced_settings' );
|
640 |
delete_option( 'breeze_cdn_integration' );
|
641 |
delete_option( 'breeze_varnish_cache' );
|
@@ -652,6 +722,8 @@ class Breeze_Admin {
|
|
652 |
} else {
|
653 |
// Delete options for each sub-blog.
|
654 |
delete_option( 'breeze_basic_settings' );
|
|
|
|
|
655 |
delete_option( 'breeze_advanced_settings' );
|
656 |
delete_option( 'breeze_cdn_integration' );
|
657 |
delete_option( 'breeze_varnish_cache' );
|
@@ -672,7 +744,7 @@ class Breeze_Admin {
|
|
672 |
* Render tab for the settings in back-end.
|
673 |
*/
|
674 |
public static function render( $tab ) {
|
675 |
-
require_once( BREEZE_PLUGIN_DIR . 'views/tabs/' . $tab . '.php' );
|
676 |
}
|
677 |
|
678 |
/**
|
57 |
add_action( 'admin_notices', array( $this, 'installing_notices' ) );
|
58 |
}
|
59 |
|
60 |
+
$breeze_display_clean = Breeze_Options_Reader::get_option_value( 'breeze-display-clean' );
|
61 |
|
62 |
+
if ( isset( $breeze_display_clean ) && $breeze_display_clean ) {
|
63 |
//register top bar menu
|
64 |
add_action( 'admin_bar_menu', array( $this, 'register_admin_bar_menu' ), 999 );
|
65 |
}
|
82 |
* @access public
|
83 |
*/
|
84 |
public function breeze_lazy_load() {
|
85 |
+
|
86 |
$is_lazy_load_enabled = false;
|
87 |
$is_lazy_load_native = false;
|
88 |
|
89 |
+
$option_breeze_lazy_load = Breeze_Options_Reader::get_option_value( 'breeze-lazy-load' );
|
90 |
+
$option_breeze_lazy_load_native = Breeze_Options_Reader::get_option_value( 'breeze-lazy-load-native' );
|
91 |
+
|
92 |
+
if ( isset( $option_breeze_lazy_load ) ) {
|
93 |
+
$is_lazy_load_enabled = filter_var( $option_breeze_lazy_load, FILTER_VALIDATE_BOOLEAN );
|
94 |
}
|
95 |
+
if ( isset( $option_breeze_lazy_load_native ) ) {
|
96 |
+
$is_lazy_load_native = filter_var( $option_breeze_lazy_load_native, FILTER_VALIDATE_BOOLEAN );
|
97 |
}
|
98 |
|
99 |
if ( true === $is_lazy_load_enabled && false === $is_lazy_load_native ) {
|
101 |
wp_enqueue_script( 'jquery' );
|
102 |
}
|
103 |
|
104 |
+
wp_enqueue_script( 'breeze-lazy', plugins_url( 'assets/js/js-front-end/breeze-lazy-load.min.js', dirname( __FILE__ ) ), array(), BREEZE_VERSION, true );
|
|
|
|
|
|
|
|
|
105 |
}
|
106 |
}
|
107 |
|
152 |
if ( ! wp_script_is( 'jquery', 'enqueued' ) ) {
|
153 |
wp_enqueue_script( 'jquery' );
|
154 |
}
|
155 |
+
$min = '.min';
|
156 |
+
if ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) {
|
157 |
+
$min = '';
|
158 |
+
}
|
159 |
+
wp_enqueue_script( 'breeze-backend', plugins_url( 'assets/js/breeze-main' . $min . '.js', dirname( __FILE__ ) ), array( 'jquery' ), time(), true ); // BREEZE_VERSION
|
160 |
+
#wp_enqueue_style( 'breeze-topbar', plugins_url( 'assets/css/topbar.css', dirname( __FILE__ ) ), array(), BREEZE_VERSION );
|
161 |
+
wp_enqueue_style( 'breeze-notice', plugins_url( 'assets/css/breeze-admin-global.css', dirname( __FILE__ ) ), array(), BREEZE_VERSION );
|
162 |
$current_screen = get_current_screen();
|
163 |
if ( $current_screen->base == 'settings_page_breeze' || $current_screen->base == 'settings_page_breeze-network' ) {
|
164 |
//add css
|
165 |
+
wp_enqueue_style( 'breeze-fonts', plugins_url( 'assets/css/breeze-fonts.css', dirname( __FILE__ ) ), array(), BREEZE_VERSION ); // BREEZE_VERSION
|
166 |
+
wp_enqueue_style( 'breeze-style', plugins_url( 'assets/css/breeze-admin.css', dirname( __FILE__ ) ), array( 'breeze-fonts' ), time() ); // BREEZE_VERSION
|
167 |
+
|
168 |
//js
|
169 |
+
#wp_enqueue_script( 'breeze-configuration', plugins_url( 'assets/js/breeze-configuration.js', dirname( __FILE__ ) ), array( 'jquery' ), BREEZE_VERSION, true );
|
170 |
|
171 |
// Include the required jQuery UI Core & Libraries
|
172 |
wp_enqueue_script( 'jquery-ui-core' );
|
174 |
wp_enqueue_script( 'jquery-ui-accordion' );
|
175 |
wp_enqueue_script( 'jquery-ui-sortable' );
|
176 |
wp_enqueue_script( 'jquery-ui-widget' );
|
177 |
+
|
178 |
+
|
179 |
+
|
180 |
}
|
181 |
|
182 |
$token_name = array(
|
183 |
'breeze_purge_varnish' => wp_create_nonce( '_breeze_purge_varnish' ),
|
184 |
'breeze_purge_database' => wp_create_nonce( '_breeze_purge_database' ),
|
185 |
'breeze_purge_cache' => wp_create_nonce( '_breeze_purge_cache' ),
|
186 |
+
'breeze_save_options' => wp_create_nonce( '_breeze_save_options' ),
|
187 |
);
|
188 |
|
189 |
wp_localize_script( 'breeze-backend', 'breeze_token_name', $token_name );
|
351 |
}
|
352 |
|
353 |
$default_basic = array(
|
354 |
+
'breeze-active' => '1',
|
355 |
+
'breeze-cross-origin' => '0',
|
356 |
+
'breeze-disable-admin' => $active_cache_users,
|
357 |
+
'breeze-gzip-compression' => '1',
|
358 |
+
'breeze-desktop-cache' => '1',
|
359 |
+
'breeze-mobile-cache' => '1',
|
360 |
+
'breeze-browser-cache' => '1',
|
361 |
+
'breeze-lazy-load' => '0',
|
362 |
+
'breeze-lazy-load-native' => '0',
|
363 |
+
'breeze-display-clean' => '1',
|
364 |
+
|
|
|
|
|
|
|
365 |
);
|
366 |
$basic = array_merge( $default_basic, $basic );
|
367 |
|
368 |
+
// Default File
|
369 |
+
$file = breeze_get_option( 'file_settings' );
|
370 |
if ( empty( $advanced ) ) {
|
371 |
+
$file = array();
|
372 |
}
|
373 |
+
|
374 |
+
$default_file = array(
|
375 |
+
'breeze-minify-html' => '0',
|
376 |
+
// --
|
377 |
+
'breeze-minify-css' => '0',
|
378 |
+
'breeze-font-display-swap' => '0',
|
379 |
'breeze-group-css' => '0',
|
|
|
|
|
|
|
|
|
380 |
'breeze-exclude-css' => array(),
|
381 |
+
// --
|
382 |
+
'breeze-minify-js' => '0',
|
383 |
+
'breeze-group-js' => '0',
|
384 |
+
'breeze-include-inline-js' => '0',
|
385 |
'breeze-exclude-js' => array(),
|
386 |
'breeze-move-to-footer-js' => array(),
|
387 |
'breeze-defer-js' => array(),
|
388 |
'breeze-enable-js-delay' => '0',
|
389 |
+
);
|
390 |
+
|
391 |
+
$file = array_merge( $default_file, $file );
|
392 |
+
|
393 |
+
// Default Advanced
|
394 |
+
$advanced = breeze_get_option( 'advanced_settings' );
|
395 |
+
if ( empty( $advanced ) ) {
|
396 |
+
$advanced = array();
|
397 |
+
}
|
398 |
+
$default_advanced = array(
|
399 |
+
'breeze-exclude-urls' => array(),
|
400 |
+
'cached-query-strings' => array(),
|
401 |
+
'breeze-wp-emoji' => '0',
|
402 |
);
|
403 |
|
404 |
$is_advanced = get_option( 'breeze_advanced_settings_120' );
|
458 |
);
|
459 |
$cdn = array_merge( $default_cdn, $cdn );
|
460 |
|
461 |
+
|
462 |
+
// Preload default
|
463 |
+
$preload = breeze_get_option( 'preload_settings' );
|
464 |
+
if ( empty( $preload ) ) {
|
465 |
+
$preload = array();
|
466 |
+
}
|
467 |
+
$default_preload = array(
|
468 |
+
'breeze-preload-fonts' => array(),
|
469 |
+
'breeze-preload-links' => '0',
|
470 |
+
);
|
471 |
+
$preload = array_merge( $default_preload, $preload );
|
472 |
+
|
473 |
// Varnish default
|
474 |
$varnish = breeze_get_option( 'varnish_cache' );
|
475 |
if ( empty( $varnish ) ) {
|
476 |
$varnish = array();
|
477 |
}
|
478 |
$default_varnish = array(
|
479 |
+
'auto-purge-varnish' => '1',
|
480 |
+
'breeze-varnish-server-ip' => '127.0.0.1',
|
481 |
+
'breeze-ttl' => 1440,
|
482 |
);
|
483 |
$varnish = array_merge( $default_varnish, $varnish );
|
484 |
|
501 |
}
|
502 |
|
503 |
$blog_advanced = get_blog_option( (int) $blog->blog_id, 'breeze_advanced_settings', '' );
|
504 |
+
if ( empty( $blog_advanced ) ) {
|
505 |
+
update_blog_option( (int) $blog->blog_id, 'breeze_advanced_settings', $advanced );
|
506 |
+
}
|
507 |
+
|
508 |
+
$blog_preload = get_blog_option( (int) $blog->blog_id, 'breeze_preload_settings', '' );
|
509 |
+
if ( empty( $blog_preload ) ) {
|
510 |
+
update_blog_option( (int) $blog->blog_id, 'breeze_preload_settings', $preload );
|
511 |
+
}
|
512 |
+
|
513 |
+
$blog_file = get_blog_option( (int) $blog->blog_id, 'breeze_file_settings', '' );
|
514 |
+
if ( empty( $blog_file ) || empty( $is_advanced ) ) {
|
515 |
+
$save_file = $file;
|
516 |
|
517 |
if ( isset( $breeze_delay_js_scripts ) ) {
|
518 |
+
if ( empty( $blog_file ) ) {
|
519 |
+
$save_file['breeze-delay-js-scripts'] = $breeze_delay_js_scripts;
|
520 |
} else {
|
521 |
+
$save_file = $blog_file;
|
522 |
+
$save_file['breeze-delay-js-scripts'] = $breeze_delay_js_scripts;
|
523 |
}
|
524 |
|
525 |
}
|
526 |
+
update_blog_option( (int) $blog->blog_id, 'breeze_file_settings', $save_file );
|
527 |
}
|
528 |
|
529 |
+
|
530 |
$blog_cdn = get_blog_option( (int) $blog->blog_id, 'breeze_cdn_integration', '' );
|
531 |
if ( empty( $blog_cdn ) ) {
|
532 |
update_blog_option( (int) $blog->blog_id, 'breeze_cdn_integration', $cdn );
|
545 |
}
|
546 |
|
547 |
$network_advanced = breeze_get_option( 'advanced_settings' );
|
548 |
+
if ( ! $network_advanced ) {
|
549 |
+
breeze_update_option( 'advanced_settings', $advanced );
|
550 |
+
}
|
551 |
+
|
552 |
+
$network_preload = breeze_get_option( 'preload_settings' );
|
553 |
+
if ( ! $network_preload ) {
|
554 |
+
breeze_update_option( 'preload_settings', $preload );
|
555 |
+
}
|
556 |
+
|
557 |
+
$network_file = breeze_get_option( 'file_settings' );
|
558 |
+
if ( ! $network_file || empty( $is_advanced ) ) {
|
559 |
+
$save_advanced = $file;
|
560 |
|
561 |
if ( isset( $breeze_delay_js_scripts ) ) {
|
562 |
+
if ( empty( $network_file ) ) {
|
563 |
$save_advanced['breeze-delay-js-scripts'] = $breeze_delay_js_scripts;
|
564 |
} else {
|
565 |
+
$save_advanced = $network_file;
|
566 |
$save_advanced['breeze-delay-js-scripts'] = $breeze_delay_js_scripts;
|
567 |
}
|
568 |
|
569 |
}
|
570 |
|
571 |
+
breeze_update_option( 'file_settings', $save_advanced, true );
|
572 |
}
|
573 |
|
574 |
$network_cdn = breeze_get_option( 'cdn_integration' );
|
590 |
}
|
591 |
|
592 |
$singe_network_advanced = breeze_get_option( 'advanced_settings' );
|
593 |
+
if ( ! $singe_network_advanced ) {
|
594 |
+
breeze_update_option( 'advanced_settings', $advanced );
|
595 |
+
}
|
596 |
+
|
597 |
+
$singe_network_preload = breeze_get_option( 'preload_settings' );
|
598 |
+
if ( ! $singe_network_preload ) {
|
599 |
+
breeze_update_option( 'preload_settings', $preload );
|
600 |
+
}
|
601 |
+
|
602 |
+
$singe_network_file = breeze_get_option( 'file_settings' );
|
603 |
+
if ( ! $singe_network_file || empty( $is_advanced ) ) {
|
604 |
$save_advanced = $advanced;
|
605 |
|
606 |
if ( isset( $breeze_delay_js_scripts ) ) {
|
607 |
+
if ( empty( $singe_network_file ) ) {
|
608 |
$save_advanced['breeze-delay-js-scripts'] = $breeze_delay_js_scripts;
|
609 |
} else {
|
610 |
+
$save_advanced = $singe_network_file;
|
611 |
$save_advanced['breeze-delay-js-scripts'] = $breeze_delay_js_scripts;
|
612 |
}
|
613 |
}
|
614 |
|
615 |
+
breeze_update_option( 'file_settings', $save_advanced, true );
|
616 |
}
|
617 |
|
618 |
$singe_network_cdn = breeze_get_option( 'cdn_integration' );
|
685 |
);
|
686 |
|
687 |
// Delete NETWORK level options.
|
688 |
+
delete_site_option( 'breeze_basic_settings' );
|
689 |
+
delete_site_option( 'breeze_preload_settings' );
|
690 |
+
delete_site_option( 'breeze_file_settings' );
|
691 |
+
delete_site_option( 'breeze_advanced_settings' );
|
692 |
+
delete_site_option( 'breeze_cdn_integration' );
|
693 |
+
delete_site_option( 'breeze_varnish_cache' );
|
694 |
+
delete_site_option( 'breeze_inherit_settings' );
|
695 |
+
delete_site_option( 'breeze_show_incompatibility' );
|
696 |
+
delete_site_option( 'breeze_first_install' );
|
697 |
+
delete_site_option( 'breeze_advanced_settings_120' );
|
698 |
+
delete_site_option( 'breeze_new_update' );
|
699 |
+
delete_site_option( 'breeze_ecommerce_detect' );
|
700 |
+
delete_site_option( 'breeze_exclude_url_pages' );
|
701 |
+
delete_site_option( 'breeze_hide_notice' );
|
702 |
|
703 |
// Delete options for each sub-blog.
|
704 |
foreach ( $sites as $blog_id ) {
|
705 |
switch_to_blog( $blog_id );
|
706 |
delete_option( 'breeze_basic_settings' );
|
707 |
+
delete_option( 'breeze_preload_settings' );
|
708 |
+
delete_option( 'breeze_file_settings' );
|
709 |
delete_option( 'breeze_advanced_settings' );
|
710 |
delete_option( 'breeze_cdn_integration' );
|
711 |
delete_option( 'breeze_varnish_cache' );
|
722 |
} else {
|
723 |
// Delete options for each sub-blog.
|
724 |
delete_option( 'breeze_basic_settings' );
|
725 |
+
delete_option( 'breeze_preload_settings' );
|
726 |
+
delete_option( 'breeze_file_settings' );
|
727 |
delete_option( 'breeze_advanced_settings' );
|
728 |
delete_option( 'breeze_cdn_integration' );
|
729 |
delete_option( 'breeze_varnish_cache' );
|
744 |
* Render tab for the settings in back-end.
|
745 |
*/
|
746 |
public static function render( $tab ) {
|
747 |
+
require_once( BREEZE_PLUGIN_DIR . 'views/option-tabs/' . $tab . '-tab.php' );
|
748 |
}
|
749 |
|
750 |
/**
|
inc/breeze-configuration.php
CHANGED
@@ -24,281 +24,432 @@ class Breeze_Configuration {
|
|
24 |
public function __construct() {
|
25 |
global $breeze_network_subsite_settings;
|
26 |
$breeze_network_subsite_settings = false;
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
}
|
29 |
|
|
|
|
|
|
|
30 |
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
*/
|
34 |
-
public function
|
35 |
-
|
36 |
-
|
37 |
-
is_multisite() &&
|
38 |
-
isset( $_REQUEST['inherit-settings'] ) &&
|
39 |
-
isset( $_POST['breeze_inherit_settings_nonce'] ) &&
|
40 |
-
wp_verify_nonce( $_POST['breeze_inherit_settings_nonce'], 'breeze_inherit_settings' )
|
41 |
-
) {
|
42 |
-
|
43 |
-
$inherit_settings = ( true === filter_var( $_REQUEST['inherit-settings'], FILTER_VALIDATE_BOOLEAN ) ? '1' : '0' );
|
44 |
-
update_option( 'breeze_inherit_settings', $inherit_settings );
|
45 |
-
Breeze_ConfigCache::factory()->write();
|
46 |
-
|
47 |
-
Breeze_ConfigCache::factory()->write_config_cache( true );
|
48 |
-
$is_inherit_settings_change = filter_var( $inherit_settings, FILTER_VALIDATE_BOOLEAN );
|
49 |
-
if ( ! is_network_admin() && true === $is_inherit_settings_change ) {
|
50 |
-
do_action( 'breeze_clear_all_cache' );
|
51 |
-
}
|
52 |
|
53 |
-
|
54 |
-
WP_Filesystem();
|
55 |
-
Breeze_ConfigCache::factory()->write_config_cache();
|
56 |
-
}
|
57 |
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
}
|
64 |
}
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
-
|
68 |
-
if ( isset( $_REQUEST['breeze_basic_action'] ) && $_REQUEST['breeze_basic_action'] == 'breeze_basic_settings' ) {
|
69 |
-
if ( isset( $_POST['breeze_settings_basic_nonce'] ) && wp_verify_nonce( $_POST['breeze_settings_basic_nonce'], 'breeze_settings_basic' ) ) {
|
70 |
-
WP_Filesystem();
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
wp_safe_redirect( add_query_arg( 'save-settings', 'success', $url ) );
|
76 |
-
exit;
|
77 |
-
}
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
$active_cache_users[ $usr_role ] = 1;
|
86 |
-
}
|
87 |
-
}
|
88 |
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
'breeze-minify-js' => ( isset( $_POST['minification-js'] ) ? '1' : '0' ),
|
97 |
-
'breeze-gzip-compression' => ( isset( $_POST['gzip-compression'] ) ? '1' : '0' ),
|
98 |
-
'breeze-browser-cache' => ( isset( $_POST['browser-cache'] ) ? '1' : '0' ),
|
99 |
-
'breeze-desktop-cache' => (int) $_POST['desktop-cache'],
|
100 |
-
'breeze-mobile-cache' => (int) $_POST['mobile-cache'],
|
101 |
-
'breeze-disable-admin' => $active_cache_users, // 0 is enable, 1 is disable in this case. @TODO remove this text.
|
102 |
-
'breeze-display-clean' => '1',
|
103 |
-
'breeze-include-inline-js' => ( isset( $_POST['include-inline-js'] ) ? '1' : '0' ),
|
104 |
-
'breeze-include-inline-css' => ( isset( $_POST['include-inline-css'] ) ? '1' : '0' ),
|
105 |
-
'breeze-wp-emoji' => ( isset( $_POST['breeze-wpjs-emoji'] ) ? '1' : '0' ),
|
106 |
-
);
|
107 |
|
108 |
-
|
|
|
109 |
|
110 |
-
|
111 |
-
|
112 |
-
Breeze_ConfigCache::factory()->write_config_cache();
|
113 |
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
|
|
|
|
120 |
|
121 |
-
|
122 |
-
if ( isset( $_POST['cache-system'] ) ) {
|
123 |
-
Breeze_PurgeCacheTime::factory()->unschedule_events();
|
124 |
-
Breeze_PurgeCacheTime::factory()->schedule_events();
|
125 |
-
}
|
126 |
-
// Add expires header
|
127 |
-
self::update_htaccess();
|
128 |
|
129 |
-
|
130 |
-
do_action( 'breeze_clear_all_cache' );
|
131 |
|
132 |
-
|
|
|
|
|
133 |
}
|
134 |
-
// Advanced options tab
|
135 |
-
if ( isset( $_REQUEST['breeze_advanced_action'] ) && $_REQUEST['breeze_advanced_action'] == 'breeze_advanced_settings' ) {
|
136 |
-
if ( isset( $_POST['breeze_settings_advanced_nonce'] ) && wp_verify_nonce( $_POST['breeze_settings_advanced_nonce'], 'breeze_settings_advanced' ) ) {
|
137 |
-
$exclude_urls = $this->string_convert_arr( sanitize_textarea_field( $_POST['exclude-urls'] ) );
|
138 |
-
$exclude_css = $this->string_convert_arr( sanitize_textarea_field( $_POST['exclude-css'] ) );
|
139 |
-
$exclude_js = $this->string_convert_arr( sanitize_textarea_field( $_POST['exclude-js'] ) );
|
140 |
-
$delay_js = $this->string_convert_arr( sanitize_textarea_field( $_POST['delay-js-scripts'] ) );
|
141 |
-
$cache_query_str = $this->string_convert_arr( sanitize_textarea_field( $_POST['cache-query-str'] ) );
|
142 |
-
$preload_fonts = $move_to_footer_js = $defer_js = array();
|
143 |
-
|
144 |
-
if ( ! empty( $exclude_js ) ) {
|
145 |
-
$exclude_js = array_unique( $exclude_js );
|
146 |
-
}
|
147 |
-
if ( ! empty( $delay_js ) ) {
|
148 |
-
$delay_js = array_unique( $delay_js );
|
149 |
-
}
|
150 |
|
151 |
-
|
152 |
-
|
153 |
-
}
|
154 |
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
continue;
|
163 |
-
}
|
164 |
-
$font_url = current( explode( '?', $font_url, 2 ) );
|
165 |
-
$preload_fonts[ sanitize_text_field( $font_url ) ] = sanitize_text_field( $font_url );
|
166 |
-
}
|
167 |
-
}
|
168 |
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
}
|
|
|
|
|
|
|
|
|
178 |
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
}
|
184 |
-
$url = current( explode( '?', $url, 2 ) );
|
185 |
-
$defer_js[ sanitize_text_field( $url ) ] = sanitize_text_field( $url );
|
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 |
-
Breeze_ConfigCache::factory()->write_config_cache();
|
212 |
|
213 |
-
|
214 |
-
|
215 |
|
216 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
}
|
218 |
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
$url = remove_query_arg( 'save-settings', $_REQUEST['_wp_http_referer'] );
|
232 |
-
wp_safe_redirect( add_query_arg( 'database-cleanup', 'success', $url ) );
|
233 |
-
exit;
|
234 |
}
|
235 |
}
|
236 |
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
$exclude_content = array();
|
242 |
-
if ( ! empty( $_POST['cdn-content'] ) ) {
|
243 |
-
$cdn_content = explode( ',', sanitize_text_field( $_POST['cdn-content'] ) );
|
244 |
-
$cdn_content = array_unique( $cdn_content );
|
245 |
-
}
|
246 |
-
if ( ! empty( $_POST['cdn-exclude-content'] ) ) {
|
247 |
-
$exclude_content = explode( ',', sanitize_text_field( $_POST['cdn-exclude-content'] ) );
|
248 |
-
$exclude_content = array_unique( $exclude_content );
|
249 |
-
}
|
250 |
|
251 |
-
|
252 |
-
if ( ! empty( $cdn_url ) ) {
|
253 |
-
$http_schema = parse_url( $cdn_url, PHP_URL_SCHEME );
|
254 |
|
255 |
-
|
256 |
-
|
|
|
257 |
|
258 |
-
|
259 |
-
|
260 |
-
}
|
261 |
-
}
|
262 |
|
263 |
-
|
264 |
-
|
265 |
-
'cdn-url' => $cdn_url,
|
266 |
-
'cdn-content' => $cdn_content,
|
267 |
-
'cdn-exclude-content' => $exclude_content,
|
268 |
-
'cdn-relative-path' => ( isset( $_POST['cdn-relative-path'] ) ? '1' : '0' ),
|
269 |
-
);
|
270 |
|
271 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
|
273 |
-
|
274 |
-
do_action( 'breeze_clear_all_cache' );
|
275 |
|
276 |
-
|
|
|
|
|
277 |
}
|
278 |
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
|
287 |
-
|
|
|
|
|
|
|
|
|
|
|
288 |
|
289 |
-
|
290 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
}
|
292 |
}
|
293 |
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
299 |
}
|
300 |
|
301 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
}
|
303 |
|
304 |
/*
|
@@ -313,7 +464,9 @@ class Breeze_Configuration {
|
|
313 |
if ( $clean ) {
|
314 |
$args['clean'] = true;
|
315 |
} else {
|
316 |
-
$args['content'] = '
|
|
|
|
|
317 |
'<IfModule mod_expires.c>' . PHP_EOL .
|
318 |
' ExpiresActive On' . PHP_EOL .
|
319 |
' ExpiresDefault "access plus 1 month"' . PHP_EOL .
|
@@ -402,7 +555,9 @@ class Breeze_Configuration {
|
|
402 |
if ( $clean ) {
|
403 |
$args['clean'] = true;
|
404 |
} else {
|
405 |
-
$args['content'] = '
|
|
|
|
|
406 |
'<IfModule mod_deflate.c>' . PHP_EOL .
|
407 |
' AddType x-font/woff .woff' . PHP_EOL .
|
408 |
' AddOutputFilterByType DEFLATE text/plain' . PHP_EOL .
|
@@ -507,15 +662,14 @@ class Breeze_Configuration {
|
|
507 |
foreach ( $blogs as $blog_id ) {
|
508 |
switch_to_blog( $blog_id );
|
509 |
$site_url = preg_quote( preg_replace( '(^https?://)', '', site_url() ) );
|
510 |
-
|
511 |
-
|
512 |
-
if ( '1' === $config['breeze-browser-cache'] ) {
|
513 |
$has_browser_cache = true;
|
514 |
$browser_cache_sites[] = $site_url;
|
515 |
} else {
|
516 |
$no_browser_cache_sites[] = $site_url;
|
517 |
}
|
518 |
-
if ( '1' ===
|
519 |
$has_gzip_compress = true;
|
520 |
$gzip_compress_sites[] = $site_url;
|
521 |
} else {
|
@@ -604,10 +758,9 @@ class Breeze_Configuration {
|
|
604 |
}
|
605 |
} else {
|
606 |
// Single-site setup.
|
607 |
-
|
608 |
-
|
609 |
-
self::
|
610 |
-
self::add_gzip_htacess( '1' !== $config['breeze-gzip-compression'] );
|
611 |
} else {
|
612 |
// Caching not activated, clean up.
|
613 |
self::add_expires_header( true );
|
@@ -661,50 +814,147 @@ class Breeze_Configuration {
|
|
661 |
return true;
|
662 |
}
|
663 |
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
669 |
global $wpdb;
|
670 |
-
$clean = '';
|
671 |
|
672 |
switch ( $type ) {
|
673 |
case 'revisions':
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
678 |
break;
|
679 |
case 'drafted':
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
684 |
break;
|
685 |
case 'trash':
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
690 |
break;
|
691 |
-
case '
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
696 |
break;
|
697 |
case 'trackbacks':
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
702 |
break;
|
703 |
case 'transient':
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
708 |
break;
|
709 |
}
|
710 |
|
@@ -712,42 +962,68 @@ class Breeze_Configuration {
|
|
712 |
}
|
713 |
|
714 |
/**
|
715 |
-
* Database
|
716 |
-
*
|
|
|
717 |
*
|
718 |
* @param string $type
|
|
|
|
|
|
|
719 |
*/
|
720 |
-
public static function
|
721 |
global $wpdb;
|
722 |
$return = 0;
|
723 |
switch ( $type ) {
|
724 |
case 'revisions':
|
725 |
-
$
|
726 |
-
|
|
|
|
|
727 |
break;
|
728 |
case 'drafted':
|
729 |
-
$
|
730 |
-
|
|
|
|
|
731 |
break;
|
732 |
case 'trash':
|
733 |
-
$
|
734 |
-
|
|
|
|
|
735 |
break;
|
736 |
-
case '
|
737 |
-
$
|
738 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
739 |
break;
|
740 |
case 'trackbacks':
|
741 |
-
$
|
742 |
-
|
|
|
|
|
743 |
break;
|
744 |
case 'transient':
|
745 |
-
$
|
746 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
747 |
break;
|
748 |
}
|
749 |
|
750 |
-
return $return;
|
751 |
}
|
752 |
|
753 |
// Convert string to array
|
@@ -828,8 +1104,43 @@ class Breeze_Configuration {
|
|
828 |
//check security
|
829 |
check_ajax_referer( '_breeze_purge_database', 'security' );
|
830 |
|
831 |
-
|
832 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
833 |
|
834 |
echo json_encode( array( 'clear' => true ) );
|
835 |
exit;
|
@@ -859,6 +1170,8 @@ class Breeze_Configuration {
|
|
859 |
* @param array $items
|
860 |
*/
|
861 |
public static function optimize_database( $items ) {
|
|
|
|
|
862 |
if ( is_multisite() && is_network_admin() ) {
|
863 |
$sites = get_sites(
|
864 |
array(
|
@@ -869,13 +1182,13 @@ class Breeze_Configuration {
|
|
869 |
foreach ( $sites as $blog_id ) {
|
870 |
switch_to_blog( $blog_id );
|
871 |
foreach ( $items as $item ) {
|
872 |
-
self::
|
873 |
}
|
874 |
restore_current_blog();
|
875 |
}
|
876 |
} else {
|
877 |
foreach ( $items as $item ) {
|
878 |
-
self::
|
879 |
}
|
880 |
}
|
881 |
}
|
24 |
public function __construct() {
|
25 |
global $breeze_network_subsite_settings;
|
26 |
$breeze_network_subsite_settings = false;
|
27 |
+
|
28 |
+
// Save the tabs settings.
|
29 |
+
add_action( 'wp_ajax_save_settings_tab_basic', array( &$this, 'update_options_for_basic' ) );
|
30 |
+
add_action( 'wp_ajax_save_settings_tab_file', array( &$this, 'update_options_for_file' ) );
|
31 |
+
add_action( 'wp_ajax_save_settings_tab_preload', array( &$this, 'update_options_for_preload' ) );
|
32 |
+
add_action( 'wp_ajax_save_settings_tab_advanced', array( &$this, 'update_options_for_advanced' ) );
|
33 |
+
add_action( 'wp_ajax_save_settings_tab_database', array( &$this, 'update_options_for_database' ) );
|
34 |
+
add_action( 'wp_ajax_save_settings_tab_cdn', array( &$this, 'update_options_for_cdn' ) );
|
35 |
+
add_action( 'wp_ajax_save_settings_tab_tools', array( &$this, 'update_options_for_tools' ) );
|
36 |
+
add_action( 'wp_ajax_save_settings_tab_faq', array( &$this, 'update_options_for_faq' ) );
|
37 |
+
add_action( 'wp_ajax_save_settings_tab_varnish', array( &$this, 'update_options_for_varnish' ) );
|
38 |
+
add_action( 'wp_ajax_save_settings_tab_inherit', array( &$this, 'update_options_for_inherit' ) );
|
39 |
}
|
40 |
|
41 |
+
public function update_options_for_varnish() {
|
42 |
+
check_ajax_referer( '_breeze_save_options', 'security' );
|
43 |
+
set_as_network_screen();
|
44 |
|
45 |
+
global $wp_filesystem;
|
46 |
+
|
47 |
+
if ( empty( $wp_filesystem ) ) {
|
48 |
+
require_once( ABSPATH . '/wp-admin/includes/file.php' );
|
49 |
+
WP_Filesystem();
|
50 |
+
}
|
51 |
+
|
52 |
+
$response = array();
|
53 |
+
parse_str( $_POST['form-data'], $_POST );
|
54 |
+
|
55 |
+
$varnish = array(
|
56 |
+
'auto-purge-varnish' => ( isset( $_POST['auto-purge-varnish'] ) ? '1' : '0' ),
|
57 |
+
'breeze-varnish-server-ip' => preg_replace( '/[^a-zA-Z0-9\-\_\.]*/', '', $_POST['varnish-server-ip'] ),
|
58 |
+
);
|
59 |
+
|
60 |
+
breeze_update_option( 'varnish_cache', $varnish, true );
|
61 |
+
|
62 |
+
Breeze_ConfigCache::factory()->write_config_cache();
|
63 |
+
|
64 |
+
// Clear varnish cache after settings
|
65 |
+
do_action( 'breeze_clear_varnish' );
|
66 |
+
|
67 |
+
wp_send_json( $response );
|
68 |
+
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Save the Basic Options settings via Ajax call.
|
73 |
+
*
|
74 |
+
* @access public
|
75 |
+
* @since 2.0.0
|
76 |
*/
|
77 |
+
public function update_options_for_basic() {
|
78 |
+
check_ajax_referer( '_breeze_save_options', 'security' );
|
79 |
+
set_as_network_screen();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
+
global $wp_filesystem;
|
|
|
|
|
|
|
82 |
|
83 |
+
if ( empty( $wp_filesystem ) ) {
|
84 |
+
require_once( ABSPATH . '/wp-admin/includes/file.php' );
|
85 |
+
WP_Filesystem();
|
86 |
+
}
|
87 |
+
|
88 |
+
|
89 |
+
$response = array();
|
90 |
+
parse_str( $_POST['form-data'], $_POST );
|
91 |
+
|
92 |
+
$post_activate_cache = isset( $_POST['breeze-admin-cache'] ) ? $_POST['breeze-admin-cache'] : array();
|
93 |
+
$all_user_roles = breeze_all_wp_user_roles();
|
94 |
+
$active_cache_users = array();
|
95 |
+
foreach ( $all_user_roles as $usr_role ) {
|
96 |
+
$active_cache_users[ $usr_role ] = 0;
|
97 |
+
if ( isset( $post_activate_cache[ $usr_role ] ) ) {
|
98 |
+
$active_cache_users[ $usr_role ] = 1;
|
99 |
}
|
100 |
}
|
101 |
|
102 |
+
$basic = array(
|
103 |
+
'breeze-active' => ( isset( $_POST['cache-system'] ) ? '1' : '0' ),
|
104 |
+
'breeze-cross-origin' => ( isset( $_POST['safe-cross-origin'] ) ? '1' : '0' ),
|
105 |
+
'breeze-disable-admin' => $active_cache_users,
|
106 |
+
'breeze-gzip-compression' => ( isset( $_POST['gzip-compression'] ) ? '1' : '0' ),
|
107 |
+
'breeze-browser-cache' => ( isset( $_POST['browser-cache'] ) ? '1' : '0' ),
|
108 |
+
'breeze-lazy-load' => ( isset( $_POST['bz-lazy-load'] ) ? '1' : '0' ),
|
109 |
+
'breeze-lazy-load-native' => ( isset( $_POST['bz-lazy-load-nat'] ) ? '1' : '0' ),
|
110 |
+
'breeze-desktop-cache' => '1',
|
111 |
+
'breeze-mobile-cache' => '1',
|
112 |
+
'breeze-display-clean' => '1',
|
113 |
+
'breeze-ttl' => (int) $_POST['cache-ttl'],
|
114 |
+
);
|
115 |
|
116 |
+
breeze_update_option( 'basic_settings', $basic, true );
|
|
|
|
|
|
|
117 |
|
118 |
+
// Storage information to cache pages
|
119 |
+
Breeze_ConfigCache::factory()->write();
|
120 |
+
Breeze_ConfigCache::factory()->write_config_cache();
|
|
|
|
|
|
|
121 |
|
122 |
+
// Turn on WP_CACHE to support advanced-cache file
|
123 |
+
if ( isset( $_POST['cache-system'] ) ) {
|
124 |
+
Breeze_ConfigCache::factory()->toggle_caching( true );
|
125 |
+
} else {
|
126 |
+
Breeze_ConfigCache::factory()->toggle_caching( false );
|
127 |
+
}
|
|
|
|
|
|
|
128 |
|
129 |
+
// Reschedule cron events
|
130 |
+
if ( isset( $_POST['cache-system'] ) ) {
|
131 |
+
Breeze_PurgeCacheTime::factory()->unschedule_events();
|
132 |
+
Breeze_PurgeCacheTime::factory()->schedule_events();
|
133 |
+
}
|
134 |
+
// Add expires header
|
135 |
+
self::update_htaccess();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
|
137 |
+
//delete cache after settings
|
138 |
+
do_action( 'breeze_clear_all_cache' );
|
139 |
|
140 |
+
wp_send_json( $response );
|
141 |
+
}
|
|
|
142 |
|
143 |
+
/**
|
144 |
+
* Save the File optimisation tab settings via Ajax call.
|
145 |
+
*
|
146 |
+
* @access public
|
147 |
+
* @since 2.0.0
|
148 |
+
*/
|
149 |
+
public function update_options_for_file() {
|
150 |
+
check_ajax_referer( '_breeze_save_options', 'security' );
|
151 |
|
152 |
+
set_as_network_screen();
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
|
154 |
+
global $wp_filesystem;
|
|
|
155 |
|
156 |
+
if ( empty( $wp_filesystem ) ) {
|
157 |
+
require_once( ABSPATH . '/wp-admin/includes/file.php' );
|
158 |
+
WP_Filesystem();
|
159 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
|
161 |
+
$response = array();
|
162 |
+
parse_str( $_POST['form-data'], $_POST );
|
|
|
163 |
|
164 |
+
$exclude_css = $this->string_convert_arr( sanitize_textarea_field( $_POST['exclude-css'] ) );
|
165 |
+
$exclude_js = $this->string_convert_arr( sanitize_textarea_field( $_POST['exclude-js'] ) );
|
166 |
+
$delay_js = $this->string_convert_arr( sanitize_textarea_field( $_POST['delay-js-scripts'] ) );
|
167 |
|
168 |
+
if ( ! empty( $exclude_js ) ) {
|
169 |
+
$exclude_js = array_unique( $exclude_js );
|
170 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
|
172 |
+
if ( ! empty( $delay_js ) ) {
|
173 |
+
$delay_js = array_unique( $delay_js );
|
174 |
+
}
|
175 |
+
|
176 |
+
if ( ! empty( $exclude_css ) ) {
|
177 |
+
$exclude_css = array_unique( $exclude_css );
|
178 |
+
}
|
179 |
+
|
180 |
+
$move_to_footer_js = $defer_js = array();
|
181 |
+
|
182 |
+
if ( ! empty( $_POST['move-to-footer-js'] ) ) {
|
183 |
+
foreach ( $_POST['move-to-footer-js'] as $url ) {
|
184 |
+
if ( trim( $url ) == '' ) {
|
185 |
+
continue;
|
186 |
}
|
187 |
+
$url = current( explode( '?', $url, 2 ) );
|
188 |
+
$move_to_footer_js[ sanitize_text_field( $url ) ] = sanitize_text_field( $url );
|
189 |
+
}
|
190 |
+
}
|
191 |
|
192 |
+
if ( ! empty( $_POST['defer-js'] ) ) {
|
193 |
+
foreach ( $_POST['defer-js'] as $url ) {
|
194 |
+
if ( trim( $url ) == '' ) {
|
195 |
+
continue;
|
|
|
|
|
|
|
|
|
196 |
}
|
197 |
+
$url = current( explode( '?', $url, 2 ) );
|
198 |
+
$defer_js[ sanitize_text_field( $url ) ] = sanitize_text_field( $url );
|
199 |
+
}
|
200 |
+
}
|
201 |
|
202 |
+
$file_settings = array(
|
203 |
+
'breeze-minify-html' => ( isset( $_POST['minification-html'] ) ? '1' : '0' ),
|
204 |
+
// --
|
205 |
+
'breeze-minify-css' => ( isset( $_POST['minification-css'] ) ? '1' : '0' ),
|
206 |
+
'breeze-font-display-swap' => ( isset( $_POST['font-display'] ) ? '1' : '0' ),
|
207 |
+
'breeze-group-css' => ( isset( $_POST['group-css'] ) ? '1' : '0' ),
|
208 |
+
'breeze-exclude-css' => $exclude_css,
|
209 |
+
'breeze-include-inline-css' => ( isset( $_POST['include-inline-css'] ) ? '1' : '0' ),
|
210 |
+
// --
|
211 |
+
'breeze-minify-js' => ( isset( $_POST['minification-js'] ) ? '1' : '0' ),
|
212 |
+
'breeze-group-js' => ( isset( $_POST['group-js'] ) ? '1' : '0' ),
|
213 |
+
'breeze-include-inline-js' => ( isset( $_POST['include-inline-js'] ) ? '1' : '0' ),
|
214 |
+
'breeze-exclude-js' => $exclude_js,
|
215 |
+
'breeze-move-to-footer-js' => $move_to_footer_js,
|
216 |
+
'breeze-defer-js' => $defer_js,
|
217 |
+
'breeze-enable-js-delay' => ( isset( $_POST['enable-js-delay'] ) ? '1' : '0' ),
|
218 |
+
'breeze-delay-js-scripts' => $delay_js,
|
219 |
+
|
220 |
+
);
|
221 |
|
222 |
+
breeze_update_option( 'file_settings', $file_settings, true );
|
223 |
|
224 |
+
// Storage information to cache pages.
|
225 |
+
Breeze_ConfigCache::factory()->write();
|
226 |
+
Breeze_ConfigCache::factory()->write_config_cache();
|
|
|
227 |
|
228 |
+
// Delete cache after settings
|
229 |
+
do_action( 'breeze_clear_all_cache' );
|
230 |
|
231 |
+
wp_send_json( $response );
|
232 |
+
}
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Save the Preload option settings via Ajax call.
|
236 |
+
*
|
237 |
+
* @access public
|
238 |
+
* @since 2.0.0
|
239 |
+
*/
|
240 |
+
public function update_options_for_preload() {
|
241 |
+
check_ajax_referer( '_breeze_save_options', 'security' );
|
242 |
+
set_as_network_screen();
|
243 |
+
|
244 |
+
|
245 |
+
global $wp_filesystem;
|
246 |
+
|
247 |
+
if ( empty( $wp_filesystem ) ) {
|
248 |
+
require_once( ABSPATH . '/wp-admin/includes/file.php' );
|
249 |
+
WP_Filesystem();
|
250 |
}
|
251 |
|
252 |
+
$response = array();
|
253 |
+
$preload_fonts = array();
|
254 |
+
parse_str( $_POST['form-data'], $_POST );
|
255 |
+
|
256 |
+
|
257 |
+
if ( isset( $_POST['breeze-preload-font'] ) && ! empty( $_POST['breeze-preload-font'] ) ) {
|
258 |
+
foreach ( $_POST['breeze-preload-font'] as $font_url ) {
|
259 |
+
if ( trim( $font_url ) == '' ) {
|
260 |
+
continue;
|
261 |
+
}
|
262 |
+
$font_url = current( explode( '?', $font_url, 2 ) );
|
263 |
+
$preload_fonts[ sanitize_text_field( $font_url ) ] = sanitize_text_field( $font_url );
|
|
|
|
|
|
|
264 |
}
|
265 |
}
|
266 |
|
267 |
+
$preload = array(
|
268 |
+
'breeze-preload-fonts' => $preload_fonts,
|
269 |
+
'breeze-preload-links' => ( isset( $_POST['preload-links'] ) ? '1' : '0' ),
|
270 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
|
272 |
+
breeze_update_option( 'preload_settings', $preload, true );
|
|
|
|
|
273 |
|
274 |
+
// Storage information to cache pages.
|
275 |
+
Breeze_ConfigCache::factory()->write();
|
276 |
+
Breeze_ConfigCache::factory()->write_config_cache();
|
277 |
|
278 |
+
// Delete cache after settings
|
279 |
+
do_action( 'breeze_clear_all_cache' );
|
|
|
|
|
280 |
|
281 |
+
wp_send_json( $response );
|
282 |
+
}
|
|
|
|
|
|
|
|
|
|
|
283 |
|
284 |
+
/**
|
285 |
+
* Save the Advanced option settings via Ajax call.
|
286 |
+
*
|
287 |
+
* @access public
|
288 |
+
* @since 2.0.0
|
289 |
+
*/
|
290 |
+
public function update_options_for_advanced() {
|
291 |
+
check_ajax_referer( '_breeze_save_options', 'security' );
|
292 |
+
set_as_network_screen();
|
293 |
|
294 |
+
global $wp_filesystem;
|
|
|
295 |
|
296 |
+
if ( empty( $wp_filesystem ) ) {
|
297 |
+
require_once( ABSPATH . '/wp-admin/includes/file.php' );
|
298 |
+
WP_Filesystem();
|
299 |
}
|
300 |
|
301 |
+
$response = array();
|
302 |
+
parse_str( $_POST['form-data'], $_POST );
|
303 |
+
|
304 |
+
$exclude_urls = $this->string_convert_arr( sanitize_textarea_field( $_POST['exclude-urls'] ) );
|
305 |
+
$cache_query_str = $this->string_convert_arr( sanitize_textarea_field( $_POST['cache-query-str'] ) );
|
306 |
+
if ( ! empty( $exclude_urls ) ) {
|
307 |
+
$exclude_urls = array_unique( $exclude_urls );
|
308 |
+
}
|
309 |
+
if ( ! empty( $cache_query_str ) ) {
|
310 |
+
$cache_query_str = array_unique( $cache_query_str );
|
311 |
+
}
|
312 |
+
|
313 |
+
$advanced = array(
|
314 |
+
'breeze-exclude-urls' => $exclude_urls,
|
315 |
+
'cached-query-strings' => $cache_query_str,
|
316 |
+
'breeze-wp-emoji' => ( isset( $_POST['breeze-wpjs-emoji'] ) ? '1' : '0' ),
|
317 |
+
);
|
318 |
+
|
319 |
+
breeze_update_option( 'advanced_settings', $advanced, true );
|
320 |
+
|
321 |
+
// Storage information to cache pages.
|
322 |
+
Breeze_ConfigCache::factory()->write();
|
323 |
+
Breeze_ConfigCache::factory()->write_config_cache();
|
324 |
+
|
325 |
+
// Delete cache after settings
|
326 |
+
do_action( 'breeze_clear_all_cache' );
|
327 |
+
|
328 |
+
wp_send_json( $response );
|
329 |
+
}
|
330 |
+
|
331 |
+
/**
|
332 |
+
* Database tab only has actions for now and it will not save anything.
|
333 |
+
*
|
334 |
+
* @access public
|
335 |
+
* @since 2.0.0
|
336 |
+
*/
|
337 |
+
public function update_options_for_database() {
|
338 |
+
// Does not have anything to save.
|
339 |
+
}
|
340 |
+
|
341 |
+
/**
|
342 |
+
* Save the CDN option settings via Ajax call.
|
343 |
+
*
|
344 |
+
* @access public
|
345 |
+
* @since 2.0.0
|
346 |
+
*/
|
347 |
+
public function update_options_for_cdn() {
|
348 |
+
check_ajax_referer( '_breeze_save_options', 'security' );
|
349 |
+
set_as_network_screen();
|
350 |
|
351 |
+
global $wp_filesystem;
|
352 |
+
|
353 |
+
if ( empty( $wp_filesystem ) ) {
|
354 |
+
require_once( ABSPATH . '/wp-admin/includes/file.php' );
|
355 |
+
WP_Filesystem();
|
356 |
+
}
|
357 |
|
358 |
+
$response = array();
|
359 |
+
parse_str( $_POST['form-data'], $_POST );
|
360 |
+
|
361 |
+
$cdn_content = array();
|
362 |
+
$exclude_content = array();
|
363 |
+
if ( ! empty( $_POST['cdn-content'] ) ) {
|
364 |
+
$cdn_content = explode( ',', sanitize_text_field( $_POST['cdn-content'] ) );
|
365 |
+
$cdn_content = array_unique( $cdn_content );
|
366 |
+
}
|
367 |
+
if ( ! empty( $_POST['cdn-exclude-content'] ) ) {
|
368 |
+
$exclude_content = explode( ',', sanitize_text_field( $_POST['cdn-exclude-content'] ) );
|
369 |
+
$exclude_content = array_unique( $exclude_content );
|
370 |
+
}
|
371 |
+
|
372 |
+
$cdn_url = ( isset( $_POST['cdn-url'] ) ? sanitize_text_field( $_POST['cdn-url'] ) : '' );
|
373 |
+
if ( ! empty( $cdn_url ) ) {
|
374 |
+
$http_schema = parse_url( $cdn_url, PHP_URL_SCHEME );
|
375 |
+
|
376 |
+
$cdn_url = ltrim( $cdn_url, 'https:' );
|
377 |
+
$cdn_url = '//' . ltrim( $cdn_url, '//' );
|
378 |
+
|
379 |
+
if ( ! empty( $http_schema ) ) {
|
380 |
+
$cdn_url = $http_schema . ':' . $cdn_url;
|
381 |
}
|
382 |
}
|
383 |
|
384 |
+
$cdn = array(
|
385 |
+
'cdn-active' => ( isset( $_POST['activate-cdn'] ) ? '1' : '0' ),
|
386 |
+
'cdn-url' => $cdn_url,
|
387 |
+
'cdn-content' => $cdn_content,
|
388 |
+
'cdn-exclude-content' => $exclude_content,
|
389 |
+
'cdn-relative-path' => ( isset( $_POST['cdn-relative-path'] ) ? '1' : '0' ),
|
390 |
+
);
|
391 |
+
|
392 |
+
breeze_update_option( 'cdn_integration', $cdn, true );
|
393 |
+
|
394 |
+
// Storage information to cache pages.
|
395 |
+
Breeze_ConfigCache::factory()->write();
|
396 |
+
Breeze_ConfigCache::factory()->write_config_cache();
|
397 |
+
|
398 |
+
// Delete cache after settings
|
399 |
+
do_action( 'breeze_clear_all_cache' );
|
400 |
+
|
401 |
+
wp_send_json( $response );
|
402 |
+
}
|
403 |
+
|
404 |
+
/**
|
405 |
+
* Tools tab has not options that need save here.
|
406 |
+
*
|
407 |
+
* @access public
|
408 |
+
* @since 2.0.0
|
409 |
+
*/
|
410 |
+
public function update_options_for_tools() {
|
411 |
+
// Does not have anything to save.
|
412 |
+
}
|
413 |
+
|
414 |
+
/**
|
415 |
+
* FAQ does not have any options to save, text information only.
|
416 |
+
*
|
417 |
+
* @access public
|
418 |
+
* @since 2.0.0
|
419 |
+
*/
|
420 |
+
public function update_options_for_faq() {
|
421 |
+
// Does not have anything to save.
|
422 |
+
}
|
423 |
+
|
424 |
+
/**
|
425 |
+
* FAQ does not have any options to save, text information only.
|
426 |
+
*
|
427 |
+
* @access public
|
428 |
+
* @since 2.0.0
|
429 |
+
*/
|
430 |
+
public function update_options_for_inherit() {
|
431 |
+
// Does not have anything to save.
|
432 |
+
check_ajax_referer( 'breeze_inherit_settings', 'security' );
|
433 |
+
|
434 |
+
set_as_network_screen();
|
435 |
+
|
436 |
+
global $wp_filesystem;
|
437 |
+
|
438 |
+
if ( empty( $wp_filesystem ) ) {
|
439 |
+
require_once( ABSPATH . '/wp-admin/includes/file.php' );
|
440 |
+
WP_Filesystem();
|
441 |
}
|
442 |
|
443 |
+
$response = array();
|
444 |
+
$inherit_settings = ( ( false === filter_var( $_POST['is-selected'], FILTER_VALIDATE_BOOLEAN ) ) ? '1' : '0' );
|
445 |
+
update_option( 'breeze_inherit_settings', $inherit_settings );
|
446 |
+
Breeze_ConfigCache::factory()->write();
|
447 |
+
Breeze_ConfigCache::factory()->write_config_cache();
|
448 |
+
|
449 |
+
// Delete cache after settings
|
450 |
+
do_action( 'breeze_clear_all_cache' );
|
451 |
+
|
452 |
+
wp_send_json( $response );
|
453 |
}
|
454 |
|
455 |
/*
|
464 |
if ( $clean ) {
|
465 |
$args['clean'] = true;
|
466 |
} else {
|
467 |
+
$args['content'] = '<IfModule mod_env.c>' . PHP_EOL .
|
468 |
+
' SetEnv BREEZE_BROWSER_CACHE_ON 1' . PHP_EOL .
|
469 |
+
'</IfModule>' . PHP_EOL .
|
470 |
'<IfModule mod_expires.c>' . PHP_EOL .
|
471 |
' ExpiresActive On' . PHP_EOL .
|
472 |
' ExpiresDefault "access plus 1 month"' . PHP_EOL .
|
555 |
if ( $clean ) {
|
556 |
$args['clean'] = true;
|
557 |
} else {
|
558 |
+
$args['content'] = '<IfModule mod_env.c>' . PHP_EOL .
|
559 |
+
' SetEnv BREEZE_GZIP_ON 1' . PHP_EOL .
|
560 |
+
'</IfModule>' . PHP_EOL .
|
561 |
'<IfModule mod_deflate.c>' . PHP_EOL .
|
562 |
' AddType x-font/woff .woff' . PHP_EOL .
|
563 |
' AddOutputFilterByType DEFLATE text/plain' . PHP_EOL .
|
662 |
foreach ( $blogs as $blog_id ) {
|
663 |
switch_to_blog( $blog_id );
|
664 |
$site_url = preg_quote( preg_replace( '(^https?://)', '', site_url() ) );
|
665 |
+
if ( '1' === Breeze_Options_Reader::get_option_value( 'breeze-active' ) ) {
|
666 |
+
if ( '1' === Breeze_Options_Reader::get_option_value( 'breeze-browser-cache' ) ) {
|
|
|
667 |
$has_browser_cache = true;
|
668 |
$browser_cache_sites[] = $site_url;
|
669 |
} else {
|
670 |
$no_browser_cache_sites[] = $site_url;
|
671 |
}
|
672 |
+
if ( '1' === Breeze_Options_Reader::get_option_value( 'breeze-gzip-compression' ) ) {
|
673 |
$has_gzip_compress = true;
|
674 |
$gzip_compress_sites[] = $site_url;
|
675 |
} else {
|
758 |
}
|
759 |
} else {
|
760 |
// Single-site setup.
|
761 |
+
if ( '1' === Breeze_Options_Reader::get_option_value( 'breeze-active' ) ) {
|
762 |
+
self::add_expires_header( '1' !== Breeze_Options_Reader::get_option_value( 'breeze-browser-cache' ) );
|
763 |
+
self::add_gzip_htacess( '1' !== Breeze_Options_Reader::get_option_value( 'breeze-gzip-compression' ) );
|
|
|
764 |
} else {
|
765 |
// Caching not activated, clean up.
|
766 |
self::add_expires_header( true );
|
814 |
return true;
|
815 |
}
|
816 |
|
817 |
+
/**
|
818 |
+
* Database optimization actions.
|
819 |
+
* Used to clean the database.
|
820 |
+
*
|
821 |
+
* Changed completely in 2.0.0
|
822 |
+
*
|
823 |
+
* @param string $type Optimization type.
|
824 |
+
*
|
825 |
+
* @return bool
|
826 |
+
* @since 2.0.0
|
827 |
+
*/
|
828 |
+
public static function clean_system( $type = '' ) {
|
829 |
global $wpdb;
|
|
|
830 |
|
831 |
switch ( $type ) {
|
832 |
case 'revisions':
|
833 |
+
/**
|
834 |
+
* Delete all revisions.
|
835 |
+
*/
|
836 |
+
$all_revisions = $wpdb->get_col(
|
837 |
+
/* translators: post type */
|
838 |
+
$wpdb->prepare( "SELECT ID FROM `$wpdb->posts` WHERE post_type = %s", 'revision' )
|
839 |
+
);
|
840 |
+
if ( ! empty( $all_revisions ) ) {
|
841 |
+
foreach ( $all_revisions as $post_id ) {
|
842 |
+
$post_id = intval( $post_id );
|
843 |
+
if ( 0 !== $post_id ) {
|
844 |
+
wp_delete_post_revision( $post_id );
|
845 |
+
}
|
846 |
+
}
|
847 |
+
}
|
848 |
break;
|
849 |
case 'drafted':
|
850 |
+
/**
|
851 |
+
* Delete all draft entries.
|
852 |
+
*/
|
853 |
+
$all_auto_draft = $wpdb->get_col(
|
854 |
+
/* translators: post status */
|
855 |
+
$wpdb->prepare( "SELECT ID FROM `$wpdb->posts` WHERE post_status = %s", 'auto-draft' )
|
856 |
+
);
|
857 |
+
if ( ! empty( $all_auto_draft ) ) {
|
858 |
+
foreach ( $all_auto_draft as $post_id ) {
|
859 |
+
$post_id = intval( $post_id );
|
860 |
+
if ( 0 !== $post_id ) {
|
861 |
+
wp_delete_post( $post_id, true );
|
862 |
+
}
|
863 |
+
}
|
864 |
+
}
|
865 |
break;
|
866 |
case 'trash':
|
867 |
+
/**
|
868 |
+
* Delete all trashed posts/pages.
|
869 |
+
*/
|
870 |
+
$all_trashed = $wpdb->get_col(
|
871 |
+
/* translators: post status */
|
872 |
+
$wpdb->prepare( "SELECT ID FROM `$wpdb->posts` WHERE post_status = %s", 'trash' )
|
873 |
+
);
|
874 |
+
if ( ! empty( $all_trashed ) ) {
|
875 |
+
foreach ( $all_trashed as $post_id ) {
|
876 |
+
$post_id = intval( $post_id );
|
877 |
+
if ( 0 !== $post_id ) {
|
878 |
+
wp_delete_post( $post_id, true );
|
879 |
+
}
|
880 |
+
}
|
881 |
+
}
|
882 |
break;
|
883 |
+
case 'comments_trash':
|
884 |
+
/**
|
885 |
+
* Delete all trashed posts
|
886 |
+
* @see get_comment_count() comment for all the trashed statuses.
|
887 |
+
*/
|
888 |
+
$comments_trashed = $wpdb->get_col(
|
889 |
+
/* translators: trashed comments status, comments for posts that are in the trash */
|
890 |
+
$wpdb->prepare( "SELECT comment_ID FROM `$wpdb->comments` WHERE comment_approved = %s OR comment_approved = %s", 'trash', 'post-trashed' )
|
891 |
+
);
|
892 |
+
if ( ! empty( $comments_trashed ) ) {
|
893 |
+
foreach ( $comments_trashed as $comment_id ) {
|
894 |
+
$comment_id = intval( $comment_id );
|
895 |
+
if ( 0 !== $comment_id ) {
|
896 |
+
wp_delete_comment( $comment_id, true );
|
897 |
+
}
|
898 |
+
}
|
899 |
+
}
|
900 |
+
break;
|
901 |
+
case 'comments_spam':
|
902 |
+
/**
|
903 |
+
* Delete all spam comments.
|
904 |
+
*/
|
905 |
+
$comments_spam = $wpdb->get_col(
|
906 |
+
/* translators: spam comments status */
|
907 |
+
$wpdb->prepare( "SELECT comment_ID FROM `$wpdb->comments` WHERE comment_approved = %s", 'spam' )
|
908 |
+
);
|
909 |
+
if ( ! empty( $comments_spam ) ) {
|
910 |
+
foreach ( $comments_spam as $comment_id ) {
|
911 |
+
$comment_id = intval( $comment_id );
|
912 |
+
if ( 0 !== $comment_id ) {
|
913 |
+
wp_delete_comment( $comment_id, true );
|
914 |
+
}
|
915 |
+
}
|
916 |
+
}
|
917 |
break;
|
918 |
case 'trackbacks':
|
919 |
+
/**
|
920 |
+
* Delete all Track-back and Ping-back comments.
|
921 |
+
*/
|
922 |
+
$comments_trackback = $wpdb->get_col(
|
923 |
+
/* translators: comment type, comment type */
|
924 |
+
$wpdb->prepare( "SELECT comment_ID FROM `$wpdb->comments` WHERE comment_type = %s OR comment_type= %s", 'trackback', 'pingback' )
|
925 |
+
);
|
926 |
+
if ( ! empty( $comments_trackback ) ) {
|
927 |
+
foreach ( $comments_trackback as $comment_id ) {
|
928 |
+
$comment_id = intval( $comment_id );
|
929 |
+
if ( 0 !== $comment_id ) {
|
930 |
+
wp_delete_comment( $comment_id, true );
|
931 |
+
}
|
932 |
+
}
|
933 |
+
}
|
934 |
break;
|
935 |
case 'transient':
|
936 |
+
/**
|
937 |
+
* Delete all Transients.
|
938 |
+
*/
|
939 |
+
$all_transients = $wpdb->get_col(
|
940 |
+
/* translators: comment type, comment type */
|
941 |
+
$wpdb->prepare( "SELECT option_name FROM $wpdb->options WHERE ( option_name LIKE %s OR option_name LIKE %s ) AND option_name NOT LIKE %s",
|
942 |
+
$wpdb->esc_like( '_transient' ) . '%',
|
943 |
+
$wpdb->esc_like( '_site_transient_' ) . '%',
|
944 |
+
$wpdb->esc_like( '_transient_timeout' ) . '%'
|
945 |
+
)
|
946 |
+
);
|
947 |
+
if ( ! empty( $all_transients ) ) {
|
948 |
+
foreach ( $all_transients as $transient ) {
|
949 |
+
if ( strpos( $transient, '_site_transient_' ) !== false ) {
|
950 |
+
$transient_name = str_replace( '_site_transient_', '', $transient );
|
951 |
+
delete_site_transient( $transient_name );
|
952 |
+
} else {
|
953 |
+
$transient_name = str_replace( '_transient_', '', $transient );
|
954 |
+
delete_transient( $transient_name );
|
955 |
+
}
|
956 |
+
}
|
957 |
+
}
|
958 |
break;
|
959 |
}
|
960 |
|
962 |
}
|
963 |
|
964 |
/**
|
965 |
+
* Returns the count of each section in the Database tab.
|
966 |
+
*
|
967 |
+
* Changed completely in 2.0.0
|
968 |
*
|
969 |
* @param string $type
|
970 |
+
*
|
971 |
+
* @return int
|
972 |
+
* @since 2.0.0
|
973 |
*/
|
974 |
+
public static function get_element_to_clean( $type = '' ) {
|
975 |
global $wpdb;
|
976 |
$return = 0;
|
977 |
switch ( $type ) {
|
978 |
case 'revisions':
|
979 |
+
$return = $wpdb->get_var(
|
980 |
+
/* translators: post type */
|
981 |
+
$wpdb->prepare( "SELECT COUNT(*) FROM `$wpdb->posts` WHERE post_type = %s", 'revision' )
|
982 |
+
);
|
983 |
break;
|
984 |
case 'drafted':
|
985 |
+
$return = $wpdb->get_var(
|
986 |
+
/* translators: post status */
|
987 |
+
$wpdb->prepare( "SELECT COUNT(*) FROM `$wpdb->posts` WHERE post_status = %s", 'auto-draft' )
|
988 |
+
);
|
989 |
break;
|
990 |
case 'trash':
|
991 |
+
$return = $wpdb->get_var(
|
992 |
+
/* translators: post status */
|
993 |
+
$wpdb->prepare( "SELECT COUNT(*) FROM `$wpdb->posts` WHERE post_status = %s", 'trash' )
|
994 |
+
);
|
995 |
break;
|
996 |
+
case 'comments_trash':
|
997 |
+
$return = $wpdb->get_var(
|
998 |
+
/* translators: trashed comments status, comments for posts that are in the trash */
|
999 |
+
$wpdb->prepare( "SELECT COUNT(*) FROM `$wpdb->comments` WHERE comment_approved = %s OR comment_approved = %s", 'trash', 'post-trashed' )
|
1000 |
+
);
|
1001 |
+
break;
|
1002 |
+
case 'comments_spam':
|
1003 |
+
$return = $wpdb->get_var(
|
1004 |
+
/* translators: spam comments status */
|
1005 |
+
$wpdb->prepare( "SELECT COUNT(*) FROM `$wpdb->comments` WHERE comment_approved = %s", 'spam' )
|
1006 |
+
);
|
1007 |
break;
|
1008 |
case 'trackbacks':
|
1009 |
+
$return = $wpdb->get_var(
|
1010 |
+
/* translators: comment type, comment type */
|
1011 |
+
$wpdb->prepare( "SELECT COUNT(*) FROM `$wpdb->comments` WHERE comment_type = %s OR comment_type= %s", 'trackback', 'pingback' )
|
1012 |
+
);
|
1013 |
break;
|
1014 |
case 'transient':
|
1015 |
+
$return = $wpdb->get_var(
|
1016 |
+
/* translators: comment type, comment type */
|
1017 |
+
$wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->options WHERE ( option_name LIKE %s OR option_name LIKE %s ) AND option_name NOT LIKE %s",
|
1018 |
+
$wpdb->esc_like( '_transient' ) . '%',
|
1019 |
+
$wpdb->esc_like( '_site_transient_' ) . '%',
|
1020 |
+
$wpdb->esc_like( '_transient_timeout' ) . '%'
|
1021 |
+
)
|
1022 |
+
);
|
1023 |
break;
|
1024 |
}
|
1025 |
|
1026 |
+
return (int) $return;
|
1027 |
}
|
1028 |
|
1029 |
// Convert string to array
|
1104 |
//check security
|
1105 |
check_ajax_referer( '_breeze_purge_database', 'security' );
|
1106 |
|
1107 |
+
set_as_network_screen();
|
1108 |
+
|
1109 |
+
$items = array(
|
1110 |
+
'post_revisions' => array( 'revisions' ),
|
1111 |
+
'auto_drafts' => array( 'drafted' ),
|
1112 |
+
'trashed_posts' => array( 'trash' ),
|
1113 |
+
'trashed_comments' => array( 'comments_trash' ),
|
1114 |
+
'spam_comments' => array( 'comments_spam' ),
|
1115 |
+
'trackbacks_pingbacks' => array( 'trackbacks' ),
|
1116 |
+
'all_transients' => array( 'transient' ),
|
1117 |
+
'all' => array( 'revisions', 'drafted', 'trash', 'comments_trash', 'comments_spam', 'trackbacks', 'transient' ),
|
1118 |
+
);
|
1119 |
+
|
1120 |
+
if ( isset( $_POST['action_type'] ) ) {
|
1121 |
+
$type = $_POST['action_type'];
|
1122 |
+
|
1123 |
+
if ( 'custom' === $type ) {
|
1124 |
+
$services = json_decode( stripslashes( $_POST['services'] ), true );
|
1125 |
+
|
1126 |
+
if ( ! empty( $services ) && is_array( $services ) ) {
|
1127 |
+
foreach ( $services as $service ) {
|
1128 |
+
if ( isset( $items[ $service ] ) ) {
|
1129 |
+
|
1130 |
+
self::optimize_database( $items[ $service ] );
|
1131 |
+
}
|
1132 |
+
}
|
1133 |
+
}
|
1134 |
+
} else {
|
1135 |
+
|
1136 |
+
if ( isset( $items[ $type ] ) ) {
|
1137 |
+
self::optimize_database( $items[ $type ] );
|
1138 |
+
}
|
1139 |
+
}
|
1140 |
+
|
1141 |
+
}
|
1142 |
+
// $type = array( 'revisions', 'drafted', 'trash', 'comments_trash', 'comments_spam', 'trackbacks', 'transient' );
|
1143 |
+
|
1144 |
|
1145 |
echo json_encode( array( 'clear' => true ) );
|
1146 |
exit;
|
1170 |
* @param array $items
|
1171 |
*/
|
1172 |
public static function optimize_database( $items ) {
|
1173 |
+
set_as_network_screen();
|
1174 |
+
|
1175 |
if ( is_multisite() && is_network_admin() ) {
|
1176 |
$sites = get_sites(
|
1177 |
array(
|
1182 |
foreach ( $sites as $blog_id ) {
|
1183 |
switch_to_blog( $blog_id );
|
1184 |
foreach ( $items as $item ) {
|
1185 |
+
self::clean_system( $item );
|
1186 |
}
|
1187 |
restore_current_blog();
|
1188 |
}
|
1189 |
} else {
|
1190 |
foreach ( $items as $item ) {
|
1191 |
+
self::clean_system( $item );
|
1192 |
}
|
1193 |
}
|
1194 |
}
|
inc/cache/config-cache.php
CHANGED
@@ -51,8 +51,8 @@ class Breeze_ConfigCache {
|
|
51 |
|
52 |
foreach ( $blogs as $blog_id ) {
|
53 |
switch_to_blog( $blog_id );
|
54 |
-
|
55 |
-
//if ( ! empty(
|
56 |
$inherit_option = get_blog_option( $blog_id, 'breeze_inherit_settings', '0' );
|
57 |
$inherit_option = filter_var( $inherit_option, FILTER_VALIDATE_BOOLEAN );
|
58 |
if ( false === $inherit_option ) {
|
@@ -66,9 +66,8 @@ class Breeze_ConfigCache {
|
|
66 |
restore_current_blog();
|
67 |
}
|
68 |
} else {
|
69 |
-
$config = breeze_get_option( 'basic_settings' );
|
70 |
|
71 |
-
if ( ! empty(
|
72 |
$cache_configs['breeze-config'][] = preg_replace( '(^https?://)', '', site_url() );
|
73 |
}
|
74 |
}
|
@@ -146,9 +145,19 @@ class Breeze_ConfigCache {
|
|
146 |
$file_string .= "\n\t" . 'return $config;';
|
147 |
$file_string .= "\n}";
|
148 |
$file_string .= "\n" . '$config = breeze_fetch_configuration_data( $site_url );';
|
149 |
-
|
150 |
-
|
151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
}
|
153 |
|
154 |
$file_string .= "\nif ( empty( \$config ) || ! isset( \$config['config_path'] ) || ! @file_exists( \$config['config_path'] ) ) { return; }" .
|
@@ -172,12 +181,11 @@ class Breeze_ConfigCache {
|
|
172 |
|
173 |
if ( true === $create_root_config ) {
|
174 |
$network_id = get_current_network_id();
|
175 |
-
$settings =
|
176 |
-
|
177 |
$homepage_url = network_site_url();
|
178 |
} else {
|
179 |
-
$settings =
|
180 |
-
$config = breeze_get_option( 'advanced_settings' );
|
181 |
$homepage_url = get_site_url();
|
182 |
}
|
183 |
|
@@ -196,9 +204,13 @@ class Breeze_ConfigCache {
|
|
196 |
|
197 |
$storage['wp-user-roles'] = breeze_all_wp_user_roles();
|
198 |
|
199 |
-
$
|
200 |
-
$
|
201 |
-
$
|
|
|
|
|
|
|
|
|
202 |
|
203 |
|
204 |
if ( isset( $_POST['woocommerce_default_customer_address'] ) ) {
|
@@ -330,17 +342,17 @@ class Breeze_ConfigCache {
|
|
330 |
}
|
331 |
}
|
332 |
|
333 |
-
if ( ! empty(
|
334 |
-
$storage['disable_per_adminuser'] =
|
335 |
}
|
336 |
|
337 |
-
if ( ! empty(
|
338 |
-
$storage['cached-query-strings'] =
|
339 |
}
|
340 |
|
341 |
$storage['exclude_url'] = array_merge(
|
342 |
$ecommerce_exclude_urls,
|
343 |
-
! empty(
|
344 |
);
|
345 |
|
346 |
$saved_pages = get_option( 'breeze_exclude_url_pages', array() );
|
@@ -355,7 +367,7 @@ class Breeze_ConfigCache {
|
|
355 |
|
356 |
$storage['exclude_url'] = array_merge(
|
357 |
$saved_pages_urls,
|
358 |
-
! empty(
|
359 |
$ecommerce_exclude_urls
|
360 |
);
|
361 |
}
|
@@ -366,7 +378,7 @@ class Breeze_ConfigCache {
|
|
366 |
if ( ! empty( $woocommerce_fb_feed_link ) ) {
|
367 |
$storage['exclude_url'] = array_merge(
|
368 |
$woocommerce_fb_feed_link,
|
369 |
-
! empty(
|
370 |
$ecommerce_exclude_urls
|
371 |
);
|
372 |
}
|
51 |
|
52 |
foreach ( $blogs as $blog_id ) {
|
53 |
switch_to_blog( $blog_id );
|
54 |
+
|
55 |
+
//if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-active' ) ) ) {
|
56 |
$inherit_option = get_blog_option( $blog_id, 'breeze_inherit_settings', '0' );
|
57 |
$inherit_option = filter_var( $inherit_option, FILTER_VALIDATE_BOOLEAN );
|
58 |
if ( false === $inherit_option ) {
|
66 |
restore_current_blog();
|
67 |
}
|
68 |
} else {
|
|
|
69 |
|
70 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-active' ) ) ) {
|
71 |
$cache_configs['breeze-config'][] = preg_replace( '(^https?://)', '', site_url() );
|
72 |
}
|
73 |
}
|
145 |
$file_string .= "\n\t" . 'return $config;';
|
146 |
$file_string .= "\n}";
|
147 |
$file_string .= "\n" . '$config = breeze_fetch_configuration_data( $site_url );';
|
148 |
+
$file_string .= "\n" . 'if ( ';
|
149 |
+
$file_string .= "\n" . ' empty( $config ) && ';
|
150 |
+
$file_string .= "\n" . ' false === filter_var( SUBDOMAIN_INSTALL, FILTER_VALIDATE_BOOLEAN ) && ';
|
151 |
+
$file_string .= "\n" . ' true === filter_var( MULTISITE, FILTER_VALIDATE_BOOLEAN ) && ';
|
152 |
+
$file_string .= "\n" . ' false === strpos( $site_url, "robots.txt") && ';
|
153 |
+
$file_string .= "\n" . ' false === strpos( $site_url, "favicon.ico") && ';
|
154 |
+
$file_string .= "\n" . ' false === strpos( $site_url, "wp-cron.php")';
|
155 |
+
$file_string .= "\n" . ' ) {';
|
156 |
+
$file_string .= "\n\t" . '$xplode = explode( "/", $site_url);';
|
157 |
+
$file_string .= "\n\t" . 'if(isset($xplode[0])){';
|
158 |
+
$file_string .= "\n\t\t" . '$config = breeze_fetch_configuration_data( $domain );';
|
159 |
+
$file_string .= "\n\t" . '}';
|
160 |
+
$file_string .= "\n" . '}';
|
161 |
}
|
162 |
|
163 |
$file_string .= "\nif ( empty( \$config ) || ! isset( \$config['config_path'] ) || ! @file_exists( \$config['config_path'] ) ) { return; }" .
|
181 |
|
182 |
if ( true === $create_root_config ) {
|
183 |
$network_id = get_current_network_id();
|
184 |
+
$settings = Breeze_Options_Reader::fetch_all_saved_settings(true);
|
185 |
+
#$settings = get_network_option( $network_id, 'breeze_basic_settings' );
|
186 |
$homepage_url = network_site_url();
|
187 |
} else {
|
188 |
+
$settings = Breeze_Options_Reader::fetch_all_saved_settings();
|
|
|
189 |
$homepage_url = get_site_url();
|
190 |
}
|
191 |
|
204 |
|
205 |
$storage['wp-user-roles'] = breeze_all_wp_user_roles();
|
206 |
|
207 |
+
$lazy_load = Breeze_Options_Reader::get_option_value( 'breeze-lazy-load', false, $create_root_config );
|
208 |
+
$lazy_load_native = Breeze_Options_Reader::get_option_value( 'breeze-lazy-load-native', false, $create_root_config );
|
209 |
+
$preload_links = Breeze_Options_Reader::get_option_value( 'breeze-preload-links', false, $create_root_config );
|
210 |
+
|
211 |
+
$storage['enabled-lazy-load'] = ( isset( $lazy_load ) ? $lazy_load : 0 );
|
212 |
+
$storage['use-lazy-load-native'] = ( isset( $lazy_load_native ) ? $lazy_load_native : 0 );
|
213 |
+
$storage['breeze-preload-links'] = ( isset( $preload_links ) ? $preload_links : 0 );
|
214 |
|
215 |
|
216 |
if ( isset( $_POST['woocommerce_default_customer_address'] ) ) {
|
342 |
}
|
343 |
}
|
344 |
|
345 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-disable-admin', false, $create_root_config ) ) ) {
|
346 |
+
$storage['disable_per_adminuser'] = Breeze_Options_Reader::get_option_value( 'breeze-disable-admin', false, $create_root_config );
|
347 |
}
|
348 |
|
349 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'cached-query-strings', false, $create_root_config ) ) ) {
|
350 |
+
$storage['cached-query-strings'] = Breeze_Options_Reader::get_option_value( 'cached-query-strings', false, $create_root_config );
|
351 |
}
|
352 |
|
353 |
$storage['exclude_url'] = array_merge(
|
354 |
$ecommerce_exclude_urls,
|
355 |
+
! empty( Breeze_Options_Reader::get_option_value( 'breeze-exclude-urls', false, $create_root_config ) ) ? Breeze_Options_Reader::get_option_value( 'breeze-exclude-urls', false, $create_root_config ) : array()
|
356 |
);
|
357 |
|
358 |
$saved_pages = get_option( 'breeze_exclude_url_pages', array() );
|
367 |
|
368 |
$storage['exclude_url'] = array_merge(
|
369 |
$saved_pages_urls,
|
370 |
+
! empty( Breeze_Options_Reader::get_option_value( 'breeze-exclude-urls', false, $create_root_config ) ) ? Breeze_Options_Reader::get_option_value( 'breeze-exclude-urls', false, $create_root_config ) : array(),
|
371 |
$ecommerce_exclude_urls
|
372 |
);
|
373 |
}
|
378 |
if ( ! empty( $woocommerce_fb_feed_link ) ) {
|
379 |
$storage['exclude_url'] = array_merge(
|
380 |
$woocommerce_fb_feed_link,
|
381 |
+
! empty( Breeze_Options_Reader::get_option_value( 'breeze-exclude-urls', false, $create_root_config ) ) ? Breeze_Options_Reader::get_option_value( 'breeze-exclude-urls', false, $create_root_config ) : array(),
|
382 |
$ecommerce_exclude_urls
|
383 |
);
|
384 |
}
|
inc/cache/execute-cache.php
CHANGED
@@ -2,7 +2,12 @@
|
|
2 |
/*
|
3 |
* Based on some work of https://github.com/tlovett1/simple-cache/blob/master/inc/dropins/file-based-page-cache.php
|
4 |
*/
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
if ( isset( $GLOBALS['breeze_config'], $GLOBALS['breeze_config']['cache_options'], $GLOBALS['breeze_config']['cache_options']['breeze-active'] ) ) {
|
8 |
$is_caching_active = filter_var( $GLOBALS['breeze_config']['cache_options']['breeze-active'], FILTER_VALIDATE_BOOLEAN );
|
@@ -11,7 +16,6 @@ if ( isset( $GLOBALS['breeze_config'], $GLOBALS['breeze_config']['cache_options'
|
|
11 |
}
|
12 |
}
|
13 |
|
14 |
-
|
15 |
// Load helper functions.
|
16 |
require_once dirname( __DIR__ ) . '/functions.php';
|
17 |
|
@@ -69,9 +73,14 @@ if ( strpos( $_SERVER['REQUEST_URI'], '/wp-json/geodir/' ) !== false ) {
|
|
69 |
return;
|
70 |
}
|
71 |
|
|
|
|
|
|
|
|
|
72 |
if (
|
73 |
strpos( $_SERVER['REQUEST_URI'], 'breeze-minification' ) !== false ||
|
74 |
-
strpos( $_SERVER['REQUEST_URI'], 'favicon.ico' ) !== false
|
|
|
75 |
) {
|
76 |
return;
|
77 |
}
|
@@ -224,8 +233,7 @@ function breeze_cache( $buffer, $flags ) {
|
|
224 |
|
225 |
$blog_id_requested = isset( $GLOBALS['breeze_config']['blog_id'] ) ? $GLOBALS['breeze_config']['blog_id'] : 0;
|
226 |
$cache_base_path = breeze_get_cache_base_path( false, $blog_id_requested );
|
227 |
-
|
228 |
-
$path = $cache_base_path . md5( $url_path );
|
229 |
|
230 |
// Make sure we can read/write files and that proper folders exist
|
231 |
if ( ! wp_mkdir_p( $path ) ) {
|
@@ -513,17 +521,18 @@ function check_exclude_page( $opts_config, $current_url ) {
|
|
513 |
if ( ! empty( $opts_config['exclude_url'] ) ) {
|
514 |
|
515 |
$is_exclude = exec_breeze_check_for_exclude_values( $current_url, $opts_config['exclude_url'] );
|
|
|
516 |
if ( ! empty( $is_exclude ) ) {
|
517 |
return true;
|
518 |
}
|
519 |
|
520 |
-
foreach ( $opts_config['exclude_url'] as $
|
521 |
// Clear blank character
|
522 |
-
$
|
523 |
-
if ( preg_match( '/(\&?\/?\(\.?\*\)|\/\*|\*)$/', $
|
524 |
// End of rules is *, /*, [&][/](*) , [&][/](.*)
|
525 |
-
$pattent = substr( $
|
526 |
-
if ( $
|
527 |
// A path of exclude url with regex
|
528 |
if ( ( @preg_match( '@' . $pattent . '@', $current_url, $matches ) > 0 ) ) {
|
529 |
return true;
|
@@ -535,13 +544,18 @@ function check_exclude_page( $opts_config, $current_url ) {
|
|
535 |
}
|
536 |
}
|
537 |
} else {
|
538 |
-
if ( $
|
|
|
539 |
// A path of exclude
|
540 |
-
if ( ( @preg_match( '@' . $
|
541 |
return true;
|
542 |
}
|
543 |
} else { // Whole path
|
544 |
-
|
|
|
|
|
|
|
|
|
545 |
return true;
|
546 |
}
|
547 |
}
|
2 |
/*
|
3 |
* Based on some work of https://github.com/tlovett1/simple-cache/blob/master/inc/dropins/file-based-page-cache.php
|
4 |
*/
|
5 |
+
|
6 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
+
header( 'Status: 403 Forbidden' );
|
8 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
9 |
+
exit;
|
10 |
+
}
|
11 |
|
12 |
if ( isset( $GLOBALS['breeze_config'], $GLOBALS['breeze_config']['cache_options'], $GLOBALS['breeze_config']['cache_options']['breeze-active'] ) ) {
|
13 |
$is_caching_active = filter_var( $GLOBALS['breeze_config']['cache_options']['breeze-active'], FILTER_VALIDATE_BOOLEAN );
|
16 |
}
|
17 |
}
|
18 |
|
|
|
19 |
// Load helper functions.
|
20 |
require_once dirname( __DIR__ ) . '/functions.php';
|
21 |
|
73 |
return;
|
74 |
}
|
75 |
|
76 |
+
if ( isset( $_GET['wc-api'] ) ) {
|
77 |
+
return;
|
78 |
+
}
|
79 |
+
|
80 |
if (
|
81 |
strpos( $_SERVER['REQUEST_URI'], 'breeze-minification' ) !== false ||
|
82 |
+
strpos( $_SERVER['REQUEST_URI'], 'favicon.ico' ) !== false ||
|
83 |
+
strpos( $_SERVER['REQUEST_URI'], 'wp-cron.php' ) !== false
|
84 |
) {
|
85 |
return;
|
86 |
}
|
233 |
|
234 |
$blog_id_requested = isset( $GLOBALS['breeze_config']['blog_id'] ) ? $GLOBALS['breeze_config']['blog_id'] : 0;
|
235 |
$cache_base_path = breeze_get_cache_base_path( false, $blog_id_requested );
|
236 |
+
$path = $cache_base_path . md5( $url_path );
|
|
|
237 |
|
238 |
// Make sure we can read/write files and that proper folders exist
|
239 |
if ( ! wp_mkdir_p( $path ) ) {
|
521 |
if ( ! empty( $opts_config['exclude_url'] ) ) {
|
522 |
|
523 |
$is_exclude = exec_breeze_check_for_exclude_values( $current_url, $opts_config['exclude_url'] );
|
524 |
+
|
525 |
if ( ! empty( $is_exclude ) ) {
|
526 |
return true;
|
527 |
}
|
528 |
|
529 |
+
foreach ( $opts_config['exclude_url'] as $exclude_url ) {
|
530 |
// Clear blank character
|
531 |
+
$exclude_url = trim( $exclude_url );
|
532 |
+
if ( preg_match( '/(\&?\/?\(\.?\*\)|\/\*|\*)$/', $exclude_url, $matches ) ) {
|
533 |
// End of rules is *, /*, [&][/](*) , [&][/](.*)
|
534 |
+
$pattent = substr( $exclude_url, 0, strpos( $exclude_url, $matches[0] ) );
|
535 |
+
if ( $exclude_url[0] == '/' ) {
|
536 |
// A path of exclude url with regex
|
537 |
if ( ( @preg_match( '@' . $pattent . '@', $current_url, $matches ) > 0 ) ) {
|
538 |
return true;
|
544 |
}
|
545 |
}
|
546 |
} else {
|
547 |
+
if ( $exclude_url[0] == '/' ) {
|
548 |
+
|
549 |
// A path of exclude
|
550 |
+
if ( ( @preg_match( '@' . $exclude_url . '@', $current_url, $matches ) > 0 ) ) {
|
551 |
return true;
|
552 |
}
|
553 |
} else { // Whole path
|
554 |
+
|
555 |
+
$exclude_url = ltrim( $exclude_url, 'https:' );
|
556 |
+
$current_url = ltrim( $current_url, 'https:' );
|
557 |
+
|
558 |
+
if ( mb_strtolower( $exclude_url ) === mb_strtolower( $current_url ) ) {
|
559 |
return true;
|
560 |
}
|
561 |
}
|
inc/cache/purge-cache.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
*
|
5 |
* Original development of this plugin by JoomUnited https://www.joomunited.com/
|
6 |
*
|
@@ -21,6 +21,7 @@
|
|
21 |
if ( ! defined( 'ABSPATH' ) ) {
|
22 |
exit;
|
23 |
}
|
|
|
24 |
class Breeze_PurgeCache {
|
25 |
|
26 |
public function set_action() {
|
@@ -35,14 +36,14 @@ class Breeze_PurgeCache {
|
|
35 |
/**
|
36 |
* When user posts a comment, set a cookie so we don't show them page cache
|
37 |
*
|
38 |
-
* @param
|
39 |
-
* @param
|
|
|
40 |
* @since 1.3
|
41 |
*/
|
42 |
public function set_comment_cookie_exceptions( $comment, $user ) {
|
43 |
-
$config = breeze_get_option( 'basic_settings' );
|
44 |
// File based caching only
|
45 |
-
if ( ! empty(
|
46 |
|
47 |
$post_id = $comment->comment_post_ID;
|
48 |
|
@@ -59,10 +60,8 @@ class Breeze_PurgeCache {
|
|
59 |
return;
|
60 |
}
|
61 |
|
62 |
-
$config = breeze_get_option( 'basic_settings' );
|
63 |
-
|
64 |
// File based caching only
|
65 |
-
if ( ! empty(
|
66 |
self::breeze_cache_flush();
|
67 |
}
|
68 |
}
|
@@ -71,9 +70,8 @@ class Breeze_PurgeCache {
|
|
71 |
if ( empty( $approved ) ) {
|
72 |
return;
|
73 |
}
|
74 |
-
$config = breeze_get_option( 'basic_settings' );
|
75 |
// File based caching only
|
76 |
-
if ( ! empty(
|
77 |
$post_id = $commentdata['comment_post_ID'];
|
78 |
|
79 |
global $wp_filesystem;
|
@@ -92,10 +90,8 @@ class Breeze_PurgeCache {
|
|
92 |
|
93 |
// if a comments status changes, purge it's parent posts cache
|
94 |
public function purge_post_on_comment_status_change( $comment_ID, $comment_status ) {
|
95 |
-
$config = breeze_get_option( 'basic_settings' );
|
96 |
-
|
97 |
// File based caching only
|
98 |
-
if ( ! empty(
|
99 |
$comment = get_comment( $comment_ID );
|
100 |
if ( ! empty( $comment ) ) {
|
101 |
$post_id = $comment->comment_post_ID;
|
@@ -153,8 +149,8 @@ class Breeze_PurgeCache {
|
|
153 |
|
154 |
/**
|
155 |
* Return an instance of the current class, create one if it doesn't exist
|
156 |
-
* @since 1.0
|
157 |
* @return object
|
|
|
158 |
*/
|
159 |
public static function factory() {
|
160 |
|
@@ -169,8 +165,9 @@ class Breeze_PurgeCache {
|
|
169 |
}
|
170 |
|
171 |
}
|
172 |
-
$breez_basic_settings = breeze_get_option( 'basic_settings' );
|
173 |
|
174 |
-
|
|
|
|
|
175 |
Breeze_PurgeCache::factory();
|
176 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @copyright 2017 Cloudways https://www.cloudways.com
|
4 |
*
|
5 |
* Original development of this plugin by JoomUnited https://www.joomunited.com/
|
6 |
*
|
21 |
if ( ! defined( 'ABSPATH' ) ) {
|
22 |
exit;
|
23 |
}
|
24 |
+
|
25 |
class Breeze_PurgeCache {
|
26 |
|
27 |
public function set_action() {
|
36 |
/**
|
37 |
* When user posts a comment, set a cookie so we don't show them page cache
|
38 |
*
|
39 |
+
* @param WP_Comment $comment
|
40 |
+
* @param WP_User $user
|
41 |
+
*
|
42 |
* @since 1.3
|
43 |
*/
|
44 |
public function set_comment_cookie_exceptions( $comment, $user ) {
|
|
|
45 |
// File based caching only
|
46 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-active' ) ) ) {
|
47 |
|
48 |
$post_id = $comment->comment_post_ID;
|
49 |
|
60 |
return;
|
61 |
}
|
62 |
|
|
|
|
|
63 |
// File based caching only
|
64 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-active' ) ) ) {
|
65 |
self::breeze_cache_flush();
|
66 |
}
|
67 |
}
|
70 |
if ( empty( $approved ) ) {
|
71 |
return;
|
72 |
}
|
|
|
73 |
// File based caching only
|
74 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-active' ) ) ) {
|
75 |
$post_id = $commentdata['comment_post_ID'];
|
76 |
|
77 |
global $wp_filesystem;
|
90 |
|
91 |
// if a comments status changes, purge it's parent posts cache
|
92 |
public function purge_post_on_comment_status_change( $comment_ID, $comment_status ) {
|
|
|
|
|
93 |
// File based caching only
|
94 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-active' ) ) ) {
|
95 |
$comment = get_comment( $comment_ID );
|
96 |
if ( ! empty( $comment ) ) {
|
97 |
$post_id = $comment->comment_post_ID;
|
149 |
|
150 |
/**
|
151 |
* Return an instance of the current class, create one if it doesn't exist
|
|
|
152 |
* @return object
|
153 |
+
* @since 1.0
|
154 |
*/
|
155 |
public static function factory() {
|
156 |
|
165 |
}
|
166 |
|
167 |
}
|
|
|
168 |
|
169 |
+
$breeze_basic_settings = Breeze_Options_Reader::get_option_value( 'breeze-active' );
|
170 |
+
|
171 |
+
if ( isset( $breeze_basic_settings ) && $breeze_basic_settings ) {
|
172 |
Breeze_PurgeCache::factory();
|
173 |
}
|
inc/cache/purge-per-time.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
*
|
5 |
* Original development of this plugin by JoomUnited https://www.joomunited.com/
|
6 |
*
|
@@ -21,9 +21,10 @@
|
|
21 |
defined( 'ABSPATH' ) || die( 'No direct script access allowed!' );
|
22 |
|
23 |
class Breeze_PurgeCacheTime {
|
24 |
-
protected $timettl
|
25 |
-
protected $normalcache
|
26 |
protected $varnishcache = 0;
|
|
|
27 |
public function __construct( $settings = null ) {
|
28 |
if ( isset( $settings['breeze-ttl'] ) ) {
|
29 |
$this->timettl = $settings['breeze-ttl'];
|
@@ -42,12 +43,14 @@ class Breeze_PurgeCacheTime {
|
|
42 |
add_filter( 'cron_schedules', array( $this, 'filter_cron_schedules' ) );
|
43 |
|
44 |
}
|
|
|
45 |
// * Unschedule events
|
46 |
public function unschedule_events() {
|
47 |
$timestamp = wp_next_scheduled( 'breeze_purge_cache' );
|
48 |
|
49 |
wp_unschedule_event( $timestamp, 'breeze_purge_cache' );
|
50 |
}
|
|
|
51 |
// set up schedule_events
|
52 |
public function schedule_events() {
|
53 |
|
@@ -56,6 +59,7 @@ class Breeze_PurgeCacheTime {
|
|
56 |
// Expire cache never
|
57 |
if ( isset( $this->timettl ) && (int) $this->timettl === 0 ) {
|
58 |
wp_unschedule_event( $timestamp, 'breeze_purge_cache' );
|
|
|
59 |
return;
|
60 |
}
|
61 |
|
@@ -102,17 +106,16 @@ class Breeze_PurgeCacheTime {
|
|
102 |
if ( ! $instance ) {
|
103 |
$instance = new self();
|
104 |
}
|
|
|
105 |
return $instance;
|
106 |
}
|
107 |
}
|
108 |
|
109 |
-
$basic = breeze_get_option( 'basic_settings' );
|
110 |
-
$varnish = breeze_get_option( 'varnish_cache' );
|
111 |
//Enabled auto purge the varnish caching by time life
|
112 |
$params = array(
|
113 |
-
'breeze-active' => (
|
114 |
-
'breeze-ttl' => (
|
115 |
-
'breeze-varnish-purge' => (
|
116 |
);
|
117 |
|
118 |
if ( $params['breeze-active'] || $params['breeze-varnish-purge'] ) {
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @copyright 2017 Cloudways https://www.cloudways.com
|
4 |
*
|
5 |
* Original development of this plugin by JoomUnited https://www.joomunited.com/
|
6 |
*
|
21 |
defined( 'ABSPATH' ) || die( 'No direct script access allowed!' );
|
22 |
|
23 |
class Breeze_PurgeCacheTime {
|
24 |
+
protected $timettl = false;
|
25 |
+
protected $normalcache = 0;
|
26 |
protected $varnishcache = 0;
|
27 |
+
|
28 |
public function __construct( $settings = null ) {
|
29 |
if ( isset( $settings['breeze-ttl'] ) ) {
|
30 |
$this->timettl = $settings['breeze-ttl'];
|
43 |
add_filter( 'cron_schedules', array( $this, 'filter_cron_schedules' ) );
|
44 |
|
45 |
}
|
46 |
+
|
47 |
// * Unschedule events
|
48 |
public function unschedule_events() {
|
49 |
$timestamp = wp_next_scheduled( 'breeze_purge_cache' );
|
50 |
|
51 |
wp_unschedule_event( $timestamp, 'breeze_purge_cache' );
|
52 |
}
|
53 |
+
|
54 |
// set up schedule_events
|
55 |
public function schedule_events() {
|
56 |
|
59 |
// Expire cache never
|
60 |
if ( isset( $this->timettl ) && (int) $this->timettl === 0 ) {
|
61 |
wp_unschedule_event( $timestamp, 'breeze_purge_cache' );
|
62 |
+
|
63 |
return;
|
64 |
}
|
65 |
|
106 |
if ( ! $instance ) {
|
107 |
$instance = new self();
|
108 |
}
|
109 |
+
|
110 |
return $instance;
|
111 |
}
|
112 |
}
|
113 |
|
|
|
|
|
114 |
//Enabled auto purge the varnish caching by time life
|
115 |
$params = array(
|
116 |
+
'breeze-active' => (int) Breeze_Options_Reader::get_option_value( 'breeze-active' ),
|
117 |
+
'breeze-ttl' => (int) Breeze_Options_Reader::get_option_value( 'breeze-ttl' ),
|
118 |
+
'breeze-varnish-purge' => (int) Breeze_Options_Reader::get_option_value( 'auto-purge-varnish' ),
|
119 |
);
|
120 |
|
121 |
if ( $params['breeze-active'] || $params['breeze-varnish-purge'] ) {
|
inc/cache/purge-varnish.php
CHANGED
@@ -22,9 +22,9 @@ defined( 'ABSPATH' ) || die( 'No direct script access allowed!' );
|
|
22 |
|
23 |
class Breeze_PurgeVarnish {
|
24 |
protected $blogId;
|
25 |
-
protected $urlsPurge
|
26 |
-
protected $auto_purge
|
27 |
-
protected $actions
|
28 |
'switch_theme', // After a theme is changed
|
29 |
'save_post', // Save a post
|
30 |
'deleted_post', // Delete a post
|
@@ -35,10 +35,10 @@ class Breeze_PurgeVarnish {
|
|
35 |
public function __construct() {
|
36 |
global $blog_id;
|
37 |
$this->blogId = $blog_id;
|
38 |
-
|
39 |
//storage config
|
40 |
-
if ( ! empty(
|
41 |
-
$this->auto_purge = (int)
|
42 |
if ( $this->auto_purge && ! isset( $_GET['breeze_check_cache_available'] ) ) {
|
43 |
// before sending the requests, we need to make sure Varnish is actually enabled.
|
44 |
// If Varnish is disabled, the requests will take longer to finish and will affect
|
@@ -107,14 +107,23 @@ class Breeze_PurgeVarnish {
|
|
107 |
//clear static cache
|
108 |
$size_cache = Breeze_Configuration::breeze_clean_cache();
|
109 |
if ( (int) $size_cache > 0 ) {
|
110 |
-
|
|
|
|
|
|
|
|
|
111 |
} else {
|
112 |
-
|
|
|
|
|
|
|
|
|
113 |
}
|
114 |
}
|
115 |
}
|
116 |
}
|
117 |
|
|
|
118 |
/**
|
119 |
* Purge varnish cache
|
120 |
*
|
@@ -141,9 +150,10 @@ class Breeze_PurgeVarnish {
|
|
141 |
$schema = $parseUrl['scheme'] . '://';
|
142 |
}
|
143 |
// Determine the host
|
144 |
-
$host
|
145 |
-
|
146 |
-
$
|
|
|
147 |
$purgeme = $varnish_host . $path . $pregex;
|
148 |
if ( ! empty( $parseUrl['query'] ) && $parseUrl['query'] != 'breeze' ) {
|
149 |
$purgeme .= '?' . $parseUrl['query'];
|
@@ -287,7 +297,7 @@ class Breeze_PurgeVarnish {
|
|
287 |
$listofurls,
|
288 |
get_post_type_archive_link( get_post_type( $postId ) ),
|
289 |
get_post_type_archive_feed_link( get_post_type( $postId ) )
|
290 |
-
|
291 |
);
|
292 |
}
|
293 |
// Feeds
|
22 |
|
23 |
class Breeze_PurgeVarnish {
|
24 |
protected $blogId;
|
25 |
+
protected $urlsPurge = array();
|
26 |
+
protected $auto_purge = false;
|
27 |
+
protected $actions = array(
|
28 |
'switch_theme', // After a theme is changed
|
29 |
'save_post', // Save a post
|
30 |
'deleted_post', // Delete a post
|
35 |
public function __construct() {
|
36 |
global $blog_id;
|
37 |
$this->blogId = $blog_id;
|
38 |
+
|
39 |
//storage config
|
40 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'auto-purge-varnish' ) ) ) {
|
41 |
+
$this->auto_purge = (int) Breeze_Options_Reader::get_option_value( 'auto-purge-varnish' );
|
42 |
if ( $this->auto_purge && ! isset( $_GET['breeze_check_cache_available'] ) ) {
|
43 |
// before sending the requests, we need to make sure Varnish is actually enabled.
|
44 |
// If Varnish is disabled, the requests will take longer to finish and will affect
|
107 |
//clear static cache
|
108 |
$size_cache = Breeze_Configuration::breeze_clean_cache();
|
109 |
if ( (int) $size_cache > 0 ) {
|
110 |
+
$class = 'notice notice-success is-dismissible breeze-notice';
|
111 |
+
$message = __( 'Cache data has been purged: ', 'breeze' ) . $size_cache . __( ' Kb static cache cleaned', 'breeze' ) ;
|
112 |
+
|
113 |
+
printf( '<div id="message-clear-cache-top" class="%1$s" style="margin: 10px 14px 10px 0;padding: 10px; display: none; font-weight: 600;"><p>%2$s</p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>', esc_attr( $class ), esc_html( $message ) );
|
114 |
+
#echo '<div id="message-clear-cache-top" style="margin: 10px 0px 10px 0;padding: 10px;" class="notice notice-success" ><strong>' . __( 'Cache data has been purged: ', 'breeze' ) . $size_cache . __( ' Kb static cache cleaned', 'breeze' ) . '</strong></div>';
|
115 |
} else {
|
116 |
+
$class = 'notice notice-success is-dismissible breeze-notice';
|
117 |
+
$message = __( 'Cache data has been purged: ', 'breeze' );
|
118 |
+
|
119 |
+
printf( '<div id="message-clear-cache-top" class="%1$s" style="margin: 10px 14px 10px 0;padding: 10px; display: none; font-weight: 600;"><p>%2$s</p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>', esc_attr( $class ), esc_html( $message ) );
|
120 |
+
#echo '<div id="message-clear-cache-top" style="margin: 10px 0px 10px 0;padding: 10px;" class="notice notice-success" ><strong>' . __( 'Cache data has been purged.', 'breeze' ) . '</strong></div>';
|
121 |
}
|
122 |
}
|
123 |
}
|
124 |
}
|
125 |
|
126 |
+
|
127 |
/**
|
128 |
* Purge varnish cache
|
129 |
*
|
150 |
$schema = $parseUrl['scheme'] . '://';
|
151 |
}
|
152 |
// Determine the host
|
153 |
+
$host = $parseUrl['host'];
|
154 |
+
|
155 |
+
$varnish_ip = Breeze_Options_Reader::get_option_value( 'breeze-varnish-server-ip' );
|
156 |
+
$varnish_host = isset( $varnish_ip ) ? $varnish_ip : '127.0.0.1';
|
157 |
$purgeme = $varnish_host . $path . $pregex;
|
158 |
if ( ! empty( $parseUrl['query'] ) && $parseUrl['query'] != 'breeze' ) {
|
159 |
$purgeme .= '?' . $parseUrl['query'];
|
297 |
$listofurls,
|
298 |
get_post_type_archive_link( get_post_type( $postId ) ),
|
299 |
get_post_type_archive_feed_link( get_post_type( $postId ) )
|
300 |
+
// Need to add in JSON?
|
301 |
);
|
302 |
}
|
303 |
// Feeds
|
inc/cdn-integration/breeze-cdn-integration.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
*
|
5 |
* Original development of this plugin by JoomUnited https://www.joomunited.com/
|
6 |
*
|
@@ -30,17 +30,18 @@ class Breeze_CDN_Integration {
|
|
30 |
* Execute rewrite cdn
|
31 |
*/
|
32 |
public function handle_rewrite_cdn() {
|
33 |
-
$cdn_integration = breeze_get_option( 'cdn_integration' );
|
34 |
|
35 |
-
|
|
|
|
|
36 |
return;
|
37 |
}
|
38 |
|
39 |
-
if (
|
40 |
return;
|
41 |
}
|
42 |
|
43 |
-
if ( get_option( 'home' ) ==
|
44 |
return;
|
45 |
}
|
46 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @copyright 2017 Cloudways https://www.cloudways.com
|
4 |
*
|
5 |
* Original development of this plugin by JoomUnited https://www.joomunited.com/
|
6 |
*
|
30 |
* Execute rewrite cdn
|
31 |
*/
|
32 |
public function handle_rewrite_cdn() {
|
|
|
33 |
|
34 |
+
$cdn_integration = Breeze_Options_Reader::get_option_value( 'cdn_integration', true );
|
35 |
+
|
36 |
+
if ( empty( Breeze_Options_Reader::get_option_value( 'cdn-active' ) ) ) {
|
37 |
return;
|
38 |
}
|
39 |
|
40 |
+
if ( empty( Breeze_Options_Reader::get_option_value( 'cdn-url' ) ) ) {
|
41 |
return;
|
42 |
}
|
43 |
|
44 |
+
if ( get_option( 'home' ) == Breeze_Options_Reader::get_option_value( 'cdn-url' ) ) {
|
45 |
return;
|
46 |
}
|
47 |
|
inc/class-breeze-disable-emoji-option.php
CHANGED
@@ -17,8 +17,9 @@ if ( ! class_exists( 'Breeze_Disable_Emoji_Option' ) ) {
|
|
17 |
private $emoji_status = false;
|
18 |
|
19 |
function __construct() {
|
20 |
-
|
21 |
-
$
|
|
|
22 |
|
23 |
if ( true === $this->emoji_status ) {
|
24 |
add_action( 'init', array( &$this, 'disable_emoji_wp_wide' ) );
|
17 |
private $emoji_status = false;
|
18 |
|
19 |
function __construct() {
|
20 |
+
|
21 |
+
$emoji_data = Breeze_Options_Reader::get_option_value( 'breeze-wp-emoji' );
|
22 |
+
$this->emoji_status = isset( $emoji_data ) ? filter_var( $emoji_data, FILTER_VALIDATE_BOOLEAN ) : false;
|
23 |
|
24 |
if ( true === $this->emoji_status ) {
|
25 |
add_action( 'init', array( &$this, 'disable_emoji_wp_wide' ) );
|
inc/class-breeze-lazy-load.php
CHANGED
@@ -122,7 +122,7 @@ class Breeze_Lazy_Load {
|
|
122 |
// If native is enabled.
|
123 |
if ( true === $use_native ) {
|
124 |
$loading = $image_element->getAttribute( 'loading' );
|
125 |
-
if (
|
126 |
$image_element->setAttribute( 'loading', 'lazy' );
|
127 |
}
|
128 |
} else {
|
122 |
// If native is enabled.
|
123 |
if ( true === $use_native ) {
|
124 |
$loading = $image_element->getAttribute( 'loading' );
|
125 |
+
if ( empty( $loading ) ) {
|
126 |
$image_element->setAttribute( 'loading', 'lazy' );
|
127 |
}
|
128 |
} else {
|
inc/class-breeze-options-reader.php
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// General singleton class.
|
4 |
+
class Breeze_Options_Reader {
|
5 |
+
// Hold the class instance.
|
6 |
+
private static $instance = null;
|
7 |
+
|
8 |
+
private static $options = array();
|
9 |
+
|
10 |
+
// The constructor is private
|
11 |
+
// to prevent initiation with outer code.
|
12 |
+
private function __construct() {
|
13 |
+
// The expensive process (e.g.,db connection) goes here.
|
14 |
+
}
|
15 |
+
|
16 |
+
// The object is created from within the class itself
|
17 |
+
// only if the class has no instance.
|
18 |
+
public static function get_instance() {
|
19 |
+
if ( null === self::$instance ) {
|
20 |
+
self::$instance = new Breeze_Options_Reader();
|
21 |
+
}
|
22 |
+
|
23 |
+
return self::$instance;
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Provides the requested option or option group.
|
28 |
+
*
|
29 |
+
* @param string $option_name option name or group of options name if $hierarchy is true.
|
30 |
+
* @param bool $hierarchy If tru then it will return the whole group.
|
31 |
+
* @param bool $root if Multisite and $root is true, returns network level options.
|
32 |
+
*
|
33 |
+
* @return mixed|null
|
34 |
+
*/
|
35 |
+
public static function get_option_value( $option_name = '', $hierarchy = false, $root = false ) {
|
36 |
+
|
37 |
+
if ( is_multisite() ) {
|
38 |
+
if ( isset( self::$options['blog_id'] ) && (int) self::$options['blog_id'] !== get_current_blog_id() ) {
|
39 |
+
self::$options = array();
|
40 |
+
} elseif ( ! isset( self::$options['blog_id'] ) ) {
|
41 |
+
self::$options = array();
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
if ( ! empty( self::$options ) && isset( self::$options[ $option_name ] ) ) {
|
46 |
+
return self::$options[ $option_name ];
|
47 |
+
}
|
48 |
+
|
49 |
+
$root_option_groups = array(
|
50 |
+
'basic_settings',
|
51 |
+
'file_settings',
|
52 |
+
'preload_settings',
|
53 |
+
'advanced_settings',
|
54 |
+
'cdn_integration',
|
55 |
+
'varnish_cache',
|
56 |
+
'inherit_settings',
|
57 |
+
);
|
58 |
+
|
59 |
+
foreach ( $root_option_groups as $group ) {
|
60 |
+
$read_data = self::read_the_option_data( $group );
|
61 |
+
|
62 |
+
if ( ! empty( $read_data ) ) {
|
63 |
+
if ( false === $hierarchy ) {
|
64 |
+
foreach ( $read_data as $option_key => $option_value ) {
|
65 |
+
self::$options[ $option_key ] = $option_value;
|
66 |
+
}
|
67 |
+
} else {
|
68 |
+
self::$options[ $group ] = $read_data;
|
69 |
+
}
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
if ( is_multisite() ) {
|
74 |
+
self::$options['blog_id'] = get_current_blog_id();
|
75 |
+
}
|
76 |
+
|
77 |
+
if ( isset( self::$options[ $option_name ] ) ) {
|
78 |
+
return self::$options[ $option_name ];
|
79 |
+
}
|
80 |
+
|
81 |
+
return null;
|
82 |
+
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Retrieve site options accounting for settings inheritance.
|
87 |
+
*
|
88 |
+
* @param string $option_name
|
89 |
+
* @param bool $is_local
|
90 |
+
*
|
91 |
+
* @return array
|
92 |
+
*/
|
93 |
+
private static function read_the_option_data( $option_name, $is_local = false ) {
|
94 |
+
$inherit = true;
|
95 |
+
|
96 |
+
global $breeze_network_subsite_settings;
|
97 |
+
|
98 |
+
if ( is_network_admin() && ! $breeze_network_subsite_settings ) {
|
99 |
+
$is_local = false;
|
100 |
+
} elseif ( ! breeze_does_inherit_settings() ) {
|
101 |
+
$inherit = false;
|
102 |
+
}
|
103 |
+
|
104 |
+
if ( ! is_multisite() || $is_local || ! $inherit ) {
|
105 |
+
$option = get_option( 'breeze_' . $option_name );
|
106 |
+
} else {
|
107 |
+
$option = get_site_option( 'breeze_' . $option_name );
|
108 |
+
}
|
109 |
+
|
110 |
+
if ( empty( $option ) || ! is_array( $option ) ) {
|
111 |
+
$option = array();
|
112 |
+
}
|
113 |
+
|
114 |
+
return $option;
|
115 |
+
}
|
116 |
+
|
117 |
+
public static function fetch_all_saved_settings( $is_root = false ) {
|
118 |
+
self::$options = array();
|
119 |
+
|
120 |
+
if ( true === $is_root && ! defined( 'WP_NETWORK_ADMIN' ) ) {
|
121 |
+
define( 'WP_NETWORK_ADMIN', true );
|
122 |
+
}
|
123 |
+
|
124 |
+
self::get_option_value( 'all', false, $is_root );
|
125 |
+
|
126 |
+
return self::$options;
|
127 |
+
}
|
128 |
+
}
|
inc/class-breeze-prefetch.php
CHANGED
@@ -25,11 +25,11 @@ if ( ! class_exists( 'Breeze_Prefetch' ) ) {
|
|
25 |
* @access public
|
26 |
*/
|
27 |
public function load_prefetch_scripts() {
|
28 |
-
$breeze_options = breeze_get_option( 'advanced_settings' );
|
29 |
// Check if the option is enabled by admin.
|
30 |
-
|
|
|
31 |
// Load the prefetch library.
|
32 |
-
wp_enqueue_script( 'breeze-prefetch', BREEZE_PLUGIN_URL . 'assets/js/breeze-prefetch-links.js', array(),
|
33 |
wp_localize_script(
|
34 |
'breeze-prefetch',
|
35 |
'breeze_prefetch',
|
25 |
* @access public
|
26 |
*/
|
27 |
public function load_prefetch_scripts() {
|
|
|
28 |
// Check if the option is enabled by admin.
|
29 |
+
$preload_links = Breeze_Options_Reader::get_option_value( 'breeze-preload-links' );
|
30 |
+
if ( isset( $preload_links ) && true === filter_var( $preload_links, FILTER_VALIDATE_BOOLEAN ) ) {
|
31 |
// Load the prefetch library.
|
32 |
+
wp_enqueue_script( 'breeze-prefetch', BREEZE_PLUGIN_URL . 'assets/js/js-front-end/breeze-prefetch-links.min.js', array(), BREEZE_VERSION, false );
|
33 |
wp_localize_script(
|
34 |
'breeze-prefetch',
|
35 |
'breeze_prefetch',
|
inc/class-breeze-preload-fonts.php
CHANGED
@@ -26,7 +26,7 @@ if ( ! class_exists( 'Breeze_Preload_Fonts' ) ) {
|
|
26 |
* @access public
|
27 |
*/
|
28 |
public function load_preload_scripts() {
|
29 |
-
$
|
30 |
$fonts_extensions = array(
|
31 |
'woff',
|
32 |
'woff2',
|
@@ -41,14 +41,14 @@ if ( ! class_exists( 'Breeze_Preload_Fonts' ) ) {
|
|
41 |
$fonts_extensions = apply_filters( 'breeze_preload_fonts_exception', $fonts_extensions );
|
42 |
|
43 |
// Check if the option is enabled by admin.
|
44 |
-
if ( isset( $
|
45 |
|
46 |
-
foreach ( $
|
47 |
$extension = pathinfo( $preload_url, PATHINFO_EXTENSION );
|
48 |
-
|
49 |
if ( 'css' === $extension ) {
|
50 |
echo '<link rel="preload" as="style" onload="this.rel = \'stylesheet\'" href="' . $preload_url . '" crossorigin>' . "\n";
|
51 |
-
} elseif ( in_array( $extension, $fonts_extensions ) ) {
|
52 |
echo '<link rel="preload" as="font" type="font/' . $extension . '" href="' . $preload_url . '" crossorigin>' . "\n";
|
53 |
}
|
54 |
}
|
26 |
* @access public
|
27 |
*/
|
28 |
public function load_preload_scripts() {
|
29 |
+
$preload_fonts = Breeze_Options_Reader::get_option_value( 'breeze-preload-fonts' );
|
30 |
$fonts_extensions = array(
|
31 |
'woff',
|
32 |
'woff2',
|
41 |
$fonts_extensions = apply_filters( 'breeze_preload_fonts_exception', $fonts_extensions );
|
42 |
|
43 |
// Check if the option is enabled by admin.
|
44 |
+
if ( isset( $preload_fonts ) && ! empty( $preload_fonts ) ) {
|
45 |
|
46 |
+
foreach ( $preload_fonts as $index => $preload_url ) {
|
47 |
$extension = pathinfo( $preload_url, PATHINFO_EXTENSION );
|
48 |
+
$extension = strtolower( $extension );
|
49 |
if ( 'css' === $extension ) {
|
50 |
echo '<link rel="preload" as="style" onload="this.rel = \'stylesheet\'" href="' . $preload_url . '" crossorigin>' . "\n";
|
51 |
+
} elseif ( in_array( $extension, $fonts_extensions, true ) ) {
|
52 |
echo '<link rel="preload" as="font" type="font/' . $extension . '" href="' . $preload_url . '" crossorigin>' . "\n";
|
53 |
}
|
54 |
}
|
inc/helpers.php
CHANGED
@@ -18,6 +18,24 @@
|
|
18 |
*/
|
19 |
defined( 'ABSPATH' ) || die( 'No direct script access allowed!' );
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
/**
|
22 |
* Retrieve site options accounting for settings inheritance.
|
23 |
*
|
@@ -691,9 +709,10 @@ function breeze_varnish_purge_cache( $url = '', $purge_varnish = false, $check_v
|
|
691 |
$schema = $parse_url['scheme'] . '://';
|
692 |
}
|
693 |
// Determine the host
|
694 |
-
$host
|
695 |
-
|
696 |
-
$
|
|
|
697 |
$purgeme = $varnish_host . $url_path . $pregex;
|
698 |
if ( ! empty( $parse_url['query'] ) && 'breeze' !== strtolower( $parse_url['query'] ) ) {
|
699 |
$purgeme .= '?' . $parse_url['query'];
|
@@ -840,3 +859,161 @@ function breeze_is_amp_page() {
|
|
840 |
|
841 |
return false;
|
842 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
*/
|
19 |
defined( 'ABSPATH' ) || die( 'No direct script access allowed!' );
|
20 |
|
21 |
+
function set_as_network_screen() {
|
22 |
+
if ( isset( $_GET['is-network'] ) || isset( $_POST['is-network'] ) ) {
|
23 |
+
$is_network = false;
|
24 |
+
|
25 |
+
if ( isset( $_GET['is-network'] ) ) {
|
26 |
+
$is_network = filter_var( $_GET['is-network'], FILTER_VALIDATE_BOOLEAN );
|
27 |
+
}
|
28 |
+
|
29 |
+
if ( isset( $_POST['is-network'] ) ) {
|
30 |
+
$is_network = filter_var( $_POST['is-network'], FILTER_VALIDATE_BOOLEAN );
|
31 |
+
}
|
32 |
+
|
33 |
+
if ( true === $is_network && ! defined( 'WP_NETWORK_ADMIN' ) ) {
|
34 |
+
define( 'WP_NETWORK_ADMIN', true );
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
/**
|
40 |
* Retrieve site options accounting for settings inheritance.
|
41 |
*
|
709 |
$schema = $parse_url['scheme'] . '://';
|
710 |
}
|
711 |
// Determine the host
|
712 |
+
$host = $parse_url['host'];
|
713 |
+
|
714 |
+
$varnish_ip = Breeze_Options_Reader::get_option_value( 'breeze-varnish-server-ip' );
|
715 |
+
$varnish_host = isset( $varnish_ip ) ? $varnish_ip : '127.0.0.1';
|
716 |
$purgeme = $varnish_host . $url_path . $pregex;
|
717 |
if ( ! empty( $parse_url['query'] ) && 'breeze' !== strtolower( $parse_url['query'] ) ) {
|
718 |
$purgeme .= '?' . $parse_url['query'];
|
859 |
|
860 |
return false;
|
861 |
}
|
862 |
+
|
863 |
+
|
864 |
+
function breeze_migrate_old_settings( $is_sigle = true, $subsite_id = 0, $is_root = false ) {
|
865 |
+
//If this is a single site.
|
866 |
+
if ( true === $is_sigle ) {
|
867 |
+
// if the option exists, then we do not need to do anything.
|
868 |
+
// This option is not available to Breeze versions < 2.0.0.
|
869 |
+
$new_option = breeze_get_option( 'file_settings', true );
|
870 |
+
if ( ! empty( $new_option ) ) {
|
871 |
+
return;
|
872 |
+
}
|
873 |
+
|
874 |
+
$get_current_basic = breeze_get_option( 'basic_settings', true );
|
875 |
+
$get_current_advanced = breeze_get_option( 'advanced_settings', true );
|
876 |
+
$get_current_varnish = breeze_get_option( 'varnish_cache', true );
|
877 |
+
$get_current_cdn = breeze_get_option( 'cdn_integration', true );
|
878 |
+
$options = array();
|
879 |
+
}
|
880 |
+
|
881 |
+
// if multisite then run code for sub-site.
|
882 |
+
if ( false === $is_sigle && ! empty( $subsite_id ) ) {
|
883 |
+
$subsite_id = absint( $subsite_id );
|
884 |
+
// if the option exists, then we do not need to do anything.
|
885 |
+
// This option is not available to Breeze versions < 2.0.0.
|
886 |
+
$new_option = get_blog_option( $subsite_id, 'breeze_file_settings', array() );
|
887 |
+
if ( ! empty( $new_option ) ) {
|
888 |
+
return;
|
889 |
+
}
|
890 |
+
|
891 |
+
$get_current_basic = get_blog_option( $subsite_id, 'breeze_basic_settings', array() );
|
892 |
+
$get_current_advanced = get_blog_option( $subsite_id, 'breeze_advanced_settings', array() );
|
893 |
+
$get_current_varnish = get_blog_option( $subsite_id, 'breeze_varnish_cache', array() );
|
894 |
+
$get_current_cdn = get_blog_option( $subsite_id, 'breeze_cdn_integration', array() );
|
895 |
+
}
|
896 |
+
|
897 |
+
// if multisite and network level.
|
898 |
+
if ( true === $is_root ) {
|
899 |
+
$new_option = get_site_option( 'breeze_file_settings', array() );
|
900 |
+
if ( ! empty( $new_option ) ) {
|
901 |
+
return;
|
902 |
+
}
|
903 |
+
|
904 |
+
$get_current_basic = get_site_option( 'breeze_basic_settings', array() );
|
905 |
+
$get_current_advanced = get_site_option( 'breeze_advanced_settings', array() );
|
906 |
+
$get_current_varnish = get_site_option( 'breeze_varnish_cache', array() );
|
907 |
+
$get_current_cdn = get_site_option( 'breeze_cdn_integration', array() );
|
908 |
+
}
|
909 |
+
|
910 |
+
if ( ! empty( $get_current_basic ) ) {
|
911 |
+
foreach ( $get_current_basic as $option_name => $value ) {
|
912 |
+
$options[ $option_name ] = $value;
|
913 |
+
}
|
914 |
+
}
|
915 |
+
|
916 |
+
if ( ! empty( $get_current_advanced ) ) {
|
917 |
+
foreach ( $get_current_advanced as $option_name => $value ) {
|
918 |
+
$options[ $option_name ] = $value;
|
919 |
+
}
|
920 |
+
}
|
921 |
+
|
922 |
+
if ( ! empty( $get_current_varnish ) ) {
|
923 |
+
foreach ( $get_current_varnish as $option_name => $value ) {
|
924 |
+
$options[ $option_name ] = $value;
|
925 |
+
}
|
926 |
+
}
|
927 |
+
|
928 |
+
if ( ! empty( $get_current_cdn ) ) {
|
929 |
+
foreach ( $get_current_cdn as $option_name => $value ) {
|
930 |
+
$options[ $option_name ] = $value;
|
931 |
+
}
|
932 |
+
}
|
933 |
+
|
934 |
+
$basic = array(
|
935 |
+
'breeze-active' => ( isset( $options['breeze-active'] ) ? $options['breeze-active'] : '1' ),
|
936 |
+
'breeze-cross-origin' => ( isset( $options['breeze-cross-origin'] ) ? $options['breeze-cross-origin'] : '0' ),
|
937 |
+
'breeze-disable-admin' => ( isset( $options['breeze-disable-admin'] ) ? $options['breeze-disable-admin'] : array() ),
|
938 |
+
'breeze-gzip-compression' => ( isset( $options['breeze-gzip-compression'] ) ? $options['breeze-gzip-compression'] : '1' ),
|
939 |
+
'breeze-browser-cache' => ( isset( $options['breeze-browser-cache'] ) ? $options['breeze-browser-cache'] : '1' ),
|
940 |
+
'breeze-lazy-load' => ( isset( $options['breeze-lazy-load'] ) ? $options['breeze-lazy-load'] : '0' ),
|
941 |
+
'breeze-lazy-load-native' => ( isset( $options['breeze-lazy-load-native'] ) ? $options['breeze-lazy-load-native'] : '0' ),
|
942 |
+
'breeze-desktop-cache' => '1',
|
943 |
+
'breeze-mobile-cache' => '1',
|
944 |
+
'breeze-display-clean' => '1',
|
945 |
+
'breeze-ttl' => ( isset( $options['breeze-ttl'] ) ? $options['breeze-ttl'] : 1440 ),
|
946 |
+
);
|
947 |
+
|
948 |
+
$file = array(
|
949 |
+
'breeze-minify-html' => ( isset( $options['breeze-minify-html'] ) ? $options['breeze-minify-html'] : '0' ),
|
950 |
+
// --
|
951 |
+
'breeze-minify-css' => ( isset( $options['breeze-minify-css'] ) ? $options['breeze-minify-css'] : '0' ),
|
952 |
+
'breeze-font-display-swap' => ( isset( $options['breeze-font-display-swap'] ) ? $options['breeze-font-display-swap'] : '0' ),
|
953 |
+
'breeze-group-css' => ( isset( $options['breeze-group-css'] ) ? $options['breeze-group-css'] : '0' ),
|
954 |
+
'breeze-exclude-css' => ( isset( $options['breeze-exclude-css'] ) ? $options['breeze-exclude-css'] : array() ),
|
955 |
+
'breeze-include-inline-css' => ( isset( $options['breeze-include-inline-css'] ) ? $options['breeze-include-inline-css'] : '0' ),
|
956 |
+
// --
|
957 |
+
'breeze-minify-js' => ( isset( $options['breeze-minify-js'] ) ? $options['breeze-minify-js'] : '0' ),
|
958 |
+
'breeze-group-js' => ( isset( $options['breeze-group-js'] ) ? $options['breeze-group-js'] : '0' ),
|
959 |
+
'breeze-include-inline-js' => ( isset( $options['breeze-include-inline-js'] ) ? $options['breeze-include-inline-js'] : '0' ),
|
960 |
+
'breeze-exclude-js' => ( isset( $options['breeze-exclude-js'] ) ? $options['breeze-exclude-js'] : array() ),
|
961 |
+
'breeze-move-to-footer-js' => ( isset( $options['breeze-move-to-footer-js'] ) ? $options['breeze-move-to-footer-js'] : array() ),
|
962 |
+
'breeze-defer-js' => ( isset( $options['breeze-defer-js'] ) ? $options['breeze-defer-js'] : array() ),
|
963 |
+
'breeze-enable-js-delay' => ( isset( $options['breeze-enable-js-delay'] ) ? $options['breeze-enable-js-delay'] : '0' ),
|
964 |
+
'breeze-delay-js-scripts' => ( isset( $options['breeze-delay-js-scripts'] ) ? $options['breeze-delay-js-scripts'] : array() ),
|
965 |
+
|
966 |
+
);
|
967 |
+
|
968 |
+
$preload = array(
|
969 |
+
'breeze-preload-fonts' => ( isset( $options['breeze-preload-fonts'] ) ? $options['breeze-preload-fonts'] : array() ),
|
970 |
+
'breeze-preload-links' => ( isset( $options['breeze-preload-links'] ) ? $options['breeze-preload-links'] : '0' ),
|
971 |
+
);
|
972 |
+
|
973 |
+
$advanced = array(
|
974 |
+
'breeze-exclude-urls' => ( isset( $options['breeze-exclude-urls'] ) ? $options['breeze-exclude-urls'] : array() ),
|
975 |
+
'cached-query-strings' => ( isset( $options['cached-query-strings'] ) ? $options['cached-query-strings'] : array() ),
|
976 |
+
'breeze-wp-emoji' => ( isset( $options['breeze-wp-emoji'] ) ? $options['breeze-wp-emoji'] : '0' ),
|
977 |
+
);
|
978 |
+
|
979 |
+
$wp_content = substr( WP_CONTENT_DIR, strlen( ABSPATH ) );
|
980 |
+
$cdn = array(
|
981 |
+
'cdn-active' => ( isset( $options['cdn-active'] ) ? $options['cdn-active'] : '0' ),
|
982 |
+
'cdn-relative-path' => ( isset( $options['cdn-relative-path'] ) ? $options['cdn-relative-path'] : '1' ),
|
983 |
+
'cdn-url' => ( isset( $options['cdn-url'] ) ? $options['cdn-url'] : '' ),
|
984 |
+
'cdn-content' => ( isset( $options['cdn-content'] ) ? $options['cdn-content'] : array( 'wp-includes', $wp_content ) ),
|
985 |
+
'cdn-exclude-content' => ( isset( $options['cdn-exclude-content'] ) ? $options['cdn-exclude-content'] : array( '.php' ) ),
|
986 |
+
);
|
987 |
+
|
988 |
+
$varnish = array(
|
989 |
+
'auto-purge-varnish' => ( isset( $options['auto-purge-varnish'] ) ? $options['auto-purge-varnish'] : '1' ),
|
990 |
+
'breeze-varnish-server-ip' => ( isset( $options['breeze-varnish-server-ip'] ) ? $options['breeze-varnish-server-ip'] : '127.0.0.1' ),
|
991 |
+
);
|
992 |
+
|
993 |
+
if ( true === $is_sigle ) {
|
994 |
+
breeze_update_option( 'basic_settings', $basic, true );
|
995 |
+
breeze_update_option( 'file_settings', $file, true );
|
996 |
+
breeze_update_option( 'preload_settings', $preload, true );
|
997 |
+
breeze_update_option( 'advanced_settings', $advanced, true );
|
998 |
+
breeze_update_option( 'cdn_integration', $cdn, true );
|
999 |
+
breeze_update_option( 'varnish_cache', $varnish, true );
|
1000 |
+
}
|
1001 |
+
|
1002 |
+
if ( false === $is_sigle && ! empty( $subsite_id ) ) {
|
1003 |
+
update_blog_option( $subsite_id, 'breeze_basic_settings', $basic );
|
1004 |
+
update_blog_option( $subsite_id, 'breeze_file_settings', $file );
|
1005 |
+
update_blog_option( $subsite_id, 'breeze_preload_settings', $preload );
|
1006 |
+
update_blog_option( $subsite_id, 'breeze_advanced_settings', $advanced );
|
1007 |
+
update_blog_option( $subsite_id, 'breeze_cdn_integration', $cdn );
|
1008 |
+
update_blog_option( $subsite_id, 'breeze_varnish_cache', $varnish );
|
1009 |
+
}
|
1010 |
+
|
1011 |
+
if ( true === $is_root ) {
|
1012 |
+
update_site_option( 'breeze_basic_settings', $basic );
|
1013 |
+
update_site_option( 'breeze_file_settings', $file );
|
1014 |
+
update_site_option( 'breeze_preload_settings', $preload );
|
1015 |
+
update_site_option( 'breeze_advanced_settings', $advanced );
|
1016 |
+
update_site_option( 'breeze_cdn_integration', $cdn );
|
1017 |
+
update_site_option( 'breeze_varnish_cache', $varnish );
|
1018 |
+
}
|
1019 |
+
}
|
inc/minification/breeze-js-deferred-loading.php
CHANGED
@@ -184,6 +184,7 @@ class Breeze_Js_Deferred_Loading extends Breeze_MinificationBase {
|
|
184 |
$this->move_to_footer_js = $options['move_to_footer_js'];
|
185 |
}
|
186 |
|
|
|
187 |
// is there JS we should simply remove
|
188 |
$removableJS = apply_filters( 'breeze_filter_js_removables', '' );
|
189 |
if ( ! empty( $removableJS ) ) {
|
@@ -211,7 +212,7 @@ class Breeze_Js_Deferred_Loading extends Breeze_MinificationBase {
|
|
211 |
$ordered_moving_js = array_map( array( $this, 'getpath' ), $ordered_moving_js );
|
212 |
$this->footer_scripts = array_merge( $ordered_moving_js, $this->footer_scripts );
|
213 |
|
214 |
-
// JS Scripts found,
|
215 |
return true;
|
216 |
}
|
217 |
|
@@ -303,11 +304,13 @@ class Breeze_Js_Deferred_Loading extends Breeze_MinificationBase {
|
|
303 |
)
|
304 |
) {
|
305 |
$this->footer_scripts[ $url ] = $path;
|
|
|
306 |
} else {
|
307 |
$this->head_scripts[ $url ] = $path;
|
308 |
}
|
309 |
} else {
|
310 |
$this->footer_scripts[ $url ] = $path;
|
|
|
311 |
}
|
312 |
} else {
|
313 |
//No merge, but maybe we can move it
|
184 |
$this->move_to_footer_js = $options['move_to_footer_js'];
|
185 |
}
|
186 |
|
187 |
+
|
188 |
// is there JS we should simply remove
|
189 |
$removableJS = apply_filters( 'breeze_filter_js_removables', '' );
|
190 |
if ( ! empty( $removableJS ) ) {
|
212 |
$ordered_moving_js = array_map( array( $this, 'getpath' ), $ordered_moving_js );
|
213 |
$this->footer_scripts = array_merge( $ordered_moving_js, $this->footer_scripts );
|
214 |
|
215 |
+
// JS Scripts found, we can start processing them.
|
216 |
return true;
|
217 |
}
|
218 |
|
304 |
)
|
305 |
) {
|
306 |
$this->footer_scripts[ $url ] = $path;
|
307 |
+
$content = str_replace( $tag, '', $content );
|
308 |
} else {
|
309 |
$this->head_scripts[ $url ] = $path;
|
310 |
}
|
311 |
} else {
|
312 |
$this->footer_scripts[ $url ] = $path;
|
313 |
+
$content = str_replace( $tag, '', $content );
|
314 |
}
|
315 |
} else {
|
316 |
//No merge, but maybe we can move it
|
inc/minification/breeze-minify-main.php
CHANGED
@@ -23,8 +23,8 @@ defined( 'ABSPATH' ) || die( 'No direct script access allowed!' );
|
|
23 |
class Breeze_Minify {
|
24 |
|
25 |
public function __construct() {
|
26 |
-
|
27 |
-
$is_caching_active = filter_var(
|
28 |
|
29 |
if ( defined( 'WP_CACHE' ) && false === WP_CACHE ) {
|
30 |
$is_caching_active = false;
|
@@ -32,43 +32,42 @@ class Breeze_Minify {
|
|
32 |
|
33 |
if ( true === $is_caching_active ) {
|
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 |
/**
|
@@ -99,19 +98,11 @@ class Breeze_Minify {
|
|
99 |
$query_instance = Breeze_Query_Strings_Rules::get_instance();
|
100 |
$breeze_query_vars_list = $query_instance->check_query_var_group();
|
101 |
if ( ! is_feed() && ! $ao_noptimize && ! is_admin() && 0 === (int) $breeze_query_vars_list['extra_query_no'] ) {
|
102 |
-
// Config element
|
103 |
-
$conf = breeze_get_option( 'basic_settings' );
|
104 |
-
$config_advanced = breeze_get_option( 'advanced_settings' );
|
105 |
-
|
106 |
-
if ( ! isset( $config_advanced['breeze-enable-js-delay'] ) ) {
|
107 |
-
$config_advanced['breeze-enable-js-delay'] = '0';
|
108 |
-
}
|
109 |
-
|
110 |
// Load our base class
|
111 |
include_once( BREEZE_PLUGIN_DIR . 'inc/minification/breeze-minification-base.php' );
|
112 |
|
113 |
// Load extra classes and set some vars
|
114 |
-
if ( ! empty(
|
115 |
include_once( BREEZE_PLUGIN_DIR . 'inc/minification/breeze-minification-html.php' );
|
116 |
// BUG: new minify-html does not support keeping HTML comments, skipping for now
|
117 |
if ( ! class_exists( 'Minify_HTML' ) ) {
|
@@ -119,7 +110,7 @@ class Breeze_Minify {
|
|
119 |
}
|
120 |
}
|
121 |
|
122 |
-
if ( ! empty(
|
123 |
|
124 |
include_once( BREEZE_PLUGIN_DIR . 'inc/minification/breeze-minification-scripts.php' );
|
125 |
|
@@ -133,15 +124,18 @@ class Breeze_Minify {
|
|
133 |
define( 'COMPRESS_SCRIPTS', false );
|
134 |
}
|
135 |
} elseif (
|
136 |
-
! empty(
|
137 |
-
! empty(
|
138 |
-
(
|
|
|
|
|
|
|
139 |
) {
|
140 |
// If we have defer scripts to handle, load only the script for this action.
|
141 |
include_once( BREEZE_PLUGIN_DIR . 'inc/minification/breeze-js-deferred-loading.php' );
|
142 |
}
|
143 |
|
144 |
-
if ( ! empty(
|
145 |
include_once( BREEZE_PLUGIN_DIR . 'inc/minification/breeze-minification-styles.php' );
|
146 |
if ( defined( 'breeze_LEGACY_MINIFIERS' ) ) {
|
147 |
if ( ! class_exists( 'Minify_CSS_Compressor' ) ) {
|
@@ -188,64 +182,52 @@ class Breeze_Minify {
|
|
188 |
|
189 |
define( 'breeze_HASH', wp_hash( breeze_CACHE_URL ) );
|
190 |
// Config element
|
191 |
-
$conf
|
192 |
-
$minify = breeze_get_option( 'advanced_settings' );
|
193 |
-
$cdn_data = breeze_get_option( 'cdn_integration' );
|
194 |
-
|
195 |
-
if ( ! isset( $minify['breeze-enable-js-delay'] ) ) {
|
196 |
-
$minify['breeze-enable-js-delay'] = '0';
|
197 |
-
}
|
198 |
-
|
199 |
$cdn_url = '';
|
200 |
-
if (
|
201 |
-
|
202 |
-
$cdn_url = $cdn_data['cdn-url'];
|
203 |
-
}
|
204 |
}
|
205 |
// Choose the classes
|
206 |
$classes = array();
|
207 |
$js_include_inline = $css_include_inline = false;
|
208 |
-
if ( ! empty(
|
209 |
$classes[] = 'Breeze_MinificationScripts';
|
210 |
} elseif (
|
211 |
-
! empty(
|
212 |
-
! empty(
|
213 |
(
|
214 |
-
|
215 |
-
|
216 |
-
true === filter_var( $minify['breeze-enable-js-delay'], FILTER_VALIDATE_BOOLEAN )
|
217 |
)
|
218 |
) {
|
219 |
$classes[] = 'Breeze_Js_Deferred_Loading';
|
220 |
}
|
221 |
|
222 |
-
if ( ! empty(
|
223 |
$classes[] = 'Breeze_MinificationStyles';
|
224 |
}
|
225 |
-
if ( ! empty(
|
226 |
$classes[] = 'Breeze_MinificationHtml';
|
227 |
}
|
228 |
-
if ( ! empty(
|
229 |
$js_include_inline = true;
|
230 |
}
|
231 |
-
if ( ! empty(
|
232 |
$css_include_inline = true;
|
233 |
}
|
234 |
$groupcss = false;
|
235 |
$groupjs = false;
|
236 |
-
if ( ! empty(
|
237 |
$groupcss = true;
|
238 |
}
|
239 |
-
if ( ! empty(
|
240 |
$groupjs = true;
|
241 |
}
|
242 |
|
243 |
-
$font_swap =
|
244 |
-
if ( isset( $conf['breeze-font-display-swap'] ) ) {
|
245 |
-
$font_swap = filter_var( $conf['breeze-font-display-swap'], FILTER_VALIDATE_BOOLEAN );
|
246 |
-
}
|
247 |
|
248 |
// Set some options
|
|
|
249 |
$classoptions = array(
|
250 |
'Breeze_MinificationScripts' => array(
|
251 |
'justhead' => false,
|
@@ -255,10 +237,10 @@ class Breeze_Minify {
|
|
255 |
'cdn_url' => '',
|
256 |
'include_inline' => $js_include_inline,
|
257 |
'group_js' => $groupjs,
|
258 |
-
'custom_js_exclude' =>
|
259 |
-
'move_to_footer_js' =>
|
260 |
-
'defer_js' =>
|
261 |
-
'delay_inline_js' => (
|
262 |
),
|
263 |
'Breeze_MinificationStyles' => array(
|
264 |
'justhead' => false,
|
@@ -272,30 +254,31 @@ class Breeze_Minify {
|
|
272 |
'font_swap' => $font_swap,
|
273 |
'nogooglefont' => false,
|
274 |
'groupcss' => $groupcss,
|
275 |
-
'custom_css_exclude' =>
|
276 |
'include_imported_css' => false,
|
277 |
),
|
278 |
'Breeze_MinificationHtml' => array(
|
279 |
'keepcomments' => false,
|
280 |
),
|
281 |
'Breeze_Js_Deferred_Loading' => array(
|
282 |
-
'move_to_footer_js' =>
|
283 |
-
'defer_js' =>
|
284 |
-
'delay_inline_js' => (
|
285 |
'cdn_url' => $cdn_url,
|
286 |
),
|
287 |
);
|
288 |
|
289 |
$content = apply_filters( 'breeze_filter_html_before_minify', $content );
|
290 |
|
291 |
-
$is_caching_on = filter_var(
|
292 |
if ( function_exists( 'is_user_logged_in' ) && is_user_logged_in() ) {
|
293 |
$current_user = wp_get_current_user();
|
294 |
$current_user_roles = (array) $current_user->roles;
|
295 |
//$one_role = reset( $current_user_roles );
|
296 |
-
$is_found
|
|
|
297 |
foreach ( $current_user_roles as $index => $one_role ) {
|
298 |
-
if ( isset( $
|
299 |
$is_found = true;
|
300 |
}
|
301 |
}
|
@@ -354,48 +337,44 @@ class Breeze_Minify {
|
|
354 |
* check url from Never cache the following pages area
|
355 |
*/
|
356 |
public function check_exclude_url( $current_url ) {
|
357 |
-
$opts_config = breeze_get_option( 'advanced_settings' );
|
358 |
-
|
359 |
$config_options = $this->read_the_config_file();
|
360 |
if ( ! empty( $config_options ) ) {
|
361 |
|
362 |
-
|
363 |
-
$opts_config = array();
|
364 |
-
}
|
365 |
|
366 |
-
if ( ! isset( $
|
367 |
-
$
|
368 |
}
|
369 |
|
370 |
-
$
|
371 |
-
$urls
|
372 |
-
$
|
373 |
}
|
374 |
|
375 |
-
if ( ! isset( $
|
376 |
-
$
|
377 |
}
|
378 |
|
379 |
-
$is_exclude = breeze_check_for_exclude_values( $current_url, $
|
380 |
if ( ! empty( $is_exclude ) ) {
|
381 |
|
382 |
return true;
|
383 |
}
|
384 |
//check disable cache for page
|
385 |
-
if ( ! empty( $
|
386 |
-
foreach ( $
|
387 |
// Clear blank character
|
388 |
-
$
|
389 |
-
if ( empty( $
|
390 |
continue;
|
391 |
}
|
392 |
|
393 |
-
if ( preg_match( '/(\&?\/?\(\.?\*\)|\/\*|\*)$/', $
|
394 |
|
395 |
if ( isset( $matches[0] ) && ! empty( $matches[0] ) ) {
|
396 |
// End of rules is *, /*, [&][/](*) , [&][/](.*)
|
397 |
-
$pattent = substr( $
|
398 |
-
if ( $
|
399 |
// A path of exclude url with regex
|
400 |
if ( ( @preg_match( '@' . $pattent . '@', $current_url, $matches ) > 0 ) ) {
|
401 |
return true;
|
@@ -413,24 +392,12 @@ class Breeze_Minify {
|
|
413 |
|
414 |
} else {
|
415 |
|
416 |
-
$test_url =
|
417 |
-
$current_url = rtrim( $current_url, '/' );
|
418 |
-
$test_url = ltrim( $test_url, 'https:' );
|
419 |
$current_url = ltrim( $current_url, 'https:' );
|
420 |
|
421 |
// Whole path
|
422 |
-
if ( $test_url
|
423 |
return true;
|
424 |
-
} else {
|
425 |
-
$test_url = $str = strtok( $test_url, '?' );
|
426 |
-
$test_url = rtrim( $test_url, '/' );
|
427 |
-
|
428 |
-
$current_url = $str = strtok( $current_url, '?' );
|
429 |
-
$current_url = rtrim( $current_url, '/' );
|
430 |
-
|
431 |
-
if ( $test_url == $current_url ) {
|
432 |
-
return true;
|
433 |
-
}
|
434 |
}
|
435 |
}
|
436 |
}
|
23 |
class Breeze_Minify {
|
24 |
|
25 |
public function __construct() {
|
26 |
+
|
27 |
+
$is_caching_active = filter_var( Breeze_Options_Reader::get_option_value( 'breeze-active' ), FILTER_VALIDATE_BOOLEAN );
|
28 |
|
29 |
if ( defined( 'WP_CACHE' ) && false === WP_CACHE ) {
|
30 |
$is_caching_active = false;
|
32 |
|
33 |
if ( true === $is_caching_active ) {
|
34 |
|
35 |
+
//check disable cache for page
|
36 |
+
$http_host_breeze = ( isset( $_SERVER['HTTP_HOST'] ) ) ? $_SERVER['HTTP_HOST'] : '';
|
37 |
+
//$domain = ( ( ( isset( $_SERVER['HTTPS'] ) && ! empty( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] !== 'off' ) || ( ! empty( $_SERVER['SERVER_PORT'] ) && $_SERVER['SERVER_PORT'] == 443 ) ) ? 'https://' : 'http://' ) . $http_host_breeze;
|
38 |
+
$domain = ( ( ( ! empty( $_SERVER['HTTPS'] ) && 'off' !== $_SERVER['HTTPS'] ) || ( isset( $_SERVER['SERVER_PORT'] ) && 443 === (int) $_SERVER['SERVER_PORT'] ) ) ? 'https://' : 'http://' ) . $http_host_breeze;
|
39 |
+
//$current_url = $domain . $_SERVER['REQUEST_URI'];
|
40 |
+
$current_url = $domain . rawurldecode( $_SERVER['REQUEST_URI'] );
|
41 |
+
|
42 |
+
$check_url = $this->check_exclude_url( $current_url );
|
43 |
+
|
44 |
+
//load config file when redirect template
|
45 |
+
if ( ! $check_url && self::should_cache() ) {
|
46 |
+
//cache html
|
47 |
+
//cache minification
|
48 |
+
if ( Breeze_MinificationCache::create_cache_minification_folder() ) {
|
49 |
+
|
50 |
+
if (
|
51 |
+
! empty( Breeze_Options_Reader::get_option_value( 'breeze-minify-html' ) ) ||
|
52 |
+
! empty( Breeze_Options_Reader::get_option_value( 'breeze-minify-css' ) ) ||
|
53 |
+
! empty( Breeze_Options_Reader::get_option_value( 'breeze-minify-js' ) ) ||
|
54 |
+
! empty( Breeze_Options_Reader::get_option_value( 'breeze-defer-js' ) ) ||
|
55 |
+
! empty( Breeze_Options_Reader::get_option_value( 'breeze-move-to-footer-js' ) ) ||
|
56 |
+
(
|
57 |
+
! empty( Breeze_Options_Reader::get_option_value( 'breeze-delay-js-scripts' ) ) &&
|
58 |
+
true === filter_var( Breeze_Options_Reader::get_option_value( 'breeze-enable-js-delay' ), FILTER_VALIDATE_BOOLEAN )
|
59 |
+
)
|
60 |
+
) {
|
61 |
+
|
62 |
+
if ( defined( 'breeze_INIT_EARLIER' ) ) {
|
63 |
+
add_action( 'init', array( $this, 'breeze_start_buffering' ), - 1 );
|
64 |
+
} else {
|
65 |
+
add_action( 'wp_loaded', array( $this, 'breeze_start_buffering' ), 2 );
|
66 |
+
}
|
67 |
}
|
68 |
}
|
69 |
}
|
70 |
}
|
|
|
71 |
}
|
72 |
|
73 |
/**
|
98 |
$query_instance = Breeze_Query_Strings_Rules::get_instance();
|
99 |
$breeze_query_vars_list = $query_instance->check_query_var_group();
|
100 |
if ( ! is_feed() && ! $ao_noptimize && ! is_admin() && 0 === (int) $breeze_query_vars_list['extra_query_no'] ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
// Load our base class
|
102 |
include_once( BREEZE_PLUGIN_DIR . 'inc/minification/breeze-minification-base.php' );
|
103 |
|
104 |
// Load extra classes and set some vars
|
105 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-minify-html' ) ) ) {
|
106 |
include_once( BREEZE_PLUGIN_DIR . 'inc/minification/breeze-minification-html.php' );
|
107 |
// BUG: new minify-html does not support keeping HTML comments, skipping for now
|
108 |
if ( ! class_exists( 'Minify_HTML' ) ) {
|
110 |
}
|
111 |
}
|
112 |
|
113 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-minify-js' ) ) ) {
|
114 |
|
115 |
include_once( BREEZE_PLUGIN_DIR . 'inc/minification/breeze-minification-scripts.php' );
|
116 |
|
124 |
define( 'COMPRESS_SCRIPTS', false );
|
125 |
}
|
126 |
} elseif (
|
127 |
+
! empty( Breeze_Options_Reader::get_option_value( 'breeze-defer-js' ) ) ||
|
128 |
+
! empty( Breeze_Options_Reader::get_option_value( 'breeze-move-to-footer-js' ) ) ||
|
129 |
+
(
|
130 |
+
! empty( Breeze_Options_Reader::get_option_value( 'breeze-delay-js-scripts' ) ) &&
|
131 |
+
true === filter_var( Breeze_Options_Reader::get_option_value( 'breeze-enable-js-delay' ), FILTER_VALIDATE_BOOLEAN )
|
132 |
+
)
|
133 |
) {
|
134 |
// If we have defer scripts to handle, load only the script for this action.
|
135 |
include_once( BREEZE_PLUGIN_DIR . 'inc/minification/breeze-js-deferred-loading.php' );
|
136 |
}
|
137 |
|
138 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-minify-css' ) ) ) {
|
139 |
include_once( BREEZE_PLUGIN_DIR . 'inc/minification/breeze-minification-styles.php' );
|
140 |
if ( defined( 'breeze_LEGACY_MINIFIERS' ) ) {
|
141 |
if ( ! class_exists( 'Minify_CSS_Compressor' ) ) {
|
182 |
|
183 |
define( 'breeze_HASH', wp_hash( breeze_CACHE_URL ) );
|
184 |
// Config element
|
185 |
+
$conf = Breeze_Options_Reader::get_option_value( 'basic_settings', true );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
$cdn_url = '';
|
187 |
+
if ( '1' === Breeze_Options_Reader::get_option_value( 'cdn-active' ) ) {
|
188 |
+
$cdn_url = Breeze_Options_Reader::get_option_value( 'cdn-url' );
|
|
|
|
|
189 |
}
|
190 |
// Choose the classes
|
191 |
$classes = array();
|
192 |
$js_include_inline = $css_include_inline = false;
|
193 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-minify-js' ) ) ) {
|
194 |
$classes[] = 'Breeze_MinificationScripts';
|
195 |
} elseif (
|
196 |
+
! empty( Breeze_Options_Reader::get_option_value( 'breeze-defer-js' ) ) ||
|
197 |
+
! empty( Breeze_Options_Reader::get_option_value( 'breeze-move-to-footer-js' ) ) ||
|
198 |
(
|
199 |
+
! empty( Breeze_Options_Reader::get_option_value( 'breeze-delay-js-scripts' ) ) &&
|
200 |
+
true === filter_var( Breeze_Options_Reader::get_option_value( 'breeze-enable-js-delay' ), FILTER_VALIDATE_BOOLEAN )
|
|
|
201 |
)
|
202 |
) {
|
203 |
$classes[] = 'Breeze_Js_Deferred_Loading';
|
204 |
}
|
205 |
|
206 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-minify-css' ) ) ) {
|
207 |
$classes[] = 'Breeze_MinificationStyles';
|
208 |
}
|
209 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-minify-html' ) ) ) {
|
210 |
$classes[] = 'Breeze_MinificationHtml';
|
211 |
}
|
212 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-include-inline-js' ) ) ) {
|
213 |
$js_include_inline = true;
|
214 |
}
|
215 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-include-inline-css' ) ) ) {
|
216 |
$css_include_inline = true;
|
217 |
}
|
218 |
$groupcss = false;
|
219 |
$groupjs = false;
|
220 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-group-css' ) ) ) {
|
221 |
$groupcss = true;
|
222 |
}
|
223 |
+
if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-group-js' ) ) ) {
|
224 |
$groupjs = true;
|
225 |
}
|
226 |
|
227 |
+
$font_swap = filter_var( Breeze_Options_Reader::get_option_value( 'breeze-font-display-swap' ), FILTER_VALIDATE_BOOLEAN );
|
|
|
|
|
|
|
228 |
|
229 |
// Set some options
|
230 |
+
$script_delay = Breeze_Options_Reader::get_option_value( 'breeze-delay-js-scripts' );
|
231 |
$classoptions = array(
|
232 |
'Breeze_MinificationScripts' => array(
|
233 |
'justhead' => false,
|
237 |
'cdn_url' => '',
|
238 |
'include_inline' => $js_include_inline,
|
239 |
'group_js' => $groupjs,
|
240 |
+
'custom_js_exclude' => Breeze_Options_Reader::get_option_value( 'breeze-exclude-js' ),
|
241 |
+
'move_to_footer_js' => Breeze_Options_Reader::get_option_value( 'breeze-move-to-footer-js' ),
|
242 |
+
'defer_js' => Breeze_Options_Reader::get_option_value( 'breeze-defer-js' ),
|
243 |
+
'delay_inline_js' => ( ! empty( $script_delay ) ? $script_delay : array() ),
|
244 |
),
|
245 |
'Breeze_MinificationStyles' => array(
|
246 |
'justhead' => false,
|
254 |
'font_swap' => $font_swap,
|
255 |
'nogooglefont' => false,
|
256 |
'groupcss' => $groupcss,
|
257 |
+
'custom_css_exclude' => Breeze_Options_Reader::get_option_value( 'breeze-exclude-css' ),
|
258 |
'include_imported_css' => false,
|
259 |
),
|
260 |
'Breeze_MinificationHtml' => array(
|
261 |
'keepcomments' => false,
|
262 |
),
|
263 |
'Breeze_Js_Deferred_Loading' => array(
|
264 |
+
'move_to_footer_js' => Breeze_Options_Reader::get_option_value( 'breeze-move-to-footer-js' ),
|
265 |
+
'defer_js' => Breeze_Options_Reader::get_option_value( 'breeze-defer-js' ),
|
266 |
+
'delay_inline_js' => ( ! empty( $script_delay ) ? $script_delay : array() ),
|
267 |
'cdn_url' => $cdn_url,
|
268 |
),
|
269 |
);
|
270 |
|
271 |
$content = apply_filters( 'breeze_filter_html_before_minify', $content );
|
272 |
|
273 |
+
$is_caching_on = filter_var( Breeze_Options_Reader::get_option_value( 'breeze-active' ), FILTER_VALIDATE_BOOLEAN );
|
274 |
if ( function_exists( 'is_user_logged_in' ) && is_user_logged_in() ) {
|
275 |
$current_user = wp_get_current_user();
|
276 |
$current_user_roles = (array) $current_user->roles;
|
277 |
//$one_role = reset( $current_user_roles );
|
278 |
+
$is_found = false;
|
279 |
+
$breeze_disable_admin = Breeze_Options_Reader::get_option_value( 'breeze-disable-admin' );
|
280 |
foreach ( $current_user_roles as $index => $one_role ) {
|
281 |
+
if ( isset( $breeze_disable_admin[ $one_role ] ) && true === filter_var( $breeze_disable_admin[ $one_role ], FILTER_VALIDATE_BOOLEAN ) ) {
|
282 |
$is_found = true;
|
283 |
}
|
284 |
}
|
337 |
* check url from Never cache the following pages area
|
338 |
*/
|
339 |
public function check_exclude_url( $current_url ) {
|
|
|
|
|
340 |
$config_options = $this->read_the_config_file();
|
341 |
if ( ! empty( $config_options ) ) {
|
342 |
|
343 |
+
$breeze_exclude_urls = Breeze_Options_Reader::get_option_value( 'breeze-exclude-urls' );
|
|
|
|
|
344 |
|
345 |
+
if ( ! isset( $breeze_exclude_urls ) || ! is_array( $breeze_exclude_urls ) ) {
|
346 |
+
$breeze_exclude_urls = array();
|
347 |
}
|
348 |
|
349 |
+
$breeze_exclude_urls = array_merge( $breeze_exclude_urls, $config_options );
|
350 |
+
$urls = array_unique( $breeze_exclude_urls );
|
351 |
+
$breeze_exclude_urls = array_map( array( $this, 'rtrim_urls' ), $urls );
|
352 |
}
|
353 |
|
354 |
+
if ( ! isset( $breeze_exclude_urls ) ) {
|
355 |
+
$breeze_exclude_urls = array();
|
356 |
}
|
357 |
|
358 |
+
$is_exclude = breeze_check_for_exclude_values( $current_url, $breeze_exclude_urls );
|
359 |
if ( ! empty( $is_exclude ) ) {
|
360 |
|
361 |
return true;
|
362 |
}
|
363 |
//check disable cache for page
|
364 |
+
if ( ! empty( $breeze_exclude_urls ) ) {
|
365 |
+
foreach ( $breeze_exclude_urls as $exclude_url_item ) {
|
366 |
// Clear blank character
|
367 |
+
$exclude_url_item = trim( $exclude_url_item );
|
368 |
+
if ( empty( $exclude_url_item ) ) {
|
369 |
continue;
|
370 |
}
|
371 |
|
372 |
+
if ( preg_match( '/(\&?\/?\(\.?\*\)|\/\*|\*)$/', $exclude_url_item, $matches ) ) {
|
373 |
|
374 |
if ( isset( $matches[0] ) && ! empty( $matches[0] ) ) {
|
375 |
// End of rules is *, /*, [&][/](*) , [&][/](.*)
|
376 |
+
$pattent = substr( $exclude_url_item, 0, strpos( $exclude_url_item, $matches[0] ) );
|
377 |
+
if ( $exclude_url_item[0] == '/' ) {
|
378 |
// A path of exclude url with regex
|
379 |
if ( ( @preg_match( '@' . $pattent . '@', $current_url, $matches ) > 0 ) ) {
|
380 |
return true;
|
392 |
|
393 |
} else {
|
394 |
|
395 |
+
$test_url = ltrim( $exclude_url_item, 'https:' );
|
|
|
|
|
396 |
$current_url = ltrim( $current_url, 'https:' );
|
397 |
|
398 |
// Whole path
|
399 |
+
if ( mb_strtolower( $test_url ) === mb_strtolower( $current_url ) ) {
|
400 |
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
401 |
}
|
402 |
}
|
403 |
}
|
inc/wp-cli/class-breeze-settings-import-export.php
CHANGED
@@ -27,6 +27,8 @@ class Breeze_Settings_Import_Export {
|
|
27 |
|
28 |
}
|
29 |
|
|
|
|
|
30 |
if ( isset( $_FILES['breeze_import_file'] ) ) {
|
31 |
$allowed_extension = array( 'json' );
|
32 |
$temp = explode( '.', $_FILES['breeze_import_file']['name'] );
|
@@ -53,7 +55,13 @@ class Breeze_Settings_Import_Export {
|
|
53 |
if ( is_multisite() ) {
|
54 |
$level = ( isset( $_POST['network_level'] ) ) ? trim( $_POST['network_level'] ) : '';
|
55 |
}
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
if ( false === $action ) {
|
58 |
wp_send_json_error( new WP_Error( 'option_read', __( 'Could not read the options from the provided JSON file', 'breeze' ) ) );
|
59 |
} elseif ( true !== $action ) {
|
@@ -118,16 +126,20 @@ class Breeze_Settings_Import_Export {
|
|
118 |
$breeze_advanced_settings = get_site_option( 'breeze_advanced_settings' );
|
119 |
$breeze_cdn_integration = get_site_option( 'breeze_cdn_integration' );
|
120 |
$breeze_varnish_cache = get_site_option( 'breeze_varnish_cache' );
|
|
|
|
|
121 |
|
122 |
// Extra options
|
123 |
$breeze_first_install = get_site_option( 'breeze_first_install' );
|
124 |
$breeze_advanced_settings_120 = get_site_option( 'breeze_advanced_settings_120' );
|
125 |
} else { // if this export is made from sub-site.
|
126 |
-
$network_id = $level;
|
127 |
$breeze_basic_settings = get_blog_option( $network_id, 'breeze_basic_settings' );
|
128 |
$breeze_advanced_settings = get_blog_option( $network_id, 'breeze_advanced_settings' );
|
129 |
$breeze_cdn_integration = get_blog_option( $network_id, 'breeze_cdn_integration' );
|
130 |
$breeze_varnish_cache = get_blog_option( $network_id, 'breeze_varnish_cache' );
|
|
|
|
|
131 |
|
132 |
// Extra options
|
133 |
$breeze_first_install = get_blog_option( $network_id, 'breeze_first_install' );
|
@@ -140,10 +152,11 @@ class Breeze_Settings_Import_Export {
|
|
140 |
$breeze_advanced_settings = get_option( 'breeze_advanced_settings' );
|
141 |
$breeze_cdn_integration = get_option( 'breeze_cdn_integration' );
|
142 |
$breeze_varnish_cache = get_option( 'breeze_varnish_cache' );
|
|
|
|
|
143 |
|
144 |
// Extra options
|
145 |
$breeze_first_install = get_option( 'breeze_first_install' );
|
146 |
-
$breeze_inherit_settings = get_option( 'breeze_inherit_settings' );
|
147 |
$breeze_ecommerce_detect = get_option( 'breeze_ecommerce_detect' );
|
148 |
$breeze_advanced_settings_120 = get_option( 'breeze_advanced_settings_120' );
|
149 |
}
|
@@ -160,6 +173,12 @@ class Breeze_Settings_Import_Export {
|
|
160 |
if ( isset( $breeze_inherit_settings ) ) {
|
161 |
$export['breeze_inherit_settings'] = $breeze_inherit_settings;
|
162 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
if ( isset( $breeze_ecommerce_detect ) ) {
|
164 |
$export['breeze_ecommerce_detect'] = $breeze_ecommerce_detect;
|
165 |
}
|
@@ -253,7 +272,6 @@ class Breeze_Settings_Import_Export {
|
|
253 |
return false;
|
254 |
}
|
255 |
|
256 |
-
WP_CLI::line( 'The level is: ' . print_r( $level, true ) );// TODO remove after testing
|
257 |
// For multisite
|
258 |
if ( is_multisite() ) {
|
259 |
WP_CLI::line( 'The WordPress install is multisite!' );
|
@@ -264,6 +282,9 @@ class Breeze_Settings_Import_Export {
|
|
264 |
|
265 |
foreach ( $options as $meta_key => $meta_value ) {
|
266 |
|
|
|
|
|
|
|
267 |
if ( false !== strpos( $meta_key, 'breeze_' ) ) {
|
268 |
update_site_option( $meta_key, $meta_value );
|
269 |
WP_CLI::line( $meta_key . ' - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
@@ -283,9 +304,13 @@ class Breeze_Settings_Import_Export {
|
|
283 |
WP_CLI::line( WP_CLI::colorize( '%GUpdating%n %M' . $site_url . '%n options' ) );
|
284 |
$blog_id = $level;
|
285 |
|
286 |
-
switch_to_blog( $blog_id);
|
287 |
|
288 |
foreach ( $options as $meta_key => $meta_value ) {
|
|
|
|
|
|
|
|
|
289 |
if ( false !== strpos( $meta_key, 'breeze_' ) ) {
|
290 |
update_blog_option( $blog_id, $meta_key, $meta_value );
|
291 |
WP_CLI::line( $meta_key . ' - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
@@ -301,6 +326,10 @@ class Breeze_Settings_Import_Export {
|
|
301 |
} else {
|
302 |
WP_CLI::line( WP_CLI::colorize( '%GUpdating%n %MBreeze%n options' ) );
|
303 |
foreach ( $options as $meta_key => $meta_value ) {
|
|
|
|
|
|
|
|
|
304 |
if ( false !== strpos( $meta_key, 'breeze_' ) ) {
|
305 |
update_option( $meta_key, $meta_value );
|
306 |
WP_CLI::line( $meta_key . ' - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
@@ -313,8 +342,395 @@ class Breeze_Settings_Import_Export {
|
|
313 |
}
|
314 |
|
315 |
do_action( 'breeze_clear_all_cache' );
|
|
|
316 |
return true;
|
317 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
318 |
}
|
319 |
|
320 |
new Breeze_Settings_Import_Export();
|
27 |
|
28 |
}
|
29 |
|
30 |
+
set_as_network_screen();
|
31 |
+
|
32 |
if ( isset( $_FILES['breeze_import_file'] ) ) {
|
33 |
$allowed_extension = array( 'json' );
|
34 |
$temp = explode( '.', $_FILES['breeze_import_file']['name'] );
|
55 |
if ( is_multisite() ) {
|
56 |
$level = ( isset( $_POST['network_level'] ) ) ? trim( $_POST['network_level'] ) : '';
|
57 |
}
|
58 |
+
if ( ! isset( $json['breeze_file_settings'] ) && ! isset( $json['breeze_preload_settings'] ) ) {
|
59 |
+
$action = self::replace_options_old_to_new( $json, $level );
|
60 |
+
} else {
|
61 |
+
$action = $this->replace_options( $json, $level );
|
62 |
+
}
|
63 |
+
|
64 |
+
|
65 |
if ( false === $action ) {
|
66 |
wp_send_json_error( new WP_Error( 'option_read', __( 'Could not read the options from the provided JSON file', 'breeze' ) ) );
|
67 |
} elseif ( true !== $action ) {
|
126 |
$breeze_advanced_settings = get_site_option( 'breeze_advanced_settings' );
|
127 |
$breeze_cdn_integration = get_site_option( 'breeze_cdn_integration' );
|
128 |
$breeze_varnish_cache = get_site_option( 'breeze_varnish_cache' );
|
129 |
+
$breeze_file_settings = get_site_option( 'breeze_file_settings' );
|
130 |
+
$breeze_preload_settings = get_site_option( 'breeze_preload_settings' );
|
131 |
|
132 |
// Extra options
|
133 |
$breeze_first_install = get_site_option( 'breeze_first_install' );
|
134 |
$breeze_advanced_settings_120 = get_site_option( 'breeze_advanced_settings_120' );
|
135 |
} else { // if this export is made from sub-site.
|
136 |
+
$network_id = (int) $level;
|
137 |
$breeze_basic_settings = get_blog_option( $network_id, 'breeze_basic_settings' );
|
138 |
$breeze_advanced_settings = get_blog_option( $network_id, 'breeze_advanced_settings' );
|
139 |
$breeze_cdn_integration = get_blog_option( $network_id, 'breeze_cdn_integration' );
|
140 |
$breeze_varnish_cache = get_blog_option( $network_id, 'breeze_varnish_cache' );
|
141 |
+
$breeze_file_settings = get_blog_option( $network_id, 'breeze_file_settings' );
|
142 |
+
$breeze_preload_settings = get_blog_option( $network_id, 'breeze_preload_settings' );
|
143 |
|
144 |
// Extra options
|
145 |
$breeze_first_install = get_blog_option( $network_id, 'breeze_first_install' );
|
152 |
$breeze_advanced_settings = get_option( 'breeze_advanced_settings' );
|
153 |
$breeze_cdn_integration = get_option( 'breeze_cdn_integration' );
|
154 |
$breeze_varnish_cache = get_option( 'breeze_varnish_cache' );
|
155 |
+
$breeze_file_settings = get_option( 'breeze_file_settings' );
|
156 |
+
$breeze_preload_settings = get_option( 'breeze_preload_settings' );
|
157 |
|
158 |
// Extra options
|
159 |
$breeze_first_install = get_option( 'breeze_first_install' );
|
|
|
160 |
$breeze_ecommerce_detect = get_option( 'breeze_ecommerce_detect' );
|
161 |
$breeze_advanced_settings_120 = get_option( 'breeze_advanced_settings_120' );
|
162 |
}
|
173 |
if ( isset( $breeze_inherit_settings ) ) {
|
174 |
$export['breeze_inherit_settings'] = $breeze_inherit_settings;
|
175 |
}
|
176 |
+
if ( isset( $breeze_preload_settings ) ) {
|
177 |
+
$export['breeze_preload_settings'] = $breeze_preload_settings;
|
178 |
+
}
|
179 |
+
if ( isset( $breeze_file_settings ) ) {
|
180 |
+
$export['breeze_file_settings'] = $breeze_file_settings;
|
181 |
+
}
|
182 |
if ( isset( $breeze_ecommerce_detect ) ) {
|
183 |
$export['breeze_ecommerce_detect'] = $breeze_ecommerce_detect;
|
184 |
}
|
272 |
return false;
|
273 |
}
|
274 |
|
|
|
275 |
// For multisite
|
276 |
if ( is_multisite() ) {
|
277 |
WP_CLI::line( 'The WordPress install is multisite!' );
|
282 |
|
283 |
foreach ( $options as $meta_key => $meta_value ) {
|
284 |
|
285 |
+
// Validate options.
|
286 |
+
$meta_value = self::validate_option_group( $meta_value, $meta_key );
|
287 |
+
|
288 |
if ( false !== strpos( $meta_key, 'breeze_' ) ) {
|
289 |
update_site_option( $meta_key, $meta_value );
|
290 |
WP_CLI::line( $meta_key . ' - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
304 |
WP_CLI::line( WP_CLI::colorize( '%GUpdating%n %M' . $site_url . '%n options' ) );
|
305 |
$blog_id = $level;
|
306 |
|
307 |
+
switch_to_blog( $blog_id );
|
308 |
|
309 |
foreach ( $options as $meta_key => $meta_value ) {
|
310 |
+
|
311 |
+
// Validate options.
|
312 |
+
$meta_value = self::validate_option_group( $meta_value, $meta_key );
|
313 |
+
|
314 |
if ( false !== strpos( $meta_key, 'breeze_' ) ) {
|
315 |
update_blog_option( $blog_id, $meta_key, $meta_value );
|
316 |
WP_CLI::line( $meta_key . ' - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
326 |
} else {
|
327 |
WP_CLI::line( WP_CLI::colorize( '%GUpdating%n %MBreeze%n options' ) );
|
328 |
foreach ( $options as $meta_key => $meta_value ) {
|
329 |
+
|
330 |
+
// Validate options.
|
331 |
+
$meta_value = self::validate_option_group( $meta_value, $meta_key );
|
332 |
+
|
333 |
if ( false !== strpos( $meta_key, 'breeze_' ) ) {
|
334 |
update_option( $meta_key, $meta_value );
|
335 |
WP_CLI::line( $meta_key . ' - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
342 |
}
|
343 |
|
344 |
do_action( 'breeze_clear_all_cache' );
|
345 |
+
|
346 |
return true;
|
347 |
}
|
348 |
+
|
349 |
+
/**
|
350 |
+
* Import settings using interface in back-end.
|
351 |
+
* Migrate old settings to the new format created in v2.0.0.
|
352 |
+
*
|
353 |
+
* @param array $options_imported The array with options from import action.
|
354 |
+
* @param string $level empty for single site, network for root multisite, numeric for subside ID.
|
355 |
+
* @param bool $show_cli_messages Display CLI messages in the terminal when using import by WP-CLI.
|
356 |
+
*
|
357 |
+
* @return bool
|
358 |
+
*
|
359 |
+
* @access private
|
360 |
+
* @since 2.0.0
|
361 |
+
*/
|
362 |
+
public static function replace_options_old_to_new( $options_imported = array(), $level = '', $show_cli_messages = false ) {
|
363 |
+
if ( empty( $options_imported ) ) {
|
364 |
+
return false;
|
365 |
+
}
|
366 |
+
|
367 |
+
$options = array();
|
368 |
+
if ( true === $show_cli_messages ) {
|
369 |
+
WP_CLI::line( 'Preparing JSON options...' );
|
370 |
+
}
|
371 |
+
|
372 |
+
foreach ( $options_imported as $option_name => $option_values ) {
|
373 |
+
if ( ! is_null( $option_values ) ) {
|
374 |
+
if ( is_array( $option_values ) ) {
|
375 |
+
foreach ( $option_values as $val_key => $val_value ) {
|
376 |
+
$options[ $val_key ] = self::validate_json_entry( $val_value, $val_key );
|
377 |
+
}
|
378 |
+
} else {
|
379 |
+
$options[ $option_name ] = self::validate_json_entry( $option_values, $option_name );
|
380 |
+
}
|
381 |
+
}
|
382 |
+
}
|
383 |
+
|
384 |
+
if ( ! empty( $options ) ) {
|
385 |
+
$basic = array(
|
386 |
+
'breeze-active' => ( isset( $options['breeze-active'] ) ? $options['breeze-active'] : '1' ),
|
387 |
+
'breeze-cross-origin' => ( isset( $options['breeze-cross-origin'] ) ? $options['breeze-cross-origin'] : '0' ),
|
388 |
+
'breeze-disable-admin' => ( isset( $options['breeze-disable-admin'] ) ? $options['breeze-disable-admin'] : array() ),
|
389 |
+
'breeze-gzip-compression' => ( isset( $options['breeze-gzip-compression'] ) ? $options['breeze-gzip-compression'] : '1' ),
|
390 |
+
'breeze-browser-cache' => ( isset( $options['breeze-browser-cache'] ) ? $options['breeze-browser-cache'] : '1' ),
|
391 |
+
'breeze-lazy-load' => ( isset( $options['breeze-lazy-load'] ) ? $options['breeze-lazy-load'] : '0' ),
|
392 |
+
'breeze-lazy-load-native' => ( isset( $options['breeze-lazy-load-native'] ) ? $options['breeze-lazy-load-native'] : '0' ),
|
393 |
+
'breeze-desktop-cache' => '1',
|
394 |
+
'breeze-mobile-cache' => '1',
|
395 |
+
'breeze-display-clean' => '1',
|
396 |
+
'breeze-ttl' => ( isset( $options['breeze-ttl'] ) ? $options['breeze-ttl'] : 1440 ),
|
397 |
+
);
|
398 |
+
|
399 |
+
$file = array(
|
400 |
+
'breeze-minify-html' => ( isset( $options['breeze-minify-html'] ) ? $options['breeze-minify-html'] : '0' ),
|
401 |
+
// --
|
402 |
+
'breeze-minify-css' => ( isset( $options['breeze-minify-css'] ) ? $options['breeze-minify-css'] : '0' ),
|
403 |
+
'breeze-font-display-swap' => ( isset( $options['breeze-font-display-swap'] ) ? $options['breeze-font-display-swap'] : '0' ),
|
404 |
+
'breeze-group-css' => ( isset( $options['breeze-group-css'] ) ? $options['breeze-group-css'] : '0' ),
|
405 |
+
'breeze-exclude-css' => ( isset( $options['breeze-exclude-css'] ) ? $options['breeze-exclude-css'] : array() ),
|
406 |
+
'breeze-include-inline-css' => ( isset( $options['breeze-include-inline-css'] ) ? $options['breeze-include-inline-css'] : '0' ),
|
407 |
+
// --
|
408 |
+
'breeze-minify-js' => ( isset( $options['breeze-minify-js'] ) ? $options['breeze-minify-js'] : '0' ),
|
409 |
+
'breeze-group-js' => ( isset( $options['breeze-group-js'] ) ? $options['breeze-group-js'] : '0' ),
|
410 |
+
'breeze-include-inline-js' => ( isset( $options['breeze-include-inline-js'] ) ? $options['breeze-include-inline-js'] : '0' ),
|
411 |
+
'breeze-exclude-js' => ( isset( $options['breeze-exclude-js'] ) ? $options['breeze-exclude-js'] : array() ),
|
412 |
+
'breeze-move-to-footer-js' => ( isset( $options['breeze-move-to-footer-js'] ) ? $options['breeze-move-to-footer-js'] : array() ),
|
413 |
+
'breeze-defer-js' => ( isset( $options['breeze-defer-js'] ) ? $options['breeze-defer-js'] : array() ),
|
414 |
+
'breeze-enable-js-delay' => ( isset( $options['breeze-enable-js-delay'] ) ? $options['breeze-enable-js-delay'] : '0' ),
|
415 |
+
'breeze-delay-js-scripts' => ( isset( $options['breeze-delay-js-scripts'] ) ? $options['breeze-delay-js-scripts'] : array() ),
|
416 |
+
|
417 |
+
);
|
418 |
+
|
419 |
+
$preload = array(
|
420 |
+
'breeze-preload-fonts' => ( isset( $options['breeze-preload-fonts'] ) ? $options['breeze-preload-fonts'] : array() ),
|
421 |
+
'breeze-preload-links' => ( isset( $options['breeze-preload-links'] ) ? $options['breeze-preload-links'] : '0' ),
|
422 |
+
);
|
423 |
+
|
424 |
+
$advanced = array(
|
425 |
+
'breeze-exclude-urls' => ( isset( $options['breeze-exclude-urls'] ) ? $options['breeze-exclude-urls'] : array() ),
|
426 |
+
'cached-query-strings' => ( isset( $options['cached-query-strings'] ) ? $options['cached-query-strings'] : array() ),
|
427 |
+
'breeze-wp-emoji' => ( isset( $options['breeze-wp-emoji'] ) ? $options['breeze-wp-emoji'] : '0' ),
|
428 |
+
);
|
429 |
+
|
430 |
+
$wp_content = substr( WP_CONTENT_DIR, strlen( ABSPATH ) );
|
431 |
+
$cdn = array(
|
432 |
+
'cdn-active' => ( isset( $options['cdn-active'] ) ? $options['cdn-active'] : '0' ),
|
433 |
+
'cdn-relative-path' => ( isset( $options['cdn-relative-path'] ) ? $options['cdn-relative-path'] : '1' ),
|
434 |
+
'cdn-url' => ( isset( $options['cdn-url'] ) ? $options['cdn-url'] : '' ),
|
435 |
+
'cdn-content' => ( isset( $options['cdn-content'] ) ? $options['cdn-content'] : array( 'wp-includes', $wp_content ) ),
|
436 |
+
'cdn-exclude-content' => ( isset( $options['cdn-exclude-content'] ) ? $options['cdn-exclude-content'] : array( '.php' ) ),
|
437 |
+
);
|
438 |
+
|
439 |
+
$varnish = array(
|
440 |
+
'auto-purge-varnish' => ( isset( $options['auto-purge-varnish'] ) ? $options['auto-purge-varnish'] : '1' ),
|
441 |
+
'breeze-varnish-server-ip' => ( isset( $options['breeze-varnish-server-ip'] ) ? $options['breeze-varnish-server-ip'] : '127.0.0.1' ),
|
442 |
+
);
|
443 |
+
|
444 |
+
if ( is_multisite() ) {
|
445 |
+
if ( true === $show_cli_messages ) {
|
446 |
+
WP_CLI::line( 'The WordPress install is multisite!' );
|
447 |
+
}
|
448 |
+
if ( 'network' === $level ) {
|
449 |
+
if ( true === $show_cli_messages ) {
|
450 |
+
WP_CLI::line( WP_CLI::colorize( '%GUpdating%n %Mnetwork%n options' ) );
|
451 |
+
|
452 |
+
WP_CLI::line( ' breeze_basic_settings - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
453 |
+
WP_CLI::line( ' breeze_file_settings - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
454 |
+
WP_CLI::line( ' breeze_preload_settings - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
455 |
+
WP_CLI::line( ' breeze_advanced_settings - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
456 |
+
WP_CLI::line( ' breeze_cdn_integration - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
457 |
+
WP_CLI::line( ' breeze_varnish_cache - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
458 |
+
}
|
459 |
+
update_site_option( 'breeze_basic_settings', $basic );
|
460 |
+
update_site_option( 'breeze_file_settings', $file );
|
461 |
+
update_site_option( 'breeze_preload_settings', $preload );
|
462 |
+
update_site_option( 'breeze_advanced_settings', $advanced );
|
463 |
+
update_site_option( 'breeze_cdn_integration', $cdn );
|
464 |
+
update_site_option( 'breeze_varnish_cache', $varnish );
|
465 |
+
|
466 |
+
Breeze_ConfigCache::factory()->write_config_cache( true );
|
467 |
+
} else {
|
468 |
+
$blog_id = absint( $level );
|
469 |
+
switch_to_blog( $blog_id );
|
470 |
+
|
471 |
+
if ( true === $show_cli_messages ) {
|
472 |
+
$is_blog = get_blog_details( $level );
|
473 |
+
$site_url = $is_blog->siteurl;
|
474 |
+
WP_CLI::line( WP_CLI::colorize( '%GUpdating%n %M' . $site_url . '%n options' ) );
|
475 |
+
|
476 |
+
WP_CLI::line( ' breeze_basic_settings - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
477 |
+
WP_CLI::line( ' breeze_file_settings - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
478 |
+
WP_CLI::line( ' breeze_preload_settings - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
479 |
+
WP_CLI::line( ' breeze_advanced_settings - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
480 |
+
WP_CLI::line( ' breeze_cdn_integration - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
481 |
+
WP_CLI::line( ' breeze_varnish_cache - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
482 |
+
}
|
483 |
+
|
484 |
+
update_blog_option( $blog_id, 'breeze_basic_settings', $basic );
|
485 |
+
update_blog_option( $blog_id, 'breeze_file_settings', $file );
|
486 |
+
update_blog_option( $blog_id, 'breeze_preload_settings', $preload );
|
487 |
+
update_blog_option( $blog_id, 'breeze_advanced_settings', $advanced );
|
488 |
+
update_blog_option( $blog_id, 'breeze_cdn_integration', $cdn );
|
489 |
+
update_blog_option( $blog_id, 'breeze_varnish_cache', $varnish );
|
490 |
+
|
491 |
+
Breeze_ConfigCache::factory()->write_config_cache();
|
492 |
+
restore_current_blog();
|
493 |
+
}
|
494 |
+
} else {
|
495 |
+
if ( true === $show_cli_messages ) {
|
496 |
+
WP_CLI::line( WP_CLI::colorize( '%GUpdating%n %MBreeze%n options' ) );
|
497 |
+
|
498 |
+
WP_CLI::line( ' breeze_basic_settings - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
499 |
+
WP_CLI::line( ' breeze_file_settings - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
500 |
+
WP_CLI::line( ' breeze_preload_settings - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
501 |
+
WP_CLI::line( ' breeze_advanced_settings - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
502 |
+
WP_CLI::line( ' breeze_cdn_integration - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
503 |
+
WP_CLI::line( ' breeze_varnish_cache - ' . WP_CLI::colorize( '%Yimported%n' ) );
|
504 |
+
}
|
505 |
+
update_option( 'breeze_basic_settings', $basic );
|
506 |
+
update_option( 'breeze_file_settings', $file );
|
507 |
+
update_option( 'breeze_preload_settings', $preload );
|
508 |
+
update_option( 'breeze_advanced_settings', $advanced );
|
509 |
+
update_option( 'breeze_cdn_integration', $cdn );
|
510 |
+
update_option( 'breeze_varnish_cache', $varnish );
|
511 |
+
|
512 |
+
Breeze_ConfigCache::factory()->write_config_cache();
|
513 |
+
}
|
514 |
+
|
515 |
+
do_action( 'breeze_clear_all_cache' );
|
516 |
+
|
517 |
+
return true;
|
518 |
+
}
|
519 |
+
if ( true === $show_cli_messages ) {
|
520 |
+
WP_CLI::line( WP_CLI::colorize( '%RJSON values are not valid%n' ) );
|
521 |
+
}
|
522 |
+
|
523 |
+
return false;
|
524 |
+
}
|
525 |
+
|
526 |
+
/**
|
527 |
+
* Validates the options making sure there values are
|
528 |
+
* the correct format for each option.
|
529 |
+
*
|
530 |
+
* @param mixed $value Imported option value.
|
531 |
+
* @param string $option Breeze option name.
|
532 |
+
*
|
533 |
+
*
|
534 |
+
* @return array|mixed|string|void|null
|
535 |
+
* @access private
|
536 |
+
* @since 2.0.0
|
537 |
+
* @static
|
538 |
+
*/
|
539 |
+
private static function validate_json_entry( $value, $option = '' ) {
|
540 |
+
|
541 |
+
/**
|
542 |
+
* Treat options that are not checkbox or array.
|
543 |
+
*/
|
544 |
+
|
545 |
+
if ( 'breeze_advanced_settings_120' === $option ) {
|
546 |
+
if ( 'no' !== $value && 'yes' !== $value ) {
|
547 |
+
return 'no';
|
548 |
+
}
|
549 |
+
|
550 |
+
return $value;
|
551 |
+
}
|
552 |
+
|
553 |
+
if ( 'breeze_ecommerce_detect' === $option ) {
|
554 |
+
if ( ! is_bool( $value ) ) {
|
555 |
+
return false;
|
556 |
+
}
|
557 |
+
|
558 |
+
return $value;
|
559 |
+
}
|
560 |
+
|
561 |
+
if ( 'breeze-varnish-server-ip' === $option ) {
|
562 |
+
if ( empty( $value ) ) {
|
563 |
+
return '127.0.0.1';
|
564 |
+
}
|
565 |
+
|
566 |
+
return $value;
|
567 |
+
}
|
568 |
+
|
569 |
+
if ( 'cdn-url' === $option ) {
|
570 |
+
if ( empty( $value ) ) {
|
571 |
+
return '';
|
572 |
+
}
|
573 |
+
|
574 |
+
return $value;
|
575 |
+
}
|
576 |
+
|
577 |
+
if ( 'breeze_first_install' === $option ) {
|
578 |
+
if ( 'no' !== $value && 'yes' !== $value ) {
|
579 |
+
return 'no';
|
580 |
+
}
|
581 |
+
|
582 |
+
return $value;
|
583 |
+
}
|
584 |
+
|
585 |
+
if ( 'breeze-ttl' === $option ) {
|
586 |
+
if ( ! is_numeric( $value ) ) {
|
587 |
+
return 1440;
|
588 |
+
}
|
589 |
+
|
590 |
+
return $value;
|
591 |
+
}
|
592 |
+
|
593 |
+
|
594 |
+
/**
|
595 |
+
* Validate all the checkboxes.
|
596 |
+
* Include the default values.
|
597 |
+
*/
|
598 |
+
$checkboxes = array(
|
599 |
+
'breeze-active' => '1',
|
600 |
+
'breeze-cross-origin' => '0',
|
601 |
+
'breeze-gzip-compression' => '1',
|
602 |
+
'breeze-browser-cache' => '1',
|
603 |
+
'breeze-lazy-load' => '0',
|
604 |
+
'breeze-lazy-load-native' => '0',
|
605 |
+
'breeze-desktop-cache' => '1',
|
606 |
+
'breeze-mobile-cache' => '1',
|
607 |
+
'breeze-display-clean' => '1',
|
608 |
+
'breeze-minify-html' => '0',
|
609 |
+
'breeze-minify-css' => '0',
|
610 |
+
'breeze-font-display-swap' => '0',
|
611 |
+
'breeze-group-css' => '0',
|
612 |
+
'breeze-include-inline-css' => '0',
|
613 |
+
'breeze-minify-js' => '0',
|
614 |
+
'breeze-group-js' => '0',
|
615 |
+
'breeze-include-inline-js' => '0',
|
616 |
+
'breeze-enable-js-delay' => '0',
|
617 |
+
'breeze-preload-links' => '0',
|
618 |
+
'breeze-wp-emoji' => '0',
|
619 |
+
'cdn-active' => '0',
|
620 |
+
'cdn-relative-path' => '1',
|
621 |
+
'auto-purge-varnish' => '1',
|
622 |
+
'breeze_inherit_settings' => '0',
|
623 |
+
);
|
624 |
+
|
625 |
+
if ( array_key_exists( $option, $checkboxes ) ) {
|
626 |
+
if ( '1' === $value || '0' === $value ) {
|
627 |
+
return $value;
|
628 |
+
} else {
|
629 |
+
|
630 |
+
return $checkboxes[ $option ];
|
631 |
+
}
|
632 |
+
}
|
633 |
+
|
634 |
+
$wp_content = substr( WP_CONTENT_DIR, strlen( ABSPATH ) );
|
635 |
+
$all_user_roles = breeze_all_wp_user_roles();
|
636 |
+
$active_cache_users = array();
|
637 |
+
foreach ( $all_user_roles as $usr_role ) {
|
638 |
+
$active_cache_users[ $usr_role ] = 0;
|
639 |
+
|
640 |
+
}
|
641 |
+
|
642 |
+
/**
|
643 |
+
* Validate all the options that should have array values.
|
644 |
+
*/
|
645 |
+
$array_list = array(
|
646 |
+
'breeze-disable-admin' => $active_cache_users,
|
647 |
+
'breeze-exclude-css' => array(),
|
648 |
+
'breeze-exclude-js' => array(),
|
649 |
+
'breeze-move-to-footer-js' => array(),
|
650 |
+
'breeze-defer-js' => array(),
|
651 |
+
'breeze-delay-js-scripts' => array(
|
652 |
+
'gtag',
|
653 |
+
'document.write',
|
654 |
+
'html5.js',
|
655 |
+
'show_ads.js',
|
656 |
+
'google_ad',
|
657 |
+
'blogcatalog.com/w',
|
658 |
+
'tweetmeme.com/i',
|
659 |
+
'mybloglog.com/',
|
660 |
+
'histats.com/js',
|
661 |
+
'ads.smowtion.com/ad.js',
|
662 |
+
'statcounter.com/counter/counter.js',
|
663 |
+
'widgets.amung.us',
|
664 |
+
'ws.amazon.com/widgets',
|
665 |
+
'media.fastclick.net',
|
666 |
+
'/ads/',
|
667 |
+
'comment-form-quicktags/quicktags.php',
|
668 |
+
'edToolbar',
|
669 |
+
'intensedebate.com',
|
670 |
+
'scripts.chitika.net/',
|
671 |
+
'_gaq.push',
|
672 |
+
'jotform.com/',
|
673 |
+
'admin-bar.min.js',
|
674 |
+
'GoogleAnalyticsObject',
|
675 |
+
'plupload.full.min.js',
|
676 |
+
'syntaxhighlighter',
|
677 |
+
'adsbygoogle',
|
678 |
+
'gist.github.com',
|
679 |
+
'_stq',
|
680 |
+
'nonce',
|
681 |
+
'post_id',
|
682 |
+
'data-noptimize',
|
683 |
+
'googletagmanager',
|
684 |
+
),
|
685 |
+
'breeze-preload-fonts' => array(),
|
686 |
+
'breeze-exclude-urls' => array(),
|
687 |
+
'cached-query-strings' => array(),
|
688 |
+
'cdn-content' => array( 'wp-includes', $wp_content ),
|
689 |
+
'cdn-exclude-content' => array( '.php' ),
|
690 |
+
);
|
691 |
+
|
692 |
+
if ( array_key_exists( $option, $array_list ) ) {
|
693 |
+
if ( is_array( $value ) ) {
|
694 |
+
return $value;
|
695 |
+
} else {
|
696 |
+
|
697 |
+
return $array_list[ $option ];
|
698 |
+
}
|
699 |
+
}
|
700 |
+
|
701 |
+
return '0';
|
702 |
+
}
|
703 |
+
|
704 |
+
/**
|
705 |
+
* Validate all the options in the group given.
|
706 |
+
*
|
707 |
+
* @param $option_group
|
708 |
+
* @param $group_name
|
709 |
+
*
|
710 |
+
* @return array
|
711 |
+
* @access private
|
712 |
+
* @since 2.0.0
|
713 |
+
* @static
|
714 |
+
*/
|
715 |
+
private static function validate_option_group( $option_group, $group_name ) {
|
716 |
+
if ( ! array( $option_group ) ) {
|
717 |
+
return array();
|
718 |
+
}
|
719 |
+
|
720 |
+
$changed_options = $option_group;
|
721 |
+
|
722 |
+
if ( ! empty( $option_group ) && is_array( $option_group ) ) {
|
723 |
+
|
724 |
+
foreach ( $option_group as $option_name => $option_value ) {
|
725 |
+
$changed_options[ $option_name ] = self::validate_json_entry( $option_value, $option_name );
|
726 |
+
}
|
727 |
+
|
728 |
+
return $changed_options;
|
729 |
+
} else {
|
730 |
+
|
731 |
+
return self::validate_json_entry( $option_group, $group_name );
|
732 |
+
}
|
733 |
+
}
|
734 |
}
|
735 |
|
736 |
new Breeze_Settings_Import_Export();
|
inc/wp-cli/class-breeze-wp-cli-core.php
CHANGED
@@ -357,8 +357,12 @@ class Breeze_WP_Cli_Core extends \WP_CLI_Command {
|
|
357 |
);
|
358 |
}
|
359 |
}
|
|
|
|
|
|
|
|
|
|
|
360 |
|
361 |
-
$settings_action = Breeze_Settings_Import_Export::replace_options_cli( $json, $level );
|
362 |
|
363 |
if ( true === $settings_action ) {
|
364 |
WP_CLI::success(
|
357 |
);
|
358 |
}
|
359 |
}
|
360 |
+
if ( ! isset( $json['breeze_file_settings'] ) && ! isset( $json['breeze_preload_settings'] ) ) {
|
361 |
+
$settings_action = Breeze_Settings_Import_Export::replace_options_old_to_new( $json, $level, true );
|
362 |
+
} else {
|
363 |
+
$settings_action = Breeze_Settings_Import_Export::replace_options_cli( $json, $level );
|
364 |
+
}
|
365 |
|
|
|
366 |
|
367 |
if ( true === $settings_action ) {
|
368 |
WP_CLI::success(
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: Cloudways
|
|
3 |
Tags: cache,caching, performance, wp-cache, cdn, combine, compress, speed plugin, database cache,gzip, http compression, js cache, minify, optimize, page cache, performance, speed, expire headers
|
4 |
Requires at least: 4.5
|
5 |
Tested up to: 5.8
|
6 |
-
Stable tag:
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -145,6 +145,15 @@ Using Gzip, Breeze compresses the request files, further reducing the size of th
|
|
145 |
|
146 |
== Changelog ==
|
147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
= 1.2.6 =
|
149 |
|
150 |
* Add: Varnish cache will be clear while plugin deactivate.
|
3 |
Tags: cache,caching, performance, wp-cache, cdn, combine, compress, speed plugin, database cache,gzip, http compression, js cache, minify, optimize, page cache, performance, speed, expire headers
|
4 |
Requires at least: 4.5
|
5 |
Tested up to: 5.8
|
6 |
+
Stable tag: 2.0.0
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
145 |
|
146 |
== Changelog ==
|
147 |
|
148 |
+
= 2.0.0 =
|
149 |
+
|
150 |
+
* Add: Implement a new UI interface.
|
151 |
+
* Fix: Duplicate script while using the option Move JS Files to Footer.
|
152 |
+
* Fix: Improvise the optimization of WordPress core functions to clean the database correctly.
|
153 |
+
* Fix: Implement condition in .htaccess rules while disable "mod_env”.
|
154 |
+
* Fix: Compatibility issue with Facebook For WooCommerce plugin.
|
155 |
+
|
156 |
+
|
157 |
= 1.2.6 =
|
158 |
|
159 |
* Add: Varnish cache will be clear while plugin deactivate.
|
views/breeze-setting-views.php
CHANGED
@@ -2,135 +2,160 @@
|
|
2 |
|
3 |
defined( 'ABSPATH' ) or die;
|
4 |
|
5 |
-
$tabs = array(
|
6 |
-
'basic' => __( 'BASIC OPTIONS', 'breeze' ),
|
7 |
-
'advanced' => __( 'ADVANCED OPTIONS', 'breeze' ),
|
8 |
-
'database' => __( 'DATABASE', 'breeze' ),
|
9 |
-
'cdn' => __( 'CDN', 'breeze' ),
|
10 |
-
'varnish' => __( 'VARNISH', 'breeze' ),
|
11 |
-
'import_export' => __( 'IMPORT/EXPORT', 'breeze' ),
|
12 |
-
'faq' => __( 'FAQs', 'breeze' ),
|
13 |
-
);
|
14 |
-
|
15 |
$global_tabs = array(
|
16 |
'faq',
|
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 |
-
$inherit_settings = get_option( 'breeze_inherit_settings', 1 );
|
44 |
-
if ( 0 != $inherit_settings ) {
|
45 |
-
$inherit_settings = 1;
|
46 |
-
$show_tabs = false;
|
47 |
-
}
|
48 |
-
?>
|
49 |
-
<form id="breeze-inherit-settings-toggle" class="breeze-form" method="post" action="">
|
50 |
-
<div class="radio-field<?php echo $inherit_settings == 1 ? ' active' : ''; ?>">
|
51 |
-
<label>
|
52 |
-
<input type="radio" id="inherit-settings" name="inherit-settings" value="1" <?php checked( $inherit_settings, 1 ); ?>>
|
53 |
-
<strong><?php esc_html_e( 'Use Network Level Settings for this site', 'breeze' ); ?>:</strong>
|
54 |
-
</label>
|
55 |
-
<small><?php esc_html_e( 'This option allows the subsite to inherit all the cache settings from network. To modify/update the settings please go to network site.', 'breeze' ); ?></small>
|
56 |
-
</div>
|
57 |
-
<div class="radio-field<?php echo $inherit_settings == 0 ? ' active' : ''; ?>">
|
58 |
-
<label>
|
59 |
-
<input type="radio" id="inherit-settings" name="inherit-settings" value="0" <?php checked( $inherit_settings, 0 ); ?>>
|
60 |
-
<strong><?php esc_html_e( 'Use Custom Settings for this site', 'breeze' ); ?>:</strong>
|
61 |
-
</label>
|
62 |
-
<small><?php esc_html_e( 'This option allows subsite to have different settings/configuration from the network level. Use this option only if you wish to have separate settings for this subsite.', 'breeze' ); ?></small>
|
63 |
-
</div>
|
64 |
-
|
65 |
-
<p class="disclaimer"><?php esc_html_e( 'To apply your changes, please click on the Save Changes button.', 'breeze' ); ?></p>
|
66 |
-
|
67 |
-
<?php wp_nonce_field( 'breeze_inherit_settings', 'breeze_inherit_settings_nonce' ); ?>
|
68 |
-
</form>
|
69 |
|
70 |
-
|
71 |
-
|
72 |
}
|
|
|
|
|
|
|
|
|
|
|
73 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
<?php
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
}
|
81 |
-
?>
|
82 |
-
</ul>
|
83 |
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
echo '<div class="tab-child">';
|
91 |
-
echo '<input type="hidden" name="breeze_' . $key . '_action" value="breeze_' . $key . '_settings">';
|
92 |
-
wp_nonce_field( 'breeze_settings_' . $key, 'breeze_settings_' . $key . '_nonce' );
|
93 |
-
Breeze_Admin::render( $key );
|
94 |
-
echo '</div>';
|
95 |
-
|
96 |
-
if (
|
97 |
-
$key != 'faq' &&
|
98 |
-
( $key != 'database' || ( is_multisite() && ! is_network_admin() ) )
|
99 |
-
) {
|
100 |
-
if ( is_multisite() && is_network_admin() ) {
|
101 |
-
echo '<p class="multisite-inherit-disclaimer">' . __( '* Any change here will also be applied to all the sub-sites that are using Network level settings.', 'wpr' ) . '</p>';
|
102 |
-
}
|
103 |
-
echo '<p class="submit">' . PHP_EOL .
|
104 |
-
'<input type="submit" class="button button-primary breeze-submit-btn" value="' . __( 'Save Changes', 'breeze' ) . '"/>' . PHP_EOL .
|
105 |
-
'</p>';
|
106 |
}
|
107 |
-
|
108 |
-
|
|
|
|
|
|
|
|
|
|
|
109 |
}
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
}
|
113 |
?>
|
114 |
|
115 |
-
<!--Right-side content-->
|
116 |
-
<div id="breeze-and-cloudways" class="rs-block">
|
117 |
-
<h3 class="rs-title"><?php _e( 'Want to Experience Better Performance?', 'breeze' ); ?></h3>
|
118 |
-
<div class="rs-content">
|
119 |
-
<p><?php _e( 'Take advantage of powerful features by deploying WordPress and Breeze on Cloudways.', 'breeze' ); ?></p>
|
120 |
-
<ul>
|
121 |
-
<li><?php _e( 'Fully Compatible with Varnish', 'breeze' ); ?></li>
|
122 |
-
<li><?php _e( 'One-Click setup of CloudwaysCDN', 'breeze' ); ?></li>
|
123 |
-
<li><?php _e( '24/7 Expert Human Support', 'breeze' ); ?></li>
|
124 |
-
<li><?php _e( 'WooCommerce Compatible', 'breeze' ); ?></li>
|
125 |
-
</ul>
|
126 |
-
<button class="button button-primary">
|
127 |
-
<a href="https://www.cloudways.com/en/wordpress-cloud-hosting.php?utm_source=breeze-plugin&utm_medium=breeze&utm_campaign=breeze" target="_blank"><?php _e( 'Find Out More', 'breeze' ); ?></a>
|
128 |
-
</button>
|
129 |
-
</div>
|
130 |
-
<div class="rs-content">
|
131 |
-
<h4><?php _e( 'Rate Breeze', 'breeze' ); ?></h4>
|
132 |
-
<p><?php _e( 'If you are satisfied with Breeze\'s performance, <a href="https://wordpress.org/plugins/breeze#reviews" target="_blank">drop us a rating here.</a>', 'breeze' ); ?></p>
|
133 |
-
</div>
|
134 |
-
</div>
|
135 |
</div>
|
|
|
136 |
</div>
|
2 |
|
3 |
defined( 'ABSPATH' ) or die;
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
$global_tabs = array(
|
6 |
'faq',
|
7 |
);
|
8 |
|
9 |
+
$breeze_option_tabs = array(
|
10 |
+
array(
|
11 |
+
'tab-slug' => 'basic',
|
12 |
+
'tab-name' => __( 'BASIC OPTIONS', 'breeze' ),
|
13 |
+
'tab-icon' => 'basic',
|
14 |
+
),
|
15 |
+
array(
|
16 |
+
'tab-slug' => 'file',
|
17 |
+
'tab-name' => __( 'FILE OPTIMIZATION', 'breeze' ),
|
18 |
+
'tab-icon' => 'file',
|
19 |
+
),
|
20 |
+
array(
|
21 |
+
'tab-slug' => 'preload',
|
22 |
+
'tab-name' => __( 'PRELOAD', 'breeze' ),
|
23 |
+
'tab-icon' => 'preload',
|
24 |
+
),
|
25 |
+
array(
|
26 |
+
'tab-slug' => 'advanced',
|
27 |
+
'tab-name' => __( 'ADVANCED OPTIONS', 'breeze' ),
|
28 |
+
'tab-icon' => 'advanced',
|
29 |
+
),
|
30 |
+
array(
|
31 |
+
'tab-slug' => 'database',
|
32 |
+
'tab-name' => __( 'DATABASE OPTIONS', 'breeze' ),
|
33 |
+
'tab-icon' => 'database',
|
34 |
+
),
|
35 |
+
// array(
|
36 |
+
// 'tab-slug' => 'varnish',
|
37 |
+
// 'tab-name' => __( 'VARNISH', 'breeze' ),
|
38 |
+
// 'tab-icon' => 'varnish',
|
39 |
+
// ),
|
40 |
+
array(
|
41 |
+
'tab-slug' => 'cdn',
|
42 |
+
'tab-name' => __( 'CDN', 'breeze' ),
|
43 |
+
'tab-icon' => 'cdn',
|
44 |
+
),
|
45 |
+
array(
|
46 |
+
'tab-slug' => 'varnish',
|
47 |
+
'tab-name' => __( 'VARNISH', 'breeze' ),
|
48 |
+
'tab-icon' => 'varnish',
|
49 |
+
),
|
50 |
+
array(
|
51 |
+
'tab-slug' => 'tools',
|
52 |
+
'tab-name' => __( 'TOOLS', 'breeze' ),
|
53 |
+
'tab-icon' => 'tools',
|
54 |
+
),
|
55 |
+
array(
|
56 |
+
'tab-slug' => 'faq',
|
57 |
+
'tab-name' => __( 'FAQs', 'breeze' ),
|
58 |
+
'tab-icon' => 'faqs',
|
59 |
+
),
|
60 |
+
);
|
61 |
|
62 |
+
$section_icons = array();
|
63 |
+
$section_title = array();
|
64 |
|
65 |
+
$show_tabs = true;
|
66 |
+
$is_subsite = is_multisite() && get_current_screen()->base !== 'settings_page_breeze-network';
|
67 |
|
68 |
+
$is_inherited_settings = false;
|
69 |
+
if ( $is_subsite ) {
|
70 |
+
// Show settings inherit option.
|
71 |
+
$inherit_settings = get_option( 'breeze_inherit_settings', '0' );
|
72 |
|
73 |
+
$is_inherited_settings = isset( $inherit_settings ) ? filter_var( $inherit_settings, FILTER_VALIDATE_BOOLEAN ) : false;
|
74 |
+
$check_inherit_setting = ( isset( $is_inherited_settings ) && false === $is_inherited_settings ) ? checked( $inherit_settings, '0', false ) : '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
+
if ( true === $is_inherited_settings ) {
|
77 |
+
$show_tabs = false;
|
78 |
}
|
79 |
+
|
80 |
+
$display_text = array(
|
81 |
+
'network' => ( true === $is_inherited_settings ) ? 'br-show' : 'br-hide',
|
82 |
+
'custom' => ( false === $is_inherited_settings ) ? 'br-show' : 'br-hide',
|
83 |
+
);
|
84 |
?>
|
85 |
+
<div style="width: 100%; margin-top: 30px;" class="change-settings-use">
|
86 |
+
<div class="on-off-checkbox settings-switcher">
|
87 |
+
<input id="inherit-settings" name="inherit-settings" type="checkbox" class="br-box" value="0" <?php echo $check_inherit_setting; ?>>
|
88 |
+
<label for="inherit-settings">
|
89 |
+
<div class="status-switch" data-unchecked="Inherit Network Settings" data-checked="Use Custom Settings"></div>
|
90 |
+
</label>
|
91 |
+
</div>
|
92 |
+
<p class="br-global-text-settings">
|
93 |
+
<span class="br-important br-is-network <?php echo esc_attr( $display_text['network'] ); ?>">
|
94 |
+
<strong><?php _e( 'Network Settings', 'breeze' ); ?></strong>:
|
95 |
+
<?php esc_html_e( 'This option allows the subsite to inherit all the cache settings from network. To modify/update the settings please go to network site.', 'breeze' ); ?>
|
96 |
+
</span>
|
97 |
|
98 |
+
<span class="br-is-custom <?php echo esc_attr( $display_text['custom'] ); ?>">
|
99 |
+
<strong><?php _e( 'Custom Settings', 'breeze' ); ?></strong>:
|
100 |
+
<?php esc_html_e( 'This option allows subsite to have different settings/configuration from the network level. Use this option only if you wish to have separate settings for this subsite.', 'breeze' ); ?>
|
101 |
+
</span>
|
102 |
+
</p>
|
103 |
+
<?php wp_nonce_field( 'breeze_inherit_settings', 'breeze_inherit_settings_nonce' ); ?>
|
104 |
+
|
105 |
+
</div>
|
106 |
+
<?php
|
107 |
+
}
|
108 |
+
?>
|
109 |
+
|
110 |
+
<div class="wrap breeze-box">
|
111 |
+
<div class="br-menu">
|
112 |
+
<div class="br-logo"> </div>
|
113 |
+
<div class="br-mobile-menu">
|
114 |
+
<span class="dashicons dashicons-menu"></span>
|
115 |
+
<?php _e( 'Open menu', 'breeze' ); ?>
|
116 |
+
</div>
|
117 |
<?php
|
118 |
+
$active_selected_tab = 'basic';
|
119 |
+
if ( isset( $_COOKIE['breeze_active_tab'] ) && ! empty( $_COOKIE['breeze_active_tab'] ) ) {
|
120 |
+
$active_selected_tab = trim( $_COOKIE['breeze_active_tab'] );
|
121 |
}
|
|
|
|
|
122 |
|
123 |
+
foreach ( $breeze_option_tabs as $item ) {
|
124 |
+
$active_css = '';
|
125 |
+
$icon = BREEZE_PLUGIN_URL . 'assets/images/' . esc_attr( $item['tab-icon'] . '.png' );
|
126 |
+
if ( $active_selected_tab === $item['tab-slug'] ) {
|
127 |
+
$active_css = ' br-active';
|
128 |
+
$icon = BREEZE_PLUGIN_URL . 'assets/images/' . esc_attr( $item['tab-icon'] . '-active.png' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
}
|
130 |
+
|
131 |
+
$section_icons[ $item['tab-slug'] ] = BREEZE_PLUGIN_URL . 'assets/images/' . esc_attr( $item['tab-icon'] . '.png' );
|
132 |
+
$section_title[ $item['tab-slug'] ] = esc_html( $item['tab-name'] );
|
133 |
+
|
134 |
+
$hide_item = '';
|
135 |
+
if ( true === $is_inherited_settings && 'faq' !== $item['tab-slug'] ) {
|
136 |
+
$hide_item = ' br-hide';
|
137 |
}
|
138 |
+
?>
|
139 |
+
<div class="br-link
|
140 |
+
<?php
|
141 |
+
echo esc_attr( $active_css );
|
142 |
+
echo esc_attr( $hide_item );
|
143 |
+
?>
|
144 |
+
" data-breeze-link="<?php echo esc_attr( $item['tab-slug'] ); ?>">
|
145 |
+
|
146 |
+
<?php
|
147 |
+
$key = $item['tab-slug'];
|
148 |
+
$is_inactive = false;
|
149 |
+
$name = mb_strtoupper( esc_html( $item['tab-name'] ) );
|
150 |
+
echo '<a id="tab-' . $key . '" class="' . ( $is_inactive ? ' inactive' : '' ) . '" href="#tab-' . $key . '" data-tab-id="' . $key . '">
|
151 |
+
<img src="' . $icon . '" data-path="' . BREEZE_PLUGIN_URL . 'assets/images/' . '"/> ' . $name . '
|
152 |
+
</a> ';
|
153 |
+
?>
|
154 |
+
</div>
|
155 |
+
<?php
|
156 |
}
|
157 |
?>
|
158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
</div>
|
160 |
+
<div class="br-options"></div>
|
161 |
</div>
|
views/option-tabs-loader.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Handles the ajax load for tabs.
|
5 |
+
*/
|
6 |
+
class Breeze_Tab_Loader {
|
7 |
+
|
8 |
+
function __construct() {
|
9 |
+
add_action( 'wp_ajax_breeze_load_options_tab', array( &$this, 'breeze_option_tab_display' ) );
|
10 |
+
}
|
11 |
+
|
12 |
+
function breeze_option_tab_display() {
|
13 |
+
$accepted_tabs = array(
|
14 |
+
'basic',
|
15 |
+
'file',
|
16 |
+
'preload',
|
17 |
+
'advanced',
|
18 |
+
'database',
|
19 |
+
'cdn',
|
20 |
+
'tools',
|
21 |
+
'faq',
|
22 |
+
'varnish',
|
23 |
+
);
|
24 |
+
|
25 |
+
$requested_tab = $_GET['request_tab'];
|
26 |
+
|
27 |
+
if ( ! in_array( $requested_tab, $accepted_tabs, true ) ) {
|
28 |
+
echo '<h3>The requested tab does not exist</h3>';
|
29 |
+
}
|
30 |
+
ob_start();
|
31 |
+
Breeze_Admin::render( $requested_tab );
|
32 |
+
$html_tab_data = ob_get_contents();
|
33 |
+
ob_end_clean();
|
34 |
+
|
35 |
+
echo $html_tab_data;
|
36 |
+
die();
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
new Breeze_Tab_Loader();
|
views/option-tabs/advanced-tab.php
ADDED
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Basic tab
|
4 |
+
*/
|
5 |
+
|
6 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
+
header( 'Status: 403 Forbidden' );
|
8 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
9 |
+
exit;
|
10 |
+
}
|
11 |
+
|
12 |
+
set_as_network_screen();
|
13 |
+
|
14 |
+
$is_custom = false;
|
15 |
+
if ( ( ! defined( 'WP_NETWORK_ADMIN' ) || ( defined( 'WP_NETWORK_ADMIN' ) && false === WP_NETWORK_ADMIN ) ) && is_multisite() ) {
|
16 |
+
$get_inherit = get_option( 'breeze_inherit_settings', '1' );
|
17 |
+
$is_custom = filter_var( $get_inherit, FILTER_VALIDATE_BOOLEAN );
|
18 |
+
}
|
19 |
+
|
20 |
+
|
21 |
+
$options = breeze_get_option( 'advanced_settings', true );
|
22 |
+
|
23 |
+
$icon = BREEZE_PLUGIN_URL . 'assets/images/advanced-active.png';
|
24 |
+
?>
|
25 |
+
<form data-section="advanced">
|
26 |
+
<?php if ( true === $is_custom ) { ?>
|
27 |
+
<div class="br-overlay-disable"><?php _e( 'Settings are inherited', 'breeze' ); ?></div>
|
28 |
+
<?php } ?>
|
29 |
+
<section>
|
30 |
+
<div class="br-section-title">
|
31 |
+
<img src="<?php echo $icon; ?>"/>
|
32 |
+
<?php _e( 'ADVANCED OPTIONS', 'breeze' ); ?>
|
33 |
+
</div>
|
34 |
+
|
35 |
+
<!-- START OPTION -->
|
36 |
+
<div class="br-option-item">
|
37 |
+
<div class="br-label">
|
38 |
+
<div class="br-option-text">
|
39 |
+
<?php _e( 'Never Cache URL(s)', 'breeze' ); ?>
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
<div class="br-option">
|
43 |
+
<p>
|
44 |
+
<?php _e( 'Specify URLs of Pages or posts that should never be cached (one per line)', 'breeze' ); ?>
|
45 |
+
</p>
|
46 |
+
<?php
|
47 |
+
$excluded_url_list = true;
|
48 |
+
|
49 |
+
if ( isset( $options['breeze-exclude-urls'] ) && ! empty( $options['breeze-exclude-urls'] ) ) {
|
50 |
+
$excluded_url_list = breeze_validate_urls( $options['breeze-exclude-urls'] );
|
51 |
+
}
|
52 |
+
|
53 |
+
|
54 |
+
$css_output = '';
|
55 |
+
if ( ! empty( $options['breeze-exclude-urls'] ) ) {
|
56 |
+
$output = implode( "\n", $options['breeze-exclude-urls'] );
|
57 |
+
$css_output = esc_textarea( $output );
|
58 |
+
}
|
59 |
+
|
60 |
+
$placeholder_never_cache_url = 'Exclude Single URL: https://demo.com/example/ Exclude Multiple URL using wildcard https://demo.com/example/(.*)';
|
61 |
+
?>
|
62 |
+
<textarea cols="100" rows="7" id="exclude-urls" name="exclude-urls" placeholder="<?php echo esc_attr( $placeholder_never_cache_url ); ?>"><?php echo $css_output; ?></textarea>
|
63 |
+
<div class="br-note">
|
64 |
+
<p>
|
65 |
+
<?php
|
66 |
+
|
67 |
+
_e( 'Add the URLs of the pages (one per line) you wish to exclude from the WordPress internal cache. To exclude URLs from the Varnish cache, please refer to this ', 'breeze' );
|
68 |
+
?>
|
69 |
+
<a
|
70 |
+
href="https://support.cloudways.com/how-to-exclude-url-from-varnish/"
|
71 |
+
target="_blank"><?php _e( 'Knowledge Base', 'breeze' ); ?></a><?php _e( ' article.', 'breeze' ); ?>
|
72 |
+
</p>
|
73 |
+
<?php if ( false === $excluded_url_list ) { ?>
|
74 |
+
<p class="br-notice">
|
75 |
+
<?php _e( 'One (or more) URL is invalid. Please check and correct the entry.', 'breeze' ); ?>
|
76 |
+
</p>
|
77 |
+
<?php } ?>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
</div>
|
81 |
+
<!-- END OPTION -->
|
82 |
+
|
83 |
+
<!-- START OPTION -->
|
84 |
+
<div class="br-option-item">
|
85 |
+
<div class="br-label">
|
86 |
+
<div class="br-option-text">
|
87 |
+
<?php _e( 'Cache Query Strings', 'breeze' ); ?>
|
88 |
+
</div>
|
89 |
+
</div>
|
90 |
+
<div class="br-option">
|
91 |
+
<?php
|
92 |
+
$cached_query_strings = '';
|
93 |
+
if ( isset( $options['cached-query-strings'] ) && ! empty( $options['cached-query-strings'] ) ) {
|
94 |
+
$output = implode( "\n", $options['cached-query-strings'] );
|
95 |
+
$cached_query_strings = esc_textarea( $output );
|
96 |
+
}
|
97 |
+
|
98 |
+
?>
|
99 |
+
<textarea cols="100" rows="7" id="cache-query-str" name="cache-query-str" placeholder="City"><?php echo $cached_query_strings; ?></textarea>
|
100 |
+
<div class="br-note">
|
101 |
+
<p>
|
102 |
+
<?php
|
103 |
+
_e( 'Pages that contain the query strings added here, will be cached. Each entry must be added in a new line. For further details please refer to this ', 'breeze' );
|
104 |
+
?>
|
105 |
+
<a
|
106 |
+
href="https://support.cloudways.com/en/articles/5126470-how-to-install-and-configure-breeze-wordpress-cache-plugin"
|
107 |
+
target="_blank"><?php _e( 'KB', 'breeze' ); ?></a><?php _e( ' article.', 'breeze' ); ?>
|
108 |
+
</p>
|
109 |
+
</div>
|
110 |
+
</div>
|
111 |
+
</div>
|
112 |
+
<!-- END OPTION -->
|
113 |
+
|
114 |
+
<!-- START OPTION -->
|
115 |
+
<div class="br-option-item">
|
116 |
+
<div class="br-label">
|
117 |
+
<div class="br-option-text">
|
118 |
+
<?php _e( 'Disable Emoji', 'breeze' ); ?>
|
119 |
+
</div>
|
120 |
+
</div>
|
121 |
+
<div class="br-option">
|
122 |
+
<?php
|
123 |
+
if ( ! isset( $options['breeze-wp-emoji'] ) ) {
|
124 |
+
$options['breeze-wp-emoji'] = '0';
|
125 |
+
}
|
126 |
+
|
127 |
+
$basic_value = filter_var( $options['breeze-wp-emoji'], FILTER_VALIDATE_BOOLEAN );
|
128 |
+
$is_enabled = ( isset( $basic_value ) && true === $basic_value ) ? checked( $options['breeze-wp-emoji'], '1', false ) : '';
|
129 |
+
?>
|
130 |
+
<div class="on-off-checkbox">
|
131 |
+
<input id="breeze-wpjs-emoji" name="breeze-wpjs-emoji" type="checkbox" class="br-box" value="1" <?php echo $is_enabled; ?>>
|
132 |
+
<label for="breeze-wpjs-emoji">
|
133 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
134 |
+
</label>
|
135 |
+
</div>
|
136 |
+
<div class="br-note">
|
137 |
+
<p>
|
138 |
+
<?php
|
139 |
+
|
140 |
+
_e( 'Disable the loading of emoji libraries and CSS', 'breeze' );
|
141 |
+
?>
|
142 |
+
</p>
|
143 |
+
</div>
|
144 |
+
</div>
|
145 |
+
</div>
|
146 |
+
<!-- END OPTION -->
|
147 |
+
</section>
|
148 |
+
<div class="br-submit">
|
149 |
+
<input type="submit" value="<?php echo __( 'Save Changes', 'breeze' ); ?>" class="br-submit-save"/>
|
150 |
+
</div>
|
151 |
+
</form>
|
views/option-tabs/basic-tab.php
ADDED
@@ -0,0 +1,327 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Basic tab
|
4 |
+
*/
|
5 |
+
|
6 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
+
header( 'Status: 403 Forbidden' );
|
8 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
9 |
+
exit;
|
10 |
+
}
|
11 |
+
|
12 |
+
set_as_network_screen();
|
13 |
+
|
14 |
+
$is_custom = false;
|
15 |
+
if ( ( ! defined( 'WP_NETWORK_ADMIN' ) || ( defined( 'WP_NETWORK_ADMIN' ) && false === WP_NETWORK_ADMIN ) ) && is_multisite() ) {
|
16 |
+
$get_inherit = get_option( 'breeze_inherit_settings', '1' );
|
17 |
+
$is_custom = filter_var( $get_inherit, FILTER_VALIDATE_BOOLEAN );
|
18 |
+
}
|
19 |
+
|
20 |
+
$basic = breeze_get_option( 'basic_settings', true );
|
21 |
+
|
22 |
+
|
23 |
+
if ( ! isset( $basic['breeze-lazy-load'] ) ) {
|
24 |
+
$basic['breeze-lazy-load'] = '0';
|
25 |
+
}
|
26 |
+
|
27 |
+
if ( ! isset( $basic['breeze-lazy-load-native'] ) ) {
|
28 |
+
$basic['breeze-lazy-load-native'] = '0';
|
29 |
+
}
|
30 |
+
|
31 |
+
$icon = BREEZE_PLUGIN_URL . 'assets/images/basic-active.png';
|
32 |
+
?>
|
33 |
+
<form data-section="basic">
|
34 |
+
<?php if ( true === $is_custom ) { ?>
|
35 |
+
<div class="br-overlay-disable"><?php _e( 'Settings are inherited', 'breeze' ); ?></div>
|
36 |
+
<?php } ?>
|
37 |
+
<section>
|
38 |
+
<div class="br-section-title">
|
39 |
+
<img src="<?php echo $icon; ?>"/>
|
40 |
+
<?php _e( 'BASIC OPTIONS', 'breeze' ); ?>
|
41 |
+
</div>
|
42 |
+
|
43 |
+
<!-- START OPTION -->
|
44 |
+
<div class="br-option-item">
|
45 |
+
<div class="br-label">
|
46 |
+
<div class="br-option-text">
|
47 |
+
<?php _e( 'Cache System', 'breeze' ); ?>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
<div class="br-option">
|
51 |
+
<?php
|
52 |
+
$basic_value = isset( $basic['breeze-active'] ) ? filter_var( $basic['breeze-active'], FILTER_VALIDATE_BOOLEAN ) : false;
|
53 |
+
$check_basic = ( isset( $basic_value ) && true === $basic_value ) ? checked( $basic['breeze-active'], '1', false ) : '';
|
54 |
+
?>
|
55 |
+
<div class="on-off-checkbox">
|
56 |
+
<input id="cache-system" name="cache-system" type="checkbox" class="br-box" value="1" <?php echo $check_basic; ?>>
|
57 |
+
<label for="cache-system">
|
58 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
59 |
+
</label>
|
60 |
+
</div>
|
61 |
+
<div class="br-note">
|
62 |
+
<p>
|
63 |
+
<?php _e( 'This is the basic cache that we recommend should be kept enabled in all cases. Basic cache will build the internal and static caches for the WordPress websites.', 'breeze' ); ?>
|
64 |
+
</p>
|
65 |
+
</div>
|
66 |
+
</div>
|
67 |
+
</div>
|
68 |
+
<!-- END OPTION -->
|
69 |
+
|
70 |
+
|
71 |
+
<!-- START OPTION -->
|
72 |
+
<div class="br-option-item">
|
73 |
+
<div class="br-label">
|
74 |
+
<div class="br-option-text">
|
75 |
+
<?php _e( 'Purge Cache After', 'breeze' ); ?>
|
76 |
+
</div>
|
77 |
+
</div>
|
78 |
+
<div class="br-option">
|
79 |
+
<?php
|
80 |
+
$cache_ttl = ( isset( $basic['breeze-ttl'] ) && ! empty( $basic['breeze-ttl'] ) ? (int) $basic['breeze-ttl'] : '1440' );
|
81 |
+
?>
|
82 |
+
<input type="text" id="cache-ttl" name="cache-ttl" size="50" placeholder="<?php _e( '1440', 'breeze' ); ?>" value="<?php echo $cache_ttl; ?>"/>
|
83 |
+
<div class="br-note">
|
84 |
+
<p>
|
85 |
+
<?php _e( 'Automatically purge internal cache after X minutes. By default this is set to 1440 minutes (1 day)', 'breeze' ); ?>
|
86 |
+
</p>
|
87 |
+
</div>
|
88 |
+
</div>
|
89 |
+
</div>
|
90 |
+
<!-- END OPTION -->
|
91 |
+
|
92 |
+
<!-- START OPTION -->
|
93 |
+
<div class="br-option-item">
|
94 |
+
<div class="br-label">
|
95 |
+
<div class="br-option-text">
|
96 |
+
<?php _e( 'Gzip Compression', 'breeze' ); ?>
|
97 |
+
</div>
|
98 |
+
</div>
|
99 |
+
<div class="br-option">
|
100 |
+
<?php
|
101 |
+
$supports_conditionals = breeze_is_supported( 'conditional_htaccess' );
|
102 |
+
|
103 |
+
$is_disabled = is_multisite() && ! is_network_admin() && ! $supports_conditionals;
|
104 |
+
$basic_value = isset( $basic['breeze-gzip-compression'] ) ? filter_var( $basic['breeze-gzip-compression'], FILTER_VALIDATE_BOOLEAN ) : false;
|
105 |
+
$is_checked = isset( $basic['breeze-gzip-compression'] ) && true === $basic_value && ! $is_disabled;
|
106 |
+
?>
|
107 |
+
<div class="on-off-checkbox">
|
108 |
+
<input id="gzip-compression" type="checkbox" name="gzip-compression" class="br-box" value="1"
|
109 |
+
<?php echo $is_disabled ? 'disabled="disabled"' : ''; ?> <?php checked( $is_checked, true ); ?>/>
|
110 |
+
<label for="gzip-compression">
|
111 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
112 |
+
</label>
|
113 |
+
</div>
|
114 |
+
<div class="br-note">
|
115 |
+
<p>
|
116 |
+
<?php _e( 'Enable this to compress your files making HTTP requests fewer and faster.', 'breeze' ); ?>
|
117 |
+
</p>
|
118 |
+
<?php
|
119 |
+
if ( $is_disabled ) {
|
120 |
+
echo '<p class="br-notice">';
|
121 |
+
printf( esc_html__( 'Enabling/disabling %s for subsites is only available for Apache 2.4 and above. For lower versions, the Network-level settings will apply.', 'breeze' ), 'Gzip Compression' );
|
122 |
+
echo '</p>';
|
123 |
+
}
|
124 |
+
?>
|
125 |
+
</div>
|
126 |
+
</div>
|
127 |
+
</div>
|
128 |
+
<!-- END OPTION -->
|
129 |
+
|
130 |
+
<!-- START OPTION -->
|
131 |
+
<div class="br-option-item">
|
132 |
+
<div class="br-label">
|
133 |
+
<div class="br-option-text">
|
134 |
+
<?php _e( 'Browser Cache', 'breeze' ); ?>
|
135 |
+
</div>
|
136 |
+
</div>
|
137 |
+
<div class="br-option">
|
138 |
+
<?php
|
139 |
+
$supports_conditionals = breeze_is_supported( 'conditional_htaccess' );
|
140 |
+
|
141 |
+
$is_disabled = is_multisite() && ! is_network_admin() && ! $supports_conditionals;
|
142 |
+
$basic_value = isset( $basic['breeze-browser-cache'] ) ? filter_var( $basic['breeze-browser-cache'], FILTER_VALIDATE_BOOLEAN ) : false;
|
143 |
+
$is_checked = isset( $basic['breeze-browser-cache'] ) && true === $basic_value && ! $is_disabled;
|
144 |
+
?>
|
145 |
+
<div class="on-off-checkbox">
|
146 |
+
<input id="browser-cache" type="checkbox" name="browser-cache" class="br-box" value="1"
|
147 |
+
<?php echo $is_disabled ? 'disabled="disabled"' : ''; ?> <?php checked( $is_checked, true ); ?>/>
|
148 |
+
<label for="browser-cache">
|
149 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
150 |
+
</label>
|
151 |
+
</div>
|
152 |
+
<div class="br-note">
|
153 |
+
<p>
|
154 |
+
<?php _e( 'Enable this to add expires headers to static files. This will ask browsers to either request a file from server or fetch from the browser’s cache.', 'breeze' ); ?>
|
155 |
+
</p>
|
156 |
+
<?php
|
157 |
+
if ( $is_disabled ) {
|
158 |
+
echo '<p class="br-notice">';
|
159 |
+
printf( esc_html__( 'Enabling/disabling %s for subsites is only available for Apache 2.4 and above. For lower versions, the Network-level settings will apply.', 'breeze' ), 'Browser Cache' );
|
160 |
+
echo '</p>';
|
161 |
+
}
|
162 |
+
?>
|
163 |
+
</div>
|
164 |
+
</div>
|
165 |
+
</div>
|
166 |
+
<!-- END OPTION -->
|
167 |
+
|
168 |
+
<!-- START OPTION -->
|
169 |
+
<div class="br-option-item">
|
170 |
+
<div class="br-label">
|
171 |
+
<div class="br-option-text">
|
172 |
+
<?php _e( 'Lazy Load Images', 'breeze' ); ?>
|
173 |
+
</div>
|
174 |
+
</div>
|
175 |
+
<div class="br-option">
|
176 |
+
<?php
|
177 |
+
$disabled = 'disabled';
|
178 |
+
|
179 |
+
if ( class_exists( 'DOMDocument' ) && class_exists( 'DOMXPath' ) ) {
|
180 |
+
$disabled = '';
|
181 |
+
}
|
182 |
+
|
183 |
+
$basic_value = isset( $basic['breeze-lazy-load'] ) ? filter_var( $basic['breeze-lazy-load'], FILTER_VALIDATE_BOOLEAN ) : false;
|
184 |
+
$check_basic = ( isset( $basic_value ) && true === $basic_value ) ? checked( $basic['breeze-lazy-load'], '1', false ) : '';
|
185 |
+
?>
|
186 |
+
<div class="on-off-checkbox">
|
187 |
+
<input id="bz-lazy-load" type="checkbox" name="bz-lazy-load" class="br-box" value='1' <?php echo $disabled; ?> <?php echo $check_basic; ?>/>
|
188 |
+
<label for="bz-lazy-load">
|
189 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
190 |
+
</label>
|
191 |
+
</div>
|
192 |
+
<div class="br-note">
|
193 |
+
<p><?php _e( 'Images will begin to load before being displayed on screen.', 'breeze' ); ?></p>
|
194 |
+
<?php
|
195 |
+
if ( ! empty( $disabled ) ) {
|
196 |
+
echo '<p class="br-notice">';
|
197 |
+
_e( 'This option requires the library PHP DOMDocument and PHP DOMXPath', 'breeze' );
|
198 |
+
echo '</p>';
|
199 |
+
}
|
200 |
+
?>
|
201 |
+
</div>
|
202 |
+
<?php
|
203 |
+
//$basic['breeze-lazy-load-native'] = '0';
|
204 |
+
//$basic['breeze-lazy-load'] = '0';
|
205 |
+
|
206 |
+
$is_checked_lazy = checked( $basic['breeze-lazy-load'], '1', false );
|
207 |
+
if ( ! empty( $is_checked_lazy ) ) {
|
208 |
+
if ( ! empty( $disabled ) ) {
|
209 |
+
$hide = ' style="display:none"';
|
210 |
+
} else {
|
211 |
+
$hide = '';
|
212 |
+
}
|
213 |
+
} else {
|
214 |
+
$hide = ' style="display:none"';
|
215 |
+
}
|
216 |
+
$basic_value = isset( $basic['breeze-lazy-load-native'] ) ? filter_var( $basic['breeze-lazy-load-native'], FILTER_VALIDATE_BOOLEAN ) : false;
|
217 |
+
$check_basic = ( isset( $basic_value ) && true === $basic_value ) ? checked( $basic['breeze-lazy-load-native'], '1', false ) : '';
|
218 |
+
?>
|
219 |
+
|
220 |
+
<span <?php echo $hide; ?> id="native-lazy-option">
|
221 |
+
<div class="on-off-checkbox">
|
222 |
+
<input id="bz-lazy-load-nat" type="checkbox" name="bz-lazy-load-nat" class="br-box" value='1' <?php echo $check_basic; ?>>
|
223 |
+
<label for="bz-lazy-load-nat">
|
224 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
225 |
+
</label>
|
226 |
+
</div>
|
227 |
+
<p>
|
228 |
+
<?php _e( 'Enable native browser lazy load', 'breeze' ); ?><br/>
|
229 |
+
</p>
|
230 |
+
<p class="br-important">
|
231 |
+
<?php
|
232 |
+
echo '<strong>';
|
233 |
+
_e( 'Important: ', 'breeze' );
|
234 |
+
echo '</strong>';
|
235 |
+
_e( 'This is not supported by all browsers.', 'breeze' );
|
236 |
+
?>
|
237 |
+
</p>
|
238 |
+
</span>
|
239 |
+
|
240 |
+
</div>
|
241 |
+
</div>
|
242 |
+
<!-- END OPTION -->
|
243 |
+
|
244 |
+
<!-- START OPTION -->
|
245 |
+
<div class="br-option-item">
|
246 |
+
<div class="br-label">
|
247 |
+
<div class="br-option-text">
|
248 |
+
<?php _e( 'Cross-origin Safe Links', 'breeze' ); ?>
|
249 |
+
</div>
|
250 |
+
</div>
|
251 |
+
<div class="br-option">
|
252 |
+
<?php
|
253 |
+
$basic_value = isset( $basic['breeze-cross-origin'] ) ? filter_var( $basic['breeze-cross-origin'], FILTER_VALIDATE_BOOLEAN ) : false;
|
254 |
+
$check_basic = ( isset( $basic_value ) && true === $basic_value ) ? checked( $basic['breeze-cross-origin'], '1', false ) : '';
|
255 |
+
?>
|
256 |
+
<div class="on-off-checkbox">
|
257 |
+
<input id="safe-cross-origin" type="checkbox" name="safe-cross-origin" class="br-box" <?php echo $check_basic; ?> value='1'/>
|
258 |
+
<label for="safe-cross-origin">
|
259 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
260 |
+
</label>
|
261 |
+
</div>
|
262 |
+
<div class="br-note">
|
263 |
+
<p><?php _e( 'Apply “noopener noreferrer” to links which have target”_blank” attribute and the anchor leads to external websites', 'breeze' ); ?></p>
|
264 |
+
</div>
|
265 |
+
</div>
|
266 |
+
</div>
|
267 |
+
<!-- END OPTION -->
|
268 |
+
|
269 |
+
<!-- START OPTION -->
|
270 |
+
<div class="br-option-item">
|
271 |
+
<div class="br-label">
|
272 |
+
<div class="br-option-text">
|
273 |
+
<?php _e( 'Cache Logged-in Users', 'breeze' ); ?>
|
274 |
+
</div>
|
275 |
+
</div>
|
276 |
+
<div class="br-option">
|
277 |
+
<?php
|
278 |
+
global $wp_roles;
|
279 |
+
$roles = $wp_roles->roles;
|
280 |
+
|
281 |
+
foreach ( $roles as $user_role => $user_role_data ) {
|
282 |
+
$is_checked_role = 0;
|
283 |
+
if ( is_array( $basic['breeze-disable-admin'] ) && isset( $basic['breeze-disable-admin'] ) && isset( $basic['breeze-disable-admin'][ $user_role ] ) ) {
|
284 |
+
$is_checked_role = (int) $basic['breeze-disable-admin'][ $user_role ];
|
285 |
+
}
|
286 |
+
|
287 |
+
$check_role = ( isset( $is_checked_role ) && 1 === $is_checked_role ) ? checked( $is_checked_role, '1', false ) : '';
|
288 |
+
|
289 |
+
?>
|
290 |
+
<strong><?php echo esc_html( $user_role_data['name'] ); ?></strong>
|
291 |
+
<div class="on-off-checkbox">
|
292 |
+
<input id="breeze-admin-cache-<?php echo esc_attr( $user_role ); ?>" type="checkbox" name="breeze-admin-cache[<?php echo esc_attr( $user_role ); ?>]" class="br-box"
|
293 |
+
value="1" <?php echo $check_role; ?>>
|
294 |
+
<label for="breeze-admin-cache-<?php echo esc_attr( $user_role ); ?>">
|
295 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
296 |
+
</label>
|
297 |
+
</div>
|
298 |
+
|
299 |
+
<br/>
|
300 |
+
<?php
|
301 |
+
}
|
302 |
+
?>
|
303 |
+
<div class="br-note">
|
304 |
+
<p>
|
305 |
+
<?php
|
306 |
+
|
307 |
+
_e( 'Enable cache for WP standard user roles: Administrator, Editor, Author, Contributor.', 'breeze' );
|
308 |
+
?>
|
309 |
+
</p>
|
310 |
+
<p class="br-important">
|
311 |
+
<?php
|
312 |
+
echo '<strong>';
|
313 |
+
_e( 'Important: ', 'breeze' );
|
314 |
+
echo '</strong>';
|
315 |
+
_e( 'This option might not work properly with some page builders.', 'breeze' );
|
316 |
+
?>
|
317 |
+
</p>
|
318 |
+
</div>
|
319 |
+
</div>
|
320 |
+
</div>
|
321 |
+
<!-- END OPTION -->
|
322 |
+
|
323 |
+
</section>
|
324 |
+
<div class="br-submit">
|
325 |
+
<input type="submit" value="<?php echo __( 'Save Changes', 'breeze' ); ?>" class="br-submit-save"/>
|
326 |
+
</div>
|
327 |
+
</form>
|
views/option-tabs/cdn-tab.php
ADDED
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Basic tab
|
4 |
+
*/
|
5 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
6 |
+
header( 'Status: 403 Forbidden' );
|
7 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
8 |
+
exit;
|
9 |
+
}
|
10 |
+
|
11 |
+
set_as_network_screen();
|
12 |
+
|
13 |
+
$is_custom = false;
|
14 |
+
if ( ( ! defined( 'WP_NETWORK_ADMIN' ) || ( defined( 'WP_NETWORK_ADMIN' ) && false === WP_NETWORK_ADMIN ) ) && is_multisite() ) {
|
15 |
+
$get_inherit = get_option( 'breeze_inherit_settings', '1' );
|
16 |
+
$is_custom = filter_var( $get_inherit, FILTER_VALIDATE_BOOLEAN );
|
17 |
+
}
|
18 |
+
|
19 |
+
|
20 |
+
$options = breeze_get_option( 'cdn_integration', true );
|
21 |
+
$cdn_content_value = '';
|
22 |
+
$cdn_exclude_content_value = '';
|
23 |
+
$icon = BREEZE_PLUGIN_URL . 'assets/images/cdn-active.png';
|
24 |
+
|
25 |
+
?>
|
26 |
+
<form data-section="cdn">
|
27 |
+
<?php if ( true === $is_custom ) { ?>
|
28 |
+
<div class="br-overlay-disable"><?php _e( 'Settings are inherited', 'breeze' ); ?></div>
|
29 |
+
<?php } ?>
|
30 |
+
<section>
|
31 |
+
<div class="br-section-title">
|
32 |
+
<img src="<?php echo $icon; ?>"/>
|
33 |
+
<?php _e( 'CDN', 'breeze' ); ?>
|
34 |
+
</div>
|
35 |
+
|
36 |
+
<!-- START OPTION -->
|
37 |
+
<div class="br-option-item">
|
38 |
+
<div class="br-label">
|
39 |
+
<div class="br-option-text">
|
40 |
+
<?php _e( 'Activate CDN', 'breeze' ); ?>
|
41 |
+
</div>
|
42 |
+
</div>
|
43 |
+
<div class="br-option">
|
44 |
+
<?php
|
45 |
+
if ( ! isset( $options['cdn-active'] ) ) {
|
46 |
+
$options['cdn-active'] = '0';
|
47 |
+
}
|
48 |
+
|
49 |
+
$basic_value = filter_var( $options['cdn-active'], FILTER_VALIDATE_BOOLEAN );
|
50 |
+
$is_enabled = ( isset( $basic_value ) && true === $basic_value ) ? checked( $options['cdn-active'], '1', false ) : '';
|
51 |
+
?>
|
52 |
+
<div class="on-off-checkbox">
|
53 |
+
<input id="activate-cdn" name="activate-cdn" type="checkbox" class="br-box" value="1" <?php echo $is_enabled; ?>>
|
54 |
+
<label for="activate-cdn">
|
55 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
56 |
+
</label>
|
57 |
+
</div>
|
58 |
+
<div class="br-note">
|
59 |
+
<p>
|
60 |
+
<?php _e( 'Enable to make CDN effective on your website.', 'breeze' ); ?>
|
61 |
+
</p>
|
62 |
+
</div>
|
63 |
+
</div>
|
64 |
+
</div>
|
65 |
+
<!-- END OPTION -->
|
66 |
+
|
67 |
+
<!-- START OPTION -->
|
68 |
+
<div class="br-option-item">
|
69 |
+
<div class="br-label">
|
70 |
+
<div class="br-option-text">
|
71 |
+
<?php _e( 'CDN CNAME', 'breeze' ); ?>
|
72 |
+
</div>
|
73 |
+
</div>
|
74 |
+
<div class="br-option">
|
75 |
+
<?php
|
76 |
+
|
77 |
+
$cdn_url = ( isset( $options['cdn-url'] ) ) ? esc_html( $options['cdn-url'] ) : '';
|
78 |
+
$cdn_url_validation = breeze_validate_url_via_regexp( $cdn_url );
|
79 |
+
|
80 |
+
?>
|
81 |
+
<input type="text" id="cdn-url" name="cdn-url" size="50" placeholder="<?php _e( 'https://www.domain.com', 'breeze' ); ?>" value="<?php echo $cdn_url; ?>"/>
|
82 |
+
<div class="br-note">
|
83 |
+
<p>
|
84 |
+
<?php
|
85 |
+
|
86 |
+
_e( 'Use double slash ‘//’ at the start of CDN CNAME, if you have some pages on HTTP and some are on HTTPS.', 'breeze' );
|
87 |
+
?>
|
88 |
+
</p>
|
89 |
+
<?php if ( false === $cdn_url_validation && ! empty( $cdn_url ) ) { ?>
|
90 |
+
<p class="br-notice">
|
91 |
+
<?php
|
92 |
+
echo $cdn_url . ' ';
|
93 |
+
echo esc_html__( 'is not a valid CDN url.', 'breeze' );
|
94 |
+
?>
|
95 |
+
</p>
|
96 |
+
<?php } ?>
|
97 |
+
</div>
|
98 |
+
</div>
|
99 |
+
</div>
|
100 |
+
<!-- END OPTION -->
|
101 |
+
|
102 |
+
|
103 |
+
<!-- START OPTION -->
|
104 |
+
<div class="br-option-item">
|
105 |
+
<div class="br-label">
|
106 |
+
<div class="br-option-text">
|
107 |
+
<?php _e( 'CDN Content', 'breeze' ); ?>
|
108 |
+
</div>
|
109 |
+
</div>
|
110 |
+
<div class="br-option">
|
111 |
+
<?php
|
112 |
+
if ( ! empty( $options['cdn-content'] ) ) {
|
113 |
+
$cdn_content_value = implode( ',', $options['cdn-content'] );
|
114 |
+
}
|
115 |
+
|
116 |
+
?>
|
117 |
+
<input type="text" id="cdn-content" name="cdn-content" size="50" value="<?php echo( ( $cdn_content_value ) ? esc_html( $cdn_content_value ) : '' ); ?>"/>
|
118 |
+
<div class="br-note">
|
119 |
+
<p>
|
120 |
+
<?php
|
121 |
+
|
122 |
+
_e( 'Enter the directories (comma separated) of which you want the CDN to serve the content.', 'breeze' );
|
123 |
+
?>
|
124 |
+
</p>
|
125 |
+
|
126 |
+
</div>
|
127 |
+
</div>
|
128 |
+
</div>
|
129 |
+
<!-- END OPTION -->
|
130 |
+
|
131 |
+
<!-- START OPTION -->
|
132 |
+
<div class="br-option-item">
|
133 |
+
<div class="br-label">
|
134 |
+
<div class="br-option-text">
|
135 |
+
<?php _e( 'Exclude Content', 'breeze' ); ?>
|
136 |
+
</div>
|
137 |
+
</div>
|
138 |
+
<div class="br-option">
|
139 |
+
<?php
|
140 |
+
if ( ! empty( $options['cdn-exclude-content'] ) ) {
|
141 |
+
$cdn_exclude_content_value = implode( ',', $options['cdn-exclude-content'] );
|
142 |
+
}
|
143 |
+
|
144 |
+
?>
|
145 |
+
<input type="text" id="cdn-exclude-content" name="cdn-exclude-content" size="50"
|
146 |
+
value="<?php echo( ( $cdn_exclude_content_value ) ? esc_html( $cdn_exclude_content_value ) : '' ); ?>"/>
|
147 |
+
<div class="br-note">
|
148 |
+
<p>
|
149 |
+
<?php
|
150 |
+
|
151 |
+
_e( 'Exclude file types or directories from CDN. Example, enter .css to exclude the CSS files.', 'breeze' );
|
152 |
+
?>
|
153 |
+
|
154 |
+
</div>
|
155 |
+
</div>
|
156 |
+
</div>
|
157 |
+
<!-- END OPTION -->
|
158 |
+
|
159 |
+
<!-- START OPTION -->
|
160 |
+
<div class="br-option-item">
|
161 |
+
<div class="br-label">
|
162 |
+
<div class="br-option-text">
|
163 |
+
<?php _e( 'Relative Path', 'breeze' ); ?>
|
164 |
+
</div>
|
165 |
+
</div>
|
166 |
+
<div class="br-option">
|
167 |
+
<?php
|
168 |
+
if ( ! isset( $options['cdn-relative-path'] ) ) {
|
169 |
+
$options['cdn-relative-path'] = '0';
|
170 |
+
}
|
171 |
+
|
172 |
+
$basic_value = filter_var( $options['cdn-relative-path'], FILTER_VALIDATE_BOOLEAN );
|
173 |
+
$is_enabled = ( isset( $basic_value ) && true === $basic_value ) ? checked( $options['cdn-relative-path'], '1', false ) : '';
|
174 |
+
?>
|
175 |
+
<div class="on-off-checkbox">
|
176 |
+
<input id="cdn-relative-path" name="cdn-relative-path" type="checkbox" class="br-box" value="1" <?php echo $is_enabled; ?>>
|
177 |
+
<label for="cdn-relative-path">
|
178 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
179 |
+
</label>
|
180 |
+
</div>
|
181 |
+
<div class="br-note">
|
182 |
+
<p>
|
183 |
+
<?php
|
184 |
+
|
185 |
+
_e( 'Keep this option enabled. Use this option to enable relative path for your CDN on your WordPress site.', 'breeze' );
|
186 |
+
?>
|
187 |
+
</p>
|
188 |
+
</div>
|
189 |
+
</div>
|
190 |
+
</div>
|
191 |
+
<!-- END OPTION -->
|
192 |
+
</section>
|
193 |
+
<div class="br-submit">
|
194 |
+
<input type="submit" value="<?php echo __( 'Save Changes', 'breeze' ); ?>" class="br-submit-save"/>
|
195 |
+
</div>
|
196 |
+
</form>
|
197 |
+
|
views/option-tabs/database-tab.php
ADDED
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Basic tab
|
4 |
+
*/
|
5 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
6 |
+
header( 'Status: 403 Forbidden' );
|
7 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
8 |
+
exit;
|
9 |
+
}
|
10 |
+
|
11 |
+
set_as_network_screen();
|
12 |
+
|
13 |
+
$icon = BREEZE_PLUGIN_URL . 'assets/images/database-active.png';
|
14 |
+
|
15 |
+
$post_revisions = 0;
|
16 |
+
$drafted = 0;
|
17 |
+
$trashed = 0;
|
18 |
+
$comments_trash = 0;
|
19 |
+
$comments_spam = 0;
|
20 |
+
$trackbacks = 0;
|
21 |
+
$transients = 0;
|
22 |
+
|
23 |
+
$total_no = 0;
|
24 |
+
|
25 |
+
if ( is_multisite() && is_network_admin() ) {
|
26 |
+
// Count items from all network sites.
|
27 |
+
$sites = get_sites(
|
28 |
+
array(
|
29 |
+
'fields' => 'ids',
|
30 |
+
)
|
31 |
+
);
|
32 |
+
|
33 |
+
foreach ( $sites as $blog_id ) {
|
34 |
+
switch_to_blog( $blog_id );
|
35 |
+
$post_revisions += Breeze_Configuration::get_element_to_clean( 'revisions' );
|
36 |
+
$drafted += Breeze_Configuration::get_element_to_clean( 'drafted' );
|
37 |
+
$trashed += Breeze_Configuration::get_element_to_clean( 'trash' );
|
38 |
+
$comments_trash += Breeze_Configuration::get_element_to_clean( 'comments_trash' );
|
39 |
+
$comments_spam += Breeze_Configuration::get_element_to_clean( 'comments_spam' );
|
40 |
+
$trackbacks += Breeze_Configuration::get_element_to_clean( 'trackbacks' );
|
41 |
+
$transients += Breeze_Configuration::get_element_to_clean( 'transient' );
|
42 |
+
restore_current_blog();
|
43 |
+
}
|
44 |
+
} else {
|
45 |
+
// Count items from the current site.
|
46 |
+
$post_revisions = Breeze_Configuration::get_element_to_clean( 'revisions' );
|
47 |
+
$drafted = Breeze_Configuration::get_element_to_clean( 'drafted' );
|
48 |
+
$trashed = Breeze_Configuration::get_element_to_clean( 'trash' );
|
49 |
+
$comments_trash = Breeze_Configuration::get_element_to_clean( 'comments_trash' );
|
50 |
+
$comments_spam = Breeze_Configuration::get_element_to_clean( 'comments_spam' );
|
51 |
+
$trackbacks = Breeze_Configuration::get_element_to_clean( 'trackbacks' );
|
52 |
+
$transients = Breeze_Configuration::get_element_to_clean( 'transient' );
|
53 |
+
}
|
54 |
+
|
55 |
+
$total_no = $post_revisions + $drafted + $trashed + $comments_trash + $comments_spam + $trackbacks + $transients;
|
56 |
+
|
57 |
+
$is_optimize_disabled = is_multisite() && ! is_network_admin() && '0' !== get_option( 'breeze_inherit_settings' );
|
58 |
+
|
59 |
+
$sections_actions = array(
|
60 |
+
'post_revisions' => array(
|
61 |
+
'title' => __( 'Post Revisions', 'breeze' ),
|
62 |
+
'describe' => __( 'Remove all post/pages revisions from DB', 'breeze' ),
|
63 |
+
'no' => $post_revisions,
|
64 |
+
),
|
65 |
+
'auto_drafts' => array(
|
66 |
+
'title' => __( 'Auto Drafts', 'breeze' ),
|
67 |
+
'describe' => __( 'Remove all post/pages auto drafts from DB', 'breeze' ),
|
68 |
+
'no' => $drafted,
|
69 |
+
),
|
70 |
+
'trashed_comments' => array(
|
71 |
+
'title' => __( 'Trashed Comments', 'breeze' ),
|
72 |
+
'describe' => __( 'Remove all trashed comments from DB', 'breeze' ),
|
73 |
+
'no' => $comments_trash,
|
74 |
+
),
|
75 |
+
'trashed_posts' => array(
|
76 |
+
'title' => __( 'Trashed Posts', 'breeze' ),
|
77 |
+
'describe' => __( 'Remove all trashed posts from DB', 'breeze' ),
|
78 |
+
'no' => $trashed,
|
79 |
+
),
|
80 |
+
'spam_comments' => array(
|
81 |
+
'title' => __( 'Spam Comments', 'breeze' ),
|
82 |
+
'describe' => __( 'Remove all the comments that are considered spam from DB', 'breeze' ),
|
83 |
+
'no' => $comments_spam,
|
84 |
+
),
|
85 |
+
'all_transients' => array(
|
86 |
+
'title' => __( 'All Transients', 'breeze' ),
|
87 |
+
'describe' => __( 'Delete expired and active transients from the WordPress database.', 'breeze' ),
|
88 |
+
'no' => $transients,
|
89 |
+
),
|
90 |
+
'trackbacks_pingbacks' => array(
|
91 |
+
'title' => __( 'Trackbacks/Pingbacks', 'breeze' ),
|
92 |
+
'describe' => __( 'Remove all trackbacks/pingbakcs data from DB', 'breeze' ),
|
93 |
+
'no' => $trackbacks,
|
94 |
+
),
|
95 |
+
// 'expired_transients' => array(
|
96 |
+
// 'title' => __( 'Expired Transients', 'breeze' ),
|
97 |
+
// 'describe' => __( 'Remove all expired transients data from DB', 'breeze' ),
|
98 |
+
// 'no' => $transients,
|
99 |
+
// ),
|
100 |
+
// 'clean_optimizer' => array(
|
101 |
+
// 'title' => __( 'Clean CSS/JS Optimizer (0)', 'breeze' ),
|
102 |
+
// 'describe' => __( 'Optimise CSS/JS', 'breeze' ),
|
103 |
+
// 'no' => '',
|
104 |
+
// ),
|
105 |
+
// 'optimize_tables' => array(
|
106 |
+
// 'title' => __( 'Optimize Tables', 'breeze' ),
|
107 |
+
// 'describe' => __( 'Try to optimize all the DB tables', 'breeze' ),
|
108 |
+
// 'no' => '',
|
109 |
+
// ),
|
110 |
+
);
|
111 |
+
|
112 |
+
?>
|
113 |
+
<section>
|
114 |
+
<div class="br-section-title">
|
115 |
+
<img src="<?php echo $icon; ?>"/>
|
116 |
+
<?php _e( 'DATABASE OPTIONS', 'breeze' ); ?>
|
117 |
+
</div>
|
118 |
+
<br/>
|
119 |
+
<div class="cta-cleanall">
|
120 |
+
<input type="checkbox" name="br-clean-all" id="br-clean-all"/>
|
121 |
+
<label for="br-clean-all" class="br-clean-label"><?php _e( 'Clean All', 'breeze' ); ?> <span class="br-has">( <?php echo esc_html( $total_no ); ?> )</span></label>
|
122 |
+
<p>
|
123 |
+
<?php _e( 'Cleall the trashed posts and pages.', 'breeze' ); ?>
|
124 |
+
</p>
|
125 |
+
<p class="br-important">
|
126 |
+
<?php
|
127 |
+
echo '<strong>';
|
128 |
+
_e( 'Important: ', 'breeze' );
|
129 |
+
echo '</strong>';
|
130 |
+
_e( 'Backup your database before using the following options!', 'breeze' );
|
131 |
+
?>
|
132 |
+
</p>
|
133 |
+
|
134 |
+
<input type="button" class="simple-btn" value="<?php _e( 'Clean Now', 'breeze' ); ?>" disabled id="br-clean-all-cta">
|
135 |
+
</div>
|
136 |
+
<div class="br-db-boxes">
|
137 |
+
<?php
|
138 |
+
if ( ! empty( $sections_actions ) ) {
|
139 |
+
foreach ( $sections_actions as $section_slug => $section_data ) {
|
140 |
+
|
141 |
+
$no_data = '';
|
142 |
+
$css_opacity = '';
|
143 |
+
if ( '' !== $section_data['no'] ) {
|
144 |
+
if ( 0 === $section_data['no'] ) {
|
145 |
+
$no_data = ' (0)';
|
146 |
+
$css_opacity = 'opac';
|
147 |
+
} else {
|
148 |
+
$no_data = ' (<span class="br-has">' . $section_data['no'] . '</span>)';
|
149 |
+
}
|
150 |
+
}
|
151 |
+
?>
|
152 |
+
<div class="br-db-item" data-section-title="<?php echo esc_attr( $section_data['title'] ); ?>" data-section="<?php echo esc_attr( $section_slug ); ?>">
|
153 |
+
<img src="<?php echo BREEZE_PLUGIN_URL . 'assets/images/' . esc_attr( $section_slug ) . '.png'; ?>">
|
154 |
+
<h3>
|
155 |
+
<?php
|
156 |
+
echo $section_data['title'];
|
157 |
+
echo $no_data;
|
158 |
+
?>
|
159 |
+
</h3>
|
160 |
+
<p>
|
161 |
+
<?php echo $section_data['describe']; ?>
|
162 |
+
</p>
|
163 |
+
|
164 |
+
<!--<a href="#<?php echo esc_attr( $section_slug ); ?>" data-section="<?php echo esc_attr( $section_slug ); ?>" class="do_clean_action <?php echo $css_opacity; ?>"><?php echo _e( 'Clean now', 'breeze' ); ?></a>-->
|
165 |
+
</div>
|
166 |
+
<?php
|
167 |
+
}
|
168 |
+
}
|
169 |
+
?>
|
170 |
+
</div>
|
171 |
+
<div class="cta-cleanall">
|
172 |
+
<input type="button" class="simple-btn" id="optimize-selected-services" value="<?php _e( 'Optimize', 'breeze' ); ?>">
|
173 |
+
<br/><br/>
|
174 |
+
</div>
|
175 |
+
</section>
|
views/option-tabs/faq-tab.php
ADDED
@@ -0,0 +1,195 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Basic tab
|
4 |
+
*/
|
5 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
6 |
+
header( 'Status: 403 Forbidden' );
|
7 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
8 |
+
exit;
|
9 |
+
}
|
10 |
+
|
11 |
+
set_as_network_screen();
|
12 |
+
|
13 |
+
$icon = BREEZE_PLUGIN_URL . 'assets/images/faq-active.png';
|
14 |
+
|
15 |
+
|
16 |
+
?>
|
17 |
+
<section>
|
18 |
+
<div class="br-section-title">
|
19 |
+
<img src="<?php echo $icon; ?>"/>
|
20 |
+
<?php _e( 'FAQS', 'breeze' ); ?>
|
21 |
+
</div>
|
22 |
+
<div>
|
23 |
+
<!-- START OPTION -->
|
24 |
+
<div class="br-option-item">
|
25 |
+
<div id="faq-content">
|
26 |
+
<div class="faq-block">
|
27 |
+
<h3 class="faq-question"><?php _e( 'Delay inline JavaScript issue', 'breeze' ); ?></h3>
|
28 |
+
<div class="faq-answer">
|
29 |
+
<p>
|
30 |
+
<?php _e( 'If JavaScript errors show up in front-end you can try the following solutions.', 'breeze' ); ?><br/>
|
31 |
+
<?php _e( '- You can disable the option altogether.', 'breeze' ); ?><br/>
|
32 |
+
<?php _e( '- You can leave the option enabled and identify which line found in the textarea is causing the issue, then remove only that online that line.', 'breeze' ); ?>
|
33 |
+
</p>
|
34 |
+
</div>
|
35 |
+
</div>
|
36 |
+
|
37 |
+
<div class="faq-block">
|
38 |
+
<h3 class="faq-question"><?php _e( 'Does Breeze support Varnish and to what extent?', 'breeze' ); ?></h3>
|
39 |
+
<div class="faq-answer">
|
40 |
+
<p><?php _e( 'Breeze, by default, supports Varnish. It has been tested to be fully compatible with Cloudways Servers that come with Varnish pre-installed. If you are using hosting providers other than Cloudways, we suggest you confirm Varnish support with your hosting provider.', 'breeze' ); ?></p>
|
41 |
+
</div>
|
42 |
+
</div>
|
43 |
+
|
44 |
+
<div class="faq-block">
|
45 |
+
<h3 class="faq-question"><?php _e( 'Does Breeze support WooCommerce?', 'breeze' ); ?></h3>
|
46 |
+
<div class="faq-answer">
|
47 |
+
<p><?php _e( 'Breeze is fully compatible with WooCommerce, out of the box. It does not require any special configurations.', 'breeze' ); ?></p>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
|
51 |
+
<div class="faq-block">
|
52 |
+
<h3 class="faq-question"><?php _e( 'Does Breeze support WordPress Multisite?', 'breeze' ); ?></h3>
|
53 |
+
<div class="faq-answer">
|
54 |
+
<p><?php _e( 'Breeze is fully compatible with WordPress Multisite without the need for any extra configuration.', 'breeze' ); ?></p>
|
55 |
+
</div>
|
56 |
+
</div>
|
57 |
+
|
58 |
+
<div class="faq-block">
|
59 |
+
<h3 class="faq-question"><?php _e( 'How does Breeze handle WordPress multisite?', 'breeze' ); ?></h3>
|
60 |
+
<div class="faq-answer">
|
61 |
+
<p><?php _e( 'Breeze handles all WordPress multisite instances globally. All the settings for multisite are now handled on the network level.', 'breeze' ); ?></p>
|
62 |
+
</div>
|
63 |
+
</div>
|
64 |
+
|
65 |
+
<div class="faq-block">
|
66 |
+
<h3 class="faq-question"><?php _e( 'Is Breeze compatible with other WordPress Cache plugins?', 'breeze' ); ?></h3>
|
67 |
+
<div class="faq-answer">
|
68 |
+
<p><?php _e( 'We DO NOT recommend using two WordPress cache plugins at the same time on any WordPress website.', 'breeze' ); ?></p>
|
69 |
+
<p><?php _e( 'We strongly recommend that you use Breeze as the only cache plugin for your website. If there are any other cache plugins installed, please ensure that you have disabled them prior to proceeding with the Breeze installation.', 'breeze' ); ?></p>
|
70 |
+
</div>
|
71 |
+
</div>
|
72 |
+
|
73 |
+
<div class="faq-block">
|
74 |
+
<h3 class="faq-question"><?php _e( 'Is Breeze compatible with HTTPS?', 'breeze' ); ?></h3>
|
75 |
+
<div class="faq-answer">
|
76 |
+
<p><?php _e( 'Breeze does not require any special configuration to work with HTTP or HTTPS pages.', 'breeze' ); ?></p>
|
77 |
+
</div>
|
78 |
+
</div>
|
79 |
+
|
80 |
+
<div class="faq-block">
|
81 |
+
<h3 class="faq-question"><?php _e( 'Does Breeze have compatibility issues with other known plugins?', 'breeze' ); ?></h3>
|
82 |
+
<div class="faq-answer">
|
83 |
+
<p><?php _e( 'Breeze has been tested with popular plugins available on WordPress.org. Please feel free to report any incompatibilities on the WordPress Support Forums or on ', 'breeze' ); ?>
|
84 |
+
<a href="https://community.cloudways.com/" target="_blank"><?php _e( 'Cloudways Community Forum.', 'breeze' ); ?></a>
|
85 |
+
</p>
|
86 |
+
</div>
|
87 |
+
</div>
|
88 |
+
|
89 |
+
<div class="faq-block">
|
90 |
+
<h3 class="faq-question"><?php _e( 'Does Breeze support CDN?', 'breeze' ); ?></h3>
|
91 |
+
<div class="faq-answer">
|
92 |
+
<p><?php _e( 'Breeze supports CDN integration. It allows all static assets (such as images, CSS and JS files) to be served via CDN.', 'breeze' ); ?></p>
|
93 |
+
</div>
|
94 |
+
</div>
|
95 |
+
|
96 |
+
<div class="faq-block">
|
97 |
+
<h3 class="faq-question"><?php _e( 'What does Breeze’s Database Optimization feature do?', 'breeze' ); ?></h3>
|
98 |
+
<div class="faq-answer">
|
99 |
+
<p><?php _e( 'WordPress databases are notorious for storing information like post revisions, spam comments and much more. Over time, databases l become bloated and it is a good practice to clear out unwanted information to reduce database size and improve optimization.', 'breeze' ); ?></p>
|
100 |
+
<p><?php _e( 'Breeze’s database optimization cleans out unwanted information in a single click.', 'breeze' ); ?></p>
|
101 |
+
</div>
|
102 |
+
</div>
|
103 |
+
|
104 |
+
<div class="faq-block">
|
105 |
+
<h3 class="faq-question"><?php _e( 'Will comments and other dynamic parts of my blog appear immediately?', 'breeze' ); ?></h3>
|
106 |
+
<div class="faq-answer">
|
107 |
+
<p><?php _e( 'Comments will appear upon moderation as per the comment system (or policy) set in place by the blog owner. Other dynamic changes such as any modifications in files will require a full cache purge.', 'breeze' ); ?></p>
|
108 |
+
</div>
|
109 |
+
</div>
|
110 |
+
|
111 |
+
<div class="faq-block">
|
112 |
+
<h3 class="faq-question"><?php _e( 'Can I exclude URLs of individual files and pages from cache?', 'breeze' ); ?></h3>
|
113 |
+
<div class="faq-answer">
|
114 |
+
<p><?php _e( 'You can exclude URL(s) by mentioning in exclude fields available in the Breeze settings. Excluding a URL(s) will automatically prevent the page to be cached on server side caching (Varnish) by adding a cache-control:no-cache Response Header.', 'breeze' ); ?></p>
|
115 |
+
<p><?php _e( 'If Varnish is active, you will need to exclude URLs and file type(s) in the Varnish configuration. If you are hosting WordPress websites on Cloudways servers, follow ', 'breeze' ); ?>
|
116 |
+
<a href="https://support.cloudways.com/how-to-exclude-url-from-varnish/" target="_blank"><?php _e( 'this KB to exclude URLs from the Varnish cache.', 'breeze' ); ?></a>
|
117 |
+
</p>
|
118 |
+
</div>
|
119 |
+
</div>
|
120 |
+
|
121 |
+
<div class="faq-block">
|
122 |
+
<h3 class="faq-question"><?php _e( 'Does it work with all hosting providers?', 'breeze' ); ?></h3>
|
123 |
+
<div class="faq-answer">
|
124 |
+
<p><?php _e( 'Breeze has been tested to work with all major hosting providers. In addition, major Breeze options such as Gzip, browser cache, minification, grouping, database optimization. CDN integration will work as expected on all hosting providers.', 'breeze' ); ?></p>
|
125 |
+
</div>
|
126 |
+
</div>
|
127 |
+
|
128 |
+
<div class="faq-block">
|
129 |
+
<h3 class="faq-question"><?php _e( 'Where can I get support for Breeze?', 'breeze' ); ?></h3>
|
130 |
+
<div class="faq-answer">
|
131 |
+
<p><?php _e( 'You can get your questions answered on the WordPress support forums. If you are a Cloudways customer, please feel free to start a discussion at', 'breeze' ); ?>
|
132 |
+
<a href="https://community.cloudways.com/" target="_blank"><?php _e( 'Cloudways Community Forum.', 'breeze' ); ?></a>
|
133 |
+
</p>
|
134 |
+
</div>
|
135 |
+
</div>
|
136 |
+
|
137 |
+
<div class="faq-block">
|
138 |
+
<h3 class="faq-question"><?php _e( 'How can I test and verify the results?', 'breeze' ); ?></h3>
|
139 |
+
<div class="faq-answer">
|
140 |
+
<p><?php _e( 'You will be able to see the impact of the Breeze Cache Plugin almost immediately. We also recommend using the following tools for generating metrics:', 'breeze' ); ?></p>
|
141 |
+
<ul style="margin-top: 10px">
|
142 |
+
<li><a href="https://developers.google.com/speed/pagespeed/" target="_blank"><?php _e( 'Google Page Speed', 'breeze' ); ?></a></li>
|
143 |
+
<li><a href="https://www.webpagetest.org/test" target="_blank"><?php _e( 'WebPagetest', 'breeze' ); ?></a></li>
|
144 |
+
<li><a href="https://tools.pingdom.com/" target="_blank"><?php _e( 'Pingdom', 'breeze' ); ?></a></li>
|
145 |
+
</ul>
|
146 |
+
</div>
|
147 |
+
</div>
|
148 |
+
|
149 |
+
<div class="faq-block">
|
150 |
+
<h3 class="faq-question"><?php _e( 'Does Breeze plugin work with Visual Builder?', 'breeze' ); ?></h3>
|
151 |
+
<div class="faq-answer">
|
152 |
+
<p><?php _e( 'Yes, Breeze Plugin is compatible with Visual Builder.', 'breeze' ); ?></p>
|
153 |
+
</div>
|
154 |
+
</div>
|
155 |
+
|
156 |
+
<div class="faq-block">
|
157 |
+
<h3 class="faq-question"><?php _e( 'What popular CDN are supported by Breeze Plugin?', 'breeze' ); ?></h3>
|
158 |
+
<div class="faq-answer">
|
159 |
+
<p><?php _e( 'Breeze supports the following three popular CDNs:', 'breeze' ); ?></p>
|
160 |
+
<ul style="margin-top: 10px">
|
161 |
+
<li><a href="https://support.cloudways.com/how-to-use-breeze-with-maxcdn/" target="_blank"><?php _e( 'MaxCDN', 'breeze' ); ?></a></li>
|
162 |
+
<li><a href="https://support.cloudways.com/how-to-use-breeze-with-keycdn/" target="_blank"><?php _e( 'KeyCDN', 'breeze' ); ?></a></li>
|
163 |
+
<li><a href="https://support.cloudways.com/how-to-use-breeze-with-amazon-cloudfront/" target="_blank"><?php _e( 'Amazon Cloudfront', 'breeze' ); ?></a></li>
|
164 |
+
</ul>
|
165 |
+
</div>
|
166 |
+
</div>
|
167 |
+
|
168 |
+
<div class="faq-block">
|
169 |
+
<h3 class="faq-question"><?php _e( 'Does Breeze support Push CDN?', 'breeze' ); ?></h3>
|
170 |
+
<div class="faq-answer">
|
171 |
+
<p><?php _e( 'No, Breeze does not support Push CDN. However, you could use Breeze with Push CDNs using third party plugins.', 'breeze' ); ?></p>
|
172 |
+
</div>
|
173 |
+
</div>
|
174 |
+
|
175 |
+
<div class="faq-block">
|
176 |
+
<h3 class="faq-question"><?php _e( 'Does Breeze Work With CloudFlare?', 'breeze' ); ?></h3>
|
177 |
+
<div class="faq-answer">
|
178 |
+
<p><?php _e( 'Yes. The process of setting up CloudFlare with Breeze is easy. Check out the following ', 'breeze' ); ?>
|
179 |
+
<a href="https://support.cloudways.com/can-i-use-cloudflare-cdn/" target="_blank"><?php _e( 'KnowledgeBase article for details.', 'breeze' ); ?></a>
|
180 |
+
</p>
|
181 |
+
</div>
|
182 |
+
</div>
|
183 |
+
|
184 |
+
<div class="faq-block">
|
185 |
+
<h3 class="faq-question"><?php _e( 'How Breeze cache uses Gzip?', 'breeze' ); ?></h3>
|
186 |
+
<div class="faq-answer">
|
187 |
+
<p><?php _e( 'Using Gzip, Breeze compresses the request files, further reducing the size of the download files and speeding up the user experience.', 'breeze' ); ?></p>
|
188 |
+
</div>
|
189 |
+
</div>
|
190 |
+
</div>
|
191 |
+
</div>
|
192 |
+
<!-- END OPTION -->
|
193 |
+
</div>
|
194 |
+
|
195 |
+
</section>
|
views/option-tabs/file-tab.php
ADDED
@@ -0,0 +1,603 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Basic tab
|
4 |
+
*/
|
5 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
6 |
+
header( 'Status: 403 Forbidden' );
|
7 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
8 |
+
exit;
|
9 |
+
}
|
10 |
+
|
11 |
+
set_as_network_screen();
|
12 |
+
|
13 |
+
$is_custom = false;
|
14 |
+
if ( ( ! defined( 'WP_NETWORK_ADMIN' ) || ( defined( 'WP_NETWORK_ADMIN' ) && false === WP_NETWORK_ADMIN ) ) && is_multisite() ) {
|
15 |
+
$get_inherit = get_option( 'breeze_inherit_settings', '1' );
|
16 |
+
$is_custom = filter_var( $get_inherit, FILTER_VALIDATE_BOOLEAN );
|
17 |
+
}
|
18 |
+
|
19 |
+
$options = breeze_get_option( 'file_settings', true );
|
20 |
+
$excluded_css_check = true;
|
21 |
+
$excluded_js_check = true;
|
22 |
+
$excluded_css_check_extension = true;
|
23 |
+
$excluded_js_check_extension = true;
|
24 |
+
$excluded_url_list = true;
|
25 |
+
|
26 |
+
$icon = BREEZE_PLUGIN_URL . 'assets/images/file-active.png';
|
27 |
+
?>
|
28 |
+
<form data-section="file">
|
29 |
+
<?php if ( true === $is_custom ) { ?>
|
30 |
+
<div class="br-overlay-disable"><?php _e( 'Settings are inherited', 'breeze' ); ?></div>
|
31 |
+
<?php } ?>
|
32 |
+
<section>
|
33 |
+
<div class="br-section-title">
|
34 |
+
<img src="<?php echo $icon; ?>"/>
|
35 |
+
<?php _e( 'FILE OPTIMIZATION', 'breeze' ); ?>
|
36 |
+
</div>
|
37 |
+
|
38 |
+
<div class="br-option-group">
|
39 |
+
<span class="section-title"><?php _e( 'HTML Settings', 'breeze' ); ?></span>
|
40 |
+
<!-- START OPTION -->
|
41 |
+
<div class="br-option-item br-top">
|
42 |
+
<div class="br-label">
|
43 |
+
<div class="br-option-text">
|
44 |
+
<?php _e( 'HTML Minify', 'breeze' ); ?>
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
<div class="br-option">
|
48 |
+
<?php
|
49 |
+
$basic_value = isset( $options['breeze-minify-html'] ) ? filter_var( $options['breeze-minify-html'], FILTER_VALIDATE_BOOLEAN ) : false;
|
50 |
+
$is_enabled = ( isset( $basic_value ) && true === $basic_value ) ? checked( $options['breeze-minify-html'], '1', false ) : '';
|
51 |
+
?>
|
52 |
+
<div class="on-off-checkbox">
|
53 |
+
<input id="minification-html" name="minification-html" type="checkbox" class="br-box" value="1" <?php echo $is_enabled; ?>>
|
54 |
+
<label for="minification-html">
|
55 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
56 |
+
</label>
|
57 |
+
</div>
|
58 |
+
<div class="br-note">
|
59 |
+
<p>
|
60 |
+
<?php
|
61 |
+
|
62 |
+
_e( 'Minifying HTML removes whitespace and comments to reduce the size.', 'breeze' );
|
63 |
+
?>
|
64 |
+
</p>
|
65 |
+
|
66 |
+
<p class="br-important">
|
67 |
+
<?php
|
68 |
+
echo '<strong>';
|
69 |
+
_e( 'Important: ', 'breeze' );
|
70 |
+
echo '</strong>';
|
71 |
+
_e( 'We recommend testing minification on a staging website before deploying it on a live website. ', 'breeze' );
|
72 |
+
echo '<br/>';
|
73 |
+
_e( 'Minification is known to cause issues on the frontend.', 'breeze' );
|
74 |
+
?>
|
75 |
+
</p>
|
76 |
+
</div>
|
77 |
+
</div>
|
78 |
+
</div>
|
79 |
+
<!-- END OPTION -->
|
80 |
+
</div><!-- END GROUP -->
|
81 |
+
|
82 |
+
<!-- START GROUP -->
|
83 |
+
<div class="br-option-group">
|
84 |
+
<span class="section-title"><?php _e( 'CSS Settings', 'breeze' ); ?></span>
|
85 |
+
<!-- START OPTION -->
|
86 |
+
<div class="br-option-item br-top">
|
87 |
+
<div class="br-label">
|
88 |
+
<div class="br-option-text">
|
89 |
+
<?php _e( 'CSS Minify', 'breeze' ); ?>
|
90 |
+
</div>
|
91 |
+
</div>
|
92 |
+
<div class="br-option">
|
93 |
+
<?php
|
94 |
+
$basic_value = isset( $options['breeze-minify-css'] ) ? filter_var( $options['breeze-minify-css'], FILTER_VALIDATE_BOOLEAN ) : false;
|
95 |
+
$is_enabled = ( isset( $basic_value ) && true === $basic_value ) ? checked( $options['breeze-minify-css'], '1', false ) : '';
|
96 |
+
|
97 |
+
$css_minify_state = true;
|
98 |
+
if ( empty( $is_enabled ) ) {
|
99 |
+
$css_minify_state = false;
|
100 |
+
}
|
101 |
+
|
102 |
+
?>
|
103 |
+
<div class="on-off-checkbox">
|
104 |
+
<input id="minification-css" name="minification-css" type="checkbox" class="br-box" value="1" <?php echo $is_enabled; ?>>
|
105 |
+
<label for="minification-css">
|
106 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
107 |
+
</label>
|
108 |
+
</div>
|
109 |
+
<div class="br-note">
|
110 |
+
<p>
|
111 |
+
<?php _e( 'Minify CSS removes whitespace and comments to reduce the file size.', 'breeze' ); ?>
|
112 |
+
</p>
|
113 |
+
</div>
|
114 |
+
|
115 |
+
<?php
|
116 |
+
$is_font_display = '';
|
117 |
+
if ( empty( $is_enabled ) ) {
|
118 |
+
$is_font_display = ' style="display: none"';
|
119 |
+
}
|
120 |
+
|
121 |
+
$basic_value = isset( $options['breeze-font-display-swap'] ) ? filter_var( $options['breeze-font-display-swap'], FILTER_VALIDATE_BOOLEAN ) : false;
|
122 |
+
$is_enabled = ( isset( $basic_value ) && true === $basic_value ) ? checked( $options['breeze-font-display-swap'], '1', false ) : '';
|
123 |
+
?>
|
124 |
+
<div id="font-display-swap" <?php echo $is_font_display; ?>>
|
125 |
+
<div class="on-off-checkbox">
|
126 |
+
<input id="font-display" name="font-display" type="checkbox" class="br-box" value="1" <?php echo $is_enabled; ?>>
|
127 |
+
<label for="font-display">
|
128 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
129 |
+
</label>
|
130 |
+
</div>
|
131 |
+
<p>
|
132 |
+
<?php _e( 'Font remain visible during load', 'breeze' ); ?><br/>
|
133 |
+
</p>
|
134 |
+
</div>
|
135 |
+
|
136 |
+
<p class="br-important">
|
137 |
+
<?php
|
138 |
+
echo '<strong>';
|
139 |
+
_e( 'Important: ', 'breeze' );
|
140 |
+
echo '</strong>';
|
141 |
+
_e( 'We recommend testing minification on a staging website before deploying it on a live website. ', 'breeze' );
|
142 |
+
echo '<br/>';
|
143 |
+
_e( 'Minification is known to cause issues on the frontend.', 'breeze' );
|
144 |
+
?>
|
145 |
+
</p>
|
146 |
+
</div>
|
147 |
+
</div>
|
148 |
+
<!-- END OPTION -->
|
149 |
+
|
150 |
+
<!-- START OPTION -->
|
151 |
+
<div class="br-option-item">
|
152 |
+
<div class="br-label">
|
153 |
+
<div class="br-option-text">
|
154 |
+
<?php _e( 'Include Inline CSS', 'breeze' ); ?>
|
155 |
+
</div>
|
156 |
+
</div>
|
157 |
+
<div class="br-option">
|
158 |
+
<?php
|
159 |
+
$basic_value = isset( $options['breeze-include-inline-css'] ) ? filter_var( $options['breeze-include-inline-css'], FILTER_VALIDATE_BOOLEAN ) : false;
|
160 |
+
$is_enabled = ( isset( $basic_value ) && true === $basic_value ) ? checked( $options['breeze-include-inline-css'], '1', false ) : '';
|
161 |
+
$disable_inline_css = '';
|
162 |
+
|
163 |
+
if ( false === $css_minify_state ) {
|
164 |
+
$disable_inline_css = 'disabled="disabled"';
|
165 |
+
}
|
166 |
+
?>
|
167 |
+
<div class="on-off-checkbox">
|
168 |
+
<input id="include-inline-css" name="include-inline-css" type="checkbox" class="br-box" value="1" <?php echo $is_enabled; ?> <?php echo $disable_inline_css; ?>>
|
169 |
+
<label for="include-inline-css">
|
170 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
171 |
+
</label>
|
172 |
+
</div>
|
173 |
+
<div class="br-note">
|
174 |
+
<p>
|
175 |
+
<?php _e( 'Minify Inline CSS removes whitespace and create seprate cache file for inline CSS.', 'breeze' ); ?>
|
176 |
+
|
177 |
+
|
178 |
+
</p>
|
179 |
+
</div>
|
180 |
+
</div>
|
181 |
+
</div>
|
182 |
+
<!-- END OPTION -->
|
183 |
+
|
184 |
+
<!-- START OPTION -->
|
185 |
+
<div class="br-option-item">
|
186 |
+
<div class="br-label">
|
187 |
+
<div class="br-option-text">
|
188 |
+
<?php _e( 'Combine CSS', 'breeze' ); ?>
|
189 |
+
</div>
|
190 |
+
</div>
|
191 |
+
<div class="br-option">
|
192 |
+
<?php
|
193 |
+
$basic_value = isset( $options['breeze-group-css'] ) ? filter_var( $options['breeze-group-css'], FILTER_VALIDATE_BOOLEAN ) : false;
|
194 |
+
$is_enabled = ( isset( $basic_value ) && true === $basic_value ) ? checked( $options['breeze-group-css'], '1', false ) : '';
|
195 |
+
|
196 |
+
$disable_group_css = '';
|
197 |
+
|
198 |
+
if ( false === $css_minify_state ) {
|
199 |
+
$disable_group_css = 'disabled="disabled"';
|
200 |
+
}
|
201 |
+
?>
|
202 |
+
<div class="on-off-checkbox">
|
203 |
+
<input id="group-css" name="group-css" type="checkbox" class="br-box" value="1" <?php echo $is_enabled; ?> <?php echo $disable_group_css; ?>>
|
204 |
+
<label for="group-css">
|
205 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
206 |
+
</label>
|
207 |
+
</div>
|
208 |
+
<div class="br-note">
|
209 |
+
<p>
|
210 |
+
<?php _e( 'Combine CSS merges all your minified files into a single file, reducing HTTP requests.', 'breeze' ); ?>
|
211 |
+
</p>
|
212 |
+
</div>
|
213 |
+
</div>
|
214 |
+
</div>
|
215 |
+
<!-- END OPTION -->
|
216 |
+
|
217 |
+
<!-- START OPTION -->
|
218 |
+
<div class="br-option-item">
|
219 |
+
<div class="br-label">
|
220 |
+
<div class="br-option-text">
|
221 |
+
<?php _e( 'Exclude CSS', 'breeze' ); ?>
|
222 |
+
</div>
|
223 |
+
</div>
|
224 |
+
<div class="br-option">
|
225 |
+
<?php
|
226 |
+
|
227 |
+
if ( isset( $options['breeze-exclude-css'] ) && ! empty( $options['breeze-exclude-css'] ) ) {
|
228 |
+
$excluded_css_check = breeze_validate_urls( $options['breeze-exclude-css'] );
|
229 |
+
if ( true === $excluded_css_check ) {
|
230 |
+
$excluded_css_check_extension = breeze_validate_the_right_extension( $options['breeze-exclude-css'], 'css' );
|
231 |
+
}
|
232 |
+
}
|
233 |
+
|
234 |
+
$css_output = '';
|
235 |
+
if ( ! empty( $options['breeze-exclude-css'] ) ) {
|
236 |
+
$output = implode( "\n", $options['breeze-exclude-css'] );
|
237 |
+
$css_output = esc_textarea( $output );
|
238 |
+
}
|
239 |
+
?>
|
240 |
+
<textarea cols="100" rows="7" id="exclude-css" name="exclude-css"
|
241 |
+
placeholder="Exclude CSS on the basis of the folder https://demo/wp-content/plugins/some-plugin/assets/css/demo(.*) Exclude CSS on the basis of the file name https://demo/wp-content/plugins/some-plugin/assets/css/demo_1/css_random_someplugin_(.*).css"><?php echo $css_output; ?></textarea>
|
242 |
+
<div class="br-note">
|
243 |
+
<p>
|
244 |
+
<?php
|
245 |
+
|
246 |
+
_e( 'Use this option to exclude CSS files from Minification and Grouping. Enter the URLs of CSS files on each line.', 'breeze' );
|
247 |
+
?>
|
248 |
+
</p>
|
249 |
+
<p class="br-notice">
|
250 |
+
<?php if ( false === $excluded_css_check_extension ) { ?>
|
251 |
+
<?php _e( 'One (or more) URL is incorrect. Please confirm that all URLs have the .css extension', 'breeze' ); ?>
|
252 |
+
<?php } ?>
|
253 |
+
<?php if ( false === $excluded_css_check ) { ?>
|
254 |
+
<?php _e( 'One (or more) URL is invalid. Please check and correct the entry.', 'breeze' ); ?>
|
255 |
+
<?php } ?>
|
256 |
+
</p>
|
257 |
+
</div>
|
258 |
+
</div>
|
259 |
+
</div>
|
260 |
+
<!-- END OPTION -->
|
261 |
+
</div><!-- END GROUP -->
|
262 |
+
|
263 |
+
<!-- START GROUP -->
|
264 |
+
<div class="br-option-group">
|
265 |
+
<span class="section-title"><?php _e( 'JS Settings', 'breeze' ); ?></span>
|
266 |
+
<!-- START OPTION -->
|
267 |
+
<div class="br-option-item br-top">
|
268 |
+
<div class="br-label">
|
269 |
+
<div class="br-option-text">
|
270 |
+
<?php _e( 'JS Minify', 'breeze' ); ?>
|
271 |
+
</div>
|
272 |
+
</div>
|
273 |
+
<div class="br-option">
|
274 |
+
<?php
|
275 |
+
$basic_value = isset( $options['breeze-minify-js'] ) ? filter_var( $options['breeze-minify-js'], FILTER_VALIDATE_BOOLEAN ) : false;
|
276 |
+
$is_enabled = ( isset( $basic_value ) && true === $basic_value ) ? checked( $options['breeze-minify-js'], '1', false ) : '';
|
277 |
+
|
278 |
+
$js_minify_state = true;
|
279 |
+
if ( empty( $is_enabled ) ) {
|
280 |
+
$js_minify_state = false;
|
281 |
+
}
|
282 |
+
?>
|
283 |
+
<div class="on-off-checkbox">
|
284 |
+
<input id="minification-js" name="minification-js" type="checkbox" class="br-box" value="1" <?php echo $is_enabled; ?>>
|
285 |
+
<label for="minification-js">
|
286 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
287 |
+
</label>
|
288 |
+
</div>
|
289 |
+
<div class="br-note">
|
290 |
+
<p>
|
291 |
+
<?php _e( 'Minify JavaScript removes whitespace and comments to reduce the file size.', 'breeze' ); ?>
|
292 |
+
</p>
|
293 |
+
|
294 |
+
<p class="br-important">
|
295 |
+
<?php
|
296 |
+
echo '<strong>';
|
297 |
+
_e( 'Important: ', 'breeze' );
|
298 |
+
echo '</strong>';
|
299 |
+
_e( 'We recommend testing minification on a staging website before deploying it on a live website. ', 'breeze' );
|
300 |
+
echo '<br/>';
|
301 |
+
_e( 'Minification is known to cause issues on the frontend.', 'breeze' );
|
302 |
+
?>
|
303 |
+
</p>
|
304 |
+
</div>
|
305 |
+
</div>
|
306 |
+
</div>
|
307 |
+
<!-- END OPTION -->
|
308 |
+
|
309 |
+
<!-- START OPTION -->
|
310 |
+
<div class="br-option-item">
|
311 |
+
<div class="br-label">
|
312 |
+
<div class="br-option-text">
|
313 |
+
<?php _e( 'Combine JS', 'breeze' ); ?>
|
314 |
+
</div>
|
315 |
+
</div>
|
316 |
+
<div class="br-option">
|
317 |
+
<?php
|
318 |
+
$basic_value = isset( $options['breeze-group-js'] ) ? filter_var( $options['breeze-group-js'], FILTER_VALIDATE_BOOLEAN ) : false;
|
319 |
+
$is_enabled = ( isset( $basic_value ) && true === $basic_value ) ? checked( $options['breeze-group-js'], '1', false ) : '';
|
320 |
+
|
321 |
+
$disable_group_js = '';
|
322 |
+
|
323 |
+
if ( false === $js_minify_state ) {
|
324 |
+
$disable_group_js = 'disabled="disabled"';
|
325 |
+
}
|
326 |
+
?>
|
327 |
+
<div class="on-off-checkbox">
|
328 |
+
<input id="group-js" name="group-js" type="checkbox" class="br-box" value="1" <?php echo $is_enabled; ?> <?php echo $disable_group_js; ?>>
|
329 |
+
<label for="group-js">
|
330 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
331 |
+
</label>
|
332 |
+
</div>
|
333 |
+
<div class="br-note">
|
334 |
+
<p>
|
335 |
+
<?php _e( 'Combine JS merges all your minified files into a single file, reducing HTTP requests.', 'breeze' ); ?>
|
336 |
+
</p>
|
337 |
+
</div>
|
338 |
+
</div>
|
339 |
+
</div>
|
340 |
+
<!-- END OPTION -->
|
341 |
+
|
342 |
+
<!-- START OPTION -->
|
343 |
+
<div class="br-option-item">
|
344 |
+
<div class="br-label">
|
345 |
+
<div class="br-option-text">
|
346 |
+
<?php _e( 'Include Inline JS', 'breeze' ); ?>
|
347 |
+
</div>
|
348 |
+
</div>
|
349 |
+
<div class="br-option">
|
350 |
+
<?php
|
351 |
+
$basic_value = isset( $options['breeze-include-inline-js'] ) ? filter_var( $options['breeze-include-inline-js'], FILTER_VALIDATE_BOOLEAN ) : false;
|
352 |
+
$is_enabled = ( isset( $basic_value ) && true === $basic_value ) ? checked( $options['breeze-include-inline-js'], '1', false ) : '';
|
353 |
+
|
354 |
+
$disable_inline_js = '';
|
355 |
+
|
356 |
+
if ( false === $js_minify_state ) {
|
357 |
+
$disable_inline_js = 'disabled="disabled"';
|
358 |
+
}
|
359 |
+
?>
|
360 |
+
<div class="on-off-checkbox">
|
361 |
+
<input id="include-inline-js" name="include-inline-js" type="checkbox" class="br-box" value="1" <?php echo $is_enabled; ?> <?php echo $disable_inline_js; ?>>
|
362 |
+
<label for="include-inline-js">
|
363 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
364 |
+
</label>
|
365 |
+
</div>
|
366 |
+
<div class="br-note">
|
367 |
+
<p>
|
368 |
+
<?php _e( 'Minify Inline JS removes whitespace and create seprate cache file for inline JS.', 'breeze' ); ?>
|
369 |
+
|
370 |
+
</p>
|
371 |
+
</div>
|
372 |
+
</div>
|
373 |
+
</div>
|
374 |
+
<!-- END OPTION -->
|
375 |
+
|
376 |
+
<!-- START OPTION -->
|
377 |
+
<div class="br-option-item">
|
378 |
+
<div class="br-label">
|
379 |
+
<div class="br-option-text">
|
380 |
+
<?php _e( 'Exclude JS', 'breeze' ); ?>
|
381 |
+
</div>
|
382 |
+
</div>
|
383 |
+
<div class="br-option">
|
384 |
+
<?php
|
385 |
+
if ( isset( $options['breeze-exclude-js'] ) && ! empty( $options['breeze-exclude-js'] ) ) {
|
386 |
+
$excluded_js_check = breeze_validate_urls( $options['breeze-exclude-js'] );
|
387 |
+
if ( true === $excluded_js_check ) {
|
388 |
+
$excluded_js_check_extension = breeze_validate_the_right_extension( $options['breeze-exclude-js'], 'js' );
|
389 |
+
}
|
390 |
+
}
|
391 |
+
|
392 |
+
$js_output = '';
|
393 |
+
if ( ! empty( $options['breeze-exclude-js'] ) ) {
|
394 |
+
$output = implode( "\n", $options['breeze-exclude-js'] );
|
395 |
+
$js_output = esc_textarea( $output );
|
396 |
+
}
|
397 |
+
|
398 |
+
?>
|
399 |
+
<textarea cols="100" rows="7" id="exclude-js" name="exclude-js"
|
400 |
+
placeholder="Exclude JS on the basis of the folder https://demo/wp-content/plugins/some-plugin/assets/js/demo(.*) Exclude JS on the basis of the file name https://demo/wp-content/plugins/some-plugin/assets/js/demo_1/js_random_someplugin_(.*).js"><?php echo $js_output; ?></textarea>
|
401 |
+
<div class="br-note">
|
402 |
+
<p>
|
403 |
+
<?php
|
404 |
+
|
405 |
+
_e( 'Use this option to exclude JS files from Minification and Grouping. Enter the URLs of JS files on each line.', 'breeze' );
|
406 |
+
?>
|
407 |
+
</p>
|
408 |
+
<p class="br-notice">
|
409 |
+
<?php if ( false === $excluded_js_check_extension ) { ?>
|
410 |
+
<?php _e( 'One (or more) URL is incorrect. Please confirm that all URLs have the .js extension', 'breeze' ); ?>
|
411 |
+
<?php } ?>
|
412 |
+
<?php if ( false === $excluded_js_check ) { ?>
|
413 |
+
<?php _e( 'One (or more) URL is invalid. Please check and correct the entry.', 'breeze' ); ?>
|
414 |
+
<?php } ?>
|
415 |
+
</p>
|
416 |
+
</div>
|
417 |
+
</div>
|
418 |
+
</div>
|
419 |
+
<!-- END OPTION -->
|
420 |
+
|
421 |
+
<!-- START OPTION -->
|
422 |
+
<div class="br-option-item">
|
423 |
+
<div class="br-label">
|
424 |
+
<div class="br-option-text">
|
425 |
+
<?php _e( 'Move JS Files to Footer', 'breeze' ); ?>
|
426 |
+
</div>
|
427 |
+
</div>
|
428 |
+
<div class="br-option">
|
429 |
+
<div class="breeze-list-url">
|
430 |
+
<?php if ( ! empty( $options['breeze-move-to-footer-js'] ) ) : ?>
|
431 |
+
<?php foreach ( $options['breeze-move-to-footer-js'] as $js_url ) : ?>
|
432 |
+
<div class="breeze-input-group">
|
433 |
+
<input type="text" size="98"
|
434 |
+
class="breeze-input-url"
|
435 |
+
name="move-to-footer-js[]"
|
436 |
+
placeholder="<?php _e( 'Enter URL...', 'breeze' ); ?>"
|
437 |
+
value="<?php echo esc_html( $js_url ); ?>"/>
|
438 |
+
<span class="sort-handle">
|
439 |
+
<span class="dashicons dashicons-arrow-up moveUp"></span>
|
440 |
+
<span class="dashicons dashicons-arrow-down moveDown"></span>
|
441 |
+
</span>
|
442 |
+
<span class="dashicons dashicons-no item-remove" title="<?php _e( 'Remove', 'breeze' ); ?>"></span>
|
443 |
+
</div>
|
444 |
+
<?php endforeach; ?>
|
445 |
+
<?php else : ?>
|
446 |
+
<div class="breeze-input-group">
|
447 |
+
<input type="text" size="98"
|
448 |
+
class="breeze-input-url"
|
449 |
+
id="move-to-footer-js"
|
450 |
+
name="move-to-footer-js[]"
|
451 |
+
placeholder="<?php _e( 'Enter URL...', 'breeze' ); ?>"
|
452 |
+
value=""/>
|
453 |
+
<span class="sort-handle">
|
454 |
+
<span class="dashicons dashicons-arrow-up moveUp"></span>
|
455 |
+
<span class="dashicons dashicons-arrow-down moveDown"></span>
|
456 |
+
</span>
|
457 |
+
<span class="dashicons dashicons-no item-remove" title="<?php _e( 'Remove', 'breeze' ); ?>"></span>
|
458 |
+
</div>
|
459 |
+
<?php endif; ?>
|
460 |
+
</div>
|
461 |
+
<div style="margin: 10px 0">
|
462 |
+
<button type="button" class="br-blue-button-reverse add-url" id="add-move-to-footer-js">
|
463 |
+
<?php _e( 'Add URL', 'breeze' ); ?>
|
464 |
+
</button>
|
465 |
+
</div>
|
466 |
+
<div class="br-note">
|
467 |
+
<p>
|
468 |
+
<?php
|
469 |
+
|
470 |
+
_e( 'Enter the complete URLs of JS files to be moved to the footer during minification process.', 'breeze' );
|
471 |
+
?>
|
472 |
+
</p>
|
473 |
+
<p class="br-important">
|
474 |
+
<?php
|
475 |
+
echo '<strong>';
|
476 |
+
_e( 'Important: ', 'breeze' );
|
477 |
+
echo '</strong>';
|
478 |
+
_e( 'You should add the URL of original files as URL of minified files are not supported.', 'breeze' );
|
479 |
+
?>
|
480 |
+
</p>
|
481 |
+
|
482 |
+
</div>
|
483 |
+
</div>
|
484 |
+
</div>
|
485 |
+
<!-- END OPTION -->
|
486 |
+
<!-- START OPTION -->
|
487 |
+
<div class="br-option-item">
|
488 |
+
<div class="br-label">
|
489 |
+
<div class="br-option-text">
|
490 |
+
<?php _e( 'JS Files With Deferred Loading', 'breeze' ); ?>
|
491 |
+
</div>
|
492 |
+
</div>
|
493 |
+
<div class="br-option">
|
494 |
+
<div class="breeze-list-url">
|
495 |
+
<?php if ( ! empty( $options['breeze-defer-js'] ) ) : ?>
|
496 |
+
<?php foreach ( $options['breeze-defer-js'] as $js_url ) : ?>
|
497 |
+
<div class="breeze-input-group">
|
498 |
+
|
499 |
+
<input type="text" size="98"
|
500 |
+
class="breeze-input-url"
|
501 |
+
name="defer-js[]"
|
502 |
+
placeholder="<?php _e( 'Enter URL...', 'breeze' ); ?>"
|
503 |
+
value="<?php echo esc_html( $js_url ); ?>"/>
|
504 |
+
<span class="sort-handle">
|
505 |
+
<span class="dashicons dashicons-arrow-up moveUp"></span>
|
506 |
+
<span class="dashicons dashicons-arrow-down moveDown"></span>
|
507 |
+
</span>
|
508 |
+
<span class="dashicons dashicons-no item-remove" title="<?php _e( 'Remove', 'breeze' ); ?>"></span>
|
509 |
+
</div>
|
510 |
+
<?php endforeach; ?>
|
511 |
+
<?php else : ?>
|
512 |
+
<div class="breeze-input-group">
|
513 |
+
<input type="text" size="98"
|
514 |
+
class="breeze-input-url"
|
515 |
+
name="defer-js[]"
|
516 |
+
id="defer-js"
|
517 |
+
placeholder="<?php _e( 'Enter URL...', 'breeze' ); ?>"
|
518 |
+
value=""/>
|
519 |
+
<span class="sort-handle">
|
520 |
+
<span class="dashicons dashicons-arrow-up moveUp"></span>
|
521 |
+
<span class="dashicons dashicons-arrow-down moveDown"></span>
|
522 |
+
</span>
|
523 |
+
<span class="dashicons dashicons-no item-remove" title="<?php _e( 'Remove', 'breeze' ); ?>"></span>
|
524 |
+
</div>
|
525 |
+
<?php endif; ?>
|
526 |
+
</div>
|
527 |
+
<div style="margin: 10px 0">
|
528 |
+
<button type="button" class="br-blue-button-reverse add-url" id="add-defer-js">
|
529 |
+
<?php _e( 'Add URL', 'breeze' ); ?>
|
530 |
+
</button>
|
531 |
+
</div>
|
532 |
+
<div class="br-note">
|
533 |
+
<p class="br-important">
|
534 |
+
<?php
|
535 |
+
echo '<strong>';
|
536 |
+
_e( 'Important: ', 'breeze' );
|
537 |
+
echo '</strong>';
|
538 |
+
_e( 'You should add the URL of original files as URL of minified files are not supported.', 'breeze' );
|
539 |
+
?>
|
540 |
+
</p>
|
541 |
+
</div>
|
542 |
+
</div>
|
543 |
+
</div>
|
544 |
+
<!-- END OPTION -->
|
545 |
+
|
546 |
+
<!-- START OPTION -->
|
547 |
+
<div class="br-option-item">
|
548 |
+
<div class="br-label">
|
549 |
+
<div class="br-option-text">
|
550 |
+
<?php _e( 'Delay JS Inline Scripts', 'breeze' ); ?>
|
551 |
+
</div>
|
552 |
+
</div>
|
553 |
+
<div class="br-option">
|
554 |
+
<?php
|
555 |
+
$basic_value = isset( $options['breeze-enable-js-delay'] ) ? filter_var( $options['breeze-enable-js-delay'], FILTER_VALIDATE_BOOLEAN ) : false;
|
556 |
+
$is_enabled = ( isset( $basic_value ) && true === $basic_value ) ? checked( $options['breeze-enable-js-delay'], '1', false ) : '';
|
557 |
+
?>
|
558 |
+
<div class="on-off-checkbox">
|
559 |
+
<input id="enable-js-delay" name="enable-js-delay" type="checkbox" class="br-box" value="1" <?php echo $is_enabled; ?>>
|
560 |
+
<label for="enable-js-delay">
|
561 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
562 |
+
</label>
|
563 |
+
</div>
|
564 |
+
<?php
|
565 |
+
$js_output = '';
|
566 |
+
if ( ! empty( $options['breeze-delay-js-scripts'] ) ) {
|
567 |
+
$output = implode( "\n", $options['breeze-delay-js-scripts'] );
|
568 |
+
$js_output = esc_textarea( $output );
|
569 |
+
}
|
570 |
+
|
571 |
+
$display_text_area = 'style="display:none"';
|
572 |
+
if ( true === $basic_value ) {
|
573 |
+
$display_text_area = 'style="display:block"';
|
574 |
+
}
|
575 |
+
?>
|
576 |
+
<div <?php echo $display_text_area; ?> id="breeze-delay-js-scripts-div">
|
577 |
+
<br/>
|
578 |
+
<textarea cols="100" rows="7" id="delay-js-scripts" name="delay-js-scripts"><?php echo $js_output; ?></textarea>
|
579 |
+
<div class="br-note">
|
580 |
+
<p>
|
581 |
+
<?php
|
582 |
+
|
583 |
+
_e( 'You can add specific keywords to identify the inline JavaScript to be delayed. Each script identifying keyword must be added on a new line.', 'breeze' );
|
584 |
+
?>
|
585 |
+
<a href="https://www.cloudways.com/blog/breeze-1-2-version-released/" target="_blank"><?php _e( 'More info here', 'breeze' ); ?></a>
|
586 |
+
</p>
|
587 |
+
<p class="br-notice">
|
588 |
+
<?php _e( 'Please clear Varnish after applying the new settings.', 'breeze' ); ?>
|
589 |
+
</p>
|
590 |
+
</div>
|
591 |
+
</div>
|
592 |
+
|
593 |
+
</div>
|
594 |
+
</div>
|
595 |
+
<!-- END OPTION -->
|
596 |
+
|
597 |
+
</div><!-- END GROUP -->
|
598 |
+
|
599 |
+
</section>
|
600 |
+
<div class="br-submit">
|
601 |
+
<input type="submit" value="<?php echo __( 'Save Changes', 'breeze' ); ?>" class="br-submit-save"/>
|
602 |
+
</div>
|
603 |
+
</form>
|
views/option-tabs/preload-tab.php
ADDED
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Basic tab
|
4 |
+
*/
|
5 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
6 |
+
header( 'Status: 403 Forbidden' );
|
7 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
8 |
+
exit;
|
9 |
+
}
|
10 |
+
|
11 |
+
set_as_network_screen();
|
12 |
+
|
13 |
+
$is_custom = false;
|
14 |
+
if ( ( ! defined( 'WP_NETWORK_ADMIN' ) || ( defined( 'WP_NETWORK_ADMIN' ) && false === WP_NETWORK_ADMIN ) ) && is_multisite() ) {
|
15 |
+
$get_inherit = get_option( 'breeze_inherit_settings', '1' );
|
16 |
+
$is_custom = filter_var( $get_inherit, FILTER_VALIDATE_BOOLEAN );
|
17 |
+
}
|
18 |
+
|
19 |
+
$options = breeze_get_option( 'preload_settings', true );
|
20 |
+
|
21 |
+
$icon = BREEZE_PLUGIN_URL . 'assets/images/preload-active.png';
|
22 |
+
?>
|
23 |
+
<form data-section="preload">
|
24 |
+
<?php if ( true === $is_custom ) { ?>
|
25 |
+
<div class="br-overlay-disable"><?php _e( 'Settings are inherited', 'breeze' ); ?></div>
|
26 |
+
<?php } ?>
|
27 |
+
<section>
|
28 |
+
<div class="br-section-title">
|
29 |
+
<img src="<?php echo $icon; ?>"/>
|
30 |
+
<?php _e( 'PRELOAD', 'breeze' ); ?>
|
31 |
+
</div>
|
32 |
+
|
33 |
+
<!-- START OPTION -->
|
34 |
+
<div class="br-option-item">
|
35 |
+
<div class="br-label">
|
36 |
+
<div class="br-option-text">
|
37 |
+
<?php _e( 'Preload Webfont', 'breeze' ); ?>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
<div class="br-option">
|
41 |
+
<div class="breeze-list-url">
|
42 |
+
<?php if ( ! empty( $options['breeze-preload-fonts'] ) ) : ?>
|
43 |
+
<?php foreach ( $options['breeze-preload-fonts'] as $font_url ) : ?>
|
44 |
+
<div class="breeze-input-group">
|
45 |
+
<input type="text" size="98"
|
46 |
+
class="breeze-input-url"
|
47 |
+
name="breeze-preload-font[]"
|
48 |
+
placeholder="<?php _e( 'Enter Font/CSS URL...', 'breeze' ); ?>"
|
49 |
+
value="<?php echo esc_html( $font_url ); ?>"/>
|
50 |
+
<span class="sort-handle">
|
51 |
+
<span class="dashicons dashicons-arrow-up moveUp"></span>
|
52 |
+
<span class="dashicons dashicons-arrow-down moveDown"></span>
|
53 |
+
</span>
|
54 |
+
<span class="dashicons dashicons-no item-remove" title="<?php _e( 'Remove', 'breeze' ); ?>"></span>
|
55 |
+
</div>
|
56 |
+
<?php endforeach; ?>
|
57 |
+
<?php else : ?>
|
58 |
+
<div class="breeze-input-group">
|
59 |
+
<input type="text" size="98"
|
60 |
+
class="breeze-input-url"
|
61 |
+
id="breeze-preload-font"
|
62 |
+
name="breeze-preload-font[]"
|
63 |
+
placeholder="<?php _e( 'Enter Font/CSS URL...', 'breeze' ); ?>"
|
64 |
+
value=""/>
|
65 |
+
<span class="sort-handle">
|
66 |
+
<span class="dashicons dashicons-arrow-up moveUp"></span>
|
67 |
+
<span class="dashicons dashicons-arrow-down moveDown"></span>
|
68 |
+
</span>
|
69 |
+
<span class="dashicons dashicons-no item-remove" title="<?php _e( 'Remove', 'breeze' ); ?>"></span>
|
70 |
+
</div>
|
71 |
+
<?php endif; ?>
|
72 |
+
</div>
|
73 |
+
<div style="margin: 10px 0">
|
74 |
+
<button type="button" class="br-blue-button-reverse add-url" id="add-breeze-preload-fonts">
|
75 |
+
<?php _e( 'Add URL', 'breeze' ); ?>
|
76 |
+
</button>
|
77 |
+
</div>
|
78 |
+
<div class="br-note">
|
79 |
+
<p>
|
80 |
+
<?php
|
81 |
+
|
82 |
+
_e( 'Specify the local font URL or the URL for the CSS file which loads only fonts. Load WOFF formats fonts for the best performance. Do not preload the whole website CSS file as it will slow down your website. Do not add Google Fonts links as those already use preload.', 'breeze' );
|
83 |
+
?>
|
84 |
+
<br/>
|
85 |
+
<?php
|
86 |
+
$theme_url = get_template_directory_uri() . '/assets/fonts/my-font.woff';
|
87 |
+
echo '<strong>';
|
88 |
+
_e( 'Example:', 'breeze' );
|
89 |
+
echo '</strong>';
|
90 |
+
echo ' ' . esc_url( $theme_url );
|
91 |
+
?>
|
92 |
+
</p>
|
93 |
+
|
94 |
+
</div>
|
95 |
+
</div>
|
96 |
+
</div>
|
97 |
+
<!-- END OPTION -->
|
98 |
+
|
99 |
+
<!-- START OPTION -->
|
100 |
+
<div class="br-option-item">
|
101 |
+
<div class="br-label">
|
102 |
+
<div class="br-option-text">
|
103 |
+
<?php _e( 'Preload Links', 'breeze' ); ?>
|
104 |
+
</div>
|
105 |
+
</div>
|
106 |
+
<div class="br-option">
|
107 |
+
<?php
|
108 |
+
$basic_value = isset( $options['breeze-preload-links'] ) ? filter_var( $options['breeze-preload-links'], FILTER_VALIDATE_BOOLEAN ) : false;
|
109 |
+
$is_enabled = ( isset( $basic_value ) && true === $basic_value ) ? checked( $options['breeze-preload-links'], '1', false ) : '';
|
110 |
+
?>
|
111 |
+
<div class="on-off-checkbox">
|
112 |
+
<input id="preload-links" name="preload-links" type="checkbox" class="br-box" value="1" <?php echo $is_enabled; ?>>
|
113 |
+
<label for="preload-links">
|
114 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
115 |
+
</label>
|
116 |
+
</div>
|
117 |
+
<div class="br-note">
|
118 |
+
<p>
|
119 |
+
<?php
|
120 |
+
|
121 |
+
_e( 'When users hover over links, the cache is created in advance. The page will load faster upon link visiting.', 'breeze' );
|
122 |
+
?>
|
123 |
+
</p>
|
124 |
+
<p class="br-important">
|
125 |
+
<?php
|
126 |
+
echo '<strong>';
|
127 |
+
_e( 'Important: ', 'breeze' );
|
128 |
+
echo '</strong>';
|
129 |
+
_e( 'This feature is supported by Chromium based browsers (Chrome, Opera, Microsoft Edge Chromimum, Brave...);', 'breeze' );
|
130 |
+
?>
|
131 |
+
</p>
|
132 |
+
</div>
|
133 |
+
</div>
|
134 |
+
</div>
|
135 |
+
<!-- END OPTION -->
|
136 |
+
</section>
|
137 |
+
<div class="br-submit">
|
138 |
+
<input type="submit" value="<?php echo __( 'Save Changes', 'breeze' ); ?>" class="br-submit-save"/>
|
139 |
+
</div>
|
140 |
+
</form>
|
views/option-tabs/tools-tab.php
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Basic tab
|
4 |
+
*/
|
5 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
6 |
+
header( 'Status: 403 Forbidden' );
|
7 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
8 |
+
exit;
|
9 |
+
}
|
10 |
+
|
11 |
+
set_as_network_screen();
|
12 |
+
|
13 |
+
$is_custom = false;
|
14 |
+
if ( ( ! defined( 'WP_NETWORK_ADMIN' ) || ( defined( 'WP_NETWORK_ADMIN' ) && false === WP_NETWORK_ADMIN ) ) && is_multisite() ) {
|
15 |
+
$get_inherit = get_option( 'breeze_inherit_settings', '1' );
|
16 |
+
$is_custom = filter_var( $get_inherit, FILTER_VALIDATE_BOOLEAN );
|
17 |
+
}
|
18 |
+
|
19 |
+
$icon = BREEZE_PLUGIN_URL . 'assets/images/tools-active.png';
|
20 |
+
|
21 |
+
$level = '';
|
22 |
+
if ( is_multisite() ) {
|
23 |
+
if ( is_network_admin() ) {
|
24 |
+
$level = 'network';
|
25 |
+
} else {
|
26 |
+
$level = get_current_blog_id();
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
?>
|
31 |
+
<section>
|
32 |
+
<?php if ( true === $is_custom ) { ?>
|
33 |
+
<div class="br-overlay-disable"><?php _e( 'Settings are inherited', 'breeze' ); ?></div>
|
34 |
+
<?php } ?>
|
35 |
+
<div class="br-section-title">
|
36 |
+
<img src="<?php echo $icon; ?>"/>
|
37 |
+
<?php _e( 'TOOLS', 'breeze' ); ?>
|
38 |
+
</div>
|
39 |
+
|
40 |
+
<!-- START OPTION -->
|
41 |
+
<div class="br-option-item">
|
42 |
+
<div class="br-label">
|
43 |
+
<div class="br-option-text">
|
44 |
+
<?php _e( 'Export Settings', 'breeze' ); ?>
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
<div class="br-option">
|
48 |
+
<input type="button" name="breeze_export_settings" id="breeze_export_settings" class="br-blue-button" value="<?php _e( 'Download Settings', 'breeze' ); ?>">
|
49 |
+
<input type="hidden" id="breeze-level" value="<?php echo esc_attr( $level ); ?>">
|
50 |
+
<div class="br-note">
|
51 |
+
<p style="font-weight: bold">
|
52 |
+
<?php _e( 'Download a backup file of your settings', 'breeze' ); ?>
|
53 |
+
</p>
|
54 |
+
</div>
|
55 |
+
</div>
|
56 |
+
</div>
|
57 |
+
<!-- END OPTION -->
|
58 |
+
|
59 |
+
<!-- START OPTION -->
|
60 |
+
<div class="br-option-item">
|
61 |
+
<div class="br-label">
|
62 |
+
<div class="br-option-text">
|
63 |
+
<?php _e( 'Import Settings:', 'breeze' ); ?>
|
64 |
+
</div>
|
65 |
+
</div>
|
66 |
+
<div class="br-option">
|
67 |
+
<div class="br-input-container">
|
68 |
+
<div class="br-input-item">
|
69 |
+
<label for="breeze_import_settings" class="br-label-for-file">
|
70 |
+
<input type="file" name="breeze_import_settings" id="breeze_import_settings">
|
71 |
+
</label>
|
72 |
+
</div>
|
73 |
+
<div class="br-input-item">
|
74 |
+
<div class="br-file-text"><?php _e( 'No File Chosen', 'breeze' ); ?></div>
|
75 |
+
</div>
|
76 |
+
</div>
|
77 |
+
|
78 |
+
<div class="br-note br-note-no-margin">
|
79 |
+
<p>
|
80 |
+
<?php
|
81 |
+
$bytes = wp_max_upload_size();
|
82 |
+
$size = size_format( $bytes );
|
83 |
+
|
84 |
+
/* translators: Upload size */
|
85 |
+
echo wp_sprintf( __( 'Choose a JSON file from your computer (maximum size: %s)', 'breeze' ), $size );
|
86 |
+
?>
|
87 |
+
</p>
|
88 |
+
<p id="file-selected"></p>
|
89 |
+
<p id="file-error" class="file_red br-notice" style="font-weight: bold"></p>
|
90 |
+
</div>
|
91 |
+
|
92 |
+
<input type="button" id="breeze_import_btn" value="<?php _e( 'Upload File and Import Settings', 'breeze' ); ?>" class="br-blue-button" disabled/>
|
93 |
+
<div class="br-space"></div>
|
94 |
+
</div>
|
95 |
+
</div>
|
96 |
+
<!-- END OPTION -->
|
97 |
+
</section>
|
views/option-tabs/varnish-tab.php
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Basic tab
|
4 |
+
*/
|
5 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
6 |
+
header( 'Status: 403 Forbidden' );
|
7 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
8 |
+
exit;
|
9 |
+
}
|
10 |
+
|
11 |
+
set_as_network_screen();
|
12 |
+
|
13 |
+
$is_custom = false;
|
14 |
+
if ( ( ! defined( 'WP_NETWORK_ADMIN' ) || ( defined( 'WP_NETWORK_ADMIN' ) && false === WP_NETWORK_ADMIN ) ) && is_multisite() ) {
|
15 |
+
$get_inherit = get_option( 'breeze_inherit_settings', '1' );
|
16 |
+
$is_custom = filter_var( $get_inherit, FILTER_VALIDATE_BOOLEAN );
|
17 |
+
}
|
18 |
+
|
19 |
+
|
20 |
+
$options = breeze_get_option( 'varnish_cache', true );
|
21 |
+
$check_varnish = is_varnish_cache_started();
|
22 |
+
|
23 |
+
$icon = BREEZE_PLUGIN_URL . 'assets/images/varnish-active.png';
|
24 |
+
|
25 |
+
?>
|
26 |
+
<form data-section="varnish">
|
27 |
+
<?php if ( true === $is_custom ) { ?>
|
28 |
+
<div class="br-overlay-disable"><?php _e( 'Settings are inherited', 'breeze' ); ?></div>
|
29 |
+
<?php } ?>
|
30 |
+
<section>
|
31 |
+
<div class="br-section-title">
|
32 |
+
<img src="<?php echo $icon; ?>"/>
|
33 |
+
<?php _e( 'Varnish', 'breeze' ); ?>
|
34 |
+
<p class="br-subtitle">
|
35 |
+
<?php _e( 'By default Varnish is enabled on all WordPress websites hosted on Cloudways.', 'breeze' ); ?>
|
36 |
+
</p>
|
37 |
+
</div>
|
38 |
+
|
39 |
+
<!-- START OPTION -->
|
40 |
+
<div class="br-option-item">
|
41 |
+
<div class="br-label">
|
42 |
+
<div class="br-option-text">
|
43 |
+
<?php _e( 'Auto Purge Varnish', 'breeze' ); ?>
|
44 |
+
</div>
|
45 |
+
</div>
|
46 |
+
<div class="br-option">
|
47 |
+
<?php
|
48 |
+
if ( ! isset( $options['auto-purge-varnish'] ) ) {
|
49 |
+
$options['auto-purge-varnish'] = '0';
|
50 |
+
}
|
51 |
+
|
52 |
+
$basic_value = filter_var( $options['auto-purge-varnish'], FILTER_VALIDATE_BOOLEAN );
|
53 |
+
$is_enabled = ( isset( $basic_value ) && true === $basic_value ) ? checked( $options['auto-purge-varnish'], '1', false ) : '';
|
54 |
+
?>
|
55 |
+
<div class="on-off-checkbox">
|
56 |
+
<input id="auto-purge-varnish" name="auto-purge-varnish" type="checkbox" class="br-box" value="1" <?php echo $is_enabled; ?>>
|
57 |
+
<label for="auto-purge-varnish">
|
58 |
+
<div class="status-switch" data-unchecked="OFF" data-checked="ON"></div>
|
59 |
+
</label>
|
60 |
+
</div>
|
61 |
+
<div class="br-note">
|
62 |
+
<p>
|
63 |
+
<?php _e( 'Keep this option enabled to automatically purge Varnish cache on actions like publishing new blog posts, pages and comments.', 'breeze' ); ?>
|
64 |
+
</p>
|
65 |
+
<?php
|
66 |
+
if ( ! $check_varnish ) {
|
67 |
+
echo '<p class="br-notice">';
|
68 |
+
// echo '<strong>';
|
69 |
+
// _e( 'Note: ', 'breeze' );
|
70 |
+
// echo '</strong>';
|
71 |
+
_e( 'Seems Varnish is disabled on your Application. Please refer to ', 'breeze' );
|
72 |
+
?>
|
73 |
+
<a href="https://support.cloudways.com/most-common-varnish-issues-and-queries/"
|
74 |
+
target="_blank"><?php _e( 'this KB', 'breeze' ); ?></a><?php _e( ' and learn how to enable it.', 'breeze' ); ?> </span>
|
75 |
+
<?php
|
76 |
+
echo '</p>';
|
77 |
+
}
|
78 |
+
?>
|
79 |
+
</div>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
+
<!-- END OPTION -->
|
83 |
+
|
84 |
+
<!-- START OPTION -->
|
85 |
+
<div class="br-option-item">
|
86 |
+
<div class="br-label">
|
87 |
+
<div class="br-option-text">
|
88 |
+
<?php _e( 'Varnish Server', 'breeze' ); ?>
|
89 |
+
</div>
|
90 |
+
</div>
|
91 |
+
<div class="br-option">
|
92 |
+
<?php
|
93 |
+
$varnish_ip = ( ! empty( $options['breeze-varnish-server-ip'] ) ? esc_html( $options['breeze-varnish-server-ip'] ) : '127.0.0.1' );
|
94 |
+
|
95 |
+
?>
|
96 |
+
<input type="text" id="varnish-server-ip" name="varnish-server-ip" size="50" placeholder="<?php _e( '127.0.0.1', 'breeze' ); ?>" value="<?php echo $varnish_ip; ?>"/>
|
97 |
+
<div class="br-note">
|
98 |
+
<p>
|
99 |
+
<?php
|
100 |
+
_e( 'Keep this default if you are a Cloudways customer. Otherwise ask your hosting provider on what to set here.', 'breeze' );
|
101 |
+
?>
|
102 |
+
</p>
|
103 |
+
</div>
|
104 |
+
</div>
|
105 |
+
</div>
|
106 |
+
<!-- END OPTION -->
|
107 |
+
|
108 |
+
<!-- START OPTION -->
|
109 |
+
<div class="br-option-item">
|
110 |
+
<div class="br-label">
|
111 |
+
<div class="br-option-text">
|
112 |
+
<?php _e( 'Purge Varnish Cache', 'breeze' ); ?>
|
113 |
+
</div>
|
114 |
+
</div>
|
115 |
+
<div class="br-option">
|
116 |
+
<a href="#" id="purge-varnish-button" class="br-blue-button-reverse"><?php _e( 'Purge', 'breeze' ); ?></a>
|
117 |
+
|
118 |
+
<div class="br-note">
|
119 |
+
<p>
|
120 |
+
<?php
|
121 |
+
|
122 |
+
_e( 'Use this option to instantly Purge Varnish Cache on entire website.', 'breeze' );
|
123 |
+
?>
|
124 |
+
</p>
|
125 |
+
</div>
|
126 |
+
</div>
|
127 |
+
</div>
|
128 |
+
<!-- END OPTION -->
|
129 |
+
</section>
|
130 |
+
<div class="br-submit">
|
131 |
+
<input type="submit" value="<?php echo __( 'Save Changes', 'breeze' ); ?>" class="br-submit-save"/>
|
132 |
+
</div>
|
133 |
+
</form>
|
134 |
+
|
views/tabs/advanced.php
DELETED
@@ -1,448 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
defined( 'ABSPATH' ) or die;
|
3 |
-
|
4 |
-
$advanced = breeze_get_option( 'advanced_settings', true );
|
5 |
-
|
6 |
-
$excluded_css_check = true;
|
7 |
-
$excluded_js_check = true;
|
8 |
-
$excluded_css_check_extension = true;
|
9 |
-
$excluded_js_check_extension = true;
|
10 |
-
$excluded_url_list = true;
|
11 |
-
if ( isset( $advanced['breeze-exclude-css'] ) && ! empty( $advanced['breeze-exclude-css'] ) ) {
|
12 |
-
$excluded_css_check = breeze_validate_urls( $advanced['breeze-exclude-css'] );
|
13 |
-
if ( true === $excluded_css_check ) {
|
14 |
-
$excluded_css_check_extension = breeze_validate_the_right_extension( $advanced['breeze-exclude-css'], 'css' );
|
15 |
-
}
|
16 |
-
}
|
17 |
-
|
18 |
-
if ( isset( $advanced['breeze-exclude-js'] ) && ! empty( $advanced['breeze-exclude-js'] ) ) {
|
19 |
-
$excluded_js_check = breeze_validate_urls( $advanced['breeze-exclude-js'] );
|
20 |
-
if ( true === $excluded_js_check ) {
|
21 |
-
$excluded_js_check_extension = breeze_validate_the_right_extension( $advanced['breeze-exclude-js'], 'js' );
|
22 |
-
}
|
23 |
-
}
|
24 |
-
|
25 |
-
if ( isset( $advanced['breeze-exclude-urls'] ) && ! empty( $advanced['breeze-exclude-urls'] ) ) {
|
26 |
-
$excluded_url_list = breeze_validate_urls( $advanced['breeze-exclude-urls'] );
|
27 |
-
}
|
28 |
-
|
29 |
-
if ( ! isset( $advanced['breeze-preload-links'] ) ) {
|
30 |
-
$advanced['breeze-preload-links'] = '0';
|
31 |
-
}
|
32 |
-
|
33 |
-
if ( ! isset( $advanced['breeze-lazy-load'] ) ) {
|
34 |
-
$advanced['breeze-lazy-load'] = '0';
|
35 |
-
}
|
36 |
-
|
37 |
-
if ( ! isset( $advanced['breeze-lazy-load-native'] ) ) {
|
38 |
-
$advanced['breeze-lazy-load-native'] = '0';
|
39 |
-
}
|
40 |
-
|
41 |
-
if ( ! isset( $advanced['breeze-group-css'] ) ) {
|
42 |
-
$advanced['breeze-group-css'] = '0';
|
43 |
-
}
|
44 |
-
|
45 |
-
if ( ! isset( $advanced['breeze-group-js'] ) ) {
|
46 |
-
$advanced['breeze-group-js'] = '0';
|
47 |
-
}
|
48 |
-
|
49 |
-
if ( ! isset( $advanced['breeze-enable-js-delay'] ) ) {
|
50 |
-
$advanced['breeze-enable-js-delay'] = '0';
|
51 |
-
}
|
52 |
-
|
53 |
-
$js_inline_enable = filter_var( $advanced['breeze-enable-js-delay'], FILTER_VALIDATE_BOOLEAN );
|
54 |
-
?>
|
55 |
-
<table cellspacing="15" id="advanced-options-tab">
|
56 |
-
<tr>
|
57 |
-
<td><label for="bz-lazy-load" class="breeze_tool_tip"><?php _e( 'Lazy-Load images', 'breeze' ); ?></label></td>
|
58 |
-
<td>
|
59 |
-
<?php
|
60 |
-
$disabled = 'disabled';
|
61 |
-
|
62 |
-
if ( class_exists( 'DOMDocument' ) && class_exists( 'DOMXPath' ) ) {
|
63 |
-
$disabled = '';
|
64 |
-
}
|
65 |
-
?>
|
66 |
-
<input type="checkbox" id="bz-lazy-load" name="bz-lazy-load"
|
67 |
-
value='1' <?php checked( $advanced['breeze-lazy-load'], '1' ); ?> <?php echo $disabled; ?>/>
|
68 |
-
<span class="breeze_tool_tip">
|
69 |
-
<?php _e( 'Images will begin to load before being displayed on screen.', 'breeze' ); ?>
|
70 |
-
</span>
|
71 |
-
<?php
|
72 |
-
if ( ! empty( $disabled ) ) {
|
73 |
-
?>
|
74 |
-
<br/>
|
75 |
-
<span class="breeze_tool_tip" style="color: #ff0000">
|
76 |
-
<?php _e( 'This option requires the library PHP DOMDocument and PHP DOMXPath', 'breeze' ); ?>
|
77 |
-
</span>
|
78 |
-
<br/>
|
79 |
-
<?php
|
80 |
-
} else {
|
81 |
-
echo '<br/>';
|
82 |
-
}
|
83 |
-
|
84 |
-
|
85 |
-
$is_checked_lazy = checked( $advanced['breeze-lazy-load'], '1', false );
|
86 |
-
if ( ! empty( $is_checked_lazy ) ) {
|
87 |
-
if ( ! empty( $disabled ) ) {
|
88 |
-
$hide = ' style="display:none"';
|
89 |
-
} else {
|
90 |
-
$hide = '';
|
91 |
-
}
|
92 |
-
} else {
|
93 |
-
$hide = ' style="display:none"';
|
94 |
-
}
|
95 |
-
|
96 |
-
?>
|
97 |
-
<br/>
|
98 |
-
<span <?php echo $hide; ?> id="native-lazy-option">
|
99 |
-
<input type="checkbox" id="bz-lazy-load-nat" name="bz-lazy-load-nat"
|
100 |
-
value='1' <?php checked( $advanced['breeze-lazy-load-native'], '1' ); ?>/>
|
101 |
-
<span class="breeze_tool_tip">
|
102 |
-
<strong><?php _e( 'Enable native browser lazy load', 'breeze' ); ?></strong><br/>
|
103 |
-
<?php _e( '<strong>Note</strong>: This is not supported by all browsers.', 'breeze' ); ?>
|
104 |
-
</span>
|
105 |
-
</span>
|
106 |
-
</td>
|
107 |
-
</tr>
|
108 |
-
<tr>
|
109 |
-
<td>
|
110 |
-
<label for="exclude-urls" class="breeze_tool_tip"><?php _e( 'Never Cache these URLs', 'breeze' ); ?></label>
|
111 |
-
</td>
|
112 |
-
<td>
|
113 |
-
<?php
|
114 |
-
$css_output = '';
|
115 |
-
if ( ! empty( $advanced['breeze-exclude-urls'] ) ) {
|
116 |
-
$output = implode( "\n", $advanced['breeze-exclude-urls'] );
|
117 |
-
$css_output = esc_textarea( $output );
|
118 |
-
}
|
119 |
-
?>
|
120 |
-
<textarea cols="100" rows="7" id="exclude-urls" name="exclude-urls"><?php echo $css_output; ?></textarea>
|
121 |
-
<br/>
|
122 |
-
<span class="breeze_tool_tip"><b>Note: </b><?php _e( 'Add the URLs of the pages (one per line) you wish to exclude from the WordPress internal cache. To exclude URLs from the Varnish cache, please refer to this ', 'breeze' ); ?><a
|
123 |
-
href="https://support.cloudways.com/how-to-exclude-url-from-varnish/"
|
124 |
-
target="_blank"><?php _e( 'Knowledge Base', 'breeze' ); ?></a><?php _e( ' article.', 'breeze' ); ?> </span>
|
125 |
-
<?php if ( false === $excluded_url_list ) { ?>
|
126 |
-
<br/>
|
127 |
-
<span class="breeze_tool_tip" style="color: #ff0000">
|
128 |
-
<?php _e( 'One (or more) URL is invalid. Please check and correct the entry.', 'breeze' ); ?>
|
129 |
-
</span>
|
130 |
-
<?php } ?>
|
131 |
-
</td>
|
132 |
-
</tr>
|
133 |
-
<tr>
|
134 |
-
<td>
|
135 |
-
<label class="breeze_tool_tip"><?php _e( 'Group Files', 'breeze' ); ?></label>
|
136 |
-
</td>
|
137 |
-
<td>
|
138 |
-
<ul>
|
139 |
-
<li>
|
140 |
-
<input type="checkbox" name="group-css" id="group-css"
|
141 |
-
value="1" <?php checked( $advanced['breeze-group-css'], '1' ); ?>/>
|
142 |
-
<label class="breeze_tool_tip" for="group-css"><?php _e( 'CSS', 'breeze' ); ?></label>
|
143 |
-
</li>
|
144 |
-
<li>
|
145 |
-
<input type="checkbox" name="group-js" id="group-js"
|
146 |
-
value="1" <?php checked( $advanced['breeze-group-js'], '1' ); ?>/>
|
147 |
-
<label class="breeze_tool_tip" for="group-js"><?php _e( 'JS', 'breeze' ); ?></label>
|
148 |
-
</li>
|
149 |
-
<li>
|
150 |
-
<span class="breeze_tool_tip">
|
151 |
-
<b>Note: </b><?php _e( 'Group CSS and JS files to combine them into a single file. This will reduce the number of HTTP requests to your server.', 'breeze' ); ?><br>
|
152 |
-
<b><?php _e( 'Important: Enable Minification to use this option.', 'breeze' ); ?></b>
|
153 |
-
</span>
|
154 |
-
</li>
|
155 |
-
</ul>
|
156 |
-
</td>
|
157 |
-
</tr>
|
158 |
-
<tr>
|
159 |
-
<td>
|
160 |
-
<label class="breeze_tool_tip"><?php _e( 'Preload links', 'breeze' ); ?></label>
|
161 |
-
</td>
|
162 |
-
<td>
|
163 |
-
<input type="checkbox" name="preload-links" id="preload-links"
|
164 |
-
value="1" <?php checked( $advanced['breeze-preload-links'], '1' ); ?>/>
|
165 |
-
<label class="breeze_tool_tip" for="preload-links"><?php _e( 'Activate preload links feature', 'breeze' ); ?></label>
|
166 |
-
<br/>
|
167 |
-
<span class="breeze_tool_tip">
|
168 |
-
<b>Note: </b><?php _e( 'When users hover over links, the cache is created in advance. The page will load faster upon link visiting.', 'breeze' ); ?><br/>
|
169 |
-
<b><?php _e( 'Important: This feature is supported by Chromium based browsers (Chrome, Opera, Microsoft Edge Chromium, Brave...)', 'breeze' ); ?>;</b>
|
170 |
-
</span>
|
171 |
-
</td>
|
172 |
-
</tr>
|
173 |
-
<tr>
|
174 |
-
<td>
|
175 |
-
<label for="exclude-css" class="breeze_tool_tip"><?php _e( 'Exclude CSS', 'breeze' ); ?></label>
|
176 |
-
</td>
|
177 |
-
<td>
|
178 |
-
<?php
|
179 |
-
$css_output = '';
|
180 |
-
if ( ! empty( $advanced['breeze-exclude-css'] ) ) {
|
181 |
-
$output = implode( "\n", $advanced['breeze-exclude-css'] );
|
182 |
-
$css_output = esc_textarea( $output );
|
183 |
-
}
|
184 |
-
?>
|
185 |
-
<textarea cols="100" rows="7" id="exclude-css" name="exclude-css"><?php echo $css_output; ?></textarea>
|
186 |
-
<?php if ( false === $excluded_css_check_extension ) { ?>
|
187 |
-
<br/><span class="breeze_tool_tip"
|
188 |
-
style="color: #ff0000"><?php _e( 'One (or more) URL is incorrect. Please confirm that all URLs have the .css extension', 'breeze' ); ?></span>
|
189 |
-
<?php } ?>
|
190 |
-
<?php if ( false === $excluded_css_check ) { ?>
|
191 |
-
<br/><span class="breeze_tool_tip" style="color: #ff0000"><?php _e( 'One (or more) URL is invalid. Please check and correct the entry.', 'breeze' ); ?></span>
|
192 |
-
<?php } ?>
|
193 |
-
<br/>
|
194 |
-
<span class="breeze_tool_tip"><b>Note: </b><?php _e( 'Use this option to exclude CSS files from Minification and Grouping. Enter the URLs of CSS files on each line.', 'breeze' ); ?></span>
|
195 |
-
</td>
|
196 |
-
</tr>
|
197 |
-
<tr>
|
198 |
-
<td>
|
199 |
-
<label for="exclude-js" class="breeze_tool_tip"><?php _e( 'Exclude JS', 'breeze' ); ?></label>
|
200 |
-
</td>
|
201 |
-
<td>
|
202 |
-
<?php
|
203 |
-
$js_output = '';
|
204 |
-
if ( ! empty( $advanced['breeze-exclude-js'] ) ) {
|
205 |
-
$output = implode( "\n", $advanced['breeze-exclude-js'] );
|
206 |
-
$js_output = esc_textarea( $output );
|
207 |
-
}
|
208 |
-
?>
|
209 |
-
<textarea cols="100" rows="7" id="exclude-js" name="exclude-js"><?php echo $js_output; ?></textarea>
|
210 |
-
<?php if ( false === $excluded_js_check_extension ) { ?>
|
211 |
-
<br/><span class="breeze_tool_tip"
|
212 |
-
style="color: #ff0000"><?php _e( 'One (or more) URL is incorrect. Please confirm that all URLs have the .js extension', 'breeze' ); ?></span>
|
213 |
-
<?php } ?>
|
214 |
-
<?php if ( false === $excluded_js_check ) { ?>
|
215 |
-
<br/><span class="breeze_tool_tip" style="color: #ff0000"><?php _e( 'One (or more) URL is invalid. Please check and correct the entry.', 'breeze' ); ?></span>
|
216 |
-
<?php } ?>
|
217 |
-
<br/>
|
218 |
-
<span class="breeze_tool_tip"><b>Note: </b><?php _e( 'Use this option to exclude JS files from Minification and Grouping. Enter the URLs of JS files on each line.', 'breeze' ); ?></span>
|
219 |
-
</td>
|
220 |
-
</tr>
|
221 |
-
<tr>
|
222 |
-
<td>
|
223 |
-
<label for="breeze-preload-font" class="breeze_tool_tip"><?php _e( 'Preload your webfonts', 'breeze' ); ?></label>
|
224 |
-
</td>
|
225 |
-
<td>
|
226 |
-
<div class="breeze-list-url">
|
227 |
-
<?php if ( ! empty( $advanced['breeze-preload-fonts'] ) ) : ?>
|
228 |
-
<?php foreach ( $advanced['breeze-preload-fonts'] as $font_url ) : ?>
|
229 |
-
<div class="breeze-input-group">
|
230 |
-
<span class="sort-handle">
|
231 |
-
<span class="dashicons dashicons-arrow-up moveUp"></span>
|
232 |
-
<span class="dashicons dashicons-arrow-down moveDown"></span>
|
233 |
-
</span>
|
234 |
-
<input type="text" size="98"
|
235 |
-
class="breeze-input-url"
|
236 |
-
name="breeze-preload-font[]"
|
237 |
-
placeholder="<?php _e( 'Enter Font/CSS URL...', 'breeze' ); ?>"
|
238 |
-
value="<?php echo esc_html( $font_url ); ?>"/>
|
239 |
-
<span class="dashicons dashicons-no item-remove" title="<?php _e( 'Remove', 'breeze' ); ?>"></span>
|
240 |
-
</div>
|
241 |
-
<?php endforeach; ?>
|
242 |
-
<?php else : ?>
|
243 |
-
<div class="breeze-input-group">
|
244 |
-
<span class="sort-handle">
|
245 |
-
<span class="dashicons dashicons-arrow-up moveUp"></span>
|
246 |
-
<span class="dashicons dashicons-arrow-down moveDown"></span>
|
247 |
-
</span>
|
248 |
-
<input type="text" size="98"
|
249 |
-
class="breeze-input-url"
|
250 |
-
id="breeze-preload-font"
|
251 |
-
name="breeze-preload-font[]"
|
252 |
-
placeholder="<?php _e( 'Enter Font/CSS URL...', 'breeze' ); ?>"
|
253 |
-
value=""/>
|
254 |
-
<span class="dashicons dashicons-no" title="<?php _e( 'Remove', 'breeze' ); ?>"></span>
|
255 |
-
</div>
|
256 |
-
<?php endif; ?>
|
257 |
-
</div>
|
258 |
-
<div style="margin: 10px 0">
|
259 |
-
<button type="button" class="button add-url" id="add-breeze-preload-fonts">
|
260 |
-
<?php _e( 'Add URL', 'breeze' ); ?>
|
261 |
-
</button>
|
262 |
-
</div>
|
263 |
-
<div>
|
264 |
-
<span class="breeze_tool_tip">
|
265 |
-
<b>Note: </b>
|
266 |
-
<?php _e( 'Specify the local font URL or the URL for the CSS file which loads only fonts.', 'breeze' ); ?>
|
267 |
-
</span>
|
268 |
-
<span class="breeze_tool_tip">
|
269 |
-
<?php _e( 'Load WOFF format fonts for the best performance.', 'breeze' ); ?>
|
270 |
-
</span>
|
271 |
-
<span class="breeze_tool_tip">
|
272 |
-
<?php _e( 'Do not preload the whole website CSS file as it will slow down your website.', 'breeze' ); ?>
|
273 |
-
</span>
|
274 |
-
<span class="breeze_tool_tip">
|
275 |
-
<?php _e( 'Do not add Google Fonts links as those already use preload.', 'breeze' ); ?>
|
276 |
-
</span>
|
277 |
-
<br/>
|
278 |
-
<span class="breeze_tool_tip">
|
279 |
-
<?php $theme_url = get_template_directory_uri() . '/assets/fonts/my-font.woff'; ?>
|
280 |
-
<?php _e( 'Example:<code>' . $theme_url . '</code>', 'breeze' ); ?>
|
281 |
-
</span>
|
282 |
-
</div>
|
283 |
-
</td>
|
284 |
-
</tr>
|
285 |
-
<tr>
|
286 |
-
<td>
|
287 |
-
<label for="move-to-footer-js" class="breeze_tool_tip"><?php _e( 'Move JS files to footer', 'breeze' ); ?></label>
|
288 |
-
</td>
|
289 |
-
<td>
|
290 |
-
<div class="breeze-list-url">
|
291 |
-
<?php if ( ! empty( $advanced['breeze-move-to-footer-js'] ) ) : ?>
|
292 |
-
<?php foreach ( $advanced['breeze-move-to-footer-js'] as $js_url ) : ?>
|
293 |
-
<div class="breeze-input-group">
|
294 |
-
<span class="sort-handle">
|
295 |
-
<span class="dashicons dashicons-arrow-up moveUp"></span>
|
296 |
-
<span class="dashicons dashicons-arrow-down moveDown"></span>
|
297 |
-
</span>
|
298 |
-
<input type="text" size="98"
|
299 |
-
class="breeze-input-url"
|
300 |
-
name="move-to-footer-js[]"
|
301 |
-
placeholder="<?php _e( 'Enter URL...', 'breeze' ); ?>"
|
302 |
-
value="<?php echo esc_html( $js_url ); ?>"/>
|
303 |
-
<span class="dashicons dashicons-no item-remove" title="<?php _e( 'Remove', 'breeze' ); ?>"></span>
|
304 |
-
</div>
|
305 |
-
<?php endforeach; ?>
|
306 |
-
<?php else : ?>
|
307 |
-
<div class="breeze-input-group">
|
308 |
-
<span class="sort-handle">
|
309 |
-
<span class="dashicons dashicons-arrow-up moveUp"></span>
|
310 |
-
<span class="dashicons dashicons-arrow-down moveDown"></span>
|
311 |
-
</span>
|
312 |
-
<input type="text" size="98"
|
313 |
-
class="breeze-input-url"
|
314 |
-
id="move-to-footer-js"
|
315 |
-
name="move-to-footer-js[]"
|
316 |
-
placeholder="<?php _e( 'Enter URL...', 'breeze' ); ?>"
|
317 |
-
value=""/>
|
318 |
-
<span class="dashicons dashicons-no" title="<?php _e( 'Remove', 'breeze' ); ?>"></span>
|
319 |
-
</div>
|
320 |
-
<?php endif; ?>
|
321 |
-
</div>
|
322 |
-
<div style="margin: 10px 0">
|
323 |
-
<button type="button" class="button add-url" id="add-move-to-footer-js">
|
324 |
-
<?php _e( 'Add URL', 'breeze' ); ?>
|
325 |
-
</button>
|
326 |
-
</div>
|
327 |
-
<div>
|
328 |
-
<span class="breeze_tool_tip">
|
329 |
-
<b>Note: </b>
|
330 |
-
<?php _e( 'Enter the complete URLs of JS files to be moved to the footer during minification process.', 'breeze' ); ?>
|
331 |
-
</span>
|
332 |
-
<span class="breeze_tool_tip">
|
333 |
-
<?php _e( 'You should add the URL of original files as URL of minified files are not supported.', 'breeze' ); ?>
|
334 |
-
</span>
|
335 |
-
</div>
|
336 |
-
</td>
|
337 |
-
</tr>
|
338 |
-
<tr>
|
339 |
-
<td>
|
340 |
-
<label for="defer-js" class="breeze_tool_tip"><?php _e( 'JS files with deferred loading', 'breeze' ); ?></label>
|
341 |
-
</td>
|
342 |
-
<td>
|
343 |
-
<div class="breeze-list-url">
|
344 |
-
<?php if ( ! empty( $advanced['breeze-defer-js'] ) ) : ?>
|
345 |
-
<?php foreach ( $advanced['breeze-defer-js'] as $js_url ) : ?>
|
346 |
-
<div class="breeze-input-group">
|
347 |
-
<span class="sort-handle">
|
348 |
-
<span class="dashicons dashicons-arrow-up moveUp"></span>
|
349 |
-
<span class="dashicons dashicons-arrow-down moveDown"></span>
|
350 |
-
</span>
|
351 |
-
<input type="text" size="98"
|
352 |
-
class="breeze-input-url"
|
353 |
-
name="defer-js[]"
|
354 |
-
placeholder="<?php _e( 'Enter URL...', 'breeze' ); ?>"
|
355 |
-
value="<?php echo esc_html( $js_url ); ?>"/>
|
356 |
-
<span class="dashicons dashicons-no item-remove" title="<?php _e( 'Remove', 'breeze' ); ?>"></span>
|
357 |
-
</div>
|
358 |
-
<?php endforeach; ?>
|
359 |
-
<?php else : ?>
|
360 |
-
<div class="breeze-input-group">
|
361 |
-
<span class="sort-handle">
|
362 |
-
<span class="dashicons dashicons-arrow-up moveUp"></span>
|
363 |
-
<span class="dashicons dashicons-arrow-down moveDown"></span>
|
364 |
-
</span>
|
365 |
-
<input type="text" size="98"
|
366 |
-
class="breeze-input-url"
|
367 |
-
name="defer-js[]"
|
368 |
-
id="defer-js"
|
369 |
-
placeholder="<?php _e( 'Enter URL...', 'breeze' ); ?>"
|
370 |
-
value=""/>
|
371 |
-
<span class="dashicons dashicons-no item-remove" title="<?php _e( 'Remove', 'breeze' ); ?>"></span>
|
372 |
-
</div>
|
373 |
-
<?php endif; ?>
|
374 |
-
</div>
|
375 |
-
<div style="margin: 10px 0">
|
376 |
-
<button type="button" class="button add-url" id="add-defer-js">
|
377 |
-
<?php _e( 'Add URL', 'breeze' ); ?>
|
378 |
-
</button>
|
379 |
-
</div>
|
380 |
-
<div>
|
381 |
-
<span class="breeze_tool_tip">
|
382 |
-
<b>Note: </b>
|
383 |
-
<?php _e( 'You should add the URL of original files as URL of minified files are not supported.', 'breeze' ); ?>
|
384 |
-
</span>
|
385 |
-
</div>
|
386 |
-
</td>
|
387 |
-
</tr>
|
388 |
-
<tr>
|
389 |
-
<td>
|
390 |
-
<label for="delay-js-scripts" class="breeze_tool_tip"><?php _e( 'Delay JS inline scripts', 'breeze' ); ?></label>
|
391 |
-
</td>
|
392 |
-
<td>
|
393 |
-
<input type="checkbox" name="enable-js-delay" id="enable-js-delay"
|
394 |
-
value="1" <?php checked( $advanced['breeze-enable-js-delay'], '1' ); ?>/>
|
395 |
-
<label class="breeze_tool_tip" for="enable-js-delay"><?php _e( 'Enable delay inline JavaScript', 'breeze' ); ?></label>
|
396 |
-
<br/>
|
397 |
-
<br/>
|
398 |
-
<?php
|
399 |
-
$js_output = '';
|
400 |
-
if ( ! empty( $advanced['breeze-delay-js-scripts'] ) ) {
|
401 |
-
$output = implode( "\n", $advanced['breeze-delay-js-scripts'] );
|
402 |
-
$js_output = esc_textarea( $output );
|
403 |
-
}
|
404 |
-
|
405 |
-
$display_text_area = 'style="display:none"';
|
406 |
-
if ( true === $js_inline_enable ) {
|
407 |
-
$display_text_area = 'style="display:block"';
|
408 |
-
}
|
409 |
-
?>
|
410 |
-
<div <?php echo $display_text_area; ?> id="breeze-delay-js-scripts-div">
|
411 |
-
<textarea cols="100" rows="7" id="delay-js-scripts" name="delay-js-scripts"><?php echo $js_output; ?></textarea>
|
412 |
-
<br/>
|
413 |
-
<span class="breeze_tool_tip">
|
414 |
-
<strong>Notes: </strong> <br/>
|
415 |
-
<?php _e( 'You can add specififc keywords to identify the inline JavaScript to be delayed. Each script identifying keyword must be added on a new line.', 'breeze' ); ?>
|
416 |
-
<a href="https://www.cloudways.com/blog/breeze-1-2-version-released/" target="_blank"><?php _e( 'More info here', 'breeze' ); ?></a><br/>
|
417 |
-
<span style="color: #ff0000">
|
418 |
-
<?php _e( 'Please clear Varnish after applying the new settings.', 'breeze' ); ?>
|
419 |
-
</span>
|
420 |
-
</span>
|
421 |
-
</div>
|
422 |
-
</td>
|
423 |
-
</tr>
|
424 |
-
<tr>
|
425 |
-
<td>
|
426 |
-
<label for="cache-query-str" class="breeze_tool_tip"><?php _e( 'Cache query strings', 'breeze' ); ?></label>
|
427 |
-
</td>
|
428 |
-
<td>
|
429 |
-
<?php
|
430 |
-
$cached_query_strings = '';
|
431 |
-
if ( isset( $advanced['cached-query-strings'] ) && ! empty( $advanced['cached-query-strings'] ) ) {
|
432 |
-
$output = implode( "\n", $advanced['cached-query-strings'] );
|
433 |
-
$cached_query_strings = esc_textarea( $output );
|
434 |
-
}
|
435 |
-
|
436 |
-
?>
|
437 |
-
<textarea cols="100" rows="7" id="cache-query-str" name="cache-query-str"><?php echo $cached_query_strings; ?></textarea>
|
438 |
-
<br/>
|
439 |
-
<span class="breeze_tool_tip">
|
440 |
-
<strong>Note: </strong> <br/>
|
441 |
-
<span>
|
442 |
-
<?php _e( 'Pages that contain the query strings added here, will be cached. Each entry must be added in a new line.', 'breeze' ); ?>
|
443 |
-
</span>
|
444 |
-
</span>
|
445 |
-
|
446 |
-
</td>
|
447 |
-
</tr>
|
448 |
-
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
views/tabs/basic.php
DELETED
@@ -1,232 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
defined( 'ABSPATH' ) or die;
|
3 |
-
|
4 |
-
$basic = breeze_get_option( 'basic_settings', true );
|
5 |
-
?>
|
6 |
-
<table cellspacing="15" id="basic-panel">
|
7 |
-
<tr>
|
8 |
-
<td>
|
9 |
-
<label for="cache-system"><?php _e( 'Cache System', 'breeze' ); ?></label>
|
10 |
-
</td>
|
11 |
-
<td>
|
12 |
-
<input type="checkbox" id="cache-system" name="cache-system"
|
13 |
-
value='1' <?php ( isset( $basic['breeze-active'] ) ) ? checked( $basic['breeze-active'], '1' ) : ''; ?> />
|
14 |
-
<span class="breeze_tool_tip">
|
15 |
-
<?php _e( 'This is the basic cache that we recommend should be kept enabled in all cases. Basic cache will build the internal and static caches for the WordPress websites.', 'breeze' ); ?>
|
16 |
-
</span>
|
17 |
-
</td>
|
18 |
-
</tr>
|
19 |
-
<tr>
|
20 |
-
<td>
|
21 |
-
<label for="safe-cross-origin"><?php _e( 'Cross-origin safe links', 'breeze' ); ?></label>
|
22 |
-
</td>
|
23 |
-
<td>
|
24 |
-
<input type="checkbox" id="safe-cross-origin" name="safe-cross-origin"
|
25 |
-
value='1' <?php ( isset( $basic['breeze-cross-origin'] ) ) ? checked( $basic['breeze-cross-origin'], '1' ) : ''; ?>/>
|
26 |
-
<span class="breeze_tool_tip">
|
27 |
-
<?php _e( 'Apply "noopener noreferrer" to links which have target"_blank" attribute and the anchor leads to external websites.', 'breeze' ); ?>
|
28 |
-
</span>
|
29 |
-
</td>
|
30 |
-
</tr>
|
31 |
-
<tr>
|
32 |
-
<td>
|
33 |
-
<label for="cache-ttl"><?php _e( 'Purge cache after', 'breeze' ); ?></label>
|
34 |
-
</td>
|
35 |
-
<td>
|
36 |
-
<input type="text" id="cache-ttl" size="5" name="cache-ttl"
|
37 |
-
value='<?php echo( isset( $basic['breeze-ttl'] ) && ! empty( $basic['breeze-ttl'] ) ? (int) $basic['breeze-ttl'] : '1440' ); ?>'/>
|
38 |
-
<span class="breeze_tool_tip" style="vertical-align: baseline">
|
39 |
-
<?php _e( 'Automatically purge internal cache after X minutes. By default this is set to 1440 minutes (1 day)', 'breeze' ); ?>
|
40 |
-
</span>
|
41 |
-
</td>
|
42 |
-
</tr>
|
43 |
-
<tr>
|
44 |
-
<td>
|
45 |
-
<label class="breeze_tool_tip"><?php _e( 'Minification', 'breeze' ); ?></label>
|
46 |
-
</td>
|
47 |
-
<td>
|
48 |
-
<ul>
|
49 |
-
<li>
|
50 |
-
<input type="checkbox" name="minification-html" id="minification-html"
|
51 |
-
value="1" <?php ( isset( $basic['breeze-minify-html'] ) ) ? checked( $basic['breeze-minify-html'], '1' ) : ''; ?> />
|
52 |
-
<label class="breeze_tool_tip" for="minification-html">
|
53 |
-
<?php _e( 'HTML', 'breeze' ); ?>
|
54 |
-
</label>
|
55 |
-
</li>
|
56 |
-
<li>
|
57 |
-
<input type="checkbox" name="minification-css" id="minification-css"
|
58 |
-
value="1" <?php ( isset( $basic['breeze-minify-css'] ) ) ? checked( $basic['breeze-minify-css'], '1' ) : ''; ?> />
|
59 |
-
<label class="breeze_tool_tip" for="minification-css">
|
60 |
-
<?php _e( 'CSS', 'breeze' ); ?>
|
61 |
-
</label>
|
62 |
-
</li>
|
63 |
-
<li id="font-display-swap" style="display: none">
|
64 |
-
|
65 |
-
<input type="checkbox" name="font-display" id="font-display"
|
66 |
-
value="1" <?php ( isset( $basic['breeze-font-display-swap'] ) ) ? checked( $basic['breeze-font-display-swap'], '1' ) : ''; ?>/>
|
67 |
-
<label class="breeze_tool_tip" for="font-display">
|
68 |
-
<?php _e( 'Font remain visible during load', 'breeze' ); ?>
|
69 |
-
</label>
|
70 |
-
</li>
|
71 |
-
<li>
|
72 |
-
<input type="checkbox" name="minification-js" id="minification-js"
|
73 |
-
value="1" <?php ( isset( $basic['breeze-minify-js'] ) ) ? checked( $basic['breeze-minify-js'], '1' ) : ''; ?> />
|
74 |
-
<label class="breeze_tool_tip" for="minification-js">
|
75 |
-
<?php _e( 'JS', 'breeze' ); ?>
|
76 |
-
</label>
|
77 |
-
</li>
|
78 |
-
<li>
|
79 |
-
<input type="checkbox" name="include-inline-js" id="include-inline-js"
|
80 |
-
value="1" <?php ( isset( $basic['breeze-include-inline-js'] ) ) ? checked( $basic['breeze-include-inline-js'], '1' ) : ''; ?>/>
|
81 |
-
<label class="breeze_tool_tip" for="include-inline-js">
|
82 |
-
<?php _e( 'Include inline JS', 'breeze' ); ?>
|
83 |
-
</label>
|
84 |
-
</li>
|
85 |
-
<li>
|
86 |
-
<input type="checkbox" name="include-inline-css" id="include-inline-css"
|
87 |
-
value="1" <?php ( isset( $basic['breeze-include-inline-css'] ) ) ? checked( $basic['breeze-include-inline-css'], '1' ) : ''; ?> />
|
88 |
-
<label class="breeze_tool_tip" for="include-inline-css">
|
89 |
-
<?php _e( 'Include inline CSS', 'breeze' ); ?>
|
90 |
-
</label>
|
91 |
-
</li>
|
92 |
-
<li>
|
93 |
-
<span><?php _e( 'Check the above boxes to minify HTML, CSS, or JS files.', 'breeze' ); ?></span>
|
94 |
-
<br>
|
95 |
-
<span>
|
96 |
-
<b><?php esc_html_e( 'Note', 'breeze' ); ?>: </b>
|
97 |
-
<span style="color: #ff0000"><?php _e( 'We recommend testing minification on a staging website before deploying it on a live website. Minification is known to cause issues on the frontend.', 'breeze' ); ?></span>
|
98 |
-
</span>
|
99 |
-
</li>
|
100 |
-
</ul>
|
101 |
-
|
102 |
-
</td>
|
103 |
-
</tr>
|
104 |
-
|
105 |
-
<?php
|
106 |
-
|
107 |
-
$htaccess_options = array(
|
108 |
-
'gzip-compression' => array(
|
109 |
-
'label' => __( 'Gzip Compression', 'breeze' ),
|
110 |
-
'desc' => __( 'Enable this to compress your files making HTTP requests fewer and faster.', 'breeze' ),
|
111 |
-
),
|
112 |
-
'browser-cache' => array(
|
113 |
-
'label' => __( 'Browser Cache', 'breeze' ),
|
114 |
-
'desc' => __( 'Enable this to add expires headers to static files. This will ask browsers to either request a file from server or fetch from the browser’s cache.', 'breeze' ),
|
115 |
-
),
|
116 |
-
);
|
117 |
-
|
118 |
-
$supports_conditionals = breeze_is_supported( 'conditional_htaccess' );
|
119 |
-
|
120 |
-
foreach ( $htaccess_options as $fid => $field ) {
|
121 |
-
$is_disabled = is_multisite() && ! is_network_admin() && ! $supports_conditionals;
|
122 |
-
$is_checked = isset( $basic[ 'breeze-' . $fid ] ) && '1' === $basic[ 'breeze-' . $fid ] && ! $is_disabled;
|
123 |
-
|
124 |
-
?>
|
125 |
-
<tr>
|
126 |
-
<td>
|
127 |
-
<label for="<?php echo esc_attr( $fid ); ?>"><?php echo esc_html( $field['label'] ); ?></label>
|
128 |
-
</td>
|
129 |
-
<td>
|
130 |
-
<input type="checkbox" id="<?php echo esc_attr( $fid ); ?>" name="<?php echo esc_attr( $fid ); ?>"
|
131 |
-
value='1' <?php checked( $is_checked, true ); ?> <?php echo $is_disabled ? 'disabled="disabled"' : ''; ?>/>
|
132 |
-
<span class="breeze_tool_tip"><?php echo esc_html( $field['desc'] ); ?></span>
|
133 |
-
<?php if ( $is_disabled ) { ?>
|
134 |
-
<br>
|
135 |
-
<span>
|
136 |
-
<b><?php esc_html_e( 'Note', 'breeze' ); ?>: </b>
|
137 |
-
<span style="color: #ff0000"><?php printf( esc_html__( 'Enabling/disabling %s for subsites is only available for Apache 2.4 and above. For lower versions, the Network-level settings will apply.', 'breeze' ), $field['label'] ); ?></span>
|
138 |
-
</span>
|
139 |
-
<?php } ?>
|
140 |
-
</td>
|
141 |
-
</tr>
|
142 |
-
<?php
|
143 |
-
}
|
144 |
-
|
145 |
-
?>
|
146 |
-
|
147 |
-
<?php
|
148 |
-
if ( ! isset( $basic['breeze-desktop-cache'] ) ) {
|
149 |
-
$basic['breeze-desktop-cache'] = '1';
|
150 |
-
}
|
151 |
-
|
152 |
-
if ( ! isset( $basic['breeze-mobile-cache'] ) ) {
|
153 |
-
$basic['breeze-mobile-cache'] = '1';
|
154 |
-
}
|
155 |
-
?>
|
156 |
-
<tr style="display: none;">
|
157 |
-
<td style="vertical-align: middle">
|
158 |
-
<label for="desktop-cache" class="breeze_tool_tip"> <?php _e( 'Desktop Cache', 'breeze' ); ?></label>
|
159 |
-
</td>
|
160 |
-
<td>
|
161 |
-
<select id="desktop-cache" name="desktop-cache">
|
162 |
-
<option value="1" <?php echo ( $basic['breeze-desktop-cache'] == '1' ) ? 'selected="selected"' : ''; ?>><?php _e( 'Activated', 'breeze' ); ?></option>
|
163 |
-
<option value="2" <?php echo ( $basic['breeze-desktop-cache'] == '2' ) ? 'selected="selected"' : ''; ?>><?php _e( 'No cache for desktop', 'breeze' ); ?></option>
|
164 |
-
</select>
|
165 |
-
</td>
|
166 |
-
</tr>
|
167 |
-
|
168 |
-
<tr style="display: none;">
|
169 |
-
<td style="vertical-align: middle">
|
170 |
-
<label for="mobile-cache" class="breeze_tool_tip"> <?php _e( 'Mobile Cache', 'breeze' ); ?></label>
|
171 |
-
</td>
|
172 |
-
<td>
|
173 |
-
<select id="mobile-cache" name="mobile-cache">
|
174 |
-
<option value="1" <?php echo ( $basic['breeze-mobile-cache'] == '1' ) ? 'selected="selected"' : ''; ?>><?php _e( 'Automatic (same as desktop)', 'breeze' ); ?></option>
|
175 |
-
<option value="2" <?php echo ( $basic['breeze-mobile-cache'] == '2' ) ? 'selected="selected"' : ''; ?>><?php _e( 'Specific mobile cache', 'breeze' ); ?></option>
|
176 |
-
<option value="3" <?php echo ( $basic['breeze-mobile-cache'] == '3' ) ? 'selected="selected"' : ''; ?>><?php _e( 'No cache for mobile', 'breeze' ); ?></option>
|
177 |
-
</select>
|
178 |
-
</td>
|
179 |
-
</tr>
|
180 |
-
<tr>
|
181 |
-
<td>
|
182 |
-
<label class="breeze_tool_tip"><?php _e( 'Enable cache for loggedin users', 'breeze' ); ?></label>
|
183 |
-
</td>
|
184 |
-
<td>
|
185 |
-
<ul>
|
186 |
-
<li>
|
187 |
-
<?php
|
188 |
-
global $wp_roles;
|
189 |
-
$roles = $wp_roles->roles;
|
190 |
-
|
191 |
-
foreach ( $roles as $user_role => $user_role_data ) {
|
192 |
-
$is_checked_role = 0;
|
193 |
-
if ( is_array( $basic['breeze-disable-admin'] ) && isset( $basic['breeze-disable-admin'] ) && isset( $basic['breeze-disable-admin'][ $user_role ] ) ) {
|
194 |
-
$is_checked_role = (int) $basic['breeze-disable-admin'][ $user_role ];
|
195 |
-
}
|
196 |
-
|
197 |
-
?>
|
198 |
-
<input type="checkbox" name="breeze-admin-cache[<?php echo esc_attr( $user_role ); ?>]" id="breeze-admin-cache-<?php echo esc_attr( $user_role ); ?>"
|
199 |
-
value="1" <?php ( isset( $is_checked_role ) && 1 === $is_checked_role ) ? checked( $is_checked_role, '1' ) : ''; ?> />
|
200 |
-
<label class="breeze_tool_tip" for="breeze-admin-cache-<?php echo esc_attr( $user_role ); ?>">
|
201 |
-
<?php echo esc_html( $user_role_data['name'] ); ?>
|
202 |
-
</label>
|
203 |
-
<br/>
|
204 |
-
<?php
|
205 |
-
}
|
206 |
-
?>
|
207 |
-
<span>
|
208 |
-
<b><?php esc_html_e( 'Note', 'breeze' ); ?>: </b>
|
209 |
-
<span style="color: #ff0000"><?php echo esc_html__( 'This option might not work properly with some page builders.', 'breeze' ); ?></span>
|
210 |
-
</span>
|
211 |
-
</li>
|
212 |
-
</ul>
|
213 |
-
</td>
|
214 |
-
</tr>
|
215 |
-
|
216 |
-
<tr>
|
217 |
-
<td>
|
218 |
-
<label class="breeze_tool_tip"><?php _e( 'Disable emoji', 'breeze' ); ?></label>
|
219 |
-
</td>
|
220 |
-
<td>
|
221 |
-
<ul>
|
222 |
-
<li>
|
223 |
-
<input type="checkbox" name="breeze-wpjs-emoji" id="breeze-wpjs-emoji" value="1" <?php if(isset($basic['breeze-wp-emoji'])){checked( $basic['breeze-wp-emoji'], '1' ); }?>/>
|
224 |
-
<label class="breeze_tool_tip" for="breeze-wpjs-emoji">
|
225 |
-
<?php _e( 'Disable the emoji library loaded by default in WrodPress to reduce HTTP requests.', 'breeze' ); ?>
|
226 |
-
|
227 |
-
</label>
|
228 |
-
</li>
|
229 |
-
</ul>
|
230 |
-
</td>
|
231 |
-
</tr>
|
232 |
-
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
views/tabs/cdn.php
DELETED
@@ -1,97 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
defined( 'ABSPATH' ) or die;
|
3 |
-
|
4 |
-
$cdn_integration = breeze_get_option( 'cdn_integration', true );
|
5 |
-
|
6 |
-
$cdn_content_value = '';
|
7 |
-
$cdn_exclude_content_value = '';
|
8 |
-
if ( ! empty( $cdn_integration['cdn-content'] ) ) {
|
9 |
-
$cdn_content_value = implode( ',', $cdn_integration['cdn-content'] );
|
10 |
-
}
|
11 |
-
if ( ! empty( $cdn_integration['cdn-exclude-content'] ) ) {
|
12 |
-
$cdn_exclude_content_value = implode( ',', $cdn_integration['cdn-exclude-content'] );
|
13 |
-
}
|
14 |
-
|
15 |
-
if ( ! isset( $cdn_integration['cdn-active'] ) ) {
|
16 |
-
$cdn_integration['cdn-active'] = '0';
|
17 |
-
}
|
18 |
-
|
19 |
-
if ( ! isset( $cdn_integration['cdn-url'] ) ) {
|
20 |
-
$cdn_integration['cdn-url'] = '';
|
21 |
-
}
|
22 |
-
|
23 |
-
if ( ! isset( $cdn_integration['cdn-relative-path'] ) ) {
|
24 |
-
$cdn_integration['cdn-relative-path'] = '0';
|
25 |
-
}
|
26 |
-
?>
|
27 |
-
<table cellspacing="15">
|
28 |
-
<tr>
|
29 |
-
<td>
|
30 |
-
<label for="activate-cdn" class="breeze_tool_tip"><?php _e( 'Activate CDN', 'breeze' ); ?></label>
|
31 |
-
</td>
|
32 |
-
<td>
|
33 |
-
<input type="checkbox" id="activate-cdn" name="activate-cdn" value="1" <?php checked( $cdn_integration['cdn-active'], '1' ); ?>/>
|
34 |
-
<span class="breeze_tool_tip"><?php _e( 'Enable to make CDN effective on your website.', 'breeze' ); ?></span>
|
35 |
-
</td>
|
36 |
-
</tr>
|
37 |
-
<tr>
|
38 |
-
<td>
|
39 |
-
<label for="cdn-url" class="breeze_tool_tip"><?php _e( 'CDN CNAME', 'breeze' ); ?></label>
|
40 |
-
</td>
|
41 |
-
<td>
|
42 |
-
<?php
|
43 |
-
$cdn_url = ( ( $cdn_integration['cdn-url'] ) ? esc_html( $cdn_integration['cdn-url'] ) : '' );
|
44 |
-
$cdn_url_validation = breeze_validate_url_via_regexp( $cdn_url );
|
45 |
-
?>
|
46 |
-
<input type="text" id="cdn-url" name="cdn-url" size="50" placeholder="<?php _e( 'https://www.domain.com', 'breeze' ); ?>" value="<?php echo $cdn_url; ?>"/>
|
47 |
-
<span style="vertical-align: baseline" class="breeze_tool_tip"><?php _e( 'Enter CDN CNAME.', 'breeze' ); ?></span>
|
48 |
-
<br>
|
49 |
-
<span class="breeze_tool_tip"><b>Note: </b><?php _e( 'Use double slash ‘//’ at the start of CDN CNAME, if you have some pages on HTTP and some are on HTTPS.', 'breeze' ); ?></span>
|
50 |
-
<?php
|
51 |
-
if ( false === $cdn_url_validation && ! empty( $cdn_url ) ) {
|
52 |
-
?>
|
53 |
-
<br/>
|
54 |
-
<span>
|
55 |
-
<b><?php esc_html_e( 'Note', 'breeze' ); ?>: </b>
|
56 |
-
<span style="color: #ff0000">
|
57 |
-
<?php
|
58 |
-
echo $cdn_url . ' ';
|
59 |
-
echo esc_html__( 'is not a valid CDN url.', 'breeze' );
|
60 |
-
?>
|
61 |
-
</span>
|
62 |
-
</span>
|
63 |
-
<?php
|
64 |
-
}
|
65 |
-
?>
|
66 |
-
</td>
|
67 |
-
</tr>
|
68 |
-
<tr>
|
69 |
-
<td>
|
70 |
-
<label for="cdn-content" class="breeze_tool_tip" ><?php _e( 'CDN Content', 'breeze' ); ?></label>
|
71 |
-
</td>
|
72 |
-
<td>
|
73 |
-
<input type="text" id="cdn-content" name="cdn-content" size="50" value="<?php echo ( ( $cdn_content_value ) ? esc_html( $cdn_content_value ) : '' ); ?>"/>
|
74 |
-
<br>
|
75 |
-
<span class="breeze_tool_tip"><b>Note: </b><?php _e( 'Enter the directories (comma separated) of which you want the CDN to serve the content.', 'breeze' ); ?></span>
|
76 |
-
</td>
|
77 |
-
</tr>
|
78 |
-
<tr>
|
79 |
-
<td>
|
80 |
-
<label for="cdn-exclude-content" class="breeze_tool_tip" ><?php _e( 'Exclude Content', 'breeze' ); ?></label>
|
81 |
-
</td>
|
82 |
-
<td>
|
83 |
-
<input type="text" id="cdn-exclude-content" name="cdn-exclude-content" size="50" value="<?php echo ( ( $cdn_exclude_content_value ) ? esc_html( $cdn_exclude_content_value ) : '' ); ?>" />
|
84 |
-
<br>
|
85 |
-
<span class="breeze_tool_tip"><b>Note: </b><?php _e( 'Exclude file types or directories from CDN. Example, enter .css to exclude the CSS files.', 'breeze' ); ?></span>
|
86 |
-
</td>
|
87 |
-
</tr>
|
88 |
-
<tr>
|
89 |
-
<td>
|
90 |
-
<label for="cdn-relative-path" class="breeze_tool_tip" ><?php _e( 'Relative path', 'breeze' ); ?></label>
|
91 |
-
</td>
|
92 |
-
<td>
|
93 |
-
<input type="checkbox" id="cdn-relative-path" name="cdn-relative-path" value="1" <?php checked( $cdn_integration['cdn-relative-path'], '1' ); ?>/>
|
94 |
-
<span class="breeze_tool_tip"><?php _e( 'Keep this option enabled. Use this option to enable relative path for your CDN on your WordPress site.', 'breeze' ); ?></span>
|
95 |
-
</td>
|
96 |
-
</tr>
|
97 |
-
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
views/tabs/database.php
DELETED
@@ -1,117 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
defined( 'ABSPATH' ) or die;
|
4 |
-
|
5 |
-
$post_revisions = 0;
|
6 |
-
$drafted = 0;
|
7 |
-
$trashed = 0;
|
8 |
-
$comments = 0;
|
9 |
-
$trackbacks = 0;
|
10 |
-
$transients = 0;
|
11 |
-
|
12 |
-
if ( is_multisite() && is_network_admin() ) {
|
13 |
-
// Count items from all network sites.
|
14 |
-
$sites = get_sites(
|
15 |
-
array(
|
16 |
-
'fields' => 'ids',
|
17 |
-
)
|
18 |
-
);
|
19 |
-
|
20 |
-
foreach ( $sites as $blog_id ) {
|
21 |
-
switch_to_blog( $blog_id );
|
22 |
-
$post_revisions += (int) Breeze_Configuration::getElementToClean( 'revisions' );
|
23 |
-
$drafted += (int) Breeze_Configuration::getElementToClean( 'drafted' );
|
24 |
-
$trashed += (int) Breeze_Configuration::getElementToClean( 'trash' );
|
25 |
-
$comments += (int) Breeze_Configuration::getElementToClean( 'comments' );
|
26 |
-
$trackbacks += (int) Breeze_Configuration::getElementToClean( 'trackbacks' );
|
27 |
-
$transients += (int) Breeze_Configuration::getElementToClean( 'transient' );
|
28 |
-
restore_current_blog();
|
29 |
-
}
|
30 |
-
} else {
|
31 |
-
// Count items from the current site.
|
32 |
-
$post_revisions = (int) Breeze_Configuration::getElementToClean( 'revisions' );
|
33 |
-
$drafted = (int) Breeze_Configuration::getElementToClean( 'drafted' );
|
34 |
-
$trashed = (int) Breeze_Configuration::getElementToClean( 'trash' );
|
35 |
-
$comments = (int) Breeze_Configuration::getElementToClean( 'comments' );
|
36 |
-
$trackbacks = (int) Breeze_Configuration::getElementToClean( 'trackbacks' );
|
37 |
-
$transients = (int) Breeze_Configuration::getElementToClean( 'transient' );
|
38 |
-
}
|
39 |
-
|
40 |
-
$is_optimize_disabled = is_multisite() && ! is_network_admin() && '0' !== get_option( 'breeze_inherit_settings' );
|
41 |
-
|
42 |
-
?>
|
43 |
-
<div class="breeze-top-notice">
|
44 |
-
<p class="breeze_tool_tip"><?php _e( 'Important: Backup your databases before using the following options!', 'breeze' ); ?></p>
|
45 |
-
</div>
|
46 |
-
<table cellspacing="15">
|
47 |
-
<tr>
|
48 |
-
<td>
|
49 |
-
<label for="data0" class="breeze_tool_tip"><?php _e( 'Select all', 'breeze' ); ?></label>
|
50 |
-
</td>
|
51 |
-
<td>
|
52 |
-
<input type="checkbox" id="data0" name="all_control" value="all_data"/>
|
53 |
-
<span class="breeze_tool_tip"><?php _e( 'Select all following options. Click Optimize to perform actions.', 'breeze' ); ?></span>
|
54 |
-
</td>
|
55 |
-
</tr>
|
56 |
-
<tr>
|
57 |
-
<td>
|
58 |
-
<label for="data1" class="breeze_tool_tip"><?php _e( 'Post revisions', 'breeze' ); ?><?php echo ' (' . $post_revisions . ')'; ?></label>
|
59 |
-
</td>
|
60 |
-
<td>
|
61 |
-
<input type="checkbox" id="data1" name="clean[]" class="clean-data" value="revisions"/>
|
62 |
-
<span class="breeze_tool_tip"><?php _e( 'Use this option to delete all post revisions from the WordPress database.', 'breeze' ); ?></span>
|
63 |
-
</td>
|
64 |
-
</tr>
|
65 |
-
<tr>
|
66 |
-
<td>
|
67 |
-
<label for="data2" class="breeze_tool_tip" ><?php _e( 'Auto drafted content', 'breeze' ); ?><?php echo ' (' . $drafted . ')'; ?></label>
|
68 |
-
</td>
|
69 |
-
<td>
|
70 |
-
<input type="checkbox" id="data2" name="clean[]" class="clean-data" value="drafted"/>
|
71 |
-
<span class="breeze_tool_tip"><?php _e( 'Use this option to delete auto saved drafts from the WordPress database.', 'breeze' ); ?></span>
|
72 |
-
</td>
|
73 |
-
</tr>
|
74 |
-
<tr>
|
75 |
-
<td>
|
76 |
-
<label for="data3" class="breeze_tool_tip" ><?php _e( 'All trashed content', 'breeze' ); ?><?php echo ' (' . $trashed . ')'; ?></label>
|
77 |
-
</td>
|
78 |
-
<td>
|
79 |
-
<input type="checkbox" id="data3" name="clean[]" class="clean-data" value="trash"/>
|
80 |
-
<span class="breeze_tool_tip"><?php _e( 'Use this option to delete all trashed content from the WordPress database.', 'breeze' ); ?></span>
|
81 |
-
|
82 |
-
</td>
|
83 |
-
</tr>
|
84 |
-
<tr>
|
85 |
-
<td>
|
86 |
-
<label for="data4" class="breeze_tool_tip" ><?php _e( 'Comments from trash & spam', 'breeze' ); ?><?php echo ' (' . $comments . ')'; ?></label>
|
87 |
-
</td>
|
88 |
-
<td>
|
89 |
-
<input type="checkbox" id="data4" name="clean[]" class="clean-data" value="comments"/>
|
90 |
-
<span class="breeze_tool_tip"><?php _e( 'Use this option to delete trash and spam comments from the WordPress database.', 'breeze' ); ?></span>
|
91 |
-
</td>
|
92 |
-
</tr>
|
93 |
-
<tr>
|
94 |
-
<td>
|
95 |
-
<label for="data5" class="breeze_tool_tip" ><?php _e( 'Trackbacks and pingbacks', 'breeze' ); ?><?php echo ' (' . $trackbacks . ')'; ?></label>
|
96 |
-
</td>
|
97 |
-
<td>
|
98 |
-
<input type="checkbox" id="data5" name="clean[]" class="clean-data" value="trackbacks"/>
|
99 |
-
<span class="breeze_tool_tip"><?php _e( 'Use this option to delete Trackbacks and Pingbacks from the WordPress database.', 'breeze' ); ?></span>
|
100 |
-
</td>
|
101 |
-
</tr>
|
102 |
-
<tr>
|
103 |
-
<td>
|
104 |
-
<label for="data6" class="breeze_tool_tip" ><?php _e( 'Transient options', 'breeze' ); ?><?php echo ' (' . $transients . ')'; ?></label>
|
105 |
-
</td>
|
106 |
-
<td>
|
107 |
-
<input type="checkbox" id="data6" name="clean[]" class="clean-data" value="transient"/>
|
108 |
-
<span class="breeze_tool_tip"><?php _e( 'Delete expired and active transients from the WordPress database.', 'breeze' ); ?></span>
|
109 |
-
</td>
|
110 |
-
</tr>
|
111 |
-
<tr>
|
112 |
-
<td></td>
|
113 |
-
<td>
|
114 |
-
<input type="submit" id="breeze-database-optimize" class="button button-primary" <?php echo $is_optimize_disabled ? ' disabled="disabled"' : ''; ?> value="<?php esc_attr_e( 'Optimize' ); ?>">
|
115 |
-
</td>
|
116 |
-
</tr>
|
117 |
-
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
views/tabs/faq.php
DELETED
@@ -1,169 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
defined( 'ABSPATH' ) or die;
|
3 |
-
?>
|
4 |
-
<div id="faq-content">
|
5 |
-
<div class="faq-block">
|
6 |
-
<h3 class="faq-question"><?php _e( 'Delay inline JavaScript issue', 'breeze' ); ?></h3>
|
7 |
-
<div class="faq-answer">
|
8 |
-
<p>
|
9 |
-
<?php _e( 'If JavaScript errors show up in front-end you can try the following solutions.', 'breeze' ); ?><br/>
|
10 |
-
<?php _e( '- You can disable the option altogether.', 'breeze' ); ?><br/>
|
11 |
-
<?php _e( '- You can leave the option enabled and identify which line found in the textarea is causing the issue, then remove only that online that line.', 'breeze' ); ?>
|
12 |
-
</p>
|
13 |
-
</div>
|
14 |
-
</div>
|
15 |
-
|
16 |
-
<div class="faq-block">
|
17 |
-
<h3 class="faq-question"><?php _e( 'Does Breeze support Varnish and to what extent?', 'breeze' ); ?></h3>
|
18 |
-
<div class="faq-answer">
|
19 |
-
<p><?php _e( 'Breeze, by default, supports Varnish. It has been tested to be fully compatible with Cloudways Servers that come with Varnish pre-installed. If you are using hosting providers other than Cloudways, we suggest you confirm Varnish support with your hosting provider.', 'breeze' ); ?></p>
|
20 |
-
</div>
|
21 |
-
</div>
|
22 |
-
|
23 |
-
<div class="faq-block">
|
24 |
-
<h3 class="faq-question"><?php _e( 'Does Breeze support WooCommerce?', 'breeze' ); ?></h3>
|
25 |
-
<div class="faq-answer">
|
26 |
-
<p><?php _e( 'Breeze is fully compatible with WooCommerce, out of the box. It does not require any special configurations.', 'breeze' ); ?></p>
|
27 |
-
</div>
|
28 |
-
</div>
|
29 |
-
|
30 |
-
<div class="faq-block">
|
31 |
-
<h3 class="faq-question"><?php _e( 'Does Breeze support WordPress Multisite?', 'breeze' ); ?></h3>
|
32 |
-
<div class="faq-answer">
|
33 |
-
<p><?php _e( 'Breeze is fully compatible with WordPress Multisite without the need for any extra configuration.', 'breeze' ); ?></p>
|
34 |
-
</div>
|
35 |
-
</div>
|
36 |
-
|
37 |
-
<div class="faq-block">
|
38 |
-
<h3 class="faq-question"><?php _e( 'How does Breeze handle WordPress multisite?', 'breeze' ); ?></h3>
|
39 |
-
<div class="faq-answer">
|
40 |
-
<p><?php _e( 'Breeze handles all WordPress multisite instances globally. All the settings for multisite are now handled on the network level.', 'breeze' ); ?></p>
|
41 |
-
</div>
|
42 |
-
</div>
|
43 |
-
|
44 |
-
<div class="faq-block">
|
45 |
-
<h3 class="faq-question"><?php _e( 'Is Breeze compatible with other WordPress Cache plugins?', 'breeze' ); ?></h3>
|
46 |
-
<div class="faq-answer">
|
47 |
-
<p><?php _e( 'We DO NOT recommend using two WordPress cache plugins at the same time on any WordPress website.', 'breeze' ); ?></p>
|
48 |
-
<p><?php _e( 'We strongly recommend that you use Breeze as the only cache plugin for your website. If there are any other cache plugins installed, please ensure that you have disabled them prior to proceeding with the Breeze installation.', 'breeze' ); ?></p>
|
49 |
-
</div>
|
50 |
-
</div>
|
51 |
-
|
52 |
-
<div class="faq-block">
|
53 |
-
<h3 class="faq-question"><?php _e( 'Is Breeze compatible with HTTPS?', 'breeze' ); ?></h3>
|
54 |
-
<div class="faq-answer">
|
55 |
-
<p><?php _e( 'Breeze does not require any special configuration to work with HTTP or HTTPS pages.', 'breeze' ); ?></p>
|
56 |
-
</div>
|
57 |
-
</div>
|
58 |
-
|
59 |
-
<div class="faq-block">
|
60 |
-
<h3 class="faq-question"><?php _e( 'Does Breeze have compatibility issues with other known plugins?', 'breeze' ); ?></h3>
|
61 |
-
<div class="faq-answer">
|
62 |
-
<p><?php _e( 'Breeze has been tested with popular plugins available on WordPress.org. Please feel free to report any incompatibilities on the WordPress Support Forums or on ', 'breeze' ); ?>
|
63 |
-
<a href="https://community.cloudways.com/" target="_blank"><?php _e( 'Cloudways Community Forum.', 'breeze' ); ?></a>
|
64 |
-
</p>
|
65 |
-
</div>
|
66 |
-
</div>
|
67 |
-
|
68 |
-
<div class="faq-block">
|
69 |
-
<h3 class="faq-question"><?php _e( 'Does Breeze support CDN?', 'breeze' ); ?></h3>
|
70 |
-
<div class="faq-answer">
|
71 |
-
<p><?php _e( 'Breeze supports CDN integration. It allows all static assets (such as images, CSS and JS files) to be served via CDN.', 'breeze' ); ?></p>
|
72 |
-
</div>
|
73 |
-
</div>
|
74 |
-
|
75 |
-
<div class="faq-block">
|
76 |
-
<h3 class="faq-question"><?php _e( 'What does Breeze’s Database Optimization feature do?', 'breeze' ); ?></h3>
|
77 |
-
<div class="faq-answer">
|
78 |
-
<p><?php _e( 'WordPress databases are notorious for storing information like post revisions, spam comments and much more. Over time, databases l become bloated and it is a good practice to clear out unwanted information to reduce database size and improve optimization.', 'breeze' ); ?></p>
|
79 |
-
<p><?php _e( 'Breeze’s database optimization cleans out unwanted information in a single click.', 'breeze' ); ?></p>
|
80 |
-
</div>
|
81 |
-
</div>
|
82 |
-
|
83 |
-
<div class="faq-block">
|
84 |
-
<h3 class="faq-question"><?php _e( 'Will comments and other dynamic parts of my blog appear immediately?', 'breeze' ); ?></h3>
|
85 |
-
<div class="faq-answer">
|
86 |
-
<p><?php _e( 'Comments will appear upon moderation as per the comment system (or policy) set in place by the blog owner. Other dynamic changes such as any modifications in files will require a full cache purge.', 'breeze' ); ?></p>
|
87 |
-
</div>
|
88 |
-
</div>
|
89 |
-
|
90 |
-
<div class="faq-block">
|
91 |
-
<h3 class="faq-question"><?php _e( 'Can I exclude URLs of individual files and pages from cache?', 'breeze' ); ?></h3>
|
92 |
-
<div class="faq-answer">
|
93 |
-
<p><?php _e( 'You can exclude a file by mentioning its URL or file type (by mentioning file extension) in the exclude fields (available in the Breeze settings). Exclude will not let the cache impact that URL or file type.', 'breeze' ); ?></p>
|
94 |
-
<p><?php _e( 'If Varnish is active, you will need to exclude URLs and file type(s) in the Varnish configuration. If you are hosting WordPress websites on Cloudways servers, follow ', 'breeze' ); ?>
|
95 |
-
<a href="https://support.cloudways.com/how-to-exclude-url-from-varnish/" target="_blank"><?php _e( 'this KB to exclude URLs from the Varnish cache.', 'breeze' ); ?></a>
|
96 |
-
</p>
|
97 |
-
</div>
|
98 |
-
</div>
|
99 |
-
|
100 |
-
<div class="faq-block">
|
101 |
-
<h3 class="faq-question"><?php _e( 'Does it work with all hosting providers?', 'breeze' ); ?></h3>
|
102 |
-
<div class="faq-answer">
|
103 |
-
<p><?php _e( 'Breeze has been tested to work with all major hosting providers. In addition, major Breeze options such as Gzip, browser cache, minification, grouping, database optimization. CDN integration will work as expected on all hosting providers.', 'breeze' ); ?></p>
|
104 |
-
</div>
|
105 |
-
</div>
|
106 |
-
|
107 |
-
<div class="faq-block">
|
108 |
-
<h3 class="faq-question"><?php _e( 'Where can I get support for Breeze?', 'breeze' ); ?></h3>
|
109 |
-
<div class="faq-answer">
|
110 |
-
<p><?php _e( 'You can get your questions answered on the WordPress support forums. If you are a Cloudways customer, please feel free to start a discussion at', 'breeze' ); ?>
|
111 |
-
<a href="https://community.cloudways.com/" target="_blank"><?php _e( 'Cloudways Community Forum.', 'breeze' ); ?></a>
|
112 |
-
</p>
|
113 |
-
</div>
|
114 |
-
</div>
|
115 |
-
|
116 |
-
<div class="faq-block">
|
117 |
-
<h3 class="faq-question"><?php _e( 'How can I test and verify the results?', 'breeze' ); ?></h3>
|
118 |
-
<div class="faq-answer">
|
119 |
-
<p><?php _e( 'You will be able to see the impact of the Breeze Cache Plugin almost immediately. We also recommend using the following tools for generating metrics:', 'breeze' ); ?></p>
|
120 |
-
<ul style="margin-top: 10px">
|
121 |
-
<li><a href="https://developers.google.com/speed/pagespeed/" target="_blank"><?php _e( 'Google Page Speed', 'breeze' ); ?></a></li>
|
122 |
-
<li><a href="https://www.webpagetest.org/test" target="_blank"><?php _e( 'WebPagetest', 'breeze' ); ?></a></li>
|
123 |
-
<li><a href="https://tools.pingdom.com/" target="_blank"><?php _e( 'Pingdom', 'breeze' ); ?></a></li>
|
124 |
-
</ul>
|
125 |
-
</div>
|
126 |
-
</div>
|
127 |
-
|
128 |
-
<div class="faq-block">
|
129 |
-
<h3 class="faq-question"><?php _e( 'Does Breeze plugin work with Visual Builder?', 'breeze' ); ?></h3>
|
130 |
-
<div class="faq-answer">
|
131 |
-
<p><?php _e( 'Yes, Breeze Plugin is compatible with Visual Builder.', 'breeze' ); ?></p>
|
132 |
-
</div>
|
133 |
-
</div>
|
134 |
-
|
135 |
-
<div class="faq-block">
|
136 |
-
<h3 class="faq-question"><?php _e( 'What popular CDN are supported by Breeze Plugin?', 'breeze' ); ?></h3>
|
137 |
-
<div class="faq-answer">
|
138 |
-
<p><?php _e( 'Breeze supports the following three popular CDNs:', 'breeze' ); ?></p>
|
139 |
-
<ul style="margin-top: 10px">
|
140 |
-
<li><a href="https://support.cloudways.com/how-to-use-breeze-with-maxcdn/" target="_blank"><?php _e( 'MaxCDN', 'breeze' ); ?></a></li>
|
141 |
-
<li><a href="https://support.cloudways.com/how-to-use-breeze-with-keycdn/" target="_blank"><?php _e( 'KeyCDN', 'breeze' ); ?></a></li>
|
142 |
-
<li><a href="https://support.cloudways.com/how-to-use-breeze-with-amazon-cloudfront/" target="_blank"><?php _e( 'Amazon Cloudfront', 'breeze' ); ?></a></li>
|
143 |
-
</ul>
|
144 |
-
</div>
|
145 |
-
</div>
|
146 |
-
|
147 |
-
<div class="faq-block">
|
148 |
-
<h3 class="faq-question"><?php _e( 'Does Breeze support Push CDN?', 'breeze' ); ?></h3>
|
149 |
-
<div class="faq-answer">
|
150 |
-
<p><?php _e( 'No, Breeze does not support Push CDN. However, you could use Breeze with Push CDNs using third party plugins.', 'breeze' ); ?></p>
|
151 |
-
</div>
|
152 |
-
</div>
|
153 |
-
|
154 |
-
<div class="faq-block">
|
155 |
-
<h3 class="faq-question"><?php _e( 'Does Breeze Work With CloudFlare?', 'breeze' ); ?></h3>
|
156 |
-
<div class="faq-answer">
|
157 |
-
<p><?php _e( 'Yes. The process of setting up CloudFlare with Breeze is easy. Check out the following ', 'breeze' ); ?>
|
158 |
-
<a href="https://support.cloudways.com/can-i-use-cloudflare-cdn/" target="_blank"><?php _e( 'KnowledgeBase article for details.', 'breeze' ); ?></a>
|
159 |
-
</p>
|
160 |
-
</div>
|
161 |
-
</div>
|
162 |
-
|
163 |
-
<div class="faq-block">
|
164 |
-
<h3 class="faq-question"><?php _e( 'How Breeze cache uses Gzip?', 'breeze' ); ?></h3>
|
165 |
-
<div class="faq-answer">
|
166 |
-
<p><?php _e( 'Using Gzip, Breeze compresses the request files, further reducing the size of the download files and speeding up the user experience.', 'breeze' ); ?></p>
|
167 |
-
</div>
|
168 |
-
</div>
|
169 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
views/tabs/import_export.php
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Import / Export the settings view.
|
4 |
-
*/
|
5 |
-
|
6 |
-
$level = '';
|
7 |
-
if ( is_multisite() ) {
|
8 |
-
if ( is_network_admin() ) {
|
9 |
-
$level = 'network';
|
10 |
-
} else {
|
11 |
-
$level = get_current_blog_id();
|
12 |
-
}
|
13 |
-
}
|
14 |
-
|
15 |
-
?>
|
16 |
-
<table cellspacing="15" id="settings-import-export">
|
17 |
-
<tr>
|
18 |
-
<td>
|
19 |
-
<label for="breeze_export_settings" class="breeze_tool_tip"><?php _e( 'Export settings:', 'breeze' ); ?></label>
|
20 |
-
</td>
|
21 |
-
<td>
|
22 |
-
<input type="button" name="breeze_export_settings" id="breeze_export_settings" class="button-primary" value="<?php _e( 'Export JSON', 'breeze' ); ?>">
|
23 |
-
<input type="hidden" id="breeze-level" value="<?php echo esc_attr( $level ); ?>">
|
24 |
-
</td>
|
25 |
-
</tr>
|
26 |
-
<tr>
|
27 |
-
<td>
|
28 |
-
<label for="breeze_import_settings" class="breeze_tool_tip"><?php _e( 'Import settings:', 'breeze' ); ?></label>
|
29 |
-
</td>
|
30 |
-
<td>
|
31 |
-
<input type="file" name="breeze_import_settings" id="breeze_import_settings">
|
32 |
-
<input type="button" id="breeze_import_btn" value="<?php _e( 'Import file', 'breeze' ); ?>" class="button-primary"/>
|
33 |
-
<p id="file-selected"></p>
|
34 |
-
<p id="file-error" class="file_red" style="font-weight: bold"></p>
|
35 |
-
</td>
|
36 |
-
</tr>
|
37 |
-
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
views/tabs/varnish.php
DELETED
@@ -1,50 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
defined( 'ABSPATH' ) or die;
|
3 |
-
|
4 |
-
$varnish = breeze_get_option( 'varnish_cache', true );
|
5 |
-
$check_varnish = is_varnish_cache_started();
|
6 |
-
|
7 |
-
if ( ! isset( $varnish['auto-purge-varnish'] ) ) {
|
8 |
-
$varnish['auto-purge-varnish'] = '0';
|
9 |
-
}
|
10 |
-
?>
|
11 |
-
<div class="breeze-top-notice">
|
12 |
-
<p class="breeze_tool_tip"><?php _e( 'By default Varnish is enabled on all WordPress websites hosted on Cloudways.', 'breeze' ); ?></p>
|
13 |
-
</div>
|
14 |
-
<table cellspacing="15">
|
15 |
-
<tr>
|
16 |
-
<td>
|
17 |
-
<label for="auto-purge-varnish" class="breeze_tool_tip"><?php _e( 'Auto Purge Varnish', 'breeze' ); ?></label>
|
18 |
-
</td>
|
19 |
-
<td>
|
20 |
-
<input type="checkbox" id="auto-purge-varnish" name="auto-purge-varnish" value="1" <?php checked( $varnish['auto-purge-varnish'], '1' ); ?>/>
|
21 |
-
<span class="breeze_tool_tip" ><?php _e( 'Keep this option enabled to automatically purge Varnish cache on actions like publishing new blog posts, pages and comments.', 'breeze' ); ?></span>
|
22 |
-
<br>
|
23 |
-
<?php if ( ! $check_varnish ) : ?>
|
24 |
-
<span><b>Note: </b>
|
25 |
-
<span style="color: #ff0000"><?php _e( 'Seems Varnish is disabled on your Application. Please refer to ', 'breeze' ); ?><a href="https://support.cloudways.com/most-common-varnish-issues-and-queries/" target="_blank"><?php _e( 'this KB', 'breeze' ); ?></a><?php _e( ' and learn how to enable it.', 'breeze' ); ?> </span>
|
26 |
-
</span>
|
27 |
-
<?php endif; ?>
|
28 |
-
</td>
|
29 |
-
</tr>
|
30 |
-
<tr>
|
31 |
-
<td>
|
32 |
-
<label for="varnish-server-ip" class="breeze_tool_tip"><?php _e( 'Varnish server', 'breeze' ); ?></label>
|
33 |
-
</td>
|
34 |
-
<td>
|
35 |
-
<input type="text" id="varnish-server-ip" size="20" name="varnish-server-ip"
|
36 |
-
value='<?php echo( ! empty( $varnish['breeze-varnish-server-ip'] ) ? esc_html( $varnish['breeze-varnish-server-ip'] ) : '127.0.0.1' ); ?>'/>
|
37 |
-
<br/>
|
38 |
-
<span class="breeze_tool_tip"><strong><?php _e( 'Note: Keep this default if you are a Cloudways customer. Otherwise ask your hosting provider on what to set here.', 'breeze' ); ?></strong></span>
|
39 |
-
</td>
|
40 |
-
</tr>
|
41 |
-
<tr>
|
42 |
-
<td style="vertical-align: middle">
|
43 |
-
<label class="breeze_tool_tip"><?php _e( 'Purge Varnish Cache', 'breeze' ); ?></label>
|
44 |
-
</td>
|
45 |
-
<td>
|
46 |
-
<input type="button" id="purge-varnish-button" class="button" value="<?php _e( 'Purge', 'breeze' ); ?>" />
|
47 |
-
<span style="vertical-align: bottom; margin-left: 5px"><?php _e( 'Use this option to instantly Purge Varnish Cache on entire website. ', 'breeze' ); ?></span>
|
48 |
-
</td>
|
49 |
-
</tr>
|
50 |
-
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|