From 6daabcab65a70078a0101694682139f71b9f4c7a Mon Sep 17 00:00:00 2001
From: Malin
Date: Tue, 19 May 2026 19:58:11 +0200
Subject: [PATCH] feat: caching, optimization, legal pages & footer
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- WP Super Cache enabled (PHP mode, gzip, Nginx compatible)
- Autoptimize: CSS/HTML minification + deferred JS + Google Fonts optimization
- Cookie Notice: GDPR/LOPD banner styled with brand colors (navy/burgundy/gold)
- Legal pages: Aviso Legal, Política de Privacidad, Política de Cookies (ES)
- MU-plugin: custom footer with legal links + Cloud Host credit
- Footer: copyright, legal nav, Hosted & Maintained by Cloud Host (cloudhost.es)
- Security: X-Frame-Options, X-Content-Type, Referrer-Policy headers
- Security: XML-RPC disabled, REST user enumeration blocked
- Performance: emoji scripts removed, post revisions limited to 3
---
.gitignore | 2 +
wp-content/autoptimize_404_handler.php | 52 +
wp-content/mu-plugins/acrib-core.php | 68 +
wp-content/plugins/autoptimize/LICENSE | 340 ++
.../plugins/autoptimize/autoptimize.php | 102 +
.../autoptimize_helper.php_example | 143 +
.../autoptimize/classes/autoptimizeBase.php | 711 +++
.../autoptimize/classes/autoptimizeCLI.php | 34 +
.../autoptimize/classes/autoptimizeCSSmin.php | 69 +
.../autoptimize/classes/autoptimizeCache.php | 855 ++++
.../classes/autoptimizeCacheChecker.php | 115 +
.../classes/autoptimizeCompatibility.php | 146 +
.../autoptimize/classes/autoptimizeConfig.php | 1116 ++++
.../classes/autoptimizeCriticalCSSBase.php | 433 ++
.../classes/autoptimizeCriticalCSSCore.php | 664 +++
.../classes/autoptimizeCriticalCSSCron.php | 881 ++++
.../classes/autoptimizeCriticalCSSEnqueue.php | 335 ++
.../autoptimizeCriticalCSSSettings.php | 433 ++
.../autoptimizeCriticalCSSSettingsAjax.php | 597 +++
.../classes/autoptimizeExitSurvey.php | 118 +
.../autoptimize/classes/autoptimizeExtra.php | 662 +++
.../autoptimize/classes/autoptimizeHTML.php | 150 +
.../autoptimize/classes/autoptimizeImages.php | 1652 ++++++
.../autoptimize/classes/autoptimizeMain.php | 855 ++++
.../classes/autoptimizeMetabox.php | 351 ++
.../classes/autoptimizeOptionWrapper.php | 150 +
.../classes/autoptimizePartners.php | 153 +
.../autoptimize/classes/autoptimizeProTab.php | 133 +
.../classes/autoptimizeScripts.php | 861 ++++
.../classes/autoptimizeSpeedupper.php | 110 +
.../autoptimize/classes/autoptimizeStyles.php | 1337 +++++
.../classes/autoptimizeToolbar.php | 167 +
.../autoptimize/classes/autoptimizeUtils.php | 595 +++
.../autoptimizeVersionUpdatesHandler.php | 300 ++
.../critcss-inc/admin_settings_adv.php | 161 +
.../critcss-inc/admin_settings_debug.php | 87 +
.../critcss-inc/admin_settings_explain.php | 57 +
.../critcss-inc/admin_settings_impexp.js.php | 68 +
.../critcss-inc/admin_settings_key.php | 67 +
.../critcss-inc/admin_settings_queue.js.php | 249 +
.../critcss-inc/admin_settings_queue.php | 96 +
.../critcss-inc/admin_settings_rules.js.php | 455 ++
.../critcss-inc/admin_settings_rules.php | 238 +
.../classes/critcss-inc/css/admin_styles.css | 253 +
.../critcss-inc/css/ao-tablesorter/asc.gif | Bin 0 -> 54 bytes
.../critcss-inc/css/ao-tablesorter/bg.gif | Bin 0 -> 64 bytes
.../critcss-inc/css/ao-tablesorter/desc.gif | Bin 0 -> 54 bytes
.../critcss-inc/css/ao-tablesorter/style.css | 40 +
.../classes/critcss-inc/js/admin_settings.js | 11 +
.../critcss-inc/js/jquery.tablesorter.min.js | 4 +
.../classes/critcss-inc/js/md5.min.js | 2 +
.../external/do_not_donate_smallest.png | Bin 0 -> 9585 bytes
.../autoptimize/classes/external/index.html | 1 +
.../classes/external/js/index.html | 1 +
.../classes/external/js/jquery.cookie.js | 89 +
.../classes/external/js/jquery.cookie.min.js | 1 +
.../classes/external/js/lazysizes.min.js | 3 +
.../classes/external/js/unslider-dots.css | 33 +
.../classes/external/js/unslider.css | 1 +
.../classes/external/js/unslider.min.js | 1 +
.../classes/external/php/ao-minify-html.php | 276 +
.../classes/external/php/index.html | 1 +
.../classes/external/php/jsmin.php | 466 ++
.../persist-admin-notices-dismissal/README.md | 117 +
.../dismiss-notice.js | 33 +
.../persist-admin-notices-dismissal.php | 159 +
.../php/yui-php-cssmin-bundled/Colors.php | 155 +
.../php/yui-php-cssmin-bundled/Minifier.php | 935 ++++
.../php/yui-php-cssmin-bundled/Utils.php | 149 +
.../php/yui-php-cssmin-bundled/index.html | 1 +
.../plugins/autoptimize/classes/index.html | 1 +
.../static/exit-survey/exit-survey.css | 221 +
.../classes/static/exit-survey/exit-survey.js | 122 +
.../autoptimize/classes/static/loading.gif | Bin 0 -> 4640 bytes
.../autoptimize/classes/static/toolbar.css | 246 +
.../autoptimize/classes/static/toolbar.js | 82 +
.../classes/static/toolbar.min.css | 1 +
.../autoptimize/classes/static/toolbar.min.js | 6 +
.../config/autoptimize_404_handler.php | 52 +
.../plugins/autoptimize/config/default.php | 87 +
.../plugins/autoptimize/config/index.html | 1 +
wp-content/plugins/autoptimize/index.html | 1 +
wp-content/plugins/autoptimize/readme.txt | 462 ++
.../cookie-notice/assets/chartjs/chart.min.js | 14 +
.../assets/microtip/microtip.css | 266 +
.../assets/microtip/microtip.min.css | 15 +
.../assets/modaal/css/modaal.css | 782 +++
.../assets/modaal/css/modaal.min.css | 5 +
.../assets/modaal/css/modaal.scss | 555 ++
.../cookie-notice/assets/modaal/js/modaal.js | 1390 +++++
.../assets/modaal/js/modaal.min.js | 6 +
.../assets/pagination/pagination.css | 1 +
.../assets/pagination/pagination.js | 1190 +++++
.../assets/pagination/pagination.min.js | 11 +
.../assets/react-admin/cn-admin-react.css | 1 +
.../assets/react-admin/cn-admin-react.js | 1064 ++++
.../assets/react-admin/lato-300.woff2 | Bin 0 -> 13912 bytes
.../assets/react-admin/lato-400.woff2 | Bin 0 -> 13980 bytes
.../assets/react-admin/lato-700.woff2 | Bin 0 -> 14168 bytes
.../assets/react-admin/lato-900.woff2 | Bin 0 -> 13724 bytes
.../assets/spectrum/spectrum.min.css | 1 +
.../assets/spectrum/spectrum.min.js | 1 +
.../plugins/cookie-notice/cookie-notice.php | 1932 +++++++
.../cookie-notice/css/admin-dashboard.css | 348 ++
.../cookie-notice/css/admin-notice.css | 43 +
.../cookie-notice/css/admin-plugins.css | 47 +
.../cookie-notice/css/admin-welcome.css | 2098 ++++++++
.../plugins/cookie-notice/css/admin.css | 833 +++
.../plugins/cookie-notice/css/admin.min.css | 1 +
.../plugins/cookie-notice/css/front.css | 343 ++
.../plugins/cookie-notice/css/front.min.css | 1 +
.../cookie-notice/img/banner-1544x500.png | Bin 0 -> 30482 bytes
.../cookie-notice/img/banner-772x250.png | Bin 0 -> 19910 bytes
.../cookie-notice/img/compliance-icon-256.png | Bin 0 -> 15129 bytes
.../cookie-notice/img/compliance-icon.png | Bin 0 -> 10331 bytes
.../cookie-notice/img/consent-logs.png | Bin 0 -> 185134 bytes
.../img/cookie-compliance-logo-dark.png | Bin 0 -> 4017 bytes
.../img/cookie-compliance-logo.png | Bin 0 -> 5110 bytes
.../img/cookie-compliance-widget.png | Bin 0 -> 18324 bytes
.../img/cookie-notice-logo-dark.png | Bin 0 -> 2624 bytes
.../cookie-notice/img/cookie-notice-logo.png | Bin 0 -> 3082 bytes
.../plugins/cookie-notice/img/hu-logo.png | Bin 0 -> 158780 bytes
.../img/hu-manity-logo-color.svg | 1 +
.../img/hu-manity-logo-white.svg | 1 +
.../cookie-notice/img/icon-128x128.png | Bin 0 -> 20700 bytes
.../cookie-notice/img/icon-256x256.png | Bin 0 -> 63764 bytes
.../cookie-notice/img/layout-bottom.png | Bin 0 -> 2407 bytes
.../cookie-notice/img/layout-bottom.svg | 1 +
.../cookie-notice/img/layout-center.png | Bin 0 -> 2616 bytes
.../cookie-notice/img/layout-center.svg | 1 +
.../plugins/cookie-notice/img/layout-left.png | Bin 0 -> 2390 bytes
.../plugins/cookie-notice/img/layout-left.svg | 1 +
.../cookie-notice/img/layout-right.png | Bin 0 -> 2398 bytes
.../cookie-notice/img/layout-right.svg | 1 +
.../plugins/cookie-notice/img/layout-top.png | Bin 0 -> 2405 bytes
.../plugins/cookie-notice/img/layout-top.svg | 1 +
.../img/privacy-consent-logs.png | Bin 0 -> 217699 bytes
.../cookie-notice/img/screen-compliance.png | Bin 0 -> 418587 bytes
.../cookie-notice/img/screen-notice.png | Bin 0 -> 299406 bytes
.../cookie-notice/includes/bot-detect.php | 1706 +++++++
.../includes/consent-logs-date-list-table.php | 282 ++
.../includes/consent-logs-list-table.php | 299 ++
.../cookie-notice/includes/consent-logs.php | 120 +
.../cookie-notice/includes/dashboard.php | 782 +++
.../cookie-notice/includes/frontend.php | 902 ++++
.../cookie-notice/includes/functions.php | 329 ++
.../includes/modules/amp/amp.php | 172 +
.../includes/modules/amp/iframe.js | 58 +
.../modules/autoptimize/autoptimize.php | 72 +
.../includes/modules/breeze/breeze.php | 100 +
.../modules/contact-form-7/contact-form-7.php | 69 +
.../contact-form-7/privacy-consent.php | 246 +
.../modules/contact-form-7/recaptcha.js | 89 +
.../includes/modules/divi/divi.php | 34 +
.../privacy-consent.php | 397 ++
.../includes/modules/elementor/elementor.php | 34 +
.../formidable-forms/privacy-consent.php | 254 +
.../modules/hummingbird/hummingbird.php | 60 +
.../litespeed-cache/litespeed-cache.php | 57 +
.../modules/mailchimp/privacy-consent.php | 233 +
.../speed-optimizer/speed-optimizer.php | 104 +
.../modules/speedycache/speedycache.php | 64 +
.../modules/woocommerce/privacy-consent.php | 382 ++
.../modules/wordpress/privacy-consent.php | 313 ++
.../wp-fastest-cache/wp-fastest-cache.php | 53 +
.../modules/wp-optimize/wp-optimize.php | 54 +
.../includes/modules/wp-rocket/wp-rocket.php | 97 +
.../modules/wp-super-cache/wp-super-cache.php | 76 +
.../modules/wpforms/privacy-consent.php | 225 +
.../cookie-notice/includes/notifications.json | 83 +
.../includes/privacy-consent-list-table.php | 332 ++
.../privacy-consent-logs-list-table.php | 382 ++
.../includes/privacy-consent-logs.php | 83 +
.../includes/privacy-consent.php | 673 +++
.../includes/react-admin-ajax.php | 1378 +++++
.../cookie-notice/includes/settings.php | 3221 ++++++++++++
.../cookie-notice/includes/welcome-api.php | 2807 ++++++++++
.../includes/welcome-frontend.php | 128 +
.../cookie-notice/includes/welcome.php | 865 ++++
wp-content/plugins/cookie-notice/index.php | 2 +
.../cookie-notice/js/admin-dashboard.js | 19 +
.../plugins/cookie-notice/js/admin-notice.js | 149 +
.../plugins/cookie-notice/js/admin-plugins.js | 71 +
.../plugins/cookie-notice/js/admin-welcome.js | 986 ++++
wp-content/plugins/cookie-notice/js/admin.js | 760 +++
.../plugins/cookie-notice/js/admin.min.js | 1 +
.../plugins/cookie-notice/js/front-welcome.js | 475 ++
wp-content/plugins/cookie-notice/js/front.js | 528 ++
.../plugins/cookie-notice/js/front.min.js | 1 +
.../cookie-notice/languages/cookie-notice.pot | 1962 +++++++
wp-content/plugins/cookie-notice/readme.txt | 719 +++
.../cookie-notice/templates/empty.html | 1 +
wp-content/plugins/wp-super-cache/LICENSE.txt | 355 ++
wp-content/plugins/wp-super-cache/SECURITY.md | 47 +
.../plugins/wp-super-cache/advanced-cache.php | 29 +
.../assets/automattic-airline.svg | 10 +
.../assets/boost-install-card-main-2x.png | Bin 0 -> 305554 bytes
.../assets/boost-install-card-main.png | Bin 0 -> 96878 bytes
.../wp-super-cache/assets/jetpack-colors.svg | 14 +
.../wp-super-cache/assets/jetpack-logo.svg | 17 +
.../assets/super-cache-icon.png | Bin 0 -> 3105 bytes
.../plugins/wp-super-cache/inc/boost.php | 235 +
.../wp-super-cache/inc/delete-cache-button.js | 37 +
.../inc/delete-cache-button.php | 182 +
.../inc/preload-notification.php | 30 +
wp-content/plugins/wp-super-cache/js/admin.js | 146 +
.../wp-super-cache/js/preload-notification.js | 122 +
.../languages/wp-super-cache-be_BY.mo | Bin 0 -> 75729 bytes
.../languages/wp-super-cache-be_BY.po | 1555 ++++++
.../languages/wp-super-cache-de_DE.mo | Bin 0 -> 70830 bytes
.../languages/wp-super-cache-de_DE.po | 1547 ++++++
.../languages/wp-super-cache-es_ES.mo | Bin 0 -> 46170 bytes
.../languages/wp-super-cache-es_ES.po | 1069 ++++
.../languages/wp-super-cache-fr_FR.mo | Bin 0 -> 61792 bytes
.../languages/wp-super-cache-fr_FR.po | 1713 +++++++
.../languages/wp-super-cache-it_IT.mo | Bin 0 -> 66758 bytes
.../languages/wp-super-cache-it_IT.po | 1694 +++++++
.../languages/wp-super-cache-ja.mo | Bin 0 -> 79297 bytes
.../languages/wp-super-cache-ja.po | 1668 ++++++
.../languages/wp-super-cache-lt_LT.mo | Bin 0 -> 57607 bytes
.../languages/wp-super-cache-lt_LT.po | 1555 ++++++
.../languages/wp-super-cache-ro_RO.mo | Bin 0 -> 59434 bytes
.../languages/wp-super-cache-ro_RO.po | 1555 ++++++
.../languages/wp-super-cache-ru_RU.mo | Bin 0 -> 88791 bytes
.../languages/wp-super-cache-ru_RU.po | 1687 ++++++
.../languages/wp-super-cache-sr_RS.mo | Bin 0 -> 84853 bytes
.../languages/wp-super-cache-sr_RS.po | 2686 ++++++++++
.../languages/wp-super-cache-sv_SE.mo | Bin 0 -> 57046 bytes
.../languages/wp-super-cache-sv_SE.po | 1543 ++++++
.../languages/wp-super-cache-tr_TR.mo | Bin 0 -> 70771 bytes
.../languages/wp-super-cache-tr_TR.po | 1617 ++++++
.../languages/wp-super-cache-ua_UA.mo | Bin 0 -> 75414 bytes
.../languages/wp-super-cache-ua_UA.po | 1555 ++++++
.../languages/wp-super-cache-uk.mo | Bin 0 -> 58904 bytes
.../languages/wp-super-cache-uk.po | 1068 ++++
.../languages/wp-super-cache-zh_CN.mo | Bin 0 -> 68811 bytes
.../languages/wp-super-cache-zh_CN.po | 1753 +++++++
.../languages/wp-super-cache-zh_TW.mo | Bin 0 -> 74884 bytes
.../languages/wp-super-cache-zh_TW.po | 1827 +++++++
.../plugins/wp-super-cache/ossdl-cdn.php | 388 ++
.../wp-super-cache/partials/advanced.php | 424 ++
.../plugins/wp-super-cache/partials/debug.php | 74 +
.../plugins/wp-super-cache/partials/easy.php | 191 +
.../wp-super-cache/partials/lockdown.php | 81 +
.../wp-super-cache/partials/preload.php | 111 +
.../partials/rejected_user_agents.php | 16 +
.../wp-super-cache/partials/restore.php | 11 +
.../partials/tracking_parameters.php | 16 +
.../plugins/awaitingmoderation.php | 64 +
.../wp-super-cache/plugins/badbehaviour.php | 98 +
.../wp-super-cache/plugins/domain-mapping.php | 137 +
.../plugins/dynamic-cache-test.php | 187 +
.../wp-super-cache/plugins/jetpack.php | 93 +
.../wp-super-cache/plugins/multisite.php | 68 +
.../wp-super-cache/plugins/wptouch.php | 142 +
wp-content/plugins/wp-super-cache/readme.txt | 270 +
...class.wp-super-cache-rest-delete-cache.php | 35 +
.../class.wp-super-cache-rest-get-cache.php | 45 +
.../class.wp-super-cache-rest-get-plugins.php | 16 +
...class.wp-super-cache-rest-get-settings.php | 208 +
.../class.wp-super-cache-rest-get-stats.php | 18 +
.../class.wp-super-cache-rest-get-status.php | 114 +
.../class.wp-super-cache-rest-preload.php | 31 +
.../class.wp-super-cache-rest-test-cache.php | 97 +
...ass.wp-super-cache-rest-update-plugins.php | 22 +
...ss.wp-super-cache-rest-update-settings.php | 652 +++
.../class.wp-super-cache-settings-map.php | 263 +
.../plugins/wp-super-cache/rest/load.php | 166 +
.../class-device-detection.php | 80 +
.../class-user-agent-info.php | 2293 +++++++++
.../src/device-detection/functions.php | 39 +
.../wp-super-cache/styling/dashboard.css | 190 +
.../plugins/wp-super-cache/wp-cache-base.php | 51 +
.../wp-super-cache/wp-cache-config-sample.php | 105 +
.../wp-super-cache/wp-cache-phase1.php | 195 +
.../wp-super-cache/wp-cache-phase2.php | 3597 +++++++++++++
.../plugins/wp-super-cache/wp-cache.php | 4511 +++++++++++++++++
277 files changed, 96841 insertions(+)
create mode 100644 wp-content/autoptimize_404_handler.php
create mode 100644 wp-content/mu-plugins/acrib-core.php
create mode 100644 wp-content/plugins/autoptimize/LICENSE
create mode 100644 wp-content/plugins/autoptimize/autoptimize.php
create mode 100644 wp-content/plugins/autoptimize/autoptimize_helper.php_example
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeBase.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeCLI.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeCSSmin.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeCache.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeCacheChecker.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeCompatibility.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeConfig.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeCriticalCSSBase.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeCriticalCSSCore.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeCriticalCSSCron.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeCriticalCSSEnqueue.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeCriticalCSSSettings.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeCriticalCSSSettingsAjax.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeExitSurvey.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeExtra.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeHTML.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeImages.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeMain.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeMetabox.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeOptionWrapper.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizePartners.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeProTab.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeScripts.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeSpeedupper.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeStyles.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeToolbar.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeUtils.php
create mode 100644 wp-content/plugins/autoptimize/classes/autoptimizeVersionUpdatesHandler.php
create mode 100644 wp-content/plugins/autoptimize/classes/critcss-inc/admin_settings_adv.php
create mode 100644 wp-content/plugins/autoptimize/classes/critcss-inc/admin_settings_debug.php
create mode 100644 wp-content/plugins/autoptimize/classes/critcss-inc/admin_settings_explain.php
create mode 100644 wp-content/plugins/autoptimize/classes/critcss-inc/admin_settings_impexp.js.php
create mode 100644 wp-content/plugins/autoptimize/classes/critcss-inc/admin_settings_key.php
create mode 100644 wp-content/plugins/autoptimize/classes/critcss-inc/admin_settings_queue.js.php
create mode 100644 wp-content/plugins/autoptimize/classes/critcss-inc/admin_settings_queue.php
create mode 100644 wp-content/plugins/autoptimize/classes/critcss-inc/admin_settings_rules.js.php
create mode 100644 wp-content/plugins/autoptimize/classes/critcss-inc/admin_settings_rules.php
create mode 100644 wp-content/plugins/autoptimize/classes/critcss-inc/css/admin_styles.css
create mode 100644 wp-content/plugins/autoptimize/classes/critcss-inc/css/ao-tablesorter/asc.gif
create mode 100644 wp-content/plugins/autoptimize/classes/critcss-inc/css/ao-tablesorter/bg.gif
create mode 100644 wp-content/plugins/autoptimize/classes/critcss-inc/css/ao-tablesorter/desc.gif
create mode 100644 wp-content/plugins/autoptimize/classes/critcss-inc/css/ao-tablesorter/style.css
create mode 100644 wp-content/plugins/autoptimize/classes/critcss-inc/js/admin_settings.js
create mode 100644 wp-content/plugins/autoptimize/classes/critcss-inc/js/jquery.tablesorter.min.js
create mode 100644 wp-content/plugins/autoptimize/classes/critcss-inc/js/md5.min.js
create mode 100644 wp-content/plugins/autoptimize/classes/external/do_not_donate_smallest.png
create mode 100644 wp-content/plugins/autoptimize/classes/external/index.html
create mode 100644 wp-content/plugins/autoptimize/classes/external/js/index.html
create mode 100644 wp-content/plugins/autoptimize/classes/external/js/jquery.cookie.js
create mode 100644 wp-content/plugins/autoptimize/classes/external/js/jquery.cookie.min.js
create mode 100644 wp-content/plugins/autoptimize/classes/external/js/lazysizes.min.js
create mode 100644 wp-content/plugins/autoptimize/classes/external/js/unslider-dots.css
create mode 100644 wp-content/plugins/autoptimize/classes/external/js/unslider.css
create mode 100644 wp-content/plugins/autoptimize/classes/external/js/unslider.min.js
create mode 100644 wp-content/plugins/autoptimize/classes/external/php/ao-minify-html.php
create mode 100644 wp-content/plugins/autoptimize/classes/external/php/index.html
create mode 100644 wp-content/plugins/autoptimize/classes/external/php/jsmin.php
create mode 100644 wp-content/plugins/autoptimize/classes/external/php/persist-admin-notices-dismissal/README.md
create mode 100644 wp-content/plugins/autoptimize/classes/external/php/persist-admin-notices-dismissal/dismiss-notice.js
create mode 100644 wp-content/plugins/autoptimize/classes/external/php/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php
create mode 100644 wp-content/plugins/autoptimize/classes/external/php/yui-php-cssmin-bundled/Colors.php
create mode 100644 wp-content/plugins/autoptimize/classes/external/php/yui-php-cssmin-bundled/Minifier.php
create mode 100644 wp-content/plugins/autoptimize/classes/external/php/yui-php-cssmin-bundled/Utils.php
create mode 100644 wp-content/plugins/autoptimize/classes/external/php/yui-php-cssmin-bundled/index.html
create mode 100644 wp-content/plugins/autoptimize/classes/index.html
create mode 100644 wp-content/plugins/autoptimize/classes/static/exit-survey/exit-survey.css
create mode 100644 wp-content/plugins/autoptimize/classes/static/exit-survey/exit-survey.js
create mode 100644 wp-content/plugins/autoptimize/classes/static/loading.gif
create mode 100644 wp-content/plugins/autoptimize/classes/static/toolbar.css
create mode 100644 wp-content/plugins/autoptimize/classes/static/toolbar.js
create mode 100644 wp-content/plugins/autoptimize/classes/static/toolbar.min.css
create mode 100644 wp-content/plugins/autoptimize/classes/static/toolbar.min.js
create mode 100644 wp-content/plugins/autoptimize/config/autoptimize_404_handler.php
create mode 100644 wp-content/plugins/autoptimize/config/default.php
create mode 100644 wp-content/plugins/autoptimize/config/index.html
create mode 100644 wp-content/plugins/autoptimize/index.html
create mode 100644 wp-content/plugins/autoptimize/readme.txt
create mode 100644 wp-content/plugins/cookie-notice/assets/chartjs/chart.min.js
create mode 100644 wp-content/plugins/cookie-notice/assets/microtip/microtip.css
create mode 100644 wp-content/plugins/cookie-notice/assets/microtip/microtip.min.css
create mode 100644 wp-content/plugins/cookie-notice/assets/modaal/css/modaal.css
create mode 100644 wp-content/plugins/cookie-notice/assets/modaal/css/modaal.min.css
create mode 100644 wp-content/plugins/cookie-notice/assets/modaal/css/modaal.scss
create mode 100644 wp-content/plugins/cookie-notice/assets/modaal/js/modaal.js
create mode 100644 wp-content/plugins/cookie-notice/assets/modaal/js/modaal.min.js
create mode 100644 wp-content/plugins/cookie-notice/assets/pagination/pagination.css
create mode 100644 wp-content/plugins/cookie-notice/assets/pagination/pagination.js
create mode 100644 wp-content/plugins/cookie-notice/assets/pagination/pagination.min.js
create mode 100644 wp-content/plugins/cookie-notice/assets/react-admin/cn-admin-react.css
create mode 100644 wp-content/plugins/cookie-notice/assets/react-admin/cn-admin-react.js
create mode 100644 wp-content/plugins/cookie-notice/assets/react-admin/lato-300.woff2
create mode 100644 wp-content/plugins/cookie-notice/assets/react-admin/lato-400.woff2
create mode 100644 wp-content/plugins/cookie-notice/assets/react-admin/lato-700.woff2
create mode 100644 wp-content/plugins/cookie-notice/assets/react-admin/lato-900.woff2
create mode 100644 wp-content/plugins/cookie-notice/assets/spectrum/spectrum.min.css
create mode 100644 wp-content/plugins/cookie-notice/assets/spectrum/spectrum.min.js
create mode 100644 wp-content/plugins/cookie-notice/cookie-notice.php
create mode 100644 wp-content/plugins/cookie-notice/css/admin-dashboard.css
create mode 100644 wp-content/plugins/cookie-notice/css/admin-notice.css
create mode 100644 wp-content/plugins/cookie-notice/css/admin-plugins.css
create mode 100644 wp-content/plugins/cookie-notice/css/admin-welcome.css
create mode 100644 wp-content/plugins/cookie-notice/css/admin.css
create mode 100644 wp-content/plugins/cookie-notice/css/admin.min.css
create mode 100644 wp-content/plugins/cookie-notice/css/front.css
create mode 100644 wp-content/plugins/cookie-notice/css/front.min.css
create mode 100644 wp-content/plugins/cookie-notice/img/banner-1544x500.png
create mode 100644 wp-content/plugins/cookie-notice/img/banner-772x250.png
create mode 100644 wp-content/plugins/cookie-notice/img/compliance-icon-256.png
create mode 100644 wp-content/plugins/cookie-notice/img/compliance-icon.png
create mode 100644 wp-content/plugins/cookie-notice/img/consent-logs.png
create mode 100644 wp-content/plugins/cookie-notice/img/cookie-compliance-logo-dark.png
create mode 100644 wp-content/plugins/cookie-notice/img/cookie-compliance-logo.png
create mode 100644 wp-content/plugins/cookie-notice/img/cookie-compliance-widget.png
create mode 100644 wp-content/plugins/cookie-notice/img/cookie-notice-logo-dark.png
create mode 100644 wp-content/plugins/cookie-notice/img/cookie-notice-logo.png
create mode 100644 wp-content/plugins/cookie-notice/img/hu-logo.png
create mode 100644 wp-content/plugins/cookie-notice/img/hu-manity-logo-color.svg
create mode 100644 wp-content/plugins/cookie-notice/img/hu-manity-logo-white.svg
create mode 100644 wp-content/plugins/cookie-notice/img/icon-128x128.png
create mode 100644 wp-content/plugins/cookie-notice/img/icon-256x256.png
create mode 100644 wp-content/plugins/cookie-notice/img/layout-bottom.png
create mode 100644 wp-content/plugins/cookie-notice/img/layout-bottom.svg
create mode 100644 wp-content/plugins/cookie-notice/img/layout-center.png
create mode 100644 wp-content/plugins/cookie-notice/img/layout-center.svg
create mode 100644 wp-content/plugins/cookie-notice/img/layout-left.png
create mode 100644 wp-content/plugins/cookie-notice/img/layout-left.svg
create mode 100644 wp-content/plugins/cookie-notice/img/layout-right.png
create mode 100644 wp-content/plugins/cookie-notice/img/layout-right.svg
create mode 100644 wp-content/plugins/cookie-notice/img/layout-top.png
create mode 100644 wp-content/plugins/cookie-notice/img/layout-top.svg
create mode 100644 wp-content/plugins/cookie-notice/img/privacy-consent-logs.png
create mode 100644 wp-content/plugins/cookie-notice/img/screen-compliance.png
create mode 100644 wp-content/plugins/cookie-notice/img/screen-notice.png
create mode 100644 wp-content/plugins/cookie-notice/includes/bot-detect.php
create mode 100644 wp-content/plugins/cookie-notice/includes/consent-logs-date-list-table.php
create mode 100644 wp-content/plugins/cookie-notice/includes/consent-logs-list-table.php
create mode 100644 wp-content/plugins/cookie-notice/includes/consent-logs.php
create mode 100644 wp-content/plugins/cookie-notice/includes/dashboard.php
create mode 100644 wp-content/plugins/cookie-notice/includes/frontend.php
create mode 100644 wp-content/plugins/cookie-notice/includes/functions.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/amp/amp.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/amp/iframe.js
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/autoptimize/autoptimize.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/breeze/breeze.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/contact-form-7/contact-form-7.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/contact-form-7/privacy-consent.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/contact-form-7/recaptcha.js
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/divi/divi.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/easy-digital-downloads/privacy-consent.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/elementor/elementor.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/formidable-forms/privacy-consent.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/hummingbird/hummingbird.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/litespeed-cache/litespeed-cache.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/mailchimp/privacy-consent.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/speed-optimizer/speed-optimizer.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/speedycache/speedycache.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/woocommerce/privacy-consent.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/wordpress/privacy-consent.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/wp-fastest-cache/wp-fastest-cache.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/wp-optimize/wp-optimize.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/wp-rocket/wp-rocket.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/wp-super-cache/wp-super-cache.php
create mode 100644 wp-content/plugins/cookie-notice/includes/modules/wpforms/privacy-consent.php
create mode 100644 wp-content/plugins/cookie-notice/includes/notifications.json
create mode 100644 wp-content/plugins/cookie-notice/includes/privacy-consent-list-table.php
create mode 100644 wp-content/plugins/cookie-notice/includes/privacy-consent-logs-list-table.php
create mode 100644 wp-content/plugins/cookie-notice/includes/privacy-consent-logs.php
create mode 100644 wp-content/plugins/cookie-notice/includes/privacy-consent.php
create mode 100644 wp-content/plugins/cookie-notice/includes/react-admin-ajax.php
create mode 100644 wp-content/plugins/cookie-notice/includes/settings.php
create mode 100644 wp-content/plugins/cookie-notice/includes/welcome-api.php
create mode 100644 wp-content/plugins/cookie-notice/includes/welcome-frontend.php
create mode 100644 wp-content/plugins/cookie-notice/includes/welcome.php
create mode 100644 wp-content/plugins/cookie-notice/index.php
create mode 100644 wp-content/plugins/cookie-notice/js/admin-dashboard.js
create mode 100644 wp-content/plugins/cookie-notice/js/admin-notice.js
create mode 100644 wp-content/plugins/cookie-notice/js/admin-plugins.js
create mode 100644 wp-content/plugins/cookie-notice/js/admin-welcome.js
create mode 100644 wp-content/plugins/cookie-notice/js/admin.js
create mode 100644 wp-content/plugins/cookie-notice/js/admin.min.js
create mode 100644 wp-content/plugins/cookie-notice/js/front-welcome.js
create mode 100644 wp-content/plugins/cookie-notice/js/front.js
create mode 100644 wp-content/plugins/cookie-notice/js/front.min.js
create mode 100644 wp-content/plugins/cookie-notice/languages/cookie-notice.pot
create mode 100644 wp-content/plugins/cookie-notice/readme.txt
create mode 100644 wp-content/plugins/cookie-notice/templates/empty.html
create mode 100644 wp-content/plugins/wp-super-cache/LICENSE.txt
create mode 100644 wp-content/plugins/wp-super-cache/SECURITY.md
create mode 100644 wp-content/plugins/wp-super-cache/advanced-cache.php
create mode 100644 wp-content/plugins/wp-super-cache/assets/automattic-airline.svg
create mode 100644 wp-content/plugins/wp-super-cache/assets/boost-install-card-main-2x.png
create mode 100644 wp-content/plugins/wp-super-cache/assets/boost-install-card-main.png
create mode 100644 wp-content/plugins/wp-super-cache/assets/jetpack-colors.svg
create mode 100644 wp-content/plugins/wp-super-cache/assets/jetpack-logo.svg
create mode 100644 wp-content/plugins/wp-super-cache/assets/super-cache-icon.png
create mode 100644 wp-content/plugins/wp-super-cache/inc/boost.php
create mode 100644 wp-content/plugins/wp-super-cache/inc/delete-cache-button.js
create mode 100644 wp-content/plugins/wp-super-cache/inc/delete-cache-button.php
create mode 100644 wp-content/plugins/wp-super-cache/inc/preload-notification.php
create mode 100644 wp-content/plugins/wp-super-cache/js/admin.js
create mode 100644 wp-content/plugins/wp-super-cache/js/preload-notification.js
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-be_BY.mo
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-be_BY.po
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-de_DE.mo
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-de_DE.po
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-es_ES.mo
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-es_ES.po
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-fr_FR.mo
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-fr_FR.po
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-it_IT.mo
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-it_IT.po
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-ja.mo
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-ja.po
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-lt_LT.mo
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-lt_LT.po
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-ro_RO.mo
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-ro_RO.po
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-ru_RU.mo
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-ru_RU.po
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-sr_RS.mo
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-sr_RS.po
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-sv_SE.mo
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-sv_SE.po
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-tr_TR.mo
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-tr_TR.po
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-ua_UA.mo
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-ua_UA.po
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-uk.mo
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-uk.po
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-zh_CN.mo
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-zh_CN.po
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-zh_TW.mo
create mode 100644 wp-content/plugins/wp-super-cache/languages/wp-super-cache-zh_TW.po
create mode 100644 wp-content/plugins/wp-super-cache/ossdl-cdn.php
create mode 100644 wp-content/plugins/wp-super-cache/partials/advanced.php
create mode 100644 wp-content/plugins/wp-super-cache/partials/debug.php
create mode 100644 wp-content/plugins/wp-super-cache/partials/easy.php
create mode 100644 wp-content/plugins/wp-super-cache/partials/lockdown.php
create mode 100644 wp-content/plugins/wp-super-cache/partials/preload.php
create mode 100644 wp-content/plugins/wp-super-cache/partials/rejected_user_agents.php
create mode 100644 wp-content/plugins/wp-super-cache/partials/restore.php
create mode 100644 wp-content/plugins/wp-super-cache/partials/tracking_parameters.php
create mode 100644 wp-content/plugins/wp-super-cache/plugins/awaitingmoderation.php
create mode 100644 wp-content/plugins/wp-super-cache/plugins/badbehaviour.php
create mode 100644 wp-content/plugins/wp-super-cache/plugins/domain-mapping.php
create mode 100644 wp-content/plugins/wp-super-cache/plugins/dynamic-cache-test.php
create mode 100644 wp-content/plugins/wp-super-cache/plugins/jetpack.php
create mode 100644 wp-content/plugins/wp-super-cache/plugins/multisite.php
create mode 100644 wp-content/plugins/wp-super-cache/plugins/wptouch.php
create mode 100644 wp-content/plugins/wp-super-cache/readme.txt
create mode 100644 wp-content/plugins/wp-super-cache/rest/class.wp-super-cache-rest-delete-cache.php
create mode 100644 wp-content/plugins/wp-super-cache/rest/class.wp-super-cache-rest-get-cache.php
create mode 100644 wp-content/plugins/wp-super-cache/rest/class.wp-super-cache-rest-get-plugins.php
create mode 100644 wp-content/plugins/wp-super-cache/rest/class.wp-super-cache-rest-get-settings.php
create mode 100644 wp-content/plugins/wp-super-cache/rest/class.wp-super-cache-rest-get-stats.php
create mode 100644 wp-content/plugins/wp-super-cache/rest/class.wp-super-cache-rest-get-status.php
create mode 100644 wp-content/plugins/wp-super-cache/rest/class.wp-super-cache-rest-preload.php
create mode 100644 wp-content/plugins/wp-super-cache/rest/class.wp-super-cache-rest-test-cache.php
create mode 100644 wp-content/plugins/wp-super-cache/rest/class.wp-super-cache-rest-update-plugins.php
create mode 100644 wp-content/plugins/wp-super-cache/rest/class.wp-super-cache-rest-update-settings.php
create mode 100644 wp-content/plugins/wp-super-cache/rest/class.wp-super-cache-settings-map.php
create mode 100644 wp-content/plugins/wp-super-cache/rest/load.php
create mode 100644 wp-content/plugins/wp-super-cache/src/device-detection/class-device-detection.php
create mode 100644 wp-content/plugins/wp-super-cache/src/device-detection/class-user-agent-info.php
create mode 100644 wp-content/plugins/wp-super-cache/src/device-detection/functions.php
create mode 100644 wp-content/plugins/wp-super-cache/styling/dashboard.css
create mode 100644 wp-content/plugins/wp-super-cache/wp-cache-base.php
create mode 100644 wp-content/plugins/wp-super-cache/wp-cache-config-sample.php
create mode 100644 wp-content/plugins/wp-super-cache/wp-cache-phase1.php
create mode 100644 wp-content/plugins/wp-super-cache/wp-cache-phase2.php
create mode 100644 wp-content/plugins/wp-super-cache/wp-cache.php
diff --git a/.gitignore b/.gitignore
index cb005dc..13e5d10 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,5 @@ wp-content/wp-cache-config.php
Thumbs.db
# Panel
.user.ini
+wp-content/cache/
+wp-content/wp-cache-config.php
diff --git a/wp-content/autoptimize_404_handler.php b/wp-content/autoptimize_404_handler.php
new file mode 100644
index 0000000..6507899
--- /dev/null
+++ b/wp-content/autoptimize_404_handler.php
@@ -0,0 +1,52 @@
+
+
+ [\d]+)']);
+ return $endpoints;
+});
+
+// --- Disable emoji (reduces ~20KB page weight) ---
+remove_action('wp_head', 'print_emoji_detection_script', 7);
+remove_action('wp_print_styles', 'print_emoji_styles');
+remove_action('admin_print_scripts', 'print_emoji_detection_script');
+remove_action('admin_print_styles', 'print_emoji_styles');
+remove_filter('the_content_feed', 'wp_staticize_emoji');
+remove_filter('comment_text_rss', 'wp_staticize_emoji');
+remove_filter('wp_mail', 'wp_staticize_emoji_for_email');
+
+// --- Limit post revisions ---
+if (!defined('WP_POST_REVISIONS')) {
+ define('WP_POST_REVISIONS', 3);
+}
diff --git a/wp-content/plugins/autoptimize/LICENSE b/wp-content/plugins/autoptimize/LICENSE
new file mode 100644
index 0000000..d6a9326
--- /dev/null
+++ b/wp-content/plugins/autoptimize/LICENSE
@@ -0,0 +1,340 @@
+GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ {description}
+ Copyright (C) {year} {fullname}
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ {signature of Ty Coon}, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
+
diff --git a/wp-content/plugins/autoptimize/autoptimize.php b/wp-content/plugins/autoptimize/autoptimize.php
new file mode 100644
index 0000000..a94b79b
--- /dev/null
+++ b/wp-content/plugins/autoptimize/autoptimize.php
@@ -0,0 +1,102 @@
+' . esc_html__( 'Autoptimize requires PHP 5.6 (or higher) to function properly. Please upgrade PHP. The Plugin has been auto-deactivated.', 'autoptimize' ) . '
';
+ if ( isset( $_GET['activate'] ) ) {
+ unset( $_GET['activate'] );
+ }
+ }
+ function autoptimize_deactivate_self() {
+ deactivate_plugins( plugin_basename( AUTOPTIMIZE_PLUGIN_FILE ) );
+ }
+ add_action( 'admin_notices', 'autoptimize_incompatible_admin_notice' );
+ add_action( 'admin_init', 'autoptimize_deactivate_self' );
+ return;
+}
+
+function autoptimize_autoload( $class_name ) {
+ if ( in_array( $class_name, array( 'AO_Minify_HTML', 'JSMin' ) ) ) {
+ $file = strtolower( $class_name );
+ $file = str_replace( '_', '-', $file );
+ $path = dirname( __FILE__ ) . '/classes/external/php/';
+ $filepath = $path . $file . '.php';
+ } elseif ( false !== strpos( $class_name, 'Autoptimize\\tubalmartin\\CssMin' ) ) {
+ $file = str_replace( 'Autoptimize\\tubalmartin\\CssMin\\', '', $class_name );
+ $path = dirname( __FILE__ ) . '/classes/external/php/yui-php-cssmin-bundled/';
+ $filepath = $path . $file . '.php';
+ } elseif ( 'autoptimize' === substr( $class_name, 0, 11 ) ) {
+ // One of our "old" classes.
+ $file = $class_name;
+ $path = dirname( __FILE__ ) . '/classes/';
+ $filepath = $path . $file . '.php';
+ } elseif ( 'PAnD' === $class_name ) {
+ $file = 'persist-admin-notices-dismissal';
+ $path = dirname( __FILE__ ) . '/classes/external/php/persist-admin-notices-dismissal/';
+ $filepath = $path . $file . '.php';
+ }
+
+ // If we didn't match one of our rules, bail!
+ if ( ! isset( $filepath ) || ! is_readable( $filepath ) ) {
+ return;
+ }
+
+ require $filepath;
+}
+
+spl_autoload_register( 'autoptimize_autoload' );
+
+// Load WP CLI command(s) on demand.
+if ( defined( 'WP_CLI' ) && WP_CLI ) {
+ require AUTOPTIMIZE_PLUGIN_DIR . 'classes/autoptimizeCLI.php';
+}
+
+// filter to disable AO both on front- and backend.
+if ( apply_filters( 'autoptimize_filter_disable_plugin', false ) ) {
+ return;
+}
+
+/**
+ * Retrieve the instance of the main plugin class.
+ *
+ * @return autoptimizeMain
+ */
+function autoptimize() {
+ static $plugin = null;
+
+ if ( null === $plugin ) {
+ $plugin = new autoptimizeMain( AUTOPTIMIZE_PLUGIN_VERSION, AUTOPTIMIZE_PLUGIN_FILE );
+ }
+
+ return $plugin;
+}
+
+autoptimize()->run();
diff --git a/wp-content/plugins/autoptimize/autoptimize_helper.php_example b/wp-content/plugins/autoptimize/autoptimize_helper.php_example
new file mode 100644
index 0000000..6e38db6
--- /dev/null
+++ b/wp-content/plugins/autoptimize/autoptimize_helper.php_example
@@ -0,0 +1,143 @@
+","after");
+ }
+
+/* autoptimize_filter_js_replacetag: where in the HTML is optimized JS injected
+
+@param array $replacetag, containing the html-tag and the method (inject "before", "after" or "replace")
+@return array with updated values */
+// add_filter('autoptimize_filter_js_replacetag','my_ao_override_js_replacetag',10,1);
+function my_ao_override_js_replacetag($replacetag) {
+ return array("","replace");
+ }
+
+/* autoptimize_js_do_minify: do we want to minify? if set to false autoptimize effectively only aggregates, but does not minify
+
+@return: boolean true or false */
+// add_filter('autoptimize_js_do_minify','my_ao_js_minify',10,1);
+function my_ao_js_minify() {
+ return false;
+ }
+
+/* autoptimize_css_do_minify: do we want to minify? if set to false autoptimize effectively only aggregates, but does not minify
+
+@return: boolean true or false */
+// add_filter('autoptimize_css_do_minify','my_ao_css_minify',10,1);
+function my_ao_css_minify() {
+ return false;
+ }
+
+/* autoptimize_js_include_inline: do we want AO to also aggregate inline JS?
+
+@return: boolean true or false */
+// add_filter('autoptimize_js_include_inline','my_ao_js_include_inline',10,1);
+function my_ao_js_include_inline() {
+ return false;
+ }
+
+/* autoptimize_css_include_inline: do we want AO to also aggregate inline CSS?
+
+@return: boolean true or false */
+// add_filter('autoptimize_css_include_inline','my_ao_css_include_inline',10,1);
+function my_ao_css_include_inline() {
+ return false;
+ }
+
+/* autoptimize_filter_css_defer_inline: what CSS to inline when "defer and inline" is activated
+
+@param $inlined: string with above the fold CSS as configured in admin
+@return: updated string with above the fold CSS */
+// add_filter('autoptimize_filter_css_defer_inline','my_ao_css_defer_inline',10,1);
+function my_ao_css_defer_inline($inlined) {
+ return $inlined."h2,h1{color:red !important;}";
+ }
+
+/* autoptimize_filter_css_fonts_cdn: do we want to move fonts to the CDN-url as well
+
+@return: false (default) or true */
+// add_filter('autoptimize_filter_css_fonts_cdn','my_css_cdnfont',10,0);
+function my_css_cdnfont(){
+ return true;
+}
diff --git a/wp-content/plugins/autoptimize/classes/autoptimizeBase.php b/wp-content/plugins/autoptimize/classes/autoptimizeBase.php
new file mode 100644
index 0000000..db3698b
--- /dev/null
+++ b/wp-content/plugins/autoptimize/classes/autoptimizeBase.php
@@ -0,0 +1,711 @@
+content = $content;
+ }
+
+ /**
+ * Reads the page and collects tags.
+ *
+ * @param array $options Options.
+ *
+ * @return bool
+ */
+ abstract public function read( $options );
+
+ /**
+ * Joins and optimizes collected things.
+ *
+ * @return bool
+ */
+ abstract public function minify();
+
+ /**
+ * Caches the things.
+ *
+ * @return void
+ */
+ abstract public function cache();
+
+ /**
+ * Returns the content
+ *
+ * @return string
+ */
+ abstract public function getcontent();
+
+ /**
+ * Tranfsorms a given URL to a full local filepath if possible.
+ * Returns local filepath or false.
+ *
+ * @param string $url URL to transform.
+ *
+ * @return bool|string
+ */
+ public function getpath( $url )
+ {
+ $url = apply_filters( 'autoptimize_filter_cssjs_alter_url', $url );
+
+ if ( is_null( $url ) ) {
+ return false;
+ }
+
+ if ( false !== strpos( $url, '%' ) ) {
+ $url = urldecode( $url );
+ }
+
+ $site_host = parse_url( AUTOPTIMIZE_WP_SITE_URL, PHP_URL_HOST );
+ $content_host = parse_url( AUTOPTIMIZE_WP_ROOT_URL, PHP_URL_HOST );
+
+ // Normalizing attempts...
+ $double_slash_position = strpos( $url, '//' );
+ if ( 0 === $double_slash_position ) {
+ if ( is_ssl() ) {
+ $url = 'https:' . $url;
+ } else {
+ $url = 'http:' . $url;
+ }
+ } elseif ( ( false === $double_slash_position ) && ( false === strpos( $url, $site_host ) ) ) {
+ if ( AUTOPTIMIZE_WP_SITE_URL === $site_host ) {
+ $url = AUTOPTIMIZE_WP_SITE_URL . $url;
+ } elseif ( 0 === strpos( $url, '/' ) ) {
+ $url = '//' . $site_host . autoptimizeUtils::path_canonicalize( $url );
+ } else {
+ $url = AUTOPTIMIZE_WP_SITE_URL . autoptimizeUtils::path_canonicalize( $url );
+ }
+ }
+
+ if ( $site_host !== $content_host ) {
+ $url = str_replace( AUTOPTIMIZE_WP_CONTENT_URL, AUTOPTIMIZE_WP_SITE_URL . AUTOPTIMIZE_WP_CONTENT_NAME, $url );
+ }
+
+ // First check; hostname wp site should be hostname of url!
+ $url_host = @parse_url( $url, PHP_URL_HOST ); // @codingStandardsIgnoreLine
+ if ( $url_host !== $site_host ) {
+ /**
+ * First try to get all domains from WPML (if available)
+ * then explicitely declare $this->cdn_url as OK as well
+ * then apply own filter autoptimize_filter_cssjs_multidomain takes an array of hostnames
+ * each item in that array will be considered part of the same WP multisite installation
+ */
+ $multidomains = array();
+
+ $multidomains_wpml = apply_filters( 'wpml_setting', array(), 'language_domains' );
+ if ( ! empty( $multidomains_wpml ) ) {
+ $multidomains = array_map( array( $this, 'get_url_hostname' ), $multidomains_wpml );
+ }
+
+ if ( ! empty( $this->cdn_url ) ) {
+ $multidomains[] = parse_url( $this->cdn_url, PHP_URL_HOST );
+ }
+
+ $multidomains = apply_filters( 'autoptimize_filter_cssjs_multidomain', $multidomains );
+
+ if ( ! empty( $multidomains ) ) {
+ if ( in_array( $url_host, $multidomains ) ) {
+ $url = str_replace( $url_host, $site_host, $url );
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ // Try to remove "wp root url" from url while not minding http<>https.
+ $tmp_ao_root = preg_replace( '/https?:/', '', AUTOPTIMIZE_WP_ROOT_URL );
+
+ if ( $site_host !== $content_host ) {
+ // As we replaced the content-domain with the site-domain, we should match against that.
+ $tmp_ao_root = preg_replace( '/https?:/', '', AUTOPTIMIZE_WP_SITE_URL );
+ }
+
+ if ( is_multisite() && ! is_main_site() && ! empty( $this->cdn_url ) && apply_filters( 'autoptimize_filter_base_getpage_multisite_cdn_juggling', true ) ) {
+ // multisite child sites with CDN need the network_site_url as tmp_ao_root but only if directory-based multisite.
+ $_network_site_url = network_site_url();
+ if ( strpos( AUTOPTIMIZE_WP_SITE_URL, $_network_site_url ) !== false ) {
+ $tmp_ao_root = preg_replace( '/https?:/', '', $_network_site_url );
+ }
+ }
+
+ $tmp_url = preg_replace( '/https?:/', '', $url );
+ $path = str_replace( $tmp_ao_root, '', $tmp_url );
+
+ // If path starts with :// or //, this is not a URL in the WP context and
+ // we have to assume we can't aggregate.
+ if ( preg_match( '#^:?//#', $path ) ) {
+ // External script/css (adsense, etc).
+ return false;
+ }
+
+ // Prepend with WP_ROOT_DIR to have full path to file.
+ $path = str_replace( '//', '/', trailingslashit( WP_ROOT_DIR ) . $path );
+
+ // Allow path to be altered, e.g. in the case of bedrock-like setups where
+ // core, theme & plugins might be in different locations on the filesystem.
+ $path = apply_filters( 'autoptimize_filter_base_getpath_path', $path, $url );
+
+ // Final check: does file exist and is it readable?
+ if ( file_exists( $path ) && is_file( $path ) && is_readable( $path ) ) {
+ return $path;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Returns the hostname part of a given $url if we're able to parse it.
+ * If not, it returns the original url (prefixed with http:// scheme in case
+ * it was missing).
+ * Used as callback for WPML multidomains filter.
+ *
+ * @param string $url URL.
+ *
+ * @return string
+ */
+ protected function get_url_hostname( $url )
+ {
+ // Checking that the url starts with something vaguely resembling a protocol.
+ if ( ( 0 !== strpos( $url, 'http' ) ) && ( 0 !== strpos( $url, '//' ) ) ) {
+ $url = 'http://' . $url;
+ }
+
+ // Grab the hostname.
+ $hostname = parse_url( $url, PHP_URL_HOST );
+
+ // Fallback when parse_url() fails.
+ if ( empty( $hostname ) ) {
+ $hostname = $url;
+ }
+
+ return $hostname;
+ }
+
+ /**
+ * Hides everything between noptimize-comment tags.
+ *
+ * @param string $markup Markup to process.
+ *
+ * @return string
+ */
+ protected function hide_noptimize( $markup )
+ {
+ return $this->replace_contents_with_marker_if_exists(
+ 'NOPTIMIZE',
+ '//',
+ '#.*?#is',
+ $markup
+ );
+ }
+
+ /**
+ * Unhide noptimize-tags.
+ *
+ * @param string $markup Markup to process.
+ *
+ * @return string
+ */
+ protected function restore_noptimize( $markup )
+ {
+ return $this->restore_marked_content( 'NOPTIMIZE', $markup );
+ }
+
+ /**
+ * Hides "iehacks" content.
+ *
+ * @param string $markup Markup to process.
+ *
+ * @return string
+ */
+ protected function hide_iehacks( $markup )
+ {
+ return $this->replace_contents_with_marker_if_exists(
+ 'IEHACK', // Marker name...
+ '#is', // Replacement regex...
+ $markup
+ );
+ }
+
+ /**
+ * Restores "hidden" iehacks content.
+ *
+ * @param string $markup Markup to process.
+ *
+ * @return string
+ */
+ protected function restore_iehacks( $markup )
+ {
+ return $this->restore_marked_content( 'IEHACK', $markup );
+ }
+
+ /**
+ * "Hides" content within HTML comments using a regex-based replacement
+ * if HTML comment markers are found.
+ * `` becomes `%%COMMENTS%%ZXhhbXBsZQ==%%COMMENTS%%`
+ *
+ * @param string $markup Markup to process.
+ *
+ * @return string
+ */
+ protected function hide_comments( $markup )
+ {
+ return $this->replace_contents_with_marker_if_exists(
+ 'COMMENTS',
+ '#is',
+ $markup
+ );
+ }
+
+ /**
+ * Restores original HTML comment markers inside a string whose HTML
+ * comments have been "hidden" by using `hide_comments()`.
+ *
+ * @param string $markup Markup to process.
+ *
+ * @return string
+ */
+ protected function restore_comments( $markup )
+ {
+ return $this->restore_marked_content( 'COMMENTS', $markup );
+ }
+
+ /**
+ * Replaces the given URL with the CDN-version of it when CDN replacement
+ * is supposed to be done.
+ *
+ * @param string $url URL to process.
+ *
+ * @return string
+ */
+ public function url_replace_cdn( $url )
+ {
+ // For 2.3 back-compat in which cdn-ing appeared to be automatically
+ // including WP subfolder/subdirectory into account as part of cdn-ing,
+ // even though it might've caused serious troubles in certain edge-cases.
+ $cdn_url = autoptimizeUtils::tweak_cdn_url_if_needed( $this->cdn_url );
+
+ // Allows API/filter to further tweak the cdn url...
+ $cdn_url = apply_filters( 'autoptimize_filter_base_cdnurl', $cdn_url );
+ if ( ! empty( $cdn_url ) && false === strpos( $url, $cdn_url ) && false !== apply_filters( 'autoptimize_filter_base_apply_cdn', true, $url ) ) {
+
+ // Simple str_replace-based approach fails when $url is protocol-or-host-relative.
+ $is_protocol_relative = autoptimizeUtils::is_protocol_relative( $url );
+ $is_host_relative = ( ! $is_protocol_relative && ( '/' === $url[0] ) );
+ $cdn_url = esc_url( rtrim( $cdn_url, '/' ) );
+
+ if ( $is_host_relative ) {
+ // Prepending host-relative urls with the cdn url.
+ $url = $cdn_url . $url;
+ } else {
+ // Either a protocol-relative or "regular" url, replacing it either way.
+ if ( $is_protocol_relative ) {
+ // Massage $site_url so that simple str_replace() still "works" by
+ // searching for the protocol-relative version of AUTOPTIMIZE_WP_SITE_URL.
+ $site_url = str_replace( array( 'http:', 'https:' ), '', AUTOPTIMIZE_WP_SITE_URL );
+ } else {
+ $site_url = AUTOPTIMIZE_WP_SITE_URL;
+ }
+ $url = str_replace( $site_url, $cdn_url, $url );
+ }
+ }
+
+ // Allow API filter to take further care of CDN replacement.
+ $url = apply_filters( 'autoptimize_filter_base_replace_cdn', $url );
+
+ return $url;
+ }
+
+ /**
+ * Injects/replaces the given payload markup into `$this->content`
+ * at the specified location.
+ * If the specified tag cannot be found, the payload is appended into
+ * $this->content along with a warning wrapped inside tags.
+ *
+ * @param string $payload Markup to inject.
+ * @param array $where Array specifying the tag name and method of injection.
+ * Index 0 is the tag name (i.e., `
Generated by Autoptimize`).
+ * Index 1 specifies ˛'before', 'after' or 'replace'. Defaults to 'before'.
+ *
+ * @return void
+ */
+ protected function inject_in_html( $payload, $where )
+ {
+ $warned = false;
+ $position = autoptimizeUtils::strpos( $this->content, $where[0] );
+ if ( false !== $position ) {
+ // Found the tag, setup content/injection as specified.
+ if ( 'after' === $where[1] ) {
+ $content = $where[0] . $payload;
+ } elseif ( 'replace' === $where[1] ) {
+ $content = $payload;
+ } else {
+ $content = $payload . $where[0];
+ }
+ // Place where specified.
+ $this->content = autoptimizeUtils::substr_replace(
+ $this->content,
+ $content,
+ $position,
+ // Using plain strlen() should be safe here for now, since
+ // we're not searching for multibyte chars here still...
+ strlen( $where[0] )
+ );
+ } else {
+ // Couldn't find what was specified, just append and add a warning.
+ $this->content .= $payload;
+ if ( ! $warned ) {
+ $tag_display = str_replace( array( '<', '>' ), '', $where[0] );
+ $this->content .= '';
+ $warned = true;
+ }
+ }
+ }
+
+ /**
+ * Returns true if given `$tag` is found in the list of `$removables`.
+ *
+ * @param string $tag Tag to search for.
+ * @param array $removables List of things considered completely removable.
+ *
+ * @return bool
+ */
+ protected function isremovable( $tag, $removables )
+ {
+ foreach ( $removables as $match ) {
+ if ( false !== strpos( $tag, $match ) ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Callback used in `self::inject_minified()`.
+ *
+ * @param array $matches Regex matches.
+ *
+ * @return string
+ */
+ public function inject_minified_callback( $matches )
+ {
+ static $conf = null;
+ if ( null === $conf ) {
+ $conf = autoptimizeConfig::instance();
+ }
+
+ /**
+ * $matches[1] holds the whole match caught by regex in self::inject_minified(),
+ * so we take that and split the string on `|`.
+ * First element is the filepath, second is the md5 hash of contents
+ * the filepath had when it was being processed.
+ * If we don't have those, we'll bail out early.
+ */
+ $filepath = null;
+ $filehash = null;
+
+ // Grab the parts we need.
+ $parts = explode( '|', $matches[1] );
+ if ( ! empty( $parts ) ) {
+ $filepath = isset( $parts[0] ) ? base64_decode( $parts[0] ) : null;
+ $filehash = isset( $parts[1] ) ? $parts[1] : null;
+ }
+
+ // Bail early if something's not right...
+ if ( ! $filepath || ! $filehash ) {
+ return "\n";
+ }
+
+ $filecontent = file_get_contents( $filepath );
+
+ // Some things are differently handled for css/js...
+ $is_js_file = ( '.js' === substr( $filepath, -3, 3 ) );
+
+ $is_css_file = false;
+ if ( ! $is_js_file ) {
+ $is_css_file = ( '.css' === substr( $filepath, -4, 4 ) );
+ }
+
+ // BOMs being nuked here unconditionally (regardless of where they are)!
+ $filecontent = preg_replace( "#\x{EF}\x{BB}\x{BF}#", '', $filecontent );
+
+ // Remove comments and blank lines.
+ if ( $is_js_file ) {
+ $filecontent = preg_replace( '#^\s*\/\/.*$#Um', '', $filecontent );
+ }
+
+ // Nuke un-important comments.
+ $filecontent = preg_replace( '#^\s*\/\*[^!].*\*\/\s?#Um', '', $filecontent );
+
+ // Normalize newlines.
+ $filecontent = preg_replace( '#(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+#', "\n", $filecontent );
+
+ // JS specifics.
+ if ( $is_js_file ) {
+ // Append a semicolon at the end of js files if it's missing.
+ $last_char = substr( $filecontent, -1, 1 );
+ if ( ';' !== $last_char && '}' !== $last_char ) {
+ $filecontent .= ';';
+ }
+ // Check if try/catch should be used.
+ $opt_js_try_catch = $conf->get( 'autoptimize_js_trycatch' );
+ if ( 'on' === $opt_js_try_catch ) {
+ // It should, wrap in try/catch.
+ $filecontent = 'try{' . $filecontent . '}catch(e){}';
+ }
+ } elseif ( $is_css_file ) {
+ $filecontent = autoptimizeStyles::fixurls( $filepath, $filecontent );
+ } else {
+ $filecontent = '';
+ }
+
+ // Return modified (or empty!) code/content.
+ return "\n" . $filecontent;
+ }
+
+ /**
+ * Inject already minified code in optimized JS/CSS.
+ *
+ * @param string $in Markup.
+ *
+ * @return string
+ */
+ protected function inject_minified( $in )
+ {
+ $out = $in;
+ if ( false !== strpos( $in, '%%INJECTLATER%%' ) ) {
+ $out = preg_replace_callback(
+ '#\/\*\!%%INJECTLATER' . AUTOPTIMIZE_HASH . '%%(.*?)%%INJECTLATER%%\*\/#is',
+ array( $this, 'inject_minified_callback' ),
+ $in
+ );
+ }
+
+ return $out;
+ }
+
+ /**
+ * Specialized method to create the INJECTLATER marker.
+ * These are somewhat "special", in the sense that they're additionally wrapped
+ * within an "exclamation mark style" comment, so that they're not stripped
+ * out by minifiers.
+ * They also currently contain the hash of the file's contents too (unlike other markers).
+ *
+ * @param string $filepath Filepath.
+ * @param string $hash Hash.
+ *
+ * @return string
+ */
+ public static function build_injectlater_marker( $filepath, $hash )
+ {
+ $contents = '/*!' . self::build_marker( 'INJECTLATER', $filepath, $hash ) . '*/';
+
+ return $contents;
+ }
+
+ /**
+ * Creates and returns a `%%`-style named marker which holds
+ * the base64 encoded `$data`.
+ * If `$hash` is provided, it's appended to the base64 encoded string
+ * using `|` as the separator (in order to support building the
+ * somewhat special/different INJECTLATER marker).
+ *
+ * @param string $name Marker name.
+ * @param string $data Marker data which will be base64-encoded.
+ * @param string|null $hash Optional.
+ *
+ * @return string
+ */
+ public static function build_marker( $name, $data, $hash = null )
+ {
+ // Start the marker, add the data.
+ $marker = '%%' . $name . AUTOPTIMIZE_HASH . '%%' . base64_encode( $data );
+
+ // Add the hash if provided.
+ if ( null !== $hash ) {
+ $marker .= '|' . $hash;
+ }
+
+ // Close the marker.
+ $marker .= '%%' . $name . '%%';
+
+ return $marker;
+ }
+
+ /**
+ * Searches for `$search` in `$content` (using either `preg_match()`
+ * or `strpos()`, depending on whether `$search` is a valid regex pattern or not).
+ * If something is found, it replaces `$content` using `$re_replace_pattern`,
+ * effectively creating our named markers (`%%{$marker}%%`.
+ * These are then at some point replaced back to their actual/original/modified
+ * contents using `autoptimizeBase::restore_marked_content()`.
+ *
+ * @param string $marker Marker name (without percent characters).
+ * @param string $search A string or full blown regex pattern to search for in $content. Uses `strpos()` or `preg_match()`.
+ * @param string $re_replace_pattern Regex pattern to use when replacing contents.
+ * @param string $content Content to work on.
+ *
+ * @return string
+ */
+ public static function replace_contents_with_marker_if_exists( $marker, $search, $re_replace_pattern, $content )
+ {
+ $found = false;
+
+ $is_regex = autoptimizeUtils::str_is_valid_regex( $search );
+ if ( $is_regex ) {
+ $found = preg_match( $search, $content );
+ } else {
+ $found = ( false !== strpos( $content, $search ) );
+ }
+
+ if ( $found ) {
+ $content = preg_replace_callback(
+ $re_replace_pattern,
+ function( $matches ) use ( $marker ) {
+ return autoptimizeBase::build_marker( $marker, $matches[0] );
+ },
+ $content
+ );
+
+ // Check for error (for example, an error can occur if $content is very large).
+ if ( null === $content ) {
+ $error_message = 'Autoptimize: preg_replace_callback() failed';
+ if ( function_exists( 'preg_last_error_msg' ) ) {
+ $error_message .= ': ' . preg_last_error_msg();
+ }
+ error_log( $error_message );
+ }
+ }
+
+ return $content;
+ }
+
+ /**
+ * Complements `autoptimizeBase::replace_contents_with_marker_if_exists()`.
+ *
+ * @param string $marker Marker.
+ * @param string $content Markup.
+ *
+ * @return string
+ */
+ public static function restore_marked_content( $marker, $content )
+ {
+ if ( false !== strpos( $content, $marker ) ) {
+ $content = preg_replace_callback(
+ '#%%' . $marker . AUTOPTIMIZE_HASH . '%%(.*?)%%' . $marker . '%%#is',
+ function ( $matches ) {
+ return base64_decode( $matches[1] );
+ },
+ $content
+ );
+ }
+
+ return $content;
+ }
+
+ /**
+ * Logs given `$data` for debugging purposes (when debug logging is on).
+ *
+ * @param mixed $data Data to log.
+ *
+ * @return void
+ */
+ protected function debug_log( $data )
+ {
+ if ( ! isset( $this->debug_log ) || ! $this->debug_log ) {
+ return;
+ }
+
+ if ( ! is_string( $data ) && ! is_resource( $data ) ) {
+ $data = var_export( $data, true );
+ }
+
+ error_log( $data );
+ }
+
+ /**
+ * Checks if a single local css/js file can be minified and returns source if so.
+ *
+ * @param string $filepath Filepath.
+ *
+ * @return bool|string to be minified code or false.
+ */
+ protected function prepare_minify_single( $filepath )
+ {
+ // Decide what we're dealing with, return false if we don't know.
+ if ( autoptimizeUtils::str_ends_in( $filepath, '.js' ) ) {
+ $type = 'js';
+ } elseif ( autoptimizeUtils::str_ends_in( $filepath, '.css' ) ) {
+ $type = 'css';
+ } else {
+ return false;
+ }
+
+ // Bail if it looks like its already minifed (by having -min or .min in filename).
+ $minified_variants = array(
+ '-min.' . $type,
+ '.min.' . $type,
+ );
+ foreach ( $minified_variants as $ending ) {
+ if ( autoptimizeUtils::str_ends_in( $filepath, $ending ) && true === apply_filters( 'autoptimize_filter_base_prepare_exclude_minified', true ) ) {
+ return false;
+ }
+ }
+
+ // Get file contents, bail if empty.
+ $contents = file_get_contents( $filepath );
+
+ return $contents;
+ }
+
+ /**
+ * Given an autoptimizeCache instance returns the (maybe cdn-ed) url of
+ * the cached file.
+ *
+ * @param autoptimizeCache $cache autoptimizeCache instance.
+ *
+ * @return string
+ */
+ protected function build_minify_single_url( autoptimizeCache $cache )
+ {
+ $url = AUTOPTIMIZE_CACHE_URL . $cache->getname();
+
+ // CDN-replace the resulting URL if needed...
+ $url = $this->url_replace_cdn( $url );
+
+ return $url;
+ }
+}
diff --git a/wp-content/plugins/autoptimize/classes/autoptimizeCLI.php b/wp-content/plugins/autoptimize/classes/autoptimizeCLI.php
new file mode 100644
index 0000000..6d0adad
--- /dev/null
+++ b/wp-content/plugins/autoptimize/classes/autoptimizeCLI.php
@@ -0,0 +1,34 @@
+minifier = new Autoptimize\tubalmartin\CssMin\Minifier( $raise_limits );
+ }
+
+ /**
+ * Runs the minifier on given string of $css.
+ * Returns the minified css.
+ *
+ * @param string $css CSS to minify.
+ *
+ * @return string
+ */
+ public function run( $css )
+ {
+ // hide calc() if filter says yes (as YUI CSS compressor PHP port has problems retaining spaces around + and - operators).
+ // regex see tests at https://regex101.com/r/ofGQG9/1
+ if ( apply_filters( 'autoptimize_filter_css_hide_calc', true ) ) {
+ $css = autoptimizeBase::replace_contents_with_marker_if_exists( 'CALC', 'calc(', '#(calc|min|max|clamp)\([^;}]*\)#m', $css );
+ }
+
+ // minify.
+ $result = $this->minifier->run( $css );
+
+ // restore calc() if filter says yes.
+ if ( apply_filters( 'autoptimize_filter_css_hide_calc', true ) ) {
+ $result = autoptimizeBase::restore_marked_content( 'CALC', $result );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Static helper.
+ *
+ * @param string $css CSS to minify.
+ *
+ * @return string
+ */
+ public static function minify( $css )
+ {
+ $minifier = new self();
+
+ return $minifier->run( $css );
+ }
+}
diff --git a/wp-content/plugins/autoptimize/classes/autoptimizeCache.php b/wp-content/plugins/autoptimize/classes/autoptimizeCache.php
new file mode 100644
index 0000000..f47f1f6
--- /dev/null
+++ b/wp-content/plugins/autoptimize/classes/autoptimizeCache.php
@@ -0,0 +1,855 @@
+ we don't gzip, the web server does it.
+ * False => we do it ourselves.
+ *
+ * @var bool
+ */
+ private $nogzip;
+
+ /**
+ * Ctor.
+ *
+ * @param string $md5 Hash.
+ * @param string $ext Extension.
+ */
+ public function __construct( $md5, $ext = 'php' )
+ {
+ $_min_ext = '';
+ if ( apply_filters( 'autoptimize_filter_cache_url_add_min_ext', false ) ) {
+ $_min_ext = '.min';
+ }
+
+ $this->cachedir = AUTOPTIMIZE_CACHE_DIR;
+ $this->nogzip = AUTOPTIMIZE_CACHE_NOGZIP;
+ if ( ! $this->nogzip ) {
+ $this->filename = AUTOPTIMIZE_CACHEFILE_PREFIX . $md5 . $_min_ext . '.php';
+ } else {
+ if ( in_array( $ext, array( 'js', 'css' ) ) ) {
+ $this->filename = $ext . '/' . AUTOPTIMIZE_CACHEFILE_PREFIX . $md5 . $_min_ext . '.' . $ext;
+ } else {
+ $this->filename = AUTOPTIMIZE_CACHEFILE_PREFIX . $md5 . $_min_ext . '.' . $ext;
+ }
+ }
+ }
+
+ /**
+ * Returns true if the cached file exists on disk.
+ *
+ * @return bool
+ */
+ public function check()
+ {
+ return file_exists( $this->cachedir . $this->filename );
+ }
+
+ /**
+ * Returns cache contents if they exist, false otherwise.
+ *
+ * @return string|false
+ */
+ public function retrieve()
+ {
+ if ( $this->check() ) {
+ if ( false == $this->nogzip ) {
+ return file_get_contents( $this->cachedir . $this->filename . '.none' );
+ } else {
+ return file_get_contents( $this->cachedir . $this->filename );
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Stores given $data in cache.
+ *
+ * @param string $data Data to cache.
+ * @param string $mime Mimetype.
+ *
+ * @return void|bool
+ */
+ public function cache( $data, $mime )
+ {
+ // readonly FS explicitly OK'ed by developer, so just pretend all is OK.
+ if ( defined( 'AUTOPTIMIZE_CACHE_READONLY' ) ) {
+ return true;
+ }
+
+ // off by default; check if cachedirs exist every time before caching
+ //
+ // to be activated for users that experience these ugly errors;
+ // PHP Warning: file_put_contents failed to open stream: No such file or directory.
+ if ( apply_filters( 'autoptimize_filter_cache_checkdirs_on_write', false ) ) {
+ $this->check_and_create_dirs();
+ }
+
+ if ( false === $this->nogzip ) {
+ // We handle gzipping ourselves.
+ $file = 'default.php';
+ $phpcode = file_get_contents( AUTOPTIMIZE_PLUGIN_DIR . 'config/' . $file );
+ $phpcode = str_replace( array( '%%CONTENT%%', 'exit;' ), array( $mime, '' ), $phpcode );
+
+ file_put_contents( $this->cachedir . $this->filename, $phpcode );
+ file_put_contents( $this->cachedir . $this->filename . '.none', $data );
+ } else {
+ // Write code to cache without doing anything else.
+ file_put_contents( $this->cachedir . $this->filename, $data );
+
+ // save fallback .js or .css file if filter true (to be false by default) but not if snippet or single.
+ if ( self::do_fallback() && strpos( $this->filename, '_snippet_' ) === false && strpos( $this->filename, '_single_' ) === false ) {
+ $_extension = pathinfo( $this->filename, PATHINFO_EXTENSION );
+ $_fallback_file = AUTOPTIMIZE_CACHEFILE_PREFIX . 'fallback.' . $_extension;
+ if ( ( 'css' === $_extension || 'js' === $_extension ) && ! file_exists( $this->cachedir . $_extension . '/' . $_fallback_file ) ) {
+ file_put_contents( $this->cachedir . $_extension . '/' . $_fallback_file, $data );
+ }
+ }
+
+ if ( apply_filters( 'autoptimize_filter_cache_create_static_gzip', false ) ) {
+ // Create an additional cached gzip file.
+ file_put_contents( $this->cachedir . $this->filename . '.gz', gzencode( $data, 9, FORCE_GZIP ) );
+ // If PHP Brotli extension is installed, create an additional cached Brotli file.
+ if ( function_exists( 'brotli_compress' ) ) {
+ file_put_contents( $this->cachedir . $this->filename . '.br', brotli_compress( $data, 11, BROTLI_GENERIC ) );
+ }
+ }
+ }
+
+ // Provide 3rd party action hook for every cache file that is created.
+ // This hook can for example be used to inject a copy of the created cache file to a other domain.
+ do_action( 'autoptimize_action_cache_file_created', $this->cachedir . $this->filename );
+ }
+
+ /**
+ * Get cache filename.
+ *
+ * @return string
+ */
+ public function getname()
+ {
+ // NOTE: This could've maybe been a do_action() instead, however,
+ // that ship has sailed.
+ // The original idea here was to provide 3rd party code a hook so that
+ // it can "listen" to all the complete autoptimized-urls that the page
+ // will emit... Or something to that effect I think?
+ apply_filters( 'autoptimize_filter_cache_getname', AUTOPTIMIZE_CACHE_URL . $this->filename );
+
+ return $this->filename;
+ }
+
+ /**
+ * Returns true if given `$file` is considered a valid Autoptimize cache file,
+ * false otherwise.
+ *
+ * @param string $dir Directory name (with a trailing slash).
+ * @param string $file Filename.
+ * @return bool
+ */
+ protected static function is_valid_cache_file( $dir, $file )
+ {
+ if ( '.' !== $file && '..' !== $file &&
+ false !== strpos( $file, AUTOPTIMIZE_CACHEFILE_PREFIX ) &&
+ is_file( $dir . $file ) ) {
+
+ // It's a valid file!
+ return true;
+ }
+
+ // Everything else is considered invalid!
+ return false;
+ }
+
+ /**
+ * Clears contents of AUTOPTIMIZE_CACHE_DIR.
+ *
+ * @return void
+ */
+ protected static function clear_cache_classic()
+ {
+ $contents = self::get_cache_contents();
+ foreach ( $contents as $name => $files ) {
+ $dir = rtrim( AUTOPTIMIZE_CACHE_DIR . $name, '/' ) . '/';
+ foreach ( $files as $file ) {
+ if ( self::is_valid_cache_file( $dir, $file ) ) {
+ @unlink( $dir . $file ); // @codingStandardsIgnoreLine
+ }
+ }
+ }
+
+ @unlink( AUTOPTIMIZE_CACHE_DIR . '/.htaccess' ); // @codingStandardsIgnoreLine
+ }
+
+ /**
+ * Recursively deletes the specified pathname (file/directory) if possible.
+ * Returns true on success, false otherwise.
+ *
+ * @param string $pathname Pathname to remove.
+ *
+ * @return bool
+ */
+ protected static function rmdir( $pathname )
+ {
+ $files = self::get_dir_contents( $pathname );
+ foreach ( $files as $file ) {
+ $path = $pathname . '/' . $file;
+ if ( is_dir( $path ) ) {
+ self::rmdir( $path );
+ } else {
+ unlink( $path );
+ }
+ }
+
+ return rmdir( $pathname );
+ }
+
+ /**
+ * Clears contents of AUTOPTIMIZE_CACHE_DIR by renaming the current
+ * cache directory into a new one with a unique name and then
+ * re-creating the default (empty) cache directory.
+ *
+ * Important/ Fixme: this does not take multisite into account, so
+ * if advanced_cache_clear_enabled is true (it is not by default)
+ * then the content for all subsites is zapped!
+ *
+ * @return bool Returns true when everything is done successfully, false otherwise.
+ */
+ protected static function clear_cache_via_rename()
+ {
+ $ok = false;
+ $dir = self::get_pathname_base();
+ $new_name = self::get_unique_name();
+
+ // Makes sure the new pathname is on the same level...
+ $new_pathname = dirname( $dir ) . '/' . $new_name;
+ $renamed = @rename( $dir, $new_pathname ); // @codingStandardsIgnoreLine
+
+ // When renamed, re-create the default cache directory back so it's
+ // available again...
+ if ( $renamed ) {
+ $ok = self::cacheavail();
+ }
+
+ return $ok;
+ }
+
+ /**
+ * Returns true when advanced cache clearing is enabled.
+ *
+ * @return bool
+ */
+ public static function advanced_cache_clear_enabled()
+ {
+ return apply_filters( 'autoptimize_filter_cache_clear_advanced', false );
+ }
+
+ /**
+ * Returns a (hopefully) unique new cache folder name for renaming purposes.
+ *
+ * @return string
+ */
+ protected static function get_unique_name()
+ {
+ $prefix = self::get_advanced_cache_clear_prefix();
+ $new_name = uniqid( $prefix, true );
+
+ return $new_name;
+ }
+
+ /**
+ * Get cache prefix name used in advanced cache clearing mode.
+ *
+ * @return string
+ */
+ protected static function get_advanced_cache_clear_prefix()
+ {
+ $pathname = self::get_pathname_base();
+ $basename = basename( $pathname );
+ $prefix = $basename . '-artifact-';
+
+ return $prefix;
+ }
+
+ /**
+ * Returns an array of file and directory names found within
+ * the given $pathname without '.' and '..' elements.
+ *
+ * @param string $pathname Pathname.
+ *
+ * @return array
+ */
+ protected static function get_dir_contents( $pathname )
+ {
+ return array_slice( scandir( $pathname ), 2 );
+ }
+
+ /**
+ * Wipes directories which were created as part of the fast cache clearing
+ * routine (which renames the current cache directory into a new one with
+ * a custom-prefixed unique name).
+ *
+ * @return bool
+ */
+ public static function delete_advanced_cache_clear_artifacts()
+ {
+ // Don't go through these motions (called from the cachechecker) if advanced cache clear isn't even active.
+ if ( ! self::advanced_cache_clear_enabled() ) {
+ return false;
+ }
+
+ $dir = self::get_pathname_base();
+ $prefix = self::get_advanced_cache_clear_prefix();
+ $parent = dirname( $dir );
+ $ok = false;
+
+ // Returns the list of files without '.' and '..' elements.
+ $files = self::get_dir_contents( $parent );
+ if ( is_array( $files ) && ! empty( $files ) ) {
+ foreach ( $files as $file ) {
+ $path = $parent . '/' . $file;
+ $prefixed = ( false !== strpos( $path, $prefix ) );
+ // Removing only our own (prefixed) directories...
+ if ( is_dir( $path ) && $prefixed ) {
+ $ok = self::rmdir( $path );
+ }
+ }
+ }
+
+ return $ok;
+ }
+
+ /**
+ * Returns the cache directory pathname used.
+ * Done as a function so we canSlightly different
+ * if multisite is used and `autoptimize_separate_blog_caches` filter
+ * is used.
+ *
+ * @return string
+ */
+ public static function get_pathname()
+ {
+ $pathname = self::get_pathname_base();
+
+ if ( is_multisite() && apply_filters( 'autoptimize_separate_blog_caches', true ) ) {
+ $blog_id = get_current_blog_id();
+ $pathname .= $blog_id . '/';
+ }
+
+ return $pathname;
+ }
+
+ /**
+ * Returns the base path of our cache directory.
+ *
+ * @return string
+ */
+ protected static function get_pathname_base()
+ {
+ $pathname = WP_CONTENT_DIR . AUTOPTIMIZE_CACHE_CHILD_DIR;
+
+ return $pathname;
+ }
+
+ /**
+ * Deletes everything from the cache directories.
+ *
+ * @param bool $propagate Whether to trigger additional actions when cache is purged.
+ *
+ * @return bool
+ */
+ public static function clearall( $propagate = true )
+ {
+ if ( defined( 'ET_CORE_VERSION' ) && 'Divi' === get_template() ) {
+ // see https://blog.futtta.be/2018/11/17/warning-divi-purging-autoptimizes-cache/ .
+ $dbt = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 2 );
+ $caller = isset( $dbt[1]['function'] ) ? $dbt[1]['function'] : null;
+ if ( 'et_core_clear_wp_cache' === $caller ) {
+ if ( apply_filters( 'autoptimize_filter_cache_divi_wrong_complain', true ) ) {
+ _doing_it_wrong( 'autoptimizeCache::clearall', 'Divi devs: please don\'t clear Autoptimize\'s cache, it is unneeded and can break sites. You can contact me at futtta@gmail.com to discuss.', 'Autoptimize 2.9.6' );
+ }
+ return false;
+ }
+ }
+
+ if ( ! self::cacheavail() || true === apply_filters( 'autoptimize_filter_cache_clearall_disabled', false ) ) {
+ return false;
+ }
+
+ // TODO/FIXME: If cache is big, switch to advanced/new cache clearing automatically?
+ if ( self::advanced_cache_clear_enabled() ) {
+ self::clear_cache_via_rename();
+ } else {
+ self::clear_cache_classic();
+ }
+
+ // Remove 404 handler if required.
+ if ( self::do_fallback() ) {
+ $_fallback_php = trailingslashit( WP_CONTENT_DIR ) . 'autoptimize_404_handler.php';
+ @unlink( $_fallback_php ); // @codingStandardsIgnoreLine
+ }
+
+ // Remove the transient so it gets regenerated...
+ delete_transient( 'autoptimize_stats' );
+
+ // Cache was just purged, clear page cache and allow others to hook into our purging...
+ if ( true === $propagate ) {
+ if ( ! function_exists( 'autoptimize_do_cachepurged_action' ) ) {
+ function autoptimize_do_cachepurged_action() {
+ do_action( 'autoptimize_action_cachepurged' );
+ }
+ }
+ add_action( 'shutdown', 'autoptimize_do_cachepurged_action', 11 );
+ add_action( 'autoptimize_action_cachepurged', array( 'autoptimizeCache', 'flushPageCache' ), 10, 0 );
+ }
+
+ // Warm cache (part of speedupper)!
+ if ( apply_filters( 'autoptimize_filter_speedupper', true ) && false == get_transient( 'autoptimize_cache_warmer_protector' ) ) {
+ set_transient( 'autoptimize_cache_warmer_protector', 'I shall not warm cache for another 10 minutes.', 60 * 10 );
+ $url = site_url() . '/?ao_speedup_cachebuster=' . rand( 1, 100000 );
+ $url = apply_filters( 'autoptimize_filter_cache_warmer_url', $url );
+ $cache = @wp_remote_get( $url ); // @codingStandardsIgnoreLine
+ unset( $cache );
+ }
+
+ return true;
+ }
+
+ /**
+ * Wrapper for clearall but with false param
+ * to ensure the event is not propagated to others
+ * through our own hooks (to avoid infinite loops).
+ *
+ * @return bool
+ */
+ public static function clearall_actionless()
+ {
+ return self::clearall( false );
+ }
+
+ /**
+ * Returns the contents of our cache dirs.
+ *
+ * @return array
+ */
+ protected static function get_cache_contents()
+ {
+ $contents = array();
+
+ foreach ( array( '', 'js', 'css' ) as $dir ) {
+ $contents[ $dir ] = scandir( AUTOPTIMIZE_CACHE_DIR . $dir );
+ }
+
+ return $contents;
+ }
+
+ /**
+ * Returns stats about cached contents.
+ *
+ * @return array
+ */
+ public static function stats()
+ {
+ $stats = get_transient( 'autoptimize_stats' );
+
+ // If no transient, do the actual scan!
+ if ( ! is_array( $stats ) ) {
+ if ( ! self::cacheavail() ) {
+ return 0;
+ }
+ $stats = self::stats_scan();
+ $count = $stats[0];
+ if ( $count > 100 ) {
+ // Store results in transient.
+ set_transient(
+ 'autoptimize_stats',
+ $stats,
+ apply_filters( 'autoptimize_filter_cache_statsexpiry', HOUR_IN_SECONDS )
+ );
+ }
+ }
+
+ return $stats;
+ }
+
+ /**
+ * Performs a scan of cache directory contents and returns an array
+ * with 3 values: count, size, timestamp.
+ * count = total number of found files
+ * size = total filesize (in bytes) of found files
+ * timestamp = unix timestamp when the scan was last performed/finished.
+ *
+ * @return array
+ */
+ protected static function stats_scan()
+ {
+ $count = 0;
+ $size = 0;
+
+ // Scan everything in our cache directories.
+ foreach ( self::get_cache_contents() as $name => $files ) {
+ $dir = rtrim( AUTOPTIMIZE_CACHE_DIR . $name, '/' ) . '/';
+ foreach ( $files as $file ) {
+ if ( self::is_valid_cache_file( $dir, $file ) ) {
+ if ( AUTOPTIMIZE_CACHE_NOGZIP &&
+ (
+ false !== strpos( $file, '.js' ) ||
+ false !== strpos( $file, '.css' ) ||
+ false !== strpos( $file, '.img' ) ||
+ false !== strpos( $file, '.txt' )
+ )
+ ) {
+ // Web server is gzipping, we count .js|.css|.img|.txt files.
+ $count++;
+ } elseif ( ! AUTOPTIMIZE_CACHE_NOGZIP && false !== strpos( $file, '.none' ) ) {
+ // We are gzipping ourselves via php, counting only .none files.
+ $count++;
+ }
+ $size += filesize( $dir . $file );
+ }
+ }
+ }
+
+ $stats = array( $count, $size, time() );
+
+ return $stats;
+ }
+
+ /**
+ * Ensures the cache directory exists, is writeable and contains the
+ * required .htaccess files.
+ * Returns false in case it fails to ensure any of those things.
+ *
+ * @return bool
+ */
+ public static function cacheavail()
+ {
+ // readonly FS explicitly OK'ed by dev, let's assume the cache dirs are there!
+ if ( defined( 'AUTOPTIMIZE_CACHE_READONLY' ) ) {
+ return true;
+ }
+
+ if ( false === autoptimizeCache::check_and_create_dirs() ) {
+ return false;
+ }
+
+ // Using .htaccess inside our cache folder to overrule wp-super-cache.
+ $htaccess = AUTOPTIMIZE_CACHE_DIR . '/.htaccess';
+ if ( ! is_file( $htaccess ) ) {
+ /**
+ * Create `wp-content/AO_htaccess_tmpl` file with
+ * whatever htaccess rules you might need
+ * if you want to override default AO htaccess
+ */
+ $htaccess_tmpl = WP_CONTENT_DIR . '/AO_htaccess_tmpl';
+ if ( is_file( $htaccess_tmpl ) ) {
+ $content = file_get_contents( $htaccess_tmpl );
+ } elseif ( is_multisite() || ! AUTOPTIMIZE_CACHE_NOGZIP ) {
+ $content = '
+ ExpiresActive On
+ ExpiresByType text/css A30672000
+ ExpiresByType text/javascript A30672000
+ ExpiresByType application/javascript A30672000
+
+
+ Header append Cache-Control "public, immutable"
+
+
+
+ SetOutputFilter DEFLATE
+
+
+
+
+ Require all granted
+
+
+
+
+ Order allow,deny
+ Allow from all
+
+';
+ } else {
+ $content = '
+ ExpiresActive On
+ ExpiresByType text/css A30672000
+ ExpiresByType text/javascript A30672000
+ ExpiresByType application/javascript A30672000
+
+
+ Header append Cache-Control "public, immutable"
+
+
+
+ SetOutputFilter DEFLATE
+
+
+
+
+ Require all denied
+
+
+
+
+ Order deny,allow
+ Deny from all
+
+';
+ }
+
+ if ( self::do_fallback() === true ) {
+ $content .= "\nErrorDocument 404 " . trailingslashit( parse_url( content_url(), PHP_URL_PATH ) ) . 'autoptimize_404_handler.php';
+ }
+ @file_put_contents( $htaccess, $content ); // @codingStandardsIgnoreLine
+ }
+
+ if ( self::do_fallback() ) {
+ self::check_fallback_php();
+ }
+
+ // All OK!
+ return true;
+ }
+
+ /**
+ * Checks if fallback-php file exists and create it if not.
+ *
+ * Return bool
+ */
+ public static function check_fallback_php() {
+ $_fallback_filename = 'autoptimize_404_handler.php';
+ $_fallback_php = trailingslashit( WP_CONTENT_DIR ) . $_fallback_filename;
+ $_fallback_status = true;
+
+ if ( ! file_exists( $_fallback_php ) && is_writable( WP_CONTENT_DIR ) ) {
+ $_fallback_php_contents = file_get_contents( AUTOPTIMIZE_PLUGIN_DIR . 'config/' . $_fallback_filename );
+ $_fallback_php_contents = str_replace( '', AUTOPTIMIZE_CACHE_DIR, $_fallback_php_contents );
+ $_fallback_php_contents = str_replace( '', AUTOPTIMIZE_CACHEFILE_PREFIX, $_fallback_php_contents );
+ if ( is_multisite() ) {
+ $_fallback_php_contents = str_replace( '$multisite = false;', '$multisite = true;', $_fallback_php_contents );
+ }
+ if ( apply_filters( 'autoptimize_filter_cache_fallback_log_errors', false ) ) {
+ $_fallback_php_contents = str_replace( '// error_log', 'error_log', $_fallback_php_contents );
+ }
+ $_fallback_status = file_put_contents( $_fallback_php, $_fallback_php_contents );
+ }
+
+ return $_fallback_status;
+ }
+
+ /**
+ * Tells if AO should try to avoid 404's by creating fallback filesize
+ * and create a php 404 handler and tell .htaccess to redirect to said handler
+ * and hook into WordPress to redirect 404 to said handler as well. NGINX users
+ * are smart enough to get this working, no? ;-)
+ *
+ * Return bool
+ */
+ public static function do_fallback() {
+ static $_do_fallback = null;
+
+ if ( null === $_do_fallback ) {
+ $_do_fallback = (bool) apply_filters( 'autoptimize_filter_cache_do_fallback', autoptimizeOptionWrapper::get_option( 'autoptimize_cache_fallback', '1' ) );
+ }
+
+ return $_do_fallback;
+ }
+
+ /**
+ * Hooks into template_redirect, will act on 404-ing requests for
+ * Autoptimized files and redirects to the fallback CSS/ JS if available
+ * and 410'ing ("Gone") if fallback not available.
+ */
+ public static function wordpress_notfound_fallback() {
+ $original_request = strtok( $_SERVER['REQUEST_URI'], '?' );
+ if ( strpos( $original_request, wp_basename( WP_CONTENT_DIR ) . AUTOPTIMIZE_CACHE_CHILD_DIR ) !== false && is_404() ) {
+ // make sure this is not considered a 404.
+ global $wp_query;
+ $wp_query->is_404 = false;
+
+ // set fallback path.
+ $js_or_css = pathinfo( $original_request, PATHINFO_EXTENSION );
+ $fallback_path = AUTOPTIMIZE_CACHE_DIR . $js_or_css . '/autoptimize_fallback.' . $js_or_css;
+
+ // prepare for Shakeeb's Unused CSS files to be 404-handled as well.
+ if ( strpos( $original_request, 'uucss/uucss-' ) !== false ) {
+ $original_request = preg_replace( '/uucss\/uucss-[a-z0-9]{32}-/', 'css/', $original_request );
+ }
+
+ // set fallback URL.
+ $fallback_target = preg_replace( '/(.*)_(?:[a-z0-9]{32})\.(js|css)$/', '${1}_fallback.${2}', $original_request );
+
+ // redirect to fallback if possible.
+ if ( $original_request !== $fallback_target && file_exists( $fallback_path ) ) {
+ // redirect to fallback.
+ wp_redirect( $fallback_target, 302 );
+ } else {
+ // return HTTP 410 (gone) reponse.
+ status_header( 410 );
+ }
+ }
+ }
+
+ /**
+ * Checks if cache dirs exist and create if not.
+ * Returns false if not succesful.
+ *
+ * @return bool
+ */
+ public static function check_and_create_dirs() {
+ if ( ! defined( 'AUTOPTIMIZE_CACHE_DIR' ) ) {
+ // We didn't set a cache.
+ return false;
+ }
+
+ foreach ( array( '', 'js', 'css' ) as $dir ) {
+ if ( ! self::check_cache_dir( AUTOPTIMIZE_CACHE_DIR . $dir ) ) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Ensures the specified `$dir` exists and is writeable.
+ * Returns false if that's not the case.
+ *
+ * @param string $dir Directory to check/create.
+ *
+ * @return bool
+ */
+ protected static function check_cache_dir( $dir )
+ {
+ // Try creating the dir if it doesn't exist.
+ if ( ! file_exists( $dir ) ) {
+ @mkdir( $dir, 0775, true ); // @codingStandardsIgnoreLine
+ if ( ! file_exists( $dir ) ) {
+ return false;
+ }
+ }
+
+ // If we still cannot write, bail.
+ if ( ! is_writable( $dir ) ) {
+ return false;
+ }
+
+ // Create an index.html in there to avoid prying eyes!
+ $idx_file = rtrim( $dir, '/\\' ) . '/index.html';
+ if ( ! is_file( $idx_file ) ) {
+ @file_put_contents( $idx_file, '