Changeset 3327873
- Timestamp:
- 07/15/2025 03:06:30 AM (9 months ago)
- Location:
- easy-critical-css
- Files:
-
- 301 added
- 23 edited
-
tags/1.3.0 (added)
-
tags/1.3.0/LICENSE (added)
-
tags/1.3.0/assets (added)
-
tags/1.3.0/assets/admin.css (added)
-
tags/1.3.0/assets/admin.js (added)
-
tags/1.3.0/build (added)
-
tags/1.3.0/build/index.asset.php (added)
-
tags/1.3.0/build/index.js (added)
-
tags/1.3.0/composer.json (added)
-
tags/1.3.0/easy-critical-css.php (added)
-
tags/1.3.0/inc (added)
-
tags/1.3.0/inc/class-admin-settings.php (added)
-
tags/1.3.0/inc/class-api-request-handler.php (added)
-
tags/1.3.0/inc/class-api-service.php (added)
-
tags/1.3.0/inc/class-compatibility-cache.php (added)
-
tags/1.3.0/inc/class-compatibility-cloudflare.php (added)
-
tags/1.3.0/inc/class-compatibility-trellis.php (added)
-
tags/1.3.0/inc/class-compatibility-woocommerce.php (added)
-
tags/1.3.0/inc/class-compatibility-wp-rocket.php (added)
-
tags/1.3.0/inc/class-critical-css-injector.php (added)
-
tags/1.3.0/inc/class-critical-css-regenerate.php (added)
-
tags/1.3.0/inc/class-critical-css-server.php (added)
-
tags/1.3.0/inc/class-critical-css-status.php (added)
-
tags/1.3.0/inc/class-critical-css.php (added)
-
tags/1.3.0/inc/class-database.php (added)
-
tags/1.3.0/inc/class-debug.php (added)
-
tags/1.3.0/inc/class-delete-handler.php (added)
-
tags/1.3.0/inc/class-gutenberg.php (added)
-
tags/1.3.0/inc/class-helpers.php (added)
-
tags/1.3.0/inc/class-individual-settings.php (added)
-
tags/1.3.0/inc/class-plugin.php (added)
-
tags/1.3.0/inc/class-remove-handler.php (added)
-
tags/1.3.0/inc/class-reset-handler.php (added)
-
tags/1.3.0/inc/class-rest-api.php (added)
-
tags/1.3.0/inc/class-settings.php (added)
-
tags/1.3.0/inc/class-uninstall-handler.php (added)
-
tags/1.3.0/inc/load-freemius.php (added)
-
tags/1.3.0/package.json (added)
-
tags/1.3.0/phpunit.xml.dist (added)
-
tags/1.3.0/readme.txt (added)
-
tags/1.3.0/src (added)
-
tags/1.3.0/src/components (added)
-
tags/1.3.0/src/components/generateButton.tsx (added)
-
tags/1.3.0/src/components/settingsField.tsx (added)
-
tags/1.3.0/src/components/settingsPanel.tsx (added)
-
tags/1.3.0/src/components/statusIndicator.tsx (added)
-
tags/1.3.0/src/hooks (added)
-
tags/1.3.0/src/hooks/useEffectiveSettings.ts (added)
-
tags/1.3.0/src/hooks/usePostSaving.ts (added)
-
tags/1.3.0/src/hooks/useSettings.ts (added)
-
tags/1.3.0/src/hooks/useSettingsVisibility.ts (added)
-
tags/1.3.0/src/hooks/useStatus.ts (added)
-
tags/1.3.0/src/index.tsx (added)
-
tags/1.3.0/src/types (added)
-
tags/1.3.0/src/types/types.ts (added)
-
tags/1.3.0/src/types/wordpress.d.ts (added)
-
tags/1.3.0/vendor (added)
-
tags/1.3.0/vendor/autoload.php (added)
-
tags/1.3.0/vendor/composer (added)
-
tags/1.3.0/vendor/composer/ClassLoader.php (added)
-
tags/1.3.0/vendor/composer/InstalledVersions.php (added)
-
tags/1.3.0/vendor/composer/LICENSE (added)
-
tags/1.3.0/vendor/composer/autoload_classmap.php (added)
-
tags/1.3.0/vendor/composer/autoload_files.php (added)
-
tags/1.3.0/vendor/composer/autoload_namespaces.php (added)
-
tags/1.3.0/vendor/composer/autoload_psr4.php (added)
-
tags/1.3.0/vendor/composer/autoload_real.php (added)
-
tags/1.3.0/vendor/composer/autoload_static.php (added)
-
tags/1.3.0/vendor/composer/installed.json (added)
-
tags/1.3.0/vendor/composer/installed.php (added)
-
tags/1.3.0/vendor/composer/platform_check.php (added)
-
tags/1.3.0/vendor/freemius (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/LICENSE.txt (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/PATCHES.txt (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/css (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/css/admin (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/css/admin/account.css (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/css/admin/add-ons.css (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/css/admin/affiliation.css (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/css/admin/checkout.css (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/css/admin/clone-resolution.css (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/css/admin/common.css (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/css/admin/connect.css (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/css/admin/debug.css (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/css/admin/dialog-boxes.css (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/css/admin/gdpr-optin-notice.css (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/css/admin/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/css/admin/optout.css (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/css/admin/plugins.css (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/css/customizer.css (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/css/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/img (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/img/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/img/plugin-icon.png (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/img/theme-icon.png (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/jquery.form.js (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/nojquery.ba-postmessage.js (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/postmessage.js (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/pricing (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/pricing/14fb1bd5b7c41648488b06147f50a0dc.svg (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/pricing/178afa6030e76635dbe835e111d2c507.png (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/pricing/27b5a722a5553d9de0170325267fccec.png (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/pricing/4375c4a3ddc6f637c2ab9a2d7220f91e.png (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/pricing/4529cac82a2d1f300d3c4702b7b5e8f3.svg (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/pricing/5480ed23b199531a8cbc05924f26952b.png (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/pricing/b4f3b958f4a019862d81b15f3f8eee3a.svg (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/pricing/c03f665db27af43971565560adfba594.png (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/pricing/cb5fc4f6ec7ada72e986f6e7dde365bf.png (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/pricing/dd89563360f0272635c8f0ab7d7f1402.png (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/pricing/e366d70661d8ad2493bd6afbd779f125.png (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/pricing/f18006f6535a1a6e9c6bfbffafe6f18a.svg (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/pricing/f3aac72a8e63997d6bb888f816457e9b.png (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/pricing/f928f1be99776af83e8e6be4baf8ffe7.svg (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/pricing/fde48e4609a6ddc11d639fc2421f2afd.png (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/pricing/freemius-pricing.js (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/assets/js/pricing/freemius-pricing.js.LICENSE.txt (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/config.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/class-freemius-abstract.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/class-freemius.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/class-fs-admin-notices.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/class-fs-api.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/class-fs-garbage-collector.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/class-fs-lock.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/class-fs-logger.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/class-fs-options.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/class-fs-plugin-updater.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/class-fs-security.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/class-fs-storage.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/class-fs-user-lock.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/customizer (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/customizer/class-fs-customizer-support-section.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/customizer/class-fs-customizer-upsell-control.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/customizer/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/debug (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/debug/class-fs-debug-bar-panel.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/debug/debug-bar-start.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/debug/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/entities (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/entities/class-fs-affiliate-terms.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/entities/class-fs-affiliate.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/entities/class-fs-billing.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/entities/class-fs-entity.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/entities/class-fs-payment.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/entities/class-fs-plugin-info.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/entities/class-fs-plugin-license.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/entities/class-fs-plugin-plan.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/entities/class-fs-plugin-tag.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/entities/class-fs-plugin.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/entities/class-fs-pricing.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/entities/class-fs-scope-entity.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/entities/class-fs-site.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/entities/class-fs-subscription.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/entities/class-fs-user.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/entities/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/fs-core-functions.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/fs-essential-functions.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/fs-html-escaping-functions.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/fs-plugin-info-dialog.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/l10n.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/managers (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/managers/class-fs-admin-menu-manager.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/managers/class-fs-admin-notice-manager.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/managers/class-fs-cache-manager.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/managers/class-fs-checkout-manager.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/managers/class-fs-clone-manager.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/managers/class-fs-contact-form-manager.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/managers/class-fs-debug-manager.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/managers/class-fs-gdpr-manager.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/managers/class-fs-key-value-storage.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/managers/class-fs-license-manager.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/managers/class-fs-option-manager.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/managers/class-fs-permission-manager.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/managers/class-fs-plan-manager.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/managers/class-fs-plugin-manager.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/managers/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/sdk (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/sdk/Exceptions (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/sdk/Exceptions/ArgumentNotExistException.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/sdk/Exceptions/EmptyArgumentException.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/sdk/Exceptions/Exception.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/sdk/Exceptions/InvalidArgumentException.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/sdk/Exceptions/OAuthException.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/sdk/Exceptions/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/sdk/FreemiusBase.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/sdk/FreemiusWordPress.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/sdk/LICENSE.txt (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/sdk/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/supplements (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/supplements/fs-essential-functions-1.1.7.1.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/supplements/fs-essential-functions-2.2.1.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/supplements/fs-migration-2.5.1.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/includes/supplements/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/languages (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/languages/freemius-cs_CZ.mo (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/languages/freemius-da_DK.mo (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/languages/freemius-de_DE.mo (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/languages/freemius-es_ES.mo (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/languages/freemius-fr_FR.mo (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/languages/freemius-he_IL.mo (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/languages/freemius-hu_HU.mo (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/languages/freemius-it_IT.mo (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/languages/freemius-ja.mo (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/languages/freemius-nl_NL.mo (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/languages/freemius-ru_RU.mo (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/languages/freemius-ta.mo (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/languages/freemius-zh_CN.mo (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/languages/freemius.pot (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/languages/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/require.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/start.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/account (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/account.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/account/billing.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/account/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/account/partials (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/account/partials/activate-license-button.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/account/partials/addon.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/account/partials/deactivate-license-button.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/account/partials/disconnect-button.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/account/partials/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/account/partials/site.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/account/payments.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/add-ons.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/add-trial-to-pricing.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/admin-notice.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/ajax-loader.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/api-connectivity-message-js.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/auto-installation.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/checkout (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/checkout.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/checkout/frame.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/checkout/process-redirect.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/checkout/redirect.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/clone-resolution-js.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/connect (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/connect.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/connect/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/connect/permission.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/connect/permissions-group.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/contact.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/debug (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/debug.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/debug/api-calls.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/debug/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/debug/logger.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/debug/plugins-themes-sync.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/debug/scheduled-crons.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/email.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/forms (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/forms/affiliation.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/forms/data-debug-mode.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/forms/deactivation (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/forms/deactivation/contact.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/forms/deactivation/form.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/forms/deactivation/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/forms/deactivation/retry-skip.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/forms/email-address-update.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/forms/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/forms/license-activation.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/forms/optout.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/forms/premium-versions-upgrade-handler.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/forms/premium-versions-upgrade-metadata.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/forms/resend-key.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/forms/subscription-cancellation.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/forms/trial-start.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/forms/user-change.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/gdpr-optin-js.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/js (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/js/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/js/jquery.content-change.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/js/open-license-activation.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/js/permissions.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/js/style-premium-theme.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/partials (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/partials/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/partials/network-activation.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/plugin-icon.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/plugin-info (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/plugin-info/description.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/plugin-info/features.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/plugin-info/index.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/plugin-info/screenshots.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/pricing.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/secure-https-header.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/sticky-admin-notice-js.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/tabs-capture-js.php (added)
-
tags/1.3.0/vendor/freemius/wordpress-sdk/templates/tabs.php (added)
-
trunk/assets/admin.css (modified) (1 diff)
-
trunk/assets/admin.js (modified) (6 diffs)
-
trunk/build/index.asset.php (modified) (1 diff)
-
trunk/build/index.js (modified) (1 diff)
-
trunk/easy-critical-css.php (modified) (1 diff)
-
trunk/inc/class-admin-settings.php (modified) (4 diffs)
-
trunk/inc/class-compatibility-cache.php (modified) (3 diffs)
-
trunk/inc/class-compatibility-cloudflare.php (added)
-
trunk/inc/class-compatibility-woocommerce.php (added)
-
trunk/inc/class-critical-css-injector.php (modified) (1 diff)
-
trunk/inc/class-critical-css-status.php (modified) (6 diffs)
-
trunk/inc/class-critical-css.php (modified) (2 diffs)
-
trunk/inc/class-database.php (modified) (1 diff)
-
trunk/inc/class-delete-handler.php (added)
-
trunk/inc/class-helpers.php (modified) (3 diffs)
-
trunk/inc/class-plugin.php (modified) (2 diffs)
-
trunk/inc/class-remove-handler.php (added)
-
trunk/inc/class-reset-handler.php (modified) (1 diff)
-
trunk/inc/class-rest-api.php (modified) (7 diffs)
-
trunk/inc/class-settings.php (modified) (7 diffs)
-
trunk/inc/class-uninstall-handler.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/src/components/statusIndicator.tsx (modified) (2 diffs)
-
trunk/src/types/types.ts (modified) (1 diff)
-
trunk/vendor/composer/autoload_classmap.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-critical-css/trunk/assets/admin.css
r3284313 r3327873 36 36 } 37 37 38 .excluded, 38 39 .paused, 39 40 .unprocessed { -
easy-critical-css/trunk/assets/admin.js
r3284313 r3327873 17 17 18 18 setupConfirmation('ecc-reset', 'ecc-reset-form') 19 setupConfirmation('ecc-delete', 'ecc-uninstall-form') 19 setupConfirmation('ecc-delete', 'ecc-delete-form') 20 setupConfirmation('ecc-uninstall', 'ecc-uninstall-form') 21 22 function toggleDeleteSection() { 23 const mode = document.querySelector('input[name="easy_cc_critical_css_mode"]:checked')?.value 24 const section = document.getElementById('ecc-delete-section') 25 if (!section) return 26 27 // Only show when mode is auto 28 section.style.display = (mode === 'auto') ? '' : 'none' 29 } 20 30 21 31 function toggleSettingVisibility(settingId, behavior = false) { … … 41 51 toggleSettingVisibility('forced-critical-selectors-container') 42 52 toggleSettingVisibility('forced-secondary-selectors-container', true) 53 toggleSettingVisibility('add-common-secondary-container', true) 43 54 toggleSettingVisibility('exclude-css-files-container') 44 55 toggleSettingVisibility('ignore-cross-domain-css-container') … … 46 57 toggleSettingVisibility('regenerate-triggers-container') 47 58 toggleSettingVisibility('expired-css-behavior-container') 59 toggleDeleteSection() 48 60 }) 49 61 }) … … 52 64 el.addEventListener('change', () => { 53 65 toggleSettingVisibility('forced-secondary-selectors-container', true) 66 toggleSettingVisibility('add-common-secondary-container', true) 54 67 }) 55 68 }) … … 61 74 toggleSettingVisibility('forced-critical-selectors-container') 62 75 toggleSettingVisibility('forced-secondary-selectors-container', true) 76 toggleSettingVisibility('add-common-secondary-container', true) 63 77 toggleSettingVisibility('exclude-css-files-container') 64 78 toggleSettingVisibility('ignore-cross-domain-css-container') … … 66 80 toggleSettingVisibility('regenerate-triggers-container') 67 81 toggleSettingVisibility('expired-css-behavior-container') 82 toggleDeleteSection() 68 83 }) -
easy-critical-css/trunk/build/index.asset.php
r3284313 r3327873 1 <?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => ' b7abfc10869f68877d2a');1 <?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '8b825f7979662931e8de'); -
easy-critical-css/trunk/build/index.js
r3284313 r3327873 1 (()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var i in s)e.o(s,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:s[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};window.React;const t=window.wp.plugins,s=window.wp.editor,i=window.wp.data,a=window.wp.components, n=window.wp.i18n,c=window.ReactJSXRuntime,r={completed:(0,n.__)("Completed","easy-critical-css"),expired:(0,n.__)("Expired","easy-critical-css"),failed:(0,n.__)("Failed","easy-critical-css"),invalid:(0,n.__)("Invalid API","easy-critical-css"),paused:(0,n.__)("Paused","easy-critical-css"),unavailable:(0,n.__)("Unavailable","easy-critical-css"),unprocessed:(0,n.__)("Unprocessed","easy-critical-css"),unreachable:(0,n.__)("Unreachable","easy-critical-css"),pending:(0,n.__)("Pending","easy-critical-css"),error:(0,n.__)("Error","easy-critical-css")},o={completed:"#1e7e34",expired:"#995a00",failed:"#b12331",invalid:"#b12331",paused:"#6c757d",unavailable:"#6c757d",unprocessed:"#6c757d",unreachable:"#b12331",pending:"#007cba",error:"#000"},l=({status:e,loading:t,fetchStatus:s})=>(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,c.jsx)("span",{children:(0,n.__)("Status:","easy-critical-css")}),(0,c.jsx)("span",{style:{display:"inline-block",padding:"3px 8px",borderRadius:"12px",background:o[e||"error"],color:"#fff",fontWeight:"500"},children:r[e||"error"]})]}),(0,c.jsx)(a.Button,{onClick:s,variant:"secondary","aria-label":(0,n.__)("Refresh Status","easy-critical-css"),children:t?(0,c.jsx)(a.Spinner,{}):(0,n.__)("Refresh","easy-critical-css")})]}),d=window.wp.element,p=window.wp.apiFetch;var u=e.n(p);const g=({postId:e,fetchStatus:t,status:s,activate_critical_css:i})=>{const[r,o]=(0,d.useState)(!1),[l,p]=(0,d.useState)(null),[g,h]=(0,d.useState)(null);return"paused"!==s&&i?(0,c.jsxs)("div",{style:{marginTop:"10px"},children:[g&&(0,c.jsx)("div",{style:{marginBottom:"10px"},children:(0,c.jsx)(a.Notice,{status:"error",isDismissible:!0,onRemove:()=>h(null),children:g})}),l&&(0,c.jsx)("div",{style:{marginBottom:"10px"},children:(0,c.jsx)(a.Notice,{status:"success",isDismissible:!0,onRemove:()=>p(null),children:l})}),(0,c.jsx)(a.Button,{onClick:async()=>{o(!0),h(null),p(null);try{const s=await u()({path:"/easy-critical-css/v1/generate",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identifier:e})});if(!s||s.code)throw new Error(s.message||(0,n.__)("An error occurred.","easy-critical-css"));p((0,n.__)("Critical CSS generation started successfully.","easy-critical-css")),t()}catch(e){console.error(e),h(e&&"object"==typeof e&&"message"in e?e.message:(0,n.__)("An unknown error occurred.","easy-critical-css"))}o(!1)},variant:"primary",style:{width:"100%",justifyContent:"center"},children:r?(0,c.jsx)(a.Spinner,{}):"completed"===s||"expired"===s?(0,n.__)("Re-Generate Critical CSS","easy-critical-css"):(0,n.__)("Generate Critical CSS","easy-critical-css")})]}):null},h=({keyName:e,setting:t,settings:s,effectiveMode:i,effectiveSecondaryBehavior:n,handleSettingsChange:r})=>{var o;const l=void 0!==s[e]?s[e]:t.default,d="boolean"==typeof i?String(i):i,p="checkbox"!==t.type,u="object"==typeof t.label?t.label[d]||t.label.auto:t.label,g="object"==typeof t.desc?t.desc[d]||t.desc.auto:t.desc,h={marginRight:"10px",maxWidth:"245px",whiteSpace:"normal",wordWrap:"break-word",textAlign:"left"};return(0,c.jsxs)("div",{children:[p&&(0,c.jsxs)("label",{htmlFor:e,style:{display:"flex",alignItems:"center",fontWeight:"500",marginBottom:"5px"},children:[u,g&&(0,c.jsx)(a.Tooltip,{text:g,style:h,children:(0,c.jsx)("span",{style:{marginLeft:"5px",cursor:"help",color:"#999"},children:(0,c.jsx)(a.Icon,{icon:"editor-help"})})})]}),"checkbox"===t.type&&(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,c.jsx)(a.CheckboxControl,{label:u,checked:!!l,onChange:t=>r(e,t)},e),g&&(0,c.jsx)(a.Tooltip,{text:g,style:h,children:(0,c.jsx)("span",{style:{marginBottom:"8px",marginLeft:"5px",cursor:"help",color:"#999"},children:(0,c.jsx)(a.Icon,{icon:"editor-help"})})})]}),"select"===t.type&&(0,c.jsx)("select",{id:e,value:String(l),onChange:t=>r(e,t.target.value),style:{width:"100%",padding:"5px"},children:Object.entries(null!==(o=t.options)&&void 0!==o?o:{}).map((([e,t])=>(0,c.jsx)("option",{value:e,children:t},e)))}),"textarea"===t.type&&(0,c.jsx)("textarea",{id:e,value:"string"==typeof l?l:"",onChange:t=>r(e,t.target.value),rows:5,style:{width:"100%",padding:"5px"}}),"text"===t.type&&(0,c.jsx)("input",{id:e,type:"text",value:"string"==typeof l?l:"",onChange:t=>r(e,t.target.value),style:{width:"100%",padding:"5px"}})]},e)},y=({settingsSchema:e,settings:t,effectiveMode:s,effectiveSecondaryBehavior:i,settingsVisible:r,setSettingsVisible:o,handleSettingsChange:l})=>{const d=Object.entries(e).filter((([e,a])=>((e,t,s,i,a)=>{if(!t.visible)return!0;for(const[e,n]of Object.entries(t.visible)){const t=s[e];if("critical_css_mode"===e&&("default"===t?i!==n:t!==n)||"secondary_css_behavior"===e&&("default"===t?a!==n:t!==n)||"critical_css_mode"!==e&&"secondary_css_behavior"!==e&&t!==n)return!1}return!0})(0,a,t,s,i)));return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(a.Button,{type:"button","aria-expanded":r,className:"components-button components-panel__body-toggle",style:{padding:"10px",background:"#f8f8f8",cursor:"pointer",userSelect:"none",marginTop:"15px"},onClick:()=>o(!r),children:[(0,n.__)("Settings","easy-critical-css"),(0,c.jsx)("span",{"aria-hidden":"true",children:(0,c.jsx)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",className:"components-panel__arrow","aria-hidden":"true",focusable:"false",children:r?(0,c.jsx)("path",{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}):(0,c.jsx)("path",{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})})})]}),r&&(0,c.jsx)("div",{style:{marginTop:"10px"},children:d.map((([e,a],n,r)=>{const o=n===r.length-1;return(0,c.jsx)("div",{style:{marginBottom:o?"0px":"15px"},children:(0,c.jsx)(h,{keyName:e,setting:a,settings:t,effectiveMode:s,effectiveSecondaryBehavior:i,handleSettingsChange:l})},e)}))})]})},{settingsSchema:f,settings:x,mode:v,secondaryBehavior:_}=eccSettings;(0,t.registerPlugin)("critical-css-sidebar",{render:()=>{const e=(0,i.useSelect)((e=>e("core/editor").getCurrentPostId()),[]),{settings:t,updateSetting:a}=((e,t,s)=>{const[a,n]=(0,d.useState)((()=>({...Object.fromEntries(Object.entries(e).map((([e,t])=>[e,t.default]))),...t}))),{editPost:c}=(0,i.useDispatch)("core/editor");return(0,d.useEffect)((()=>{s&&(async()=>{try{const e=await u()({path:`/easy-critical-css/v1/get-settings/${s}`});n((t=>({...t,...e})))}catch(e){console.error("Error fetching Easy Critical CSS settings:",e)}})()}),[s]),{settings:a,updateSetting:(e,t)=>{n((s=>({...s,[e]:t}))),u()({path:`/easy-critical-css/v1/update-settings/${s}`,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:t})}).catch((t=>console.error(`Error updating ${e}:`,t))),c({meta:{[e]:t}})}}})(f,x,e),{status:n,loading:r,fetchStatus:o}=((e,t)=>{const[s,i]=(0,d.useState)(null),[a,n]=(0,d.useState)(!1),c=async()=>{if(e){n(!0),console.log("Fetching Critical CSS for Post ID:",e);try{const s=await u()({path:`/easy-critical-css/v1/status/${e}`});i(t?s.status:"paused")}catch(e){const t=e;"invalid_post_id"===t?.code?i("unavailable"):(console.error("Error fetching Critical CSS status:",e),i("error"))}n(!1)}};return(0,d.useEffect)((()=>{c()}),[e,t]),{status:s,loading:a,fetchStatus:c}})(e,t.activate_critical_css);((e,t)=>{const s=(0,i.useSelect)((e=>({isSaving:e("core/editor").isSavingPost()})),[]);(0,d.useEffect)((()=>{s&&(console.log("Saving settings on post save:",t),u()({path:`/easy-critical-css/v1/update-settings/${e}`,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((()=>console.log("Easy Critical CSS Settings saved with post update"))).catch((e=>console.error("Error saving settings with post update:",e))))}),[s])})(e,t);const{effectiveMode:p,effectiveSecondaryBehavior:h}=((e,t,s)=>({effectiveMode:e.critical_css_mode&&"default"!==e.critical_css_mode?e.critical_css_mode:t,effectiveSecondaryBehavior:e.secondary_css_behavior&&"default"!==e.secondary_css_behavior?e.secondary_css_behavior:s}))(t,v,_),{settingsVisible:S,setSettingsVisible:m}=(e=>{const[t,s]=(0,d.useState)(!1);return(0,d.useEffect)((()=>{s("manual"===e)}),[]),{settingsVisible:t,setSettingsVisible:s}})(p);return(0,c.jsxs)(s.PluginDocumentSettingPanel,{name:"easy-critical-css-sidebar",title:"Easy Critical CSS",className:"easy-critical-css-panel",children:["manual"!==p&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(l,{status:n,loading:r,fetchStatus:o}),(0,c.jsx)(g,{postId:e,fetchStatus:o,status:n,activate_critical_css:t.activate_critical_css})]}),(0,c.jsx)(y,{settingsSchema:f,settings:t,effectiveMode:p,effectiveSecondaryBehavior:h,settingsVisible:S,setSettingsVisible:m,handleSettingsChange:a})]})}})})();1 (()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var i in s)e.o(s,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:s[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};window.React;const t=window.wp.plugins,s=window.wp.editor,i=window.wp.data,a=window.wp.components,c=window.wp.i18n,n=window.ReactJSXRuntime,r={completed:(0,c.__)("Completed","easy-critical-css"),expired:(0,c.__)("Expired","easy-critical-css"),excluded:(0,c.__)("Excluded","easy-critical-css"),failed:(0,c.__)("Failed","easy-critical-css"),invalid:(0,c.__)("Invalid API","easy-critical-css"),paused:(0,c.__)("Paused","easy-critical-css"),unavailable:(0,c.__)("Unavailable","easy-critical-css"),unprocessed:(0,c.__)("Unprocessed","easy-critical-css"),unreachable:(0,c.__)("Unreachable","easy-critical-css"),pending:(0,c.__)("Pending","easy-critical-css"),error:(0,c.__)("Error","easy-critical-css")},o={completed:"#1e7e34",expired:"#995a00",excluded:"#6c757d",failed:"#b12331",invalid:"#b12331",paused:"#6c757d",unavailable:"#6c757d",unprocessed:"#6c757d",unreachable:"#b12331",pending:"#007cba",error:"#000"},l=({status:e,loading:t,fetchStatus:s})=>(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,n.jsx)("span",{children:(0,c.__)("Status:","easy-critical-css")}),(0,n.jsx)("span",{style:{display:"inline-block",padding:"3px 8px",borderRadius:"12px",background:o[e||"error"],color:"#fff",fontWeight:"500"},children:r[e||"error"]})]}),(0,n.jsx)(a.Button,{onClick:s,variant:"secondary","aria-label":(0,c.__)("Refresh Status","easy-critical-css"),children:t?(0,n.jsx)(a.Spinner,{}):(0,c.__)("Refresh","easy-critical-css")})]}),d=window.wp.element,p=window.wp.apiFetch;var u=e.n(p);const g=({postId:e,fetchStatus:t,status:s,activate_critical_css:i})=>{const[r,o]=(0,d.useState)(!1),[l,p]=(0,d.useState)(null),[g,h]=(0,d.useState)(null);return"paused"!==s&&i?(0,n.jsxs)("div",{style:{marginTop:"10px"},children:[g&&(0,n.jsx)("div",{style:{marginBottom:"10px"},children:(0,n.jsx)(a.Notice,{status:"error",isDismissible:!0,onRemove:()=>h(null),children:g})}),l&&(0,n.jsx)("div",{style:{marginBottom:"10px"},children:(0,n.jsx)(a.Notice,{status:"success",isDismissible:!0,onRemove:()=>p(null),children:l})}),(0,n.jsx)(a.Button,{onClick:async()=>{o(!0),h(null),p(null);try{const s=await u()({path:"/easy-critical-css/v1/generate",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identifier:e})});if(!s||s.code)throw new Error(s.message||(0,c.__)("An error occurred.","easy-critical-css"));p((0,c.__)("Critical CSS generation started successfully.","easy-critical-css")),t()}catch(e){console.error(e),h(e&&"object"==typeof e&&"message"in e?e.message:(0,c.__)("An unknown error occurred.","easy-critical-css"))}o(!1)},variant:"primary",style:{width:"100%",justifyContent:"center"},children:r?(0,n.jsx)(a.Spinner,{}):"completed"===s||"expired"===s?(0,c.__)("Re-Generate Critical CSS","easy-critical-css"):(0,c.__)("Generate Critical CSS","easy-critical-css")})]}):null},h=({keyName:e,setting:t,settings:s,effectiveMode:i,effectiveSecondaryBehavior:c,handleSettingsChange:r})=>{var o;const l=void 0!==s[e]?s[e]:t.default,d="boolean"==typeof i?String(i):i,p="checkbox"!==t.type,u="object"==typeof t.label?t.label[d]||t.label.auto:t.label,g="object"==typeof t.desc?t.desc[d]||t.desc.auto:t.desc,h={marginRight:"10px",maxWidth:"245px",whiteSpace:"normal",wordWrap:"break-word",textAlign:"left"};return(0,n.jsxs)("div",{children:[p&&(0,n.jsxs)("label",{htmlFor:e,style:{display:"flex",alignItems:"center",fontWeight:"500",marginBottom:"5px"},children:[u,g&&(0,n.jsx)(a.Tooltip,{text:g,style:h,children:(0,n.jsx)("span",{style:{marginLeft:"5px",cursor:"help",color:"#999"},children:(0,n.jsx)(a.Icon,{icon:"editor-help"})})})]}),"checkbox"===t.type&&(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,n.jsx)(a.CheckboxControl,{label:u,checked:!!l,onChange:t=>r(e,t)},e),g&&(0,n.jsx)(a.Tooltip,{text:g,style:h,children:(0,n.jsx)("span",{style:{marginBottom:"8px",marginLeft:"5px",cursor:"help",color:"#999"},children:(0,n.jsx)(a.Icon,{icon:"editor-help"})})})]}),"select"===t.type&&(0,n.jsx)("select",{id:e,value:String(l),onChange:t=>r(e,t.target.value),style:{width:"100%",padding:"5px"},children:Object.entries(null!==(o=t.options)&&void 0!==o?o:{}).map((([e,t])=>(0,n.jsx)("option",{value:e,children:t},e)))}),"textarea"===t.type&&(0,n.jsx)("textarea",{id:e,value:"string"==typeof l?l:"",onChange:t=>r(e,t.target.value),rows:5,style:{width:"100%",padding:"5px"}}),"text"===t.type&&(0,n.jsx)("input",{id:e,type:"text",value:"string"==typeof l?l:"",onChange:t=>r(e,t.target.value),style:{width:"100%",padding:"5px"}})]},e)},y=({settingsSchema:e,settings:t,effectiveMode:s,effectiveSecondaryBehavior:i,settingsVisible:r,setSettingsVisible:o,handleSettingsChange:l})=>{const d=Object.entries(e).filter((([e,a])=>((e,t,s,i,a)=>{if(!t.visible)return!0;for(const[e,c]of Object.entries(t.visible)){const t=s[e];if("critical_css_mode"===e&&("default"===t?i!==c:t!==c)||"secondary_css_behavior"===e&&("default"===t?a!==c:t!==c)||"critical_css_mode"!==e&&"secondary_css_behavior"!==e&&t!==c)return!1}return!0})(0,a,t,s,i)));return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a.Button,{type:"button","aria-expanded":r,className:"components-button components-panel__body-toggle",style:{padding:"10px",background:"#f8f8f8",cursor:"pointer",userSelect:"none",marginTop:"15px"},onClick:()=>o(!r),children:[(0,c.__)("Settings","easy-critical-css"),(0,n.jsx)("span",{"aria-hidden":"true",children:(0,n.jsx)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",className:"components-panel__arrow","aria-hidden":"true",focusable:"false",children:r?(0,n.jsx)("path",{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}):(0,n.jsx)("path",{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})})})]}),r&&(0,n.jsx)("div",{style:{marginTop:"10px"},children:d.map((([e,a],c,r)=>{const o=c===r.length-1;return(0,n.jsx)("div",{style:{marginBottom:o?"0px":"15px"},children:(0,n.jsx)(h,{keyName:e,setting:a,settings:t,effectiveMode:s,effectiveSecondaryBehavior:i,handleSettingsChange:l})},e)}))})]})},{settingsSchema:f,settings:x,mode:v,secondaryBehavior:_}=eccSettings;(0,t.registerPlugin)("critical-css-sidebar",{render:()=>{const e=(0,i.useSelect)((e=>e("core/editor").getCurrentPostId()),[]),{settings:t,updateSetting:a}=((e,t,s)=>{const[a,c]=(0,d.useState)((()=>({...Object.fromEntries(Object.entries(e).map((([e,t])=>[e,t.default]))),...t}))),{editPost:n}=(0,i.useDispatch)("core/editor");return(0,d.useEffect)((()=>{s&&(async()=>{try{const e=await u()({path:`/easy-critical-css/v1/get-settings/${s}`});c((t=>({...t,...e})))}catch(e){console.error("Error fetching Easy Critical CSS settings:",e)}})()}),[s]),{settings:a,updateSetting:(e,t)=>{c((s=>({...s,[e]:t}))),u()({path:`/easy-critical-css/v1/update-settings/${s}`,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:t})}).catch((t=>console.error(`Error updating ${e}:`,t))),n({meta:{[e]:t}})}}})(f,x,e),{status:c,loading:r,fetchStatus:o}=((e,t)=>{const[s,i]=(0,d.useState)(null),[a,c]=(0,d.useState)(!1),n=async()=>{if(e){c(!0),console.log("Fetching Critical CSS for Post ID:",e);try{const s=await u()({path:`/easy-critical-css/v1/status/${e}`});i(t?s.status:"paused")}catch(e){const t=e;"invalid_post_id"===t?.code?i("unavailable"):(console.error("Error fetching Critical CSS status:",e),i("error"))}c(!1)}};return(0,d.useEffect)((()=>{n()}),[e,t]),{status:s,loading:a,fetchStatus:n}})(e,t.activate_critical_css);((e,t)=>{const s=(0,i.useSelect)((e=>({isSaving:e("core/editor").isSavingPost()})),[]);(0,d.useEffect)((()=>{s&&(console.log("Saving settings on post save:",t),u()({path:`/easy-critical-css/v1/update-settings/${e}`,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((()=>console.log("Easy Critical CSS Settings saved with post update"))).catch((e=>console.error("Error saving settings with post update:",e))))}),[s])})(e,t);const{effectiveMode:p,effectiveSecondaryBehavior:h}=((e,t,s)=>({effectiveMode:e.critical_css_mode&&"default"!==e.critical_css_mode?e.critical_css_mode:t,effectiveSecondaryBehavior:e.secondary_css_behavior&&"default"!==e.secondary_css_behavior?e.secondary_css_behavior:s}))(t,v,_),{settingsVisible:S,setSettingsVisible:m}=(e=>{const[t,s]=(0,d.useState)(!1);return(0,d.useEffect)((()=>{s("manual"===e)}),[]),{settingsVisible:t,setSettingsVisible:s}})(p);return(0,n.jsxs)(s.PluginDocumentSettingPanel,{name:"easy-critical-css-sidebar",title:"Easy Critical CSS",className:"easy-critical-css-panel",children:["manual"!==p&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l,{status:c,loading:r,fetchStatus:o}),(0,n.jsx)(g,{postId:e,fetchStatus:o,status:c,activate_critical_css:t.activate_critical_css})]}),(0,n.jsx)(y,{settingsSchema:f,settings:t,effectiveMode:p,effectiveSecondaryBehavior:h,settingsVisible:S,setSettingsVisible:m,handleSettingsChange:a})]})}})})(); -
easy-critical-css/trunk/easy-critical-css.php
r3319025 r3327873 3 3 * Plugin Name: Easy Critical CSS 4 4 * Description: Easily inject Critical CSS and optimized Secondary CSS to improve page speed and performance. 5 * Version: 1. 2.15 * Version: 1.3.0 6 6 * Requires at least: 6.2 7 7 * Tested up to: 6.8.1 -
easy-critical-css/trunk/inc/class-admin-settings.php
r3317868 r3327873 30 30 <div class="wrap"> 31 31 <h1><?php esc_html_e( 'Easy Critical CSS Settings', 'easy-critical-css' ); ?></h1> 32 33 <?php 34 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No need for nonce verification as we are using this for read-only purposes. 35 if ( isset( $_GET['settings-reset'] ) && 'true' === $_GET['settings-reset'] ) { 36 echo '<div class="notice notice-success"><p>' 37 . esc_html__( 'All Easy Critical CSS settings have been reset.', 'easy-critical-css' ) 38 . '</p></div>'; 39 } 40 41 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No need for nonce verification as we are using this for read-only purposes. 42 if ( isset( $_GET['styles-deleted'] ) && 'true' === $_GET['styles-deleted'] ) { 43 echo '<div class="notice notice-success"><p>' 44 . esc_html__( 'All Critical and Secondary CSS styles have been deleted.', 'easy-critical-css' ) 45 . '</p></div>'; 46 } 47 ?> 32 48 33 49 <form method="post" action="options.php"> … … 55 71 </form> 56 72 73 <div id="ecc-delete-section"> 74 <hr> 75 <h2><?php esc_html_e( 'Delete Current Critical CSS', 'easy-critical-css' ); ?></h2> 76 <p><?php esc_html_e( 'Click the button below to delete all associated Critical and Secondary CSS. This action will not clear any settings, but cannot be undone.', 'easy-critical-css' ); ?></p> 77 <form id="ecc-delete-form" method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" 78 data-confirm="<?php esc_attr_e( 'Are you sure you want to delete all stored Easy Critical CSS styles? This action CANNOT be undone.', 'easy-critical-css' ); ?>"> 79 <input type="hidden" name="action" value="easy_cc_delete"> 80 <?php wp_nonce_field( 'easy_cc_delete', 'easy_cc_nonce' ); ?> 81 <p class="submit"> 82 <button id="ecc-delete" type="submit" class="button button-danger"> 83 <?php esc_html_e( 'Delete All Critical & Secondary CSS Styles', 'easy-critical-css' ); ?> 84 </button> 85 </p> 86 </form> 87 </div> 88 89 57 90 <hr> 58 91 <h2><?php esc_html_e( 'Uninstall Plugin & Delete All Data', 'easy-critical-css' ); ?></h2> … … 64 97 <?php wp_nonce_field( 'easy_cc_uninstall', 'easy_cc_nonce' ); ?> 65 98 <p class="submit"> 66 <button id="ecc- delete" class="button button-danger">99 <button id="ecc-uninstall" class="button button-danger"> 67 100 <?php esc_html_e( 'Delete All Data & Uninstall', 'easy-critical-css' ); ?> 68 101 </button> … … 257 290 'desc' => __( 'Specify CSS selectors that should always be included in stripped Secondary CSS, even if they are normally stripped.', 'easy-critical-css' ) . $forced_selectors_desc, 258 291 ], 292 'add_common_secondary' => [ 293 'label' => __( 'Include Common Secondary Selectors', 'easy-critical-css' ), 294 'type' => 'checkbox', 295 'value_type' => 'boolean', 296 'options' => [ 297 'label' => __( 'Include selectors commonly added via JavaScript.', 'easy-critical-css' ), 298 ], 299 'desc' => __( 'By default, the Critical CSS generator only captures selectors present on initial page load. Selectors that are added later by user interaction may be missed. Checking this will include a set of those common secondary selectors, and more may be added in future releases.', 'easy-critical-css' ), 300 'default_value' => true, 301 'default_label' => __( 'Checked', 'easy-critical-css' ), 302 ], 259 303 'default_critical_css' => [ 260 304 'label' => __( 'Default Critical CSS', 'easy-critical-css' ), -
easy-critical-css/trunk/inc/class-compatibility-cache.php
r3307644 r3327873 17 17 add_action( 'easy_cc_single_expired', [ __CLASS__, 'clear_cache_single' ] ); 18 18 add_action( 'easy_cc_single_generated', [ __CLASS__, 'clear_cache_single' ] ); 19 }20 21 public static function clear_cloudflare_cache( $url = null ) {22 $cloudflare_email = defined( 'CLOUDFLARE_EMAIL' ) ? CLOUDFLARE_EMAIL : get_option( 'cloudflare_email' );23 $cloudflare_api_key = defined( 'CLOUDFLARE_API_KEY' ) ? CLOUDFLARE_API_KEY : get_option( 'cloudflare_api_key' );24 $cloudflare_zone_id = defined( 'CLOUDFLARE_ZONE_ID' ) ? CLOUDFLARE_ZONE_ID : get_option( 'cloudflare_zone_id' );25 26 if ( empty( $cloudflare_email ) || empty( $cloudflare_api_key ) || empty( $cloudflare_zone_id ) ) {27 return;28 }29 30 $body = $url ? [ 'files' => [ esc_url_raw( $url ) ] ] : [ 'purge_everything' => true ];31 32 $response = wp_remote_request(33 'https://api.cloudflare.com/client/v4/zones/' . $cloudflare_zone_id . '/purge_cache',34 [35 'method' => 'POST',36 'headers' => [37 'X-Auth-Email' => $cloudflare_email,38 'X-Auth-Key' => $cloudflare_api_key,39 'Content-Type' => 'application/json',40 ],41 'body' => wp_json_encode( $body ),42 'timeout' => 10,43 ]44 );45 19 } 46 20 … … 176 150 177 151 // Cloudflare (if API details exist). 178 self::clear_cloudflare_cache();152 Compatibility_Cloudflare::clear_cloudflare_cache(); 179 153 } 180 154 … … 308 282 309 283 // Cloudflare (if API details exist). 310 self::clear_cloudflare_cache( $url );284 Compatibility_Cloudflare::clear_cloudflare_cache( $url ); 311 285 } 312 286 -
easy-critical-css/trunk/inc/class-critical-css-injector.php
r3319025 r3327873 74 74 $serve_from_files = Settings::get_global_serve_css_from_files(); 75 75 $has_db_critical = ! empty( $generated_css['critical_css'] ); 76 $has_file_critical = $serve_from_files && is_readable( trailingslashit( wp_upload_dir()['basedir'] ) . 'easy-critical-css/critical/' . $url_hash. '.css' );76 $has_file_critical = $serve_from_files && is_readable( trailingslashit( wp_upload_dir()['basedir'] ) . 'easy-critical-css/critical/' . sanitize_file_name( $url_hash ) . '.css' ); 77 77 78 78 // Check for critical CSS. -
easy-critical-css/trunk/inc/class-critical-css-status.php
r3295017 r3327873 86 86 } 87 87 88 return $generated['status']; 88 /** 89 * Filters the Critical CSS status of an individual post/page. 90 * 91 * @since 1.3.0 92 * 93 * @param string $status Critical CSS status of an individual post/page. 94 * @param string|int $identifier URL, Post ID, or URL hash. 95 */ 96 $status = apply_filters( 'easy_cc_critical_status', $generated['status'], $identifier ); 97 98 return $status; 89 99 } 90 100 … … 93 103 'completed' => __( 'Completed', 'easy-critical-css' ), 94 104 'expired' => __( 'Expired', 'easy-critical-css' ), 105 'excluded' => __( 'Excluded', 'easy-critical-css' ), 95 106 'failed' => __( 'Failed', 'easy-critical-css' ), 96 107 'invalid' => __( 'Invalid API', 'easy-critical-css' ), … … 122 133 123 134 $critical_css = Critical_CSS::get_generated_css( $identifier ); 124 $has_critical = ! empty( $critical_css['critical_css'] ); 135 136 // Has Critical in the DB? 137 $has_db_critical = ! empty( $critical_css['critical_css'] ); 138 139 // What about files? 140 $serve_from_files = Settings::get_global_serve_css_from_files(); 141 $upload_base = trailingslashit( wp_upload_dir()['basedir'] ) . 'easy-critical-css/critical/'; 142 $hash = sanitize_file_name( $critical_css['url_hash'] ); 143 $has_file_critical = $serve_from_files && is_readable( "{$upload_base}{$hash}.css" ); 144 145 // Critical exists in either DB or as a file. 146 $has_critical = $has_db_critical || $has_file_critical; 147 125 148 $status = self::get_status( $identifier ); 126 149 $status_label = self::get_critical_css_status_label( $status ); … … 133 156 ] 134 157 ); 158 159 // If there’s savings data AND we display secondary, show it in the admin bar. 160 if ( 161 Settings::get_individual_secondary_behavior( $identifier ) 162 && ! empty( $critical_css['size_savings'] ) 163 ) { 164 $savings = json_decode( wp_unslash( $critical_css['size_savings'] ), true ); 165 166 if ( is_array( $savings ) && isset( $savings['bytes'], $savings['percent'] ) ) { 167 $bytes = size_format( $savings['bytes'] ); 168 $percent = number_format_i18n( $savings['percent'], 0 ) . '%'; 169 170 $wp_admin_bar->add_node( 171 [ 172 'id' => 'critical_css_savings', 173 'title' => sprintf( 174 /* translators: 1: human-readable bytes, 2: percent saved */ 175 __( 'Savings: %1$s (%2$s)', 'easy-critical-css' ), 176 $bytes, 177 $percent 178 ), 179 'parent' => 'critical_css_status', 180 ] 181 ); 182 } 183 } 135 184 136 185 // Do we need to show the Generate Critical CSS link? … … 148 197 ); 149 198 } 199 200 // Do we need Delete link 201 if ( $has_critical && current_user_can( 'manage_options' ) ) { 202 $wp_admin_bar->add_node( 203 [ 204 'id' => 'critical_css_delete', 205 'title' => __( 'Delete Generated Critical CSS', 'easy-critical-css' ), 206 'parent' => 'critical_css_status', 207 'href' => '#', 208 'meta' => [ 'class' => 'critical-css-delete-link' ], 209 ] 210 ); 211 } 150 212 } 151 213 … … 184 246 }) 185 247 }) 248 document.querySelectorAll('.critical-css-delete-link a').forEach(link => { 249 link.addEventListener('click', function (event) { 250 event.preventDefault() 251 if (!eccIdentifier) return 252 253 if (!confirm('<?php echo esc_js( __( 'Are you sure you want to delete Critical CSS?', 'easy-critical-css' ) ); ?>')) { 254 return 255 } 256 257 wp.apiFetch({ 258 path: '/easy-critical-css/v1/delete', 259 method: 'POST', 260 headers: { 'Content-Type': 'application/json' }, 261 body: JSON.stringify({ identifier: eccIdentifier }) 262 }) 263 .then(() => alert('<?php echo esc_js( __( 'Critical CSS styles deleted successfully.', 'easy-critical-css' ) ); ?>')) 264 .catch(err => alert('<?php echo esc_js( __( 'Error: ', 'easy-critical-css' ) ); ?>' + err.message)) 265 }) 266 }) 186 267 }) 187 268 </script> -
easy-critical-css/trunk/inc/class-critical-css.php
r3317868 r3327873 46 46 'zip', 47 47 'gz', 48 'rar', 48 49 ] 49 50 ); … … 52 53 $path_info = pathinfo( wp_parse_url( $current_url, PHP_URL_PATH ) ); 53 54 if ( isset( $path_info['extension'] ) && in_array( strtolower( $path_info['extension'] ), $excluded_extensions, true ) ) { 55 return null; 56 } 57 58 // Block any wp-admin requests 59 $path = wp_parse_url( $current_url, PHP_URL_PATH ); 60 if ( strpos( $path, '/wp-admin/' ) !== false ) { 54 61 return null; 55 62 } -
easy-critical-css/trunk/inc/class-database.php
r3307644 r3327873 249 249 return (bool) $deleted; 250 250 } 251 252 public static function clear_all_styles() { 253 global $wpdb; 254 255 $table_name = esc_sql( self::get_table_name() ); 256 257 return $wpdb->query( 258 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared 259 "UPDATE $table_name 260 SET 261 requested_time = NULL, 262 generated_time = NULL, 263 critical_css = NULL, 264 remaining_css = NULL, 265 secondary_css = NULL, 266 size_savings = NULL, 267 processing_status = 'unprocessed' 268 " 269 ); 270 } 271 272 public static function clear_individual_styles( $identifier ) { 273 global $wpdb; 274 275 $table_name = esc_sql( self::get_table_name() ); 276 $hash = Helpers::get_url_hash( $identifier ); 277 278 return $wpdb->query( 279 $wpdb->prepare( 280 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared 281 "UPDATE {$table_name} 282 SET 283 generated_time = NULL, 284 critical_css = NULL, 285 remaining_css = NULL, 286 secondary_css = NULL, 287 size_savings = NULL, 288 processing_status = 'unprocessed' 289 WHERE url_hash = %s 290 ", 291 $hash 292 ) 293 ); 294 } 251 295 } -
easy-critical-css/trunk/inc/class-helpers.php
r3317868 r3327873 289 289 290 290 /** 291 * Parses a newline-separated string into a clean array.291 * Parses a newline-separated string into a clean deduped array. 292 292 * 293 293 * @param string $selector_string Raw newline-separated string. … … 296 296 */ 297 297 public static function parse_newline_list( $selector_string ) { 298 return array_values( 299 array_filter( 300 array_map( 'trim', explode( "\n", $selector_string ) ), 301 function ( $item ) { 302 return $item !== ''; 303 } 304 ) 305 ); 298 $seen = []; 299 $result = []; 300 301 $selectors = explode( "\n", $selector_string ); 302 foreach ( $selectors as $selector ) { 303 $item = trim( $selector ); 304 if ( $item === '' || isset( $seen[ $item ] ) ) { 305 continue; 306 } 307 $seen[ $item ] = true; 308 $result[] = $item; 309 } 310 311 return $result; 306 312 } 307 313 … … 316 322 'rnd', 317 323 'no-cache', 324 'timestamp', 318 325 'sucurianticache', 319 326 'wp_scrape_key', -
easy-critical-css/trunk/inc/class-plugin.php
r3319025 r3327873 10 10 private static $instance = null; 11 11 12 private static $plugin_version = '1. 2.1';12 private static $plugin_version = '1.3.0'; 13 13 14 14 private static $db_version = '2'; … … 71 71 Critical_CSS_Regenerate::init(); 72 72 Compatibility_Cache::init(); 73 Compatibility_Cloudflare::init(); 74 Compatibility_Trellis::init(); 75 Compatibility_WooCommerce::init(); 73 76 Compatibility_WP_Rocket::init(); 74 Compatibility_Trellis::init();75 77 Critical_CSS::init(); 76 78 Database::init(); 77 79 Gutenberg::init(); 80 Delete_Handler::init(); 78 81 Reset_Handler::init(); 79 82 REST_API::init(); -
easy-critical-css/trunk/inc/class-reset-handler.php
r3284313 r3327873 44 44 self::reset_settings(); 45 45 46 // Flush rew ite rules.46 // Flush rewrite rules. 47 47 flush_rewrite_rules(); 48 49 // Clear all cache. 50 Compatibility_Cache::clear_cache_all(); 48 51 49 52 // Redirect w/success message. -
easy-critical-css/trunk/inc/class-rest-api.php
r3319025 r3327873 26 26 'permission_callback' => '__return_true', 27 27 'args' => [ 28 'hash' => [28 'hash' => [ 29 29 'required' => true, 30 30 'type' => 'string', 31 31 ], 32 'handshake' => [32 'handshake' => [ 33 33 'required' => true, 34 34 'type' => 'string', 35 35 ], 36 'criticalCSS' => [37 'required' => true,36 'criticalCSS' => [ 37 'required' => false, 38 38 'type' => 'string', 39 39 ], 40 'remainingCSS' => [41 'required' => true,40 'remainingCSS' => [ 41 'required' => false, 42 42 'type' => 'string', 43 43 ], 44 'secondaryCSS' => [45 'required' => true,44 'secondaryCSS' => [ 45 'required' => false, 46 46 'type' => 'string', 47 47 ], 48 'url' => [ 48 'criticalCSSUrl' => [ 49 'required' => false, 50 'type' => 'string', 51 'validate_callback' => [ __CLASS__, 'validate_criticalcss_net_url' ], 52 ], 53 'remainingCSSUrl' => [ 54 'required' => false, 55 'type' => 'string', 56 'validate_callback' => [ __CLASS__, 'validate_criticalcss_net_url' ], 57 ], 58 'secondaryCSSUrl' => [ 59 'required' => false, 60 'type' => 'string', 61 'validate_callback' => [ __CLASS__, 'validate_criticalcss_net_url' ], 62 ], 63 'url' => [ 49 64 'required' => true, 50 65 'type' => 'string', 51 'validate_callback' => 'esc_url_raw', 66 'validate_callback' => function ( $url ) { 67 return (bool) filter_var( $url, FILTER_VALIDATE_URL ); 68 }, 52 69 ], 53 70 ], … … 133 150 register_rest_route( 134 151 self::$route_namespace, 152 '/delete', 153 [ 154 'methods' => 'POST', 155 'callback' => [ __CLASS__, 'handle_delete_request' ], 156 'permission_callback' => function () { 157 return current_user_can( 'manage_options' ); 158 }, 159 'args' => [ 160 'identifier' => [ 161 'required' => true, 162 'validate_callback' => function ( $param ) { 163 return is_numeric( $param ) || filter_var( $param, FILTER_VALIDATE_URL ); 164 }, 165 ], 166 ], 167 ] 168 ); 169 170 register_rest_route( 171 self::$route_namespace, 135 172 '/content', 136 173 [ … … 198 235 } 199 236 237 private static function validate_criticalcss_net_url( $url ) { 238 // Allow empty for inline-only cases. 239 if ( $url === '' ) { 240 return true; 241 } 242 243 // Basic URL syntax check. 244 if ( filter_var( $url, FILTER_VALIDATE_URL ) === false ) { 245 return false; 246 } 247 248 // Parse out the host and scheme. 249 $parts = wp_parse_url( $url ); 250 if ( empty( $parts['scheme'] ) || empty( $parts['host'] ) ) { 251 return false; 252 } 253 254 // Must be https. 255 if ( 'https' !== $parts['scheme'] ) { 256 return false; 257 } 258 259 // Host must end in ".criticalcss.net". 260 if ( ! preg_match( '/(^|\.)criticalcss\.net$/i', $parts['host'] ) ) { 261 return false; 262 } 263 264 return true; 265 } 266 200 267 private static function remove_old_css_files( $hash ) { 201 268 $upload_dir = wp_upload_dir(); … … 270 337 } 271 338 339 // If no inline CSS, but we have URLs, fetch them now. 340 $css_types = [ 341 'critical' => 'criticalCSS', 342 'remaining' => 'remainingCSS', 343 'secondary' => 'secondaryCSS', 344 ]; 345 foreach ( $css_types as $type => $param_key ) { 346 $url_key = $type . 'Url'; 347 if ( empty( $params[ $param_key ] ) && ! empty( $params[ $url_key ] ) ) { 348 $resp = wp_remote_get( esc_url_raw( $params[ $url_key ] ), [ 'timeout' => 20 ] ); 349 if ( is_wp_error( $resp ) || 200 !== wp_remote_retrieve_response_code( $resp ) ) { 350 if ( $type === 'critical' ) { 351 return new WP_Error( 352 'css_fetch_failed', 353 __( 'Could not fetch critical CSS from URL.', 'easy-critical-css' ), 354 [ 'status' => 502 ] 355 ); 356 } 357 continue; 358 } 359 $params[ $param_key ] = wp_remote_retrieve_body( $resp ); 360 } 361 } 362 363 // Now if we are empty, this is a legit failure. 272 364 if ( empty( $params['criticalCSS'] ) ) { 273 365 // Store CSS failure. … … 415 507 416 508 return rest_ensure_response( $result ); 509 } 510 511 public static function handle_delete_request( WP_REST_Request $request ) { 512 $identifier = $request->get_param( 'identifier' ); 513 $result = Delete_Handler::delete_one( $identifier ); 514 515 if ( is_wp_error( $result ) ) { 516 return $result; 517 } 518 519 return rest_ensure_response( 520 [ 521 'success' => true, 522 'message' => __( 'Critical CSS styles deleted for the page.', 'easy-critical-css' ), 523 ] 524 ); 417 525 } 418 526 … … 556 664 } 557 665 558 return[666 $response = [ 559 667 'html' => $body, 560 668 'stylesheets' => $stylesheet_hrefs, … … 562 670 'css' => $css_combined, 563 671 ]; 672 673 return rest_ensure_response( $response ); 564 674 } 565 675 } -
easy-critical-css/trunk/inc/class-settings.php
r3317868 r3327873 117 117 public static function get_global_forced_critical() { 118 118 $selectors = self::get_global_setting( 'forced_critical_selectors', '' ); 119 119 120 return Helpers::parse_newline_list( $selectors ); 120 121 } … … 130 131 $global = self::get_global_forced_critical(); 131 132 $selectors = (string) self::get_individual_setting( $identifier, 'forced_critical_selectors', implode( "\n", $global ) ); 132 return Helpers::parse_newline_list( $selectors ); 133 134 return Helpers::parse_newline_list( $selectors ); 135 } 136 137 /** 138 * Gets the global Add Common Secondary Selectors. 139 * 140 * @return bool 141 */ 142 public static function get_global_add_common_secondary() { 143 return (bool) self::get_global_setting( 'add_common_secondary', true ); 133 144 } 134 145 … … 140 151 public static function get_global_forced_secondary() { 141 152 $selectors = self::get_global_setting( 'forced_secondary_selectors', '' ); 153 154 // Add common secondary selectors if setting active. 155 if ( self::get_global_add_common_secondary() ) { 156 $selectors .= "\n.active"; 157 } 158 142 159 return Helpers::parse_newline_list( $selectors ); 143 160 } … … 153 170 $global = self::get_global_forced_secondary(); 154 171 $selectors = (string) self::get_individual_setting( $identifier, 'forced_secondary_selectors', implode( "\n", $global ) ); 172 173 // Add common secondary selectors if setting active. 174 if ( self::get_global_add_common_secondary() ) { 175 $selectors .= "\n.active"; 176 } 177 155 178 return Helpers::parse_newline_list( $selectors ); 156 179 } … … 174 197 public static function get_individual_default_critical_css( $identifier ) { 175 198 $global = self::get_global_default_critical_css(); 199 176 200 return (string) self::get_individual_setting( $identifier, 'critical_css', $global ); 177 201 } … … 195 219 public static function get_global_excluded_css_files() { 196 220 $files = self::get_global_setting( 'exclude_css_files', '' ); 221 197 222 return Helpers::parse_newline_list( $files ); 198 223 } … … 208 233 $global = self::get_global_excluded_css_files(); 209 234 $files = (string) self::get_individual_setting( $identifier, 'exclude_css_files', implode( "\n", $global ) ); 235 210 236 return Helpers::parse_newline_list( $files ); 211 237 } -
easy-critical-css/trunk/inc/class-uninstall-handler.php
r3317868 r3327873 29 29 30 30 // Delete any static files. 31 $basedir = trailingslashit( wp_upload_dir()['basedir'] ) . 'easy-critical-css'; 32 $subdirs = [ 'critical', 'secondary', 'remaining' ]; 33 34 foreach ( $subdirs as $subdir ) { 35 $dir = trailingslashit( $basedir ) . $subdir; 36 37 if ( file_exists( $dir ) ) { 38 foreach ( glob( "$dir/*.css" ) as $file ) { 39 wp_delete_file( $file ); 40 } 41 42 // We are deleting from wp-content/uploads which is writable on all standard WordPress installs. 43 // WP_Filesystem is not needed here and may cause permission prompts on some hosts. 44 // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_rmdir 45 rmdir( $dir ); 46 } 47 } 48 49 if ( is_dir( $basedir ) && count( glob( "$basedir/*" ) ) === 0 ) { 50 // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_rmdir 51 rmdir( $basedir ); 52 } 31 Delete_Handler::delete_files(); 53 32 54 33 // Delete log file. … … 67 46 easy_cc_fs()->add_action( 'after_uninstall', 'easy_cc_fs_uninstall_cleanup' ); 68 47 48 // Clear all cache. 49 Compatibility_Cache::clear_cache_all(); 50 69 51 // Deactivate Easy Critical CSS plugin. 70 52 deactivate_plugins( Plugin::get_plugin_file() ); 53 54 // Flush rewrite rules. 55 flush_rewrite_rules(); 71 56 72 57 // Redirect w/success message. -
easy-critical-css/trunk/readme.txt
r3319025 r3327873 102 102 == Changelog == 103 103 104 = 1.3.0 = 105 - FEATURE: Adds WooCommerce compatibility 106 - FEATURE: Hovering over the Critical CSS status now displays the size savings when using Secondary CSS 107 - FEATURE: Introduces new setting to auto include common Secondary selectors 108 - FEATURE: Creates new Settings buttons to quickly delete all and page-specific previously auto-generated styles 109 - FIX: Dedupes any user-added forced selectors 110 - FIX: Improves Cloudflare support 111 104 112 = 1.2.1 = 105 113 - OPTIMIZATION: Utilizes a preload swap to defer Secondary CSS instead of a print/media swap -
easy-critical-css/trunk/src/components/statusIndicator.tsx
r3284313 r3327873 7 7 completed: __('Completed', 'easy-critical-css'), 8 8 expired: __('Expired', 'easy-critical-css'), 9 excluded: __('Excluded', 'easy-critical-css'), 9 10 failed: __('Failed', 'easy-critical-css'), 10 11 invalid: __('Invalid API', 'easy-critical-css'), … … 20 21 completed: '#1e7e34', 21 22 expired: '#995a00', 23 excluded: '#6c757d', 22 24 failed: '#b12331', 23 25 invalid: '#b12331', -
easy-critical-css/trunk/src/types/types.ts
r3284313 r3327873 1 1 export type Status = 'completed' 2 2 | 'expired' 3 | 'excluded' 3 4 | 'failed' 4 5 | 'invalid' -
easy-critical-css/trunk/vendor/composer/autoload_classmap.php
r3317868 r3327873 12 12 'EasyCriticalCSS\\Admin_Settings' => $baseDir . '/inc/class-admin-settings.php', 13 13 'EasyCriticalCSS\\Compatibility_Cache' => $baseDir . '/inc/class-compatibility-cache.php', 14 'EasyCriticalCSS\\Compatibility_Cloudflare' => $baseDir . '/inc/class-compatibility-cloudflare.php', 14 15 'EasyCriticalCSS\\Compatibility_Trellis' => $baseDir . '/inc/class-compatibility-trellis.php', 15 16 'EasyCriticalCSS\\Compatibility_WP_Rocket' => $baseDir . '/inc/class-compatibility-wp-rocket.php', 17 'EasyCriticalCSS\\Compatibility_WooCommerce' => $baseDir . '/inc/class-compatibility-woocommerce.php', 16 18 'EasyCriticalCSS\\Critical_CSS' => $baseDir . '/inc/class-critical-css.php', 17 19 'EasyCriticalCSS\\Critical_CSS_Injector' => $baseDir . '/inc/class-critical-css-injector.php', … … 21 23 'EasyCriticalCSS\\Database' => $baseDir . '/inc/class-database.php', 22 24 'EasyCriticalCSS\\Debug' => $baseDir . '/inc/class-debug.php', 25 'EasyCriticalCSS\\Delete_Handler' => $baseDir . '/inc/class-delete-handler.php', 23 26 'EasyCriticalCSS\\Gutenberg' => $baseDir . '/inc/class-gutenberg.php', 24 27 'EasyCriticalCSS\\Helpers' => $baseDir . '/inc/class-helpers.php', -
easy-critical-css/trunk/vendor/composer/autoload_static.php
r3317868 r3327873 31 31 'EasyCriticalCSS\\Admin_Settings' => __DIR__ . '/../..' . '/inc/class-admin-settings.php', 32 32 'EasyCriticalCSS\\Compatibility_Cache' => __DIR__ . '/../..' . '/inc/class-compatibility-cache.php', 33 'EasyCriticalCSS\\Compatibility_Cloudflare' => __DIR__ . '/../..' . '/inc/class-compatibility-cloudflare.php', 33 34 'EasyCriticalCSS\\Compatibility_Trellis' => __DIR__ . '/../..' . '/inc/class-compatibility-trellis.php', 34 35 'EasyCriticalCSS\\Compatibility_WP_Rocket' => __DIR__ . '/../..' . '/inc/class-compatibility-wp-rocket.php', 36 'EasyCriticalCSS\\Compatibility_WooCommerce' => __DIR__ . '/../..' . '/inc/class-compatibility-woocommerce.php', 35 37 'EasyCriticalCSS\\Critical_CSS' => __DIR__ . '/../..' . '/inc/class-critical-css.php', 36 38 'EasyCriticalCSS\\Critical_CSS_Injector' => __DIR__ . '/../..' . '/inc/class-critical-css-injector.php', … … 40 42 'EasyCriticalCSS\\Database' => __DIR__ . '/../..' . '/inc/class-database.php', 41 43 'EasyCriticalCSS\\Debug' => __DIR__ . '/../..' . '/inc/class-debug.php', 44 'EasyCriticalCSS\\Delete_Handler' => __DIR__ . '/../..' . '/inc/class-delete-handler.php', 42 45 'EasyCriticalCSS\\Gutenberg' => __DIR__ . '/../..' . '/inc/class-gutenberg.php', 43 46 'EasyCriticalCSS\\Helpers' => __DIR__ . '/../..' . '/inc/class-helpers.php', -
easy-critical-css/trunk/vendor/composer/installed.php
r3319025 r3327873 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' 6dbdd173fea13327e403938376d1d677bae57e28',6 'reference' => 'a88ecc654551c83ad454541fa5297413a497f7b8', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 32 32 'pretty_version' => 'dev-main', 33 33 'version' => 'dev-main', 34 'reference' => ' 6dbdd173fea13327e403938376d1d677bae57e28',34 'reference' => 'a88ecc654551c83ad454541fa5297413a497f7b8', 35 35 'type' => 'wordpress-plugin', 36 36 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.