Changeset 3454474
- Timestamp:
- 02/05/2026 10:26:32 AM (4 weeks ago)
- Location:
- wp-cloudflare-page-cache
- Files:
-
- 28 edited
- 1 copied
-
tags/5.2.3 (copied) (copied from wp-cloudflare-page-cache/trunk)
-
tags/5.2.3/CHANGELOG.md (modified) (1 diff)
-
tags/5.2.3/assets/advanced-cache.php (modified) (1 diff)
-
tags/5.2.3/assets/build/154.js (modified) (1 diff)
-
tags/5.2.3/assets/src/pages/settings/content/advanced/AdvancedCache.tsx (modified) (1 diff)
-
tags/5.2.3/bootstrap.php (modified) (1 diff)
-
tags/5.2.3/languages/wp-cloudflare-page-cache.pot (modified) (1 diff)
-
tags/5.2.3/libs/cache_controller.class.php (modified) (1 diff)
-
tags/5.2.3/libs/html_cache.class.php (modified) (1 diff)
-
tags/5.2.3/libs/logs.class.php (modified) (1 diff)
-
tags/5.2.3/readme.txt (modified) (2 diffs)
-
tags/5.2.3/src/Constants.php (modified) (1 diff)
-
tags/5.2.3/src/Modules/Settings_Manager.php (modified) (1 diff)
-
tags/5.2.3/vendor/composer/installed.php (modified) (2 diffs)
-
tags/5.2.3/wp-cloudflare-super-page-cache.php (modified) (1 diff)
-
trunk/CHANGELOG.md (modified) (1 diff)
-
trunk/assets/advanced-cache.php (modified) (1 diff)
-
trunk/assets/build/154.js (modified) (1 diff)
-
trunk/assets/src/pages/settings/content/advanced/AdvancedCache.tsx (modified) (1 diff)
-
trunk/bootstrap.php (modified) (1 diff)
-
trunk/languages/wp-cloudflare-page-cache.pot (modified) (1 diff)
-
trunk/libs/cache_controller.class.php (modified) (1 diff)
-
trunk/libs/html_cache.class.php (modified) (1 diff)
-
trunk/libs/logs.class.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Constants.php (modified) (1 diff)
-
trunk/src/Modules/Settings_Manager.php (modified) (1 diff)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/wp-cloudflare-super-page-cache.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-cloudflare-page-cache/tags/5.2.3/CHANGELOG.md
r3437972 r3454474 1 ##### Version 5.2.3 (2026-02-05) 2 3 - Enhanced security 4 1 5 ##### Version 5.2.2 (2026-01-12) 2 6 -
wp-cloudflare-page-cache/tags/5.2.3/assets/advanced-cache.php
r3327334 r3454474 189 189 190 190 if ( ! file_exists( $cache_path . $cache_key ) || $swcfpc_objects['fallback_cache']->fallback_cache_is_expired_page( $cache_key ) ) { 191 192 // Bypass 4xx or 5xx HTTP status codes (security blocks, errors, etc.) 193 if ( SPC\Services\Settings_Store::get_instance()->get( SPC\Constants::SETTING_FALLBACK_CACHE_HTTP_RESPONSE_CODE ) ) { 194 $http_status = http_response_code(); 195 if ( $http_status !== false && $http_status >= 400 && $http_status < 600 ) { 196 return $html; 197 } 198 } 191 199 192 200 if ( $sw_cloudflare_pagecache->get_single_config( 'cf_fallback_cache_ttl', 0 ) == 0 ) { -
wp-cloudflare-page-cache/tags/5.2.3/assets/build/154.js
r3405353 r3454474 1 "use strict";(globalThis.webpackChunkwp_cloudflare_page_cache=globalThis.webpackChunkwp_cloudflare_page_cache||[]).push([[154],{341:(e,a,t)=>{t.d(a,{BE:()=>u,Uz:()=>n,_s:()=>o,cp:()=>i,gk:()=>m,uT:()=>s,zj:()=>p});var l=t(1609),c=t(7248),r=t(2748);function o({...e}){return(0,l.createElement)(c._s.Root,{"data-slot":"drawer",...e})}function n({...e}){return(0,l.createElement)(c._s.Trigger,{"data-slot":"drawer-trigger",...e})}function s({...e}){return(0,l.createElement)(c._s.Portal,{"data-slot":"drawer-portal",...e})}function i({...e}){return(0,l.createElement)(c._s.Close,{"data-slot":"drawer-close",...e})}function d({className:e,...a}){return(0,l.createElement)(c._s.Overlay,{"data-slot":"drawer-overlay",className:(0,r.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[9999] bg-black/50",e),...a})}function p({className:e,children:a,...t}){return(0,l.createElement)(s,{"data-slot":"drawer-portal"},(0,l.createElement)(d,null),(0,l.createElement)(c._s.Content,{"data-slot":"drawer-content",className:(0,r.cn)("group/drawer-content bg-background fixed z-[10000] isolate flex flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...t},a))}function u({className:e,...a}){return(0,l.createElement)("div",{"data-slot":"drawer-header",className:(0,r.cn)("flex flex-col gap-1.5 p-3",e),...a})}function m({className:e,...a}){return(0,l.createElement)(c._s.Title,{"data-slot":"drawer-title",className:(0,r.cn)("text-foreground font-semibold",e),...a})}},1747:(e,a,t)=>{t.d(a,{F:()=>o});var l=t(1609),c=t(4674),r=t(2748);function o({className:e,children:a,...t}){return(0,l.createElement)(c.bL,{"data-slot":"scroll-area",className:(0,r.cn)("relative",e),...t},(0,l.createElement)(c.LM,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"},a),(0,l.createElement)(n,null),(0,l.createElement)(c.OK,null))}function n({className:e,orientation:a="vertical",...t}){return(0,l.createElement)(c.VM,{"data-slot":"scroll-area-scrollbar",orientation:a,className:(0,r.cn)("flex touch-none p-px transition-colors select-none","vertical"===a&&"h-full w-2.5 border-l border-l-transparent","horizontal"===a&&"h-2.5 flex-col border-t border-t-transparent",e),...t},(0,l.createElement)(c.lr,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"}))}},2154:(e,a,t)=>{t.r(a),t.d(a,{default:()=>We});var l=t(1609),c=t(3781),r=t(5975),o=t(341),n=t(2748),s=t(4585),i=t(4758),d=t(7723),p=t(9407);const u=(0,p.A)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);var m=t(8697),h=t(827), g=t(5404),_=t(4721),f=t(7102),b=t(9391),w=t(1747),y=t(504),E=t(6087);const v=()=>{const{darkMode:e}=(0,i.C)(),{isToggleOn:a,settings:t}=(0,s.C)(),{i18n:c}=window.SPCDash,p=e=>{navigator.clipboard.writeText(e),_.oR.success((0,d.__)("Copied to clipboard!","wp-cloudflare-page-cache"))},v=(0,d.sprintf)("map $upstream_http_x_wp_cf_super_cache_active $wp_cf_super_cache_active {\n default 'no-cache, no-store, must-revalidate, max-age=0';\n '1' 's-maxage=%s, max-age=%s';\n}",t.cf_maxage,t.cf_browser_maxage),x="more_clear_headers 'Pragma';\nmore_clear_headers 'Expires';\nmore_clear_headers 'Cache-Control';\nadd_header Cache-Control $wp_cf_super_cache_active;";let N="";return a("cf_bypass_sitemap")&&(N+='location ~* \\.(xml|xsl)$ { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; }\n'),a("cf_bypass_file_robots")&&(N+='location /robots.txt { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; }\n'),a("cf_browser_caching_htaccess")&&(N+='location ~* \\.(css|js|pdf)$ { add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=2592000, stale-while-revalidate=86400, stale-if-error=604800"; expires 30d; }\n',N+='location ~* \\.(jpg|jpeg|png|gif|ico|eot|swf|svg|webp|avif|ttf|otf|woff|woff2|ogg|mp4|mpeg|avi|mkv|webm|mp3)$ { add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=31536000, stale-while-revalidate=86400, stale-if-error=604800"; expires 365d; }\n'),N+='location /wp-cron.php { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; }\n',(0,l.createElement)(o._s,null,(0,l.createElement)(o.Uz,{className:"underline text-current cursor-pointer"},(0,d.__)("here","wp-cloudflare-page-cache")),(0,l.createElement)(o.uT,null,(0,l.createElement)(o.zj,{className:(0,n.cn)("overflow-hidden",{dark:e})},(0,l.createElement)(o.BE,{className:"border-b border-border bg-muted"},(0,l.createElement)(y.A,{className:"text-left flex items-center justify-between w-full"},(0,l.createElement)(o.gk,null,(0,l.createElement)("h2",{className:"flex items-center text-lg mb-0"},(0,l.createElement)(u,{className:"size-6 text-orange-500 mr-3"}),(0,d.__)("Nginx Instructions","wp-cloudflare-page-cache"))),(0,l.createElement)(o.cp,null,(0,l.createElement)(r.A,{variant:"ghost",size:"icon",icon:m.A},(0,l.createElement)("span",{className:"sr-only"},c.close))))),(0,l.createElement)(w.F,{className:"overflow-auto max-w-full max-h-[80vh] py-5"},(0,l.createElement)(y.A,{className:"py-0"},a("cf_cache_control_htaccess")&&(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",{className:"flex items-center mb-3"},(0,l.createElement)(h.A,{className:"size-5 mr-2 text-blue-500"}),(0,l.createElement)("h3",{className:"text-base"},(0,d.__)("Overwrite the cache-control header","wp-cloudflare-page-cache"))),(0,l.createElement)("div",{className:"space-y-4"},(0,l.createElement)("p",{className:"text-sm mb-2 text-muted-foreground"},(0,E.createInterpolateElement)((0,d.__)("Edit the main Nginx configuration file, usually <code>/etc/nginx.conf</code>, and enter these rules immediately after opening the http block:","wp-cloudflare-page-cache"),{code:(0,l.createElement)("code",{className:"px-2 py-1 rounded bg-muted font-mono"},"/etc/nginx.conf")})),(0,l.createElement)("div",{className:"relative"},(0,l.createElement)(r.A,{variant:"default",size:"icon",onClick:()=>p(v),icon:g.A,className:"absolute top-2 right-2 z-10"},(0,l.createElement)("span",{className:"sr-only"},(0,d.__)("Copy to clipboard","wp-cloudflare-page-cache"))),(0,l.createElement)("pre",{className:"text-muted-foreground bg-muted border border-border break-all p-4 rounded-2xl overflow-x-auto text-sm whitespace-pre-wrap"},v)),(0,l.createElement)("div",null,(0,l.createElement)("p",{className:"text-sm mb-2 text-muted-foreground"},(0,d.__)("Now open the configuration file of your domain and add the following rules inside the block that deals with the management of PHP pages:","wp-cloudflare-page-cache")),(0,l.createElement)("div",{className:"relative"},(0,l.createElement)(r.A,{variant:"default",size:"icon",onClick:()=>p(x),className:"absolute top-2 right-2 z-10",icon:g.A},(0,l.createElement)("span",{className:"sr-only"},(0,d.__)("Copy to clipboard","wp-cloudflare-page-cache"))),(0,l.createElement)("pre",{className:"text-muted-foreground bg-muted border border-border p-4 rounded-2xl overflow-y-auto text-sm whitespace-pre-wrap"},x)))),(0,l.createElement)(f.A,{className:"my-5"})),(0,l.createElement)("div",{className:"flex items-center mb-3"},(0,l.createElement)(h.A,{className:"size-5 mr-2 text-blue-500"}),(0,l.createElement)("h3",{className:"text-base"},(0,d.__)("Browser caching rules","wp-cloudflare-page-cache"))),(0,l.createElement)("div",{className:"space-y-4"},(0,l.createElement)("div",null,(0,l.createElement)("p",{className:"text-sm mb-2 text-muted-foreground"},(0,d.__)("Open the configuration file of your domain and add the following rules:","wp-cloudflare-page-cache")),(0,l.createElement)("div",{className:"relative"},(0,l.createElement)(r.A,{variant:"default",size:"icon",onClick:()=>p(N),className:"absolute top-2 right-2 z-10",icon:g.A},(0,l.createElement)("span",{className:"sr-only"},(0,d.__)("Copy to clipboard","wp-cloudflare-page-cache"))),(0,l.createElement)("pre",{className:"text-muted-foreground bg-muted border border-border p-4 rounded-2xl overflow-y-auto text-sm whitespace-pre-wrap"},N)))),(0,l.createElement)(b.A,{type:"info",className:"my-5",title:(0,d.__)("Save and restart Nginx.","wp-cloudflare-page-cache")}))))))};var x=t(7158),N=t(2318),k=t(5181),A=t(2133),C=t(6214),P=t(1071),R=t(9957),j=t(1351),S=t(2579),L=t(8834),I=t(1104),z=t(1427),T=t(4848),U="Accordion",O=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[D,F,M]=(0,C.N)(U),[W,V]=(0,A.A)(U,[M,L.z3]),H=(0,L.z3)(),$=l.forwardRef(((e,a)=>{const{type:t,...l}=e,c=l,r=l;return(0,T.jsx)(D.Provider,{scope:e.__scopeAccordion,children:"multiple"===t?(0,T.jsx)(J,{...r,ref:a}):(0,T.jsx)(G,{...c,ref:a})})}));$.displayName=U;var[q,B]=W(U),[K,X]=W(U,{collapsible:!1}),G=l.forwardRef(((e,a)=>{const{value:t,defaultValue:c,onValueChange:r=()=>{},collapsible:o=!1,...n}=e,[s,i]=(0,j.i)({prop:t,defaultProp:c??"",onChange:r,caller:U});return(0,T.jsx)(q,{scope:e.__scopeAccordion,value:l.useMemo((()=>s?[s]:[]),[s]),onItemOpen:i,onItemClose:l.useCallback((()=>o&&i("")),[o,i]),children:(0,T.jsx)(K,{scope:e.__scopeAccordion,collapsible:o,children:(0,T.jsx)(Y,{...n,ref:a})})})})),J=l.forwardRef(((e,a)=>{const{value:t,defaultValue:c,onValueChange:r=()=>{},...o}=e,[n,s]=(0,j.i)({prop:t,defaultProp:c??[],onChange:r,caller:U}),i=l.useCallback((e=>s(((a=[])=>[...a,e]))),[s]),d=l.useCallback((e=>s(((a=[])=>a.filter((a=>a!==e))))),[s]);return(0,T.jsx)(q,{scope:e.__scopeAccordion,value:n,onItemOpen:i,onItemClose:d,children:(0,T.jsx)(K,{scope:e.__scopeAccordion,collapsible:!0,children:(0,T.jsx)(Y,{...o,ref:a})})})})),[Q,Z]=W(U),Y=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,disabled:c,dir:r,orientation:o="vertical",...n}=e,s=l.useRef(null),i=(0,P.s)(s,a),d=F(t),p="ltr"===(0,z.jH)(r),u=(0,R.m)(e.onKeyDown,(e=>{if(!O.includes(e.key))return;const a=e.target,t=d().filter((e=>!e.ref.current?.disabled)),l=t.findIndex((e=>e.ref.current===a)),c=t.length;if(-1===l)return;e.preventDefault();let r=l;const n=c-1,s=()=>{r=l+1,r>n&&(r=0)},i=()=>{r=l-1,r<0&&(r=n)};switch(e.key){case"Home":r=0;break;case"End":r=n;break;case"ArrowRight":"horizontal"===o&&(p?s():i());break;case"ArrowDown":"vertical"===o&&s();break;case"ArrowLeft":"horizontal"===o&&(p?i():s());break;case"ArrowUp":"vertical"===o&&i()}const u=r%c;t[u].ref.current?.focus()}));return(0,T.jsx)(Q,{scope:t,disabled:c,direction:r,orientation:o,children:(0,T.jsx)(D.Slot,{scope:t,children:(0,T.jsx)(S.sG.div,{...n,"data-orientation":o,ref:i,onKeyDown:c?void 0:u})})})})),ee="AccordionItem",[ae,te]=W(ee),le=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,value:l,...c}=e,r=Z(ee,t),o=B(ee,t),n=H(t),s=(0,I.B)(),i=l&&o.value.includes(l)||!1,d=r.disabled||e.disabled;return(0,T.jsx)(ae,{scope:t,open:i,disabled:d,triggerId:s,children:(0,T.jsx)(L.bL,{"data-orientation":r.orientation,"data-state":de(i),...n,...c,ref:a,disabled:d,open:i,onOpenChange:e=>{e?o.onItemOpen(l):o.onItemClose(l)}})})}));le.displayName=ee;var ce="AccordionHeader",re=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,...l}=e,c=Z(U,t),r=te(ce,t);return(0,T.jsx)(S.sG.h3,{"data-orientation":c.orientation,"data-state":de(r.open),"data-disabled":r.disabled?"":void 0,...l,ref:a})}));re.displayName=ce;var oe="AccordionTrigger",ne=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,...l}=e,c=Z(U,t),r=te(oe,t),o=X(oe,t),n=H(t);return(0,T.jsx)(D.ItemSlot,{scope:t,children:(0,T.jsx)(L.l9,{"aria-disabled":r.open&&!o.collapsible||void 0,"data-orientation":c.orientation,id:r.triggerId,...n,...l,ref:a})})}));ne.displayName=oe;var se="AccordionContent",ie=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,...l}=e,c=Z(U,t),r=te(se,t),o=H(t);return(0,T.jsx)(L.UC,{role:"region","aria-labelledby":r.triggerId,"data-orientation":c.orientation,...o,...l,ref:a,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})}));function de(e){return e?"open":"closed"}ie.displayName=se;var pe=$,ue=le,me=re,he=ne,ge=ie;const _e=(0,p.A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);function fe({...e}){return(0,l.createElement)(pe,{"data-slot":"accordion",...e})}function be({className:e,...a}){return(0,l.createElement)(ue,{"data-slot":"accordion-item",className:e,...a})}function we({className:e,children:a,...t}){return(0,l.createElement)(me,{className:"flex",as:"p"},(0,l.createElement)(he,{"data-slot":"accordion-trigger",className:(0,n.cn)("cursor-pointer focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-center justify-between gap-4 py-2 text-left text-sm w-full font-medium transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),...t},a,(0,l.createElement)(_e,{className:"ml-auto text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})))}function ye({className:e,children:a,...t}){return(0,l.createElement)(ge,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...t},(0,l.createElement)("div",{className:(0,n.cn)("py-4",e)},a))}var Ee=t(3327);const ve=()=>(0,l.createElement)("div",{className:"grid gap-1"},(0,l.createElement)(fe,{type:"single",collapsible:!0,className:"rounded-sm border overflow-hidden"},(0,l.createElement)(be,{value:"htaccess"},(0,l.createElement)(we,{className:"!m-0 bg-muted px-4 py-3 !text-sm"},(0,d.__)("Additional info","wp-cloudflare-page-cache")),(0,l.createElement)(ye,{className:"p-4 bg-muted/20"},(0,l.createElement)(b.A,{type:"warning",title:(0,d.__)("Important Notes","wp-cloudflare-page-cache"),description:(0,E.createInterpolateElement)((0,d.__)("This option is not essential as in most cases this plugin works out of the box. If the page cache does not work after a considerable number of attempts or you see that max-age and s-maxage values of <code>X-WP-CF-Super-Cache-Cache-Control</code> response header are not the same of the ones in <code>Cache-Control</code> response header, activate this option.","wp-cloudflare-page-cache"),{code:(0,l.createElement)("code",null)})}),(0,l.createElement)("div",{className:"grid lg:grid-cols-2 gap-4 mt-4"},(0,l.createElement)(b.A,{type:"success",title:`${(0,d.__)("Read here if you use Apache","wp-cloudflare-page-cache")} (.htaccess):`,description:(0,E.createInterpolateElement)((0,d.__)("For overwriting to work, make sure that the rules added by Super Page Cache are placed at the bottom of the <code>.htaccess</code> file. If they are present <strong>BEFORE</strong> other caching rules of other plugins, move them to the bottom manually.","wp-cloudflare-page-cache"),{code:(0,l.createElement)("code",null),strong:(0,l.createElement)("strong",null)})}),(0,l.createElement)(b.A,{type:"info",title:`${(0,d.__)("Read here if you use Nginx","wp-cloudflare-page-cache")}:`,description:(0,E.createInterpolateElement)((0,d.__)("It is not possible for Super Page Cache to automatically change the settings to allow this option to work immediately. For it to work, update these settings and then follow the instructions <button>here</button>.","wp-cloudflare-page-cache"),{button:(0,l.createElement)(v,null)})})))))),xe=()=>{const{isToggleOn:e}=(0,s.C)(),a=[{id:"cf_fallback_cache_curl",type:"toggle",label:(0,d.__)("Use cURL","wp-cloudflare-page-cache"),description:(0,d.__)("Use cURL instead of WordPress advanced-cache.php to generate the Page page. It can increase the time it takes to generate the Page cache but improves compatibility with other performance plugins.","wp-cloudflare-page-cache")},{id:"cf_fallback_cache_ttl",type:"number",min:0,label:`${(0,d.__)("Cache Lifespan","wp-cloudflare-page-cache")} (${(0,d.__)("seconds","wp-cloudflare-page-cache")})`,description:(0,d.__)("Enter 0 for no expiration.","wp-cloudflare-page-cache"),hide:!e("cf_fallback_cache")},{id:"cf_fallback_cache_save_headers",type:"toggle",label:(0,d.__)("Save response headers","wp-cloudflare-page-cache"),description:`${(0,d.__)("Save response headers together with HTML code.","wp-cloudflare-page-cache")} ${(0,d.__)("The following response header will never be saved:","wp-cloudflare-page-cache")}`,hide:!e("cf_fallback_cache"),children:(0,l.createElement)("pre",{className:"text-xs mt-1"},"cache-control, set-cookie, X-WP-CF-Super-Cache*")},{id:"cf_fallback_cache_prevent_cache_urls_without_trailing_slash",type:"toggle",label:(0,d.__)("Prevent to cache URLs without trailing slash","wp-cloudflare-page-cache"),hide:!e("cf_fallback_cache")},{id:"cf_auto_purge_on_comments",type:"toggle",label:(0,d.__)("Auto-Purge Cache on Comment Activity","wp-cloudflare-page-cache"),description:(0,d.__)("Automatically purge single post cache when a new comment is inserted into the database or when a comment is approved or deleted","wp-cloudflare-page-cache")},{id:"cf_auto_purge_on_upgrader_process_complete",type:"toggle",label:(0,d.__)("Auto-purge on Updates","wp-cloudflare-page-cache"),description:(0,d.__)("Automatically purge the cache when the plugin update process is complete","wp-cloudflare-page-cache")},{id:"cf_strip_cookies",type:"toggle",label:(0,d.__)("Strip response cookies","wp-cloudflare-page-cache"),description:(0,d.__)("Cloudflare will not cache when there are cookies in responses unless you strip out them to overwrite the behavior. If the cache does not work due to response cookies and you are sure that these cookies are not essential for the website to works, enable this option.","wp-cloudflare-page-cache")},{id:"cf_cache_control_htaccess",type:"toggle",label:(0,d.__)("Overwrite the cache-control header for WordPress's pages using web server rules","wp-cloudflare-page-cache"),description:(0,l.createElement)(N.A,{variant:"destructive"},(0,d.__)("Writes into .htaccess","wp-cloudflare-page-cache")),children:(0,l.createElement)("div",{className:"grid gap-2 mt-2"},(0,l.createElement)(b.A,{description:(0,d.__)("This option is useful if you use Super Page Cache together with other performance plugins that could affect the Cloudflare cache with their cache-control headers. It works automatically if you are using Apache as web server or as backend web server.","wp-cloudflare-page-cache")}),(0,l.createElement)(ve,null))},{id:"cf_purge_only_html",type:"toggle",label:(0,d.__)("Purge HTML pages only","wp-cloudflare-page-cache"),description:(0,d.__)("Purge only the cached HTML pages instead of the whole cache (assets & pages).","wp-cloudflare-page-cache")},{id:"cf_disable_cache_purging_queue",type:"toggle",label:(0,d.__)("Disable cache purging using queue","wp-cloudflare-page-cache"),description:(0,d.__)("By default this plugin purge the cache after 10 seconds from the purging action, to avoid a high number of purge requests in case of multiple events triggered by third party plugins. This is done using a classic WordPress scheduled event. If you notice any errors regarding the scheduled intervals, you can deactivate this mode by enabling this option.","wp-cloudflare-page-cache")},{id:"advanced_exclude_dynamic_content",type:"checkbox-group",label:(0,d.__)("Don't cache the following dynamic contents:","wp-cloudflare-page-cache"),controls:[{id:"cf_bypass_404",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("404 Page","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_404"))," ")},{id:"cf_bypass_single_post",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Single posts","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_single"))," ")},{id:"cf_bypass_pages",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Pages","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_page"))," ")},{id:"cf_bypass_front_page",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Front Page","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_front_page"))," ")},{id:"cf_bypass_home",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Home","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_home"))," ")},{id:"cf_bypass_archives",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Archives","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_archive"))," ")},{id:"cf_bypass_tags",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Tags","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_tag"))," ")},{id:"cf_bypass_category",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Categories","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_category"))," ")},{id:"cf_bypass_feeds",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Feeds","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_feed"))," ")},{id:"cf_bypass_search_pages",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Search Pages","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_search"))," ")},{id:"cf_bypass_author_pages",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Author Pages","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_author"))," ")},{id:"cf_bypass_amp",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("AMP pages","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_amp"))," ")},{id:"cf_bypass_ajax",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Ajax requests","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_ajax"))," ")},{id:"cf_bypass_query_var",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Pages with query args","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_query_var"))," ")},{id:"cf_bypass_wp_json_rest",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("WP JSON endpoints","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_wp_json_rest"))," ")}]},{id:"advanced_exclude_dynamic_content",type:"checkbox-group",label:(0,d.__)("Don't cache the following static contents:","wp-cloudflare-page-cache"),stack:!0,description:(0,l.createElement)(l.Fragment,null,(0,E.createInterpolateElement)((0,d.__)("<strong>If you use Nginx:</strong> It is recommended to add the browser caching rules that you find in the instructions <button>here</button>.","wp-cloudflare-page-cache"),{strong:(0,l.createElement)("strong",null),button:(0,l.createElement)(v,null)}),(0,l.createElement)("br",null),(0,l.createElement)(N.A,{variant:"destructive",className:"mt-3"},(0,d.__)("Writes into .htaccess","wp-cloudflare-page-cache"))),controls:[{id:"cf_bypass_sitemap",type:"checkbox",label:(0,d.__)("XML sitemaps","wp-cloudflare-page-cache")},{id:"cf_bypass_file_robots",type:"checkbox",label:(0,d.__)("Robots.txt","wp-cloudflare-page-cache")}]},{id:"cf_post_per_page",type:"number",min:1,max:100,label:(0,d.__)("Posts per page","wp-cloudflare-page-cache"),description:(0,d.__)("Enter how many posts per page (or category) the theme shows to your users. It will be use to clean up the pagination on cache purge.","wp-cloudflare-page-cache")}],t=[{id:"cf_browser_caching_htaccess",type:"toggle",label:(0,d.__)("Add browser caching rules for static assets","wp-cloudflare-page-cache"),description:(0,l.createElement)(l.Fragment,null,(0,E.createInterpolateElement)((0,d.__)("<strong>If you use Nginx:</strong> it is not possible for Super Page Cache to automatically change the settings to allow this option to work immediately. For it to work, update these settings and then follow the instructions <button>here</button>."),{button:(0,l.createElement)(v,null),strong:(0,l.createElement)("strong",null)}),(0,l.createElement)("br",null),(0,l.createElement)(N.A,{variant:"destructive",className:"mt-3"},(0,d.__)("Writes into .htaccess","wp-cloudflare-page-cache"))),children:(0,l.createElement)(b.A,{type:"warning",className:"mt-5"},(0,d.__)('If you are using Plesk, make sure you have disabled the options "Smart static files processing" and "Serve static files directly by Nginx" on "Apache & Nginx Settings" page of your Plesk panel or ask your hosting provider to update browser caching rules for you.',"wp-cloudflare-page-cache"))}];return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Cache","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:a}))),(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Browser Caching","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)("div",{className:"p-4"},(0,l.createElement)(b.A,{description:(0,d.__)("This option is useful if you want to use Super Page Cache to enable browser caching rules for assets such like images, CSS, scripts, etc. It works automatically if you use Apache as web server or as backend web server.","wp-cloudflare-page-cache")})),(0,l.createElement)(Ee.A,{controls:t}))))},Ne=()=>{const{settings:e,isToggleOn:a}=(0,s.C)();e.cf_page_rule_id;const t=[{id:"group-cf-behavior",type:"checkbox-group",label:(0,d.__)("Automatically purge the Cloudflare's cache when something changes on the website","wp-cloudflare-page-cache"),stack:!0,description:(0,l.createElement)(l.Fragment,null,(0,d.__)("Example: update/publish a post/page","wp-cloudflare-page-cache"),(0,l.createElement)("br",null),(0,E.createInterpolateElement)((0,d.__)("It is recommended to add the browser caching rules that you find <button>here</button>.","wp-cloudflare-page-cache"),{button:(0,l.createElement)(v,null)})),controls:[{id:"cf_auto_purge",type:"checkbox",label:(0,d.__)("Purge cache for related pages only","wp-cloudflare-page-cache"),recommended:!0},{id:"cf_auto_purge_all",type:"checkbox",label:(0,d.__)("Purge whole cache","wp-cloudflare-page-cache")}]},{id:"cf_fallback_cache_auto_purge",type:"toggle",label:(0,d.__)("Automatically purge the Page cache when Cloudflare cache is purged","wp-cloudflare-page-cache"),hide:!a("cf_fallback_cache")},{id:"cf_bypass_backend_page_rule",type:"toggle",label:(0,d.__)("Force cache bypassing for backend with an additional Cloudflare page rule","wp-cloudflare-page-cache"),description:(0,E.createInterpolateElement)((0,d.__)("<strong>Read here:</strong> by default, all back-end URLs are not cached thanks to some response headers, but if for some circumstances your backend pages are still cached, you can enable this option which will add an <strong>additional page rule on Cloudflare</strong> to force cache bypassing for the whole WordPress backend directly from Cloudflare.","wp-cloudflare-page-cache"),{strong:(0,l.createElement)("strong",null)}),hide:a("cf_woker_enabled")}],c=[{id:"cf_maxage",type:"number",label:(0,d.__)("Cache-Control max-age","wp-cloudflare-page-cache"),description:(0,d.__)("Don't touch if you don't know what is it. Must be greater than zero. Recommended 31536000 (1 year)","wp-cloudflare-page-cache"),min:1,max:31536e4},{id:"cf_browser_maxage",type:"number",label:(0,d.__)("Browser Cache-Control max-age","wp-cloudflare-page-cache"),description:(0,d.__)("Don't touch if you don't know what is it. Must be greater than zero. Recommended a value between 60 and 600","wp-cloudflare-page-cache"),min:1,max:31536e4}];return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Cache Lifetime Settings","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:c}))),(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Cloudflare Cache Behavior","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:t}))))};var ke=t(8068),Ae=t(8309),Ce=t(3160);const Pe=(0,p.A)("trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]),Re=()=>{const{logDownloadURL:e,logViewURL:a}=window.SPCDash,{lockAsync:t,asyncLocked:c}=(0,i.C)(),[o,n]=(0,E.useState)(!1);return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(r.A,{variant:"ghost",target:"_blank",href:e,icon:Ae.A},(0,d.__)("Download Log File","wp-cloudflare-page-cache")),(0,l.createElement)(r.A,{variant:"ghost",target:"_blank",href:a,icon:Ce.A},(0,d.__)("View Log File","wp-cloudflare-page-cache")),(0,l.createElement)(r.A,{variant:"destructive",loader:o,disabled:c,onClick:async()=>{t(!0),n(!0);const e=await ke.R.clearLogs();t(!1),n(!1),e.success?_.oR.success(e.message):_.oR.error(e.message)},icon:Pe},(0,d.__)("Clear logs now","wp-cloudflare-page-cache")))},je=()=>{const{isToggleOn:e}=(0,s.C)(),a=[{id:"log_enabled",type:"toggle",label:(0,d.__)("Log mode","wp-cloudflare-page-cache"),description:(0,d.__)("Enable this option if you want to log all activity of this plugin.","wp-cloudflare-page-cache")},{id:"log_max_file_size",type:"number",label:(0,d.__)("Max log file size in MB","wp-cloudflare-page-cache"),description:(0,d.__)("Automatically reset the log file when it exceeded the max file size. Set 0 to never reset it.","wp-cloudflare-page-cache"),hide:!e("log_enabled")},{id:"log_verbosity",type:"select",label:(0,d.__)("Log verbosity","wp-cloudflare-page-cache"),options:[{value:"1",label:(0,d.__)("Standard","wp-cloudflare-page-cache")},{value:"2",label:(0,d.__)("High","wp-cloudflare-page-cache")}],hide:!e("log_enabled")}];return(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Logs Settings","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:a})),e("log_enabled")&&(0,l.createElement)(k.wL,{className:"md:justify-end grid md:flex gap-4"},(0,l.createElement)(Re,null)))};var Se=t(6284);const Le=({content:e})=>(0,l.createElement)("div",{className:"flex mt-5"},(0,l.createElement)(Se.p,{className:"rounded-r-none border-r-0 grow h-auto",disabled:!0,value:null!=e?e:""}),(0,l.createElement)(r.A,{icon:g.A,onClick:()=>{navigator.clipboard.writeText(e),_.oR.success((0,d.__)("Copied to clipboard!","wp-cloudflare-page-cache"))},className:"rounded-l-none",size:"icon"},(0,l.createElement)("span",{className:"sr-only"},(0,d.__)("Copy to clipboard","wp-cloudflare-page-cache"))));var Ie=t(3040);const ze=()=>{const{wordpressRoles:e}=window.SPCDash,{settings:a,updateSetting:t}=(0,s.C)(),{asyncLocked:c}=(0,i.C)();return(0,l.createElement)("div",{className:"grid gap-3 mt-5 md:grid-cols-2 lg:grid-cols-1 xl:grid-cols-2 w-full"},Object.entries(e).map((([e,r],o)=>(0,l.createElement)("div",{key:`${e}-${o}`,className:"grid gap-3"},0!==o&&1!==o&&(0,l.createElement)(f.A,null),(0,l.createElement)("div",{className:"flex items-center gap-2"},(0,l.createElement)(Ie.A,{value:a.cf_purge_roles.includes(e)||!1,id:e,label:r,onChange:l=>((e,l)=>{let c=[...a.cf_purge_roles||[]];l?c.push(e):c=c.filter((a=>a!=e)),t("cf_purge_roles",c)})(e,l),disabled:c}))))))},Te=()=>{const{settings:e}=(0,s.C)(),{cronjobPurgeURL:a}=window.SPCDash,t=a.replace("replace:cf_purge_url_secret_key",e.cf_purge_url_secret_key||""),c=[{id:"cf_opcache_purge_on_flush",type:"toggle",label:(0,d.__)("Automatically purge the OPcache cache is purged","wp-cloudflare-page-cache")},{id:"cf_object_cache_purge_on_flush",type:"toggle",label:(0,d.__)("Automatically purge the object cache when cache is purged","wp-cloudflare-page-cache")},{id:"cronjob_purge_url",type:"custom",label:(0,d.__)("Purge the whole cache via Cronjob","wp-cloudflare-page-cache"),description:(0,d.__)("If you want purge the whole cache at specific intervals decided by you, you can create a cronjob that hits the following URL:","wp-cloudflare-page-cache"),component:(0,l.createElement)(Le,{content:t})},{id:"cf_purge_url_secret_key",type:"text",label:(0,d.__)("Purge cache URL secret key","wp-cloudflare-page-cache"),description:(0,d.__)("Secret key to use to purge the whole Cloudflare cache via URL. Don't touch if you don't know how to use it.","wp-cloudflare-page-cache")},{id:"cf_remove_purge_option_toolbar",type:"toggle",label:(0,d.__)("Remove purge option from toolbar","wp-cloudflare-page-cache")},{id:"cf_disable_single_metabox",type:"toggle",label:(0,d.__)("\tHide Metaboxes","wp-cloudflare-page-cache"),description:(0,d.__)("Disable the metaboxes on single pages and posts to avoid conflicts with other plugins.","wp-cloudflare-page-cache")},{id:"cf_seo_redirect",type:"toggle",label:(0,d.__)("SEO redirect","wp-cloudflare-page-cache"),description:(0,d.__)("Enable this option if you want to redirect the user to the correct page when the page is not found.","wp-cloudflare-page-cache")},{id:"purge_roles_custom",label:(0,d.__)("Select user roles allowed to purge the cache","wp-cloudflare-page-cache"),description:(0,d.__)("Admins are always allowed.","wp-cloudflare-page-cache"),type:"custom",component:(0,l.createElement)(ze,null)},{id:"cf_prefetch_urls_viewport",type:"toggle",label:(0,d.__)("Auto prefetch URLs in viewport","wp-cloudflare-page-cache"),description:(0,d.__)("If enabled, the browser prefetches in background all the internal URLs found in the viewport.","wp-cloudflare-page-cache")},{id:"cf_prefetch_urls_on_hover",type:"toggle",label:(0,d.__)("Auto prefetch URLs on mouse hover","wp-cloudflare-page-cache"),description:(0,d.__)("If enabled, the browser prefetches in background all the internal URLs found in the viewport.","wp-cloudflare-page-cache")},{type:"toggle",id:"cf_remove_cache_buster",label:(0,d.__)("Remove Cache Buster Query Parameter","wp-cloudflare-page-cache"),description:(0,d.__)("Stop adding cache buster query parameter when using the default page rule mode.","wp-cloudflare-page-cache"),hide:window.SPCDash.settings?.cf_remove_cache_buster||1},{type:"toggle",id:"keep_settings_on_deactivation",label:(0,d.__)("Keep settings on deactivation","wp-cloudflare-page-cache"),description:(0,d.__)("Keep settings on plugin deactivation.","wp-cloudflare-page-cache")}];return(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Other Settings","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:c})))},Ue=()=>{const[e,a]=(0,E.useState)(!1),{asyncLocked:t,lockAsync:c}=(0,i.C)();return(0,l.createElement)(r.A,{variant:"orange",onClick:async()=>{c(!0),a(!0);const e=await ke.R.startPreloader();c(!1),a(!1),e.success?_.oR.success(e.message):_.oR.error(e.message)},disabled:e||t,loader:e},e?(0,d.__)("Starting Preloader","wp-cloudflare-page-cache")+"...":(0,d.__)("Start Preloader","wp-cloudflare-page-cache"))},Oe=()=>{const{wordpressMenus:e}=window.SPCDash,{settings:a,isToggleOn:t,updateSetting:c}=(0,s.C)(),{asyncLocked:r}=(0,i.C)(),o=a.cf_preloader_nav_menus||[];return(0,l.createElement)("div",{className:"grid gap-3 mt-5"},Object.entries(e).map((([e,t],n)=>[0!==n&&(0,l.createElement)(f.A,{key:`separator-${e}`}),(0,l.createElement)("div",{className:"flex items-center gap-2",key:e},(0,l.createElement)(Ie.A,{value:a.cf_preloader_nav_menus.includes(e)||!1,id:e,label:(0,l.createElement)("span",null," ",(0,E.createInterpolateElement)(/* translators: %s is the menu name */ /* translators: %s is the menu name */(0,d.sprintf)((0,d.__)("Preload all internal links in <strong>%s</strong> WP Menu","wp-cloudflare-page-cache"),t),{strong:(0,l.createElement)("strong",{className:"font-bold opacity-75"})})),onChange:a=>((e,a)=>{let t=[...o];a?t.push(e):t=t.filter((a=>a!=e)),c("cf_preloader_nav_menus",t)})(e,a),disabled:r}))])),Object.keys(e).length>0&&(0,l.createElement)(f.A,null),(0,l.createElement)("div",{className:"flex items-center gap-2"},(0,l.createElement)(Ie.A,{value:t("cf_preload_last_urls"),id:"cf_preload_last_urls",label:(0,d.__)("Preload last 20 published/updated posts, pages & CPTs combined","wp-cloudflare-page-cache"),disabled:r,onChange:e=>{c("cf_preload_last_urls",e?1:0)}})))},De=()=>{const{settings:e,isToggleOn:a}=(0,s.C)(),{cronjobURL:t}=window.SPCDash,c=t.replace("replace:cf_preloader_url_secret_key",e.cf_preloader_url_secret_key||""),r=[{id:"cf_preloader",type:"toggle",label:(0,d.__)("Enable preloader","wp-cloudflare-page-cache")},{id:"cf_preloader_start_on_purge",type:"toggle",label:(0,d.__)("Automatically preload the pages you have purged from cache.","wp-cloudflare-page-cache"),hide:!a("cf_preloader")},{id:"preloader-custom-operation",type:"custom",label:(0,d.__)("Preloader operation","wp-cloudflare-page-cache"),description:(0,d.__)("Choose the URLs preloading logic that the preloader must use. If no option is chosen, the most recently published URLs and the home page will be preloaded.","wp-cloudflare-page-cache"),component:(0,l.createElement)(Oe,null),hide:!a("cf_preloader")},{id:"cf_preload_sitemap_urls",type:"textarea",label:(0,d.__)("Preload all URLs into the following sitemaps","wp-cloudflare-page-cache"),description:(0,l.createElement)(l.Fragment,null,(0,d.__)("One sitemap per line.","wp-cloudflare-page-cache"),(0,l.createElement)("br",null),(0,l.createElement)("br",null),(0,d.__)("Example","wp-cloudflare-page-cache")+":",(0,l.createElement)("br",null),(0,l.createElement)("pre",null,"/post-sitemap.xml",(0,l.createElement)("br",null),"/page-sitemap.xml",(0,l.createElement)("br",null))),hide:!a("cf_preloader")},{id:"preloader_cronjob_info",type:"custom",label:(0,d.__)("Start the preloader via Cronjob","wp-cloudflare-page-cache"),description:(0,d.__)("If you want start the preloader at specific intervals decided by you, you can create a cronjob that hits the following URL:","wp-cloudflare-page-cache"),component:(0,l.createElement)(Le,{content:c}),hide:!a("cf_preloader")},{id:"cf_preloader_url_secret_key",type:"text",label:(0,d.__)("Cronjob secret key","wp-cloudflare-page-cache"),description:(0,d.__)("Secret key to use to start the preloader via URL. Don't touch if you don't know how to use it.","wp-cloudflare-page-cache"),hide:!a("cf_preloader")}];return(0,l.createElement)(k.Ay,{className:(0,n.cn)({"pb-0":a("cf_preloader")})},(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Preloader","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:r})),a("cf_preloader")&&(0,l.createElement)(k.wL,{className:"flex justify-end"},(0,l.createElement)(Ue,null)))},Fe=()=>{const{i18n:e}=window.SPCDash,{asyncLocked:a,lockAsync:t}=(0,i.C)(),[c,o]=(0,E.useState)(!1);return(0,l.createElement)(r.A,{variant:"destructive",onClick:async()=>{t(!0),o(!0);const a=await ke.R.purgeCacheVarnish();t(!1),o(!1),a.success?_.oR.success(a.message):_.oR.error(a.message||e.genericError)},loader:c,disabled:c||a,className:"flex items-center gap-2"},c?(0,d.__)("Purging Varnish Cache","wp-cloudflare-page-cache")+"...":(0,d.__)("Purge Varnish Cache","wp-cloudflare-page-cache"))},Me=()=>{const{isToggleOn:e}=(0,s.C)(),a=[{id:"cf_varnish_support",type:"toggle",label:(0,d.__)("Varnish Support","wp-cloudflare-page-cache")},{id:"cf_varnish_hostname",type:"text",label:(0,d.__)("Hostname","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")},{id:"cf_varnish_port",type:"number",label:(0,d.__)("Port","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support"),min:0,max:65535},{id:"cf_varnish_purge_method",type:"text",label:(0,d.__)("HTTP method for single page cache purge","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")},{id:"cf_varnish_purge_all_method",type:"text",label:(0,d.__)("HTTP method for whole page cache purge","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")},{id:"cf_varnish_cw",type:"text",label:(0,d.__)("Cloudways Varnish","wp-cloudflare-page-cache"),description:(0,d.__)("Enable this option if you are using Varnish on Cloudways.","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")},{id:"cf_varnish_auto_purge",type:"toggle",label:(0,d.__)("Automatically purge Varnish cache when the cache is purged.","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")}];return(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Varnish Settings","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:a})),e("cf_varnish_support")&&(0,l.createElement)(k.wL,{className:"flex justify-end"},(0,l.createElement)(Fe,null)))},We=()=>(0,l.createElement)(c.A,null,(0,l.createElement)(xe,null),(0,l.createElement)(Ne,null),(0,l.createElement)(De,null),(0,l.createElement)(Me,null),(0,l.createElement)(je,null),(0,l.createElement)(Te,null))},7158:(e,a,t)=>{t.d(a,{A:()=>p});var l=t(1609),c=t(7213),r=t(6674),o=t(2748);function n({delayDuration:e=0,...a}){return(0,l.createElement)(r.Kq,{"data-slot":"tooltip-provider",delayDuration:e,...a})}function s({...e}){return(0,l.createElement)(n,null,(0,l.createElement)(r.bL,{"data-slot":"tooltip",...e}))}function i({...e}){return(0,l.createElement)(r.l9,{"data-slot":"tooltip-trigger",...e})}function d({className:e,sideOffset:a=0,children:t,...c}){return(0,l.createElement)(r.ZL,null,(0,l.createElement)(r.UC,{"data-slot":"tooltip-content",sideOffset:a,className:(0,o.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...c},t,(0,l.createElement)(r.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})))}const p=({children:e,className:a="",icon:t=null,text:r=""})=>{if(!e)return null;const n=t||c.A;return(0,l.createElement)(s,null,(0,l.createElement)(i,null,(0,l.createElement)(n,{size:16,className:(0,o.cn)("text-muted-foreground ml-1",a)}),r&&(0,l.createElement)("span",{className:"sr-only"},r)),(0,l.createElement)(d,null,e))}}}]);1 "use strict";(globalThis.webpackChunkwp_cloudflare_page_cache=globalThis.webpackChunkwp_cloudflare_page_cache||[]).push([[154],{341:(e,a,t)=>{t.d(a,{BE:()=>u,Uz:()=>n,_s:()=>o,cp:()=>i,gk:()=>m,uT:()=>s,zj:()=>p});var l=t(1609),c=t(7248),r=t(2748);function o({...e}){return(0,l.createElement)(c._s.Root,{"data-slot":"drawer",...e})}function n({...e}){return(0,l.createElement)(c._s.Trigger,{"data-slot":"drawer-trigger",...e})}function s({...e}){return(0,l.createElement)(c._s.Portal,{"data-slot":"drawer-portal",...e})}function i({...e}){return(0,l.createElement)(c._s.Close,{"data-slot":"drawer-close",...e})}function d({className:e,...a}){return(0,l.createElement)(c._s.Overlay,{"data-slot":"drawer-overlay",className:(0,r.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[9999] bg-black/50",e),...a})}function p({className:e,children:a,...t}){return(0,l.createElement)(s,{"data-slot":"drawer-portal"},(0,l.createElement)(d,null),(0,l.createElement)(c._s.Content,{"data-slot":"drawer-content",className:(0,r.cn)("group/drawer-content bg-background fixed z-[10000] isolate flex flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...t},a))}function u({className:e,...a}){return(0,l.createElement)("div",{"data-slot":"drawer-header",className:(0,r.cn)("flex flex-col gap-1.5 p-3",e),...a})}function m({className:e,...a}){return(0,l.createElement)(c._s.Title,{"data-slot":"drawer-title",className:(0,r.cn)("text-foreground font-semibold",e),...a})}},1747:(e,a,t)=>{t.d(a,{F:()=>o});var l=t(1609),c=t(4674),r=t(2748);function o({className:e,children:a,...t}){return(0,l.createElement)(c.bL,{"data-slot":"scroll-area",className:(0,r.cn)("relative",e),...t},(0,l.createElement)(c.LM,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"},a),(0,l.createElement)(n,null),(0,l.createElement)(c.OK,null))}function n({className:e,orientation:a="vertical",...t}){return(0,l.createElement)(c.VM,{"data-slot":"scroll-area-scrollbar",orientation:a,className:(0,r.cn)("flex touch-none p-px transition-colors select-none","vertical"===a&&"h-full w-2.5 border-l border-l-transparent","horizontal"===a&&"h-2.5 flex-col border-t border-t-transparent",e),...t},(0,l.createElement)(c.lr,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"}))}},2154:(e,a,t)=>{t.r(a),t.d(a,{default:()=>We});var l=t(1609),c=t(3781),r=t(5975),o=t(341),n=t(2748),s=t(4585),i=t(4758),d=t(7723),p=t(9407);const u=(0,p.A)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);var m=t(8697),h=t(827),_=t(5404),g=t(4721),f=t(7102),b=t(9391),w=t(1747),y=t(504),E=t(6087);const v=()=>{const{darkMode:e}=(0,i.C)(),{isToggleOn:a,settings:t}=(0,s.C)(),{i18n:c}=window.SPCDash,p=e=>{navigator.clipboard.writeText(e),g.oR.success((0,d.__)("Copied to clipboard!","wp-cloudflare-page-cache"))},v=(0,d.sprintf)("map $upstream_http_x_wp_cf_super_cache_active $wp_cf_super_cache_active {\n default 'no-cache, no-store, must-revalidate, max-age=0';\n '1' 's-maxage=%s, max-age=%s';\n}",t.cf_maxage,t.cf_browser_maxage),x="more_clear_headers 'Pragma';\nmore_clear_headers 'Expires';\nmore_clear_headers 'Cache-Control';\nadd_header Cache-Control $wp_cf_super_cache_active;";let N="";return a("cf_bypass_sitemap")&&(N+='location ~* \\.(xml|xsl)$ { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; }\n'),a("cf_bypass_file_robots")&&(N+='location /robots.txt { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; }\n'),a("cf_browser_caching_htaccess")&&(N+='location ~* \\.(css|js|pdf)$ { add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=2592000, stale-while-revalidate=86400, stale-if-error=604800"; expires 30d; }\n',N+='location ~* \\.(jpg|jpeg|png|gif|ico|eot|swf|svg|webp|avif|ttf|otf|woff|woff2|ogg|mp4|mpeg|avi|mkv|webm|mp3)$ { add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=31536000, stale-while-revalidate=86400, stale-if-error=604800"; expires 365d; }\n'),N+='location /wp-cron.php { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; }\n',(0,l.createElement)(o._s,null,(0,l.createElement)(o.Uz,{className:"underline text-current cursor-pointer"},(0,d.__)("here","wp-cloudflare-page-cache")),(0,l.createElement)(o.uT,null,(0,l.createElement)(o.zj,{className:(0,n.cn)("overflow-hidden",{dark:e})},(0,l.createElement)(o.BE,{className:"border-b border-border bg-muted"},(0,l.createElement)(y.A,{className:"text-left flex items-center justify-between w-full"},(0,l.createElement)(o.gk,null,(0,l.createElement)("h2",{className:"flex items-center text-lg mb-0"},(0,l.createElement)(u,{className:"size-6 text-orange-500 mr-3"}),(0,d.__)("Nginx Instructions","wp-cloudflare-page-cache"))),(0,l.createElement)(o.cp,null,(0,l.createElement)(r.A,{variant:"ghost",size:"icon",icon:m.A},(0,l.createElement)("span",{className:"sr-only"},c.close))))),(0,l.createElement)(w.F,{className:"overflow-auto max-w-full max-h-[80vh] py-5"},(0,l.createElement)(y.A,{className:"py-0"},a("cf_cache_control_htaccess")&&(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",{className:"flex items-center mb-3"},(0,l.createElement)(h.A,{className:"size-5 mr-2 text-blue-500"}),(0,l.createElement)("h3",{className:"text-base"},(0,d.__)("Overwrite the cache-control header","wp-cloudflare-page-cache"))),(0,l.createElement)("div",{className:"space-y-4"},(0,l.createElement)("p",{className:"text-sm mb-2 text-muted-foreground"},(0,E.createInterpolateElement)((0,d.__)("Edit the main Nginx configuration file, usually <code>/etc/nginx.conf</code>, and enter these rules immediately after opening the http block:","wp-cloudflare-page-cache"),{code:(0,l.createElement)("code",{className:"px-2 py-1 rounded bg-muted font-mono"},"/etc/nginx.conf")})),(0,l.createElement)("div",{className:"relative"},(0,l.createElement)(r.A,{variant:"default",size:"icon",onClick:()=>p(v),icon:_.A,className:"absolute top-2 right-2 z-10"},(0,l.createElement)("span",{className:"sr-only"},(0,d.__)("Copy to clipboard","wp-cloudflare-page-cache"))),(0,l.createElement)("pre",{className:"text-muted-foreground bg-muted border border-border break-all p-4 rounded-2xl overflow-x-auto text-sm whitespace-pre-wrap"},v)),(0,l.createElement)("div",null,(0,l.createElement)("p",{className:"text-sm mb-2 text-muted-foreground"},(0,d.__)("Now open the configuration file of your domain and add the following rules inside the block that deals with the management of PHP pages:","wp-cloudflare-page-cache")),(0,l.createElement)("div",{className:"relative"},(0,l.createElement)(r.A,{variant:"default",size:"icon",onClick:()=>p(x),className:"absolute top-2 right-2 z-10",icon:_.A},(0,l.createElement)("span",{className:"sr-only"},(0,d.__)("Copy to clipboard","wp-cloudflare-page-cache"))),(0,l.createElement)("pre",{className:"text-muted-foreground bg-muted border border-border p-4 rounded-2xl overflow-y-auto text-sm whitespace-pre-wrap"},x)))),(0,l.createElement)(f.A,{className:"my-5"})),(0,l.createElement)("div",{className:"flex items-center mb-3"},(0,l.createElement)(h.A,{className:"size-5 mr-2 text-blue-500"}),(0,l.createElement)("h3",{className:"text-base"},(0,d.__)("Browser caching rules","wp-cloudflare-page-cache"))),(0,l.createElement)("div",{className:"space-y-4"},(0,l.createElement)("div",null,(0,l.createElement)("p",{className:"text-sm mb-2 text-muted-foreground"},(0,d.__)("Open the configuration file of your domain and add the following rules:","wp-cloudflare-page-cache")),(0,l.createElement)("div",{className:"relative"},(0,l.createElement)(r.A,{variant:"default",size:"icon",onClick:()=>p(N),className:"absolute top-2 right-2 z-10",icon:_.A},(0,l.createElement)("span",{className:"sr-only"},(0,d.__)("Copy to clipboard","wp-cloudflare-page-cache"))),(0,l.createElement)("pre",{className:"text-muted-foreground bg-muted border border-border p-4 rounded-2xl overflow-y-auto text-sm whitespace-pre-wrap"},N)))),(0,l.createElement)(b.A,{type:"info",className:"my-5",title:(0,d.__)("Save and restart Nginx.","wp-cloudflare-page-cache")}))))))};var x=t(7158),N=t(2318),k=t(5181),A=t(2133),C=t(6214),P=t(1071),R=t(9957),j=t(1351),S=t(2579),L=t(8834),I=t(1104),z=t(1427),T=t(4848),U="Accordion",O=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[D,F,M]=(0,C.N)(U),[W,V]=(0,A.A)(U,[M,L.z3]),H=(0,L.z3)(),$=l.forwardRef(((e,a)=>{const{type:t,...l}=e,c=l,r=l;return(0,T.jsx)(D.Provider,{scope:e.__scopeAccordion,children:"multiple"===t?(0,T.jsx)(J,{...r,ref:a}):(0,T.jsx)(G,{...c,ref:a})})}));$.displayName=U;var[q,B]=W(U),[K,X]=W(U,{collapsible:!1}),G=l.forwardRef(((e,a)=>{const{value:t,defaultValue:c,onValueChange:r=()=>{},collapsible:o=!1,...n}=e,[s,i]=(0,j.i)({prop:t,defaultProp:c??"",onChange:r,caller:U});return(0,T.jsx)(q,{scope:e.__scopeAccordion,value:l.useMemo((()=>s?[s]:[]),[s]),onItemOpen:i,onItemClose:l.useCallback((()=>o&&i("")),[o,i]),children:(0,T.jsx)(K,{scope:e.__scopeAccordion,collapsible:o,children:(0,T.jsx)(Y,{...n,ref:a})})})})),J=l.forwardRef(((e,a)=>{const{value:t,defaultValue:c,onValueChange:r=()=>{},...o}=e,[n,s]=(0,j.i)({prop:t,defaultProp:c??[],onChange:r,caller:U}),i=l.useCallback((e=>s(((a=[])=>[...a,e]))),[s]),d=l.useCallback((e=>s(((a=[])=>a.filter((a=>a!==e))))),[s]);return(0,T.jsx)(q,{scope:e.__scopeAccordion,value:n,onItemOpen:i,onItemClose:d,children:(0,T.jsx)(K,{scope:e.__scopeAccordion,collapsible:!0,children:(0,T.jsx)(Y,{...o,ref:a})})})})),[Q,Z]=W(U),Y=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,disabled:c,dir:r,orientation:o="vertical",...n}=e,s=l.useRef(null),i=(0,P.s)(s,a),d=F(t),p="ltr"===(0,z.jH)(r),u=(0,R.m)(e.onKeyDown,(e=>{if(!O.includes(e.key))return;const a=e.target,t=d().filter((e=>!e.ref.current?.disabled)),l=t.findIndex((e=>e.ref.current===a)),c=t.length;if(-1===l)return;e.preventDefault();let r=l;const n=c-1,s=()=>{r=l+1,r>n&&(r=0)},i=()=>{r=l-1,r<0&&(r=n)};switch(e.key){case"Home":r=0;break;case"End":r=n;break;case"ArrowRight":"horizontal"===o&&(p?s():i());break;case"ArrowDown":"vertical"===o&&s();break;case"ArrowLeft":"horizontal"===o&&(p?i():s());break;case"ArrowUp":"vertical"===o&&i()}const u=r%c;t[u].ref.current?.focus()}));return(0,T.jsx)(Q,{scope:t,disabled:c,direction:r,orientation:o,children:(0,T.jsx)(D.Slot,{scope:t,children:(0,T.jsx)(S.sG.div,{...n,"data-orientation":o,ref:i,onKeyDown:c?void 0:u})})})})),ee="AccordionItem",[ae,te]=W(ee),le=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,value:l,...c}=e,r=Z(ee,t),o=B(ee,t),n=H(t),s=(0,I.B)(),i=l&&o.value.includes(l)||!1,d=r.disabled||e.disabled;return(0,T.jsx)(ae,{scope:t,open:i,disabled:d,triggerId:s,children:(0,T.jsx)(L.bL,{"data-orientation":r.orientation,"data-state":de(i),...n,...c,ref:a,disabled:d,open:i,onOpenChange:e=>{e?o.onItemOpen(l):o.onItemClose(l)}})})}));le.displayName=ee;var ce="AccordionHeader",re=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,...l}=e,c=Z(U,t),r=te(ce,t);return(0,T.jsx)(S.sG.h3,{"data-orientation":c.orientation,"data-state":de(r.open),"data-disabled":r.disabled?"":void 0,...l,ref:a})}));re.displayName=ce;var oe="AccordionTrigger",ne=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,...l}=e,c=Z(U,t),r=te(oe,t),o=X(oe,t),n=H(t);return(0,T.jsx)(D.ItemSlot,{scope:t,children:(0,T.jsx)(L.l9,{"aria-disabled":r.open&&!o.collapsible||void 0,"data-orientation":c.orientation,id:r.triggerId,...n,...l,ref:a})})}));ne.displayName=oe;var se="AccordionContent",ie=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,...l}=e,c=Z(U,t),r=te(se,t),o=H(t);return(0,T.jsx)(L.UC,{role:"region","aria-labelledby":r.triggerId,"data-orientation":c.orientation,...o,...l,ref:a,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})}));function de(e){return e?"open":"closed"}ie.displayName=se;var pe=$,ue=le,me=re,he=ne,_e=ie;const ge=(0,p.A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);function fe({...e}){return(0,l.createElement)(pe,{"data-slot":"accordion",...e})}function be({className:e,...a}){return(0,l.createElement)(ue,{"data-slot":"accordion-item",className:e,...a})}function we({className:e,children:a,...t}){return(0,l.createElement)(me,{className:"flex",as:"p"},(0,l.createElement)(he,{"data-slot":"accordion-trigger",className:(0,n.cn)("cursor-pointer focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-center justify-between gap-4 py-2 text-left text-sm w-full font-medium transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),...t},a,(0,l.createElement)(ge,{className:"ml-auto text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})))}function ye({className:e,children:a,...t}){return(0,l.createElement)(_e,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...t},(0,l.createElement)("div",{className:(0,n.cn)("py-4",e)},a))}var Ee=t(3327);const ve=()=>(0,l.createElement)("div",{className:"grid gap-1"},(0,l.createElement)(fe,{type:"single",collapsible:!0,className:"rounded-sm border overflow-hidden"},(0,l.createElement)(be,{value:"htaccess"},(0,l.createElement)(we,{className:"!m-0 bg-muted px-4 py-3 !text-sm"},(0,d.__)("Additional info","wp-cloudflare-page-cache")),(0,l.createElement)(ye,{className:"p-4 bg-muted/20"},(0,l.createElement)(b.A,{type:"warning",title:(0,d.__)("Important Notes","wp-cloudflare-page-cache"),description:(0,E.createInterpolateElement)((0,d.__)("This option is not essential as in most cases this plugin works out of the box. If the page cache does not work after a considerable number of attempts or you see that max-age and s-maxage values of <code>X-WP-CF-Super-Cache-Cache-Control</code> response header are not the same of the ones in <code>Cache-Control</code> response header, activate this option.","wp-cloudflare-page-cache"),{code:(0,l.createElement)("code",null)})}),(0,l.createElement)("div",{className:"grid lg:grid-cols-2 gap-4 mt-4"},(0,l.createElement)(b.A,{type:"success",title:`${(0,d.__)("Read here if you use Apache","wp-cloudflare-page-cache")} (.htaccess):`,description:(0,E.createInterpolateElement)((0,d.__)("For overwriting to work, make sure that the rules added by Super Page Cache are placed at the bottom of the <code>.htaccess</code> file. If they are present <strong>BEFORE</strong> other caching rules of other plugins, move them to the bottom manually.","wp-cloudflare-page-cache"),{code:(0,l.createElement)("code",null),strong:(0,l.createElement)("strong",null)})}),(0,l.createElement)(b.A,{type:"info",title:`${(0,d.__)("Read here if you use Nginx","wp-cloudflare-page-cache")}:`,description:(0,E.createInterpolateElement)((0,d.__)("It is not possible for Super Page Cache to automatically change the settings to allow this option to work immediately. For it to work, update these settings and then follow the instructions <button>here</button>.","wp-cloudflare-page-cache"),{button:(0,l.createElement)(v,null)})})))))),xe=()=>{const{isToggleOn:e}=(0,s.C)(),a=[{id:"cf_fallback_cache_curl",type:"toggle",label:(0,d.__)("Use cURL","wp-cloudflare-page-cache"),description:(0,d.__)("Use cURL instead of WordPress advanced-cache.php to generate the Page page. It can increase the time it takes to generate the Page cache but improves compatibility with other performance plugins.","wp-cloudflare-page-cache")},{id:"cf_fallback_cache_ttl",type:"number",min:0,label:`${(0,d.__)("Cache Lifespan","wp-cloudflare-page-cache")} (${(0,d.__)("seconds","wp-cloudflare-page-cache")})`,description:(0,d.__)("Enter 0 for no expiration.","wp-cloudflare-page-cache"),hide:!e("cf_fallback_cache")},{id:"cf_fallback_cache_save_headers",type:"toggle",label:(0,d.__)("Save response headers","wp-cloudflare-page-cache"),description:`${(0,d.__)("Save response headers together with HTML code.","wp-cloudflare-page-cache")} ${(0,d.__)("The following response header will never be saved:","wp-cloudflare-page-cache")}`,hide:!e("cf_fallback_cache"),children:(0,l.createElement)("pre",{className:"text-xs mt-1"},"cache-control, set-cookie, X-WP-CF-Super-Cache*")},{id:"cf_fallback_cache_http_response_code",type:"toggle",label:(0,d.__)("Don't cache 4xx / 5xx responses","wp-cloudflare-page-cache"),description:(0,d.__)("Exclude 4xx and 5xx HTTP error responses from being cached.","wp-cloudflare-page-cache"),hide:!e("cf_fallback_cache")},{id:"cf_fallback_cache_prevent_cache_urls_without_trailing_slash",type:"toggle",label:(0,d.__)("Prevent to cache URLs without trailing slash","wp-cloudflare-page-cache"),hide:!e("cf_fallback_cache")},{id:"cf_auto_purge_on_comments",type:"toggle",label:(0,d.__)("Auto-Purge Cache on Comment Activity","wp-cloudflare-page-cache"),description:(0,d.__)("Automatically purge single post cache when a new comment is inserted into the database or when a comment is approved or deleted","wp-cloudflare-page-cache")},{id:"cf_auto_purge_on_upgrader_process_complete",type:"toggle",label:(0,d.__)("Auto-purge on Updates","wp-cloudflare-page-cache"),description:(0,d.__)("Automatically purge the cache when the plugin update process is complete","wp-cloudflare-page-cache")},{id:"cf_strip_cookies",type:"toggle",label:(0,d.__)("Strip response cookies","wp-cloudflare-page-cache"),description:(0,d.__)("Cloudflare will not cache when there are cookies in responses unless you strip out them to overwrite the behavior. If the cache does not work due to response cookies and you are sure that these cookies are not essential for the website to works, enable this option.","wp-cloudflare-page-cache")},{id:"cf_cache_control_htaccess",type:"toggle",label:(0,d.__)("Overwrite the cache-control header for WordPress's pages using web server rules","wp-cloudflare-page-cache"),description:(0,l.createElement)(N.A,{variant:"destructive"},(0,d.__)("Writes into .htaccess","wp-cloudflare-page-cache")),children:(0,l.createElement)("div",{className:"grid gap-2 mt-2"},(0,l.createElement)(b.A,{description:(0,d.__)("This option is useful if you use Super Page Cache together with other performance plugins that could affect the Cloudflare cache with their cache-control headers. It works automatically if you are using Apache as web server or as backend web server.","wp-cloudflare-page-cache")}),(0,l.createElement)(ve,null))},{id:"cf_purge_only_html",type:"toggle",label:(0,d.__)("Purge HTML pages only","wp-cloudflare-page-cache"),description:(0,d.__)("Purge only the cached HTML pages instead of the whole cache (assets & pages).","wp-cloudflare-page-cache")},{id:"cf_disable_cache_purging_queue",type:"toggle",label:(0,d.__)("Disable cache purging using queue","wp-cloudflare-page-cache"),description:(0,d.__)("By default this plugin purge the cache after 10 seconds from the purging action, to avoid a high number of purge requests in case of multiple events triggered by third party plugins. This is done using a classic WordPress scheduled event. If you notice any errors regarding the scheduled intervals, you can deactivate this mode by enabling this option.","wp-cloudflare-page-cache")},{id:"advanced_exclude_dynamic_content",type:"checkbox-group",label:(0,d.__)("Don't cache the following dynamic contents:","wp-cloudflare-page-cache"),controls:[{id:"cf_bypass_404",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("404 Page","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_404"))," ")},{id:"cf_bypass_single_post",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Single posts","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_single"))," ")},{id:"cf_bypass_pages",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Pages","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_page"))," ")},{id:"cf_bypass_front_page",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Front Page","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_front_page"))," ")},{id:"cf_bypass_home",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Home","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_home"))," ")},{id:"cf_bypass_archives",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Archives","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_archive"))," ")},{id:"cf_bypass_tags",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Tags","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_tag"))," ")},{id:"cf_bypass_category",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Categories","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_category"))," ")},{id:"cf_bypass_feeds",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Feeds","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_feed"))," ")},{id:"cf_bypass_search_pages",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Search Pages","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_search"))," ")},{id:"cf_bypass_author_pages",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Author Pages","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_author"))," ")},{id:"cf_bypass_amp",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("AMP pages","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_amp"))," ")},{id:"cf_bypass_ajax",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Ajax requests","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_ajax"))," ")},{id:"cf_bypass_query_var",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Pages with query args","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_query_var"))," ")},{id:"cf_bypass_wp_json_rest",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("WP JSON endpoints","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_wp_json_rest"))," ")}]},{id:"advanced_exclude_dynamic_content",type:"checkbox-group",label:(0,d.__)("Don't cache the following static contents:","wp-cloudflare-page-cache"),stack:!0,description:(0,l.createElement)(l.Fragment,null,(0,E.createInterpolateElement)((0,d.__)("<strong>If you use Nginx:</strong> It is recommended to add the browser caching rules that you find in the instructions <button>here</button>.","wp-cloudflare-page-cache"),{strong:(0,l.createElement)("strong",null),button:(0,l.createElement)(v,null)}),(0,l.createElement)("br",null),(0,l.createElement)(N.A,{variant:"destructive",className:"mt-3"},(0,d.__)("Writes into .htaccess","wp-cloudflare-page-cache"))),controls:[{id:"cf_bypass_sitemap",type:"checkbox",label:(0,d.__)("XML sitemaps","wp-cloudflare-page-cache")},{id:"cf_bypass_file_robots",type:"checkbox",label:(0,d.__)("Robots.txt","wp-cloudflare-page-cache")}]},{id:"cf_post_per_page",type:"number",min:1,max:100,label:(0,d.__)("Posts per page","wp-cloudflare-page-cache"),description:(0,d.__)("Enter how many posts per page (or category) the theme shows to your users. It will be use to clean up the pagination on cache purge.","wp-cloudflare-page-cache")}],t=[{id:"cf_browser_caching_htaccess",type:"toggle",label:(0,d.__)("Add browser caching rules for static assets","wp-cloudflare-page-cache"),description:(0,l.createElement)(l.Fragment,null,(0,E.createInterpolateElement)((0,d.__)("<strong>If you use Nginx:</strong> it is not possible for Super Page Cache to automatically change the settings to allow this option to work immediately. For it to work, update these settings and then follow the instructions <button>here</button>."),{button:(0,l.createElement)(v,null),strong:(0,l.createElement)("strong",null)}),(0,l.createElement)("br",null),(0,l.createElement)(N.A,{variant:"destructive",className:"mt-3"},(0,d.__)("Writes into .htaccess","wp-cloudflare-page-cache"))),children:(0,l.createElement)(b.A,{type:"warning",className:"mt-5"},(0,d.__)('If you are using Plesk, make sure you have disabled the options "Smart static files processing" and "Serve static files directly by Nginx" on "Apache & Nginx Settings" page of your Plesk panel or ask your hosting provider to update browser caching rules for you.',"wp-cloudflare-page-cache"))}];return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Cache","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:a}))),(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Browser Caching","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)("div",{className:"p-4"},(0,l.createElement)(b.A,{description:(0,d.__)("This option is useful if you want to use Super Page Cache to enable browser caching rules for assets such like images, CSS, scripts, etc. It works automatically if you use Apache as web server or as backend web server.","wp-cloudflare-page-cache")})),(0,l.createElement)(Ee.A,{controls:t}))))},Ne=()=>{const{settings:e,isToggleOn:a}=(0,s.C)();e.cf_page_rule_id;const t=[{id:"group-cf-behavior",type:"checkbox-group",label:(0,d.__)("Automatically purge the Cloudflare's cache when something changes on the website","wp-cloudflare-page-cache"),stack:!0,description:(0,l.createElement)(l.Fragment,null,(0,d.__)("Example: update/publish a post/page","wp-cloudflare-page-cache"),(0,l.createElement)("br",null),(0,E.createInterpolateElement)((0,d.__)("It is recommended to add the browser caching rules that you find <button>here</button>.","wp-cloudflare-page-cache"),{button:(0,l.createElement)(v,null)})),controls:[{id:"cf_auto_purge",type:"checkbox",label:(0,d.__)("Purge cache for related pages only","wp-cloudflare-page-cache"),recommended:!0},{id:"cf_auto_purge_all",type:"checkbox",label:(0,d.__)("Purge whole cache","wp-cloudflare-page-cache")}]},{id:"cf_fallback_cache_auto_purge",type:"toggle",label:(0,d.__)("Automatically purge the Page cache when Cloudflare cache is purged","wp-cloudflare-page-cache"),hide:!a("cf_fallback_cache")},{id:"cf_bypass_backend_page_rule",type:"toggle",label:(0,d.__)("Force cache bypassing for backend with an additional Cloudflare page rule","wp-cloudflare-page-cache"),description:(0,E.createInterpolateElement)((0,d.__)("<strong>Read here:</strong> by default, all back-end URLs are not cached thanks to some response headers, but if for some circumstances your backend pages are still cached, you can enable this option which will add an <strong>additional page rule on Cloudflare</strong> to force cache bypassing for the whole WordPress backend directly from Cloudflare.","wp-cloudflare-page-cache"),{strong:(0,l.createElement)("strong",null)}),hide:a("cf_woker_enabled")}],c=[{id:"cf_maxage",type:"number",label:(0,d.__)("Cache-Control max-age","wp-cloudflare-page-cache"),description:(0,d.__)("Don't touch if you don't know what is it. Must be greater than zero. Recommended 31536000 (1 year)","wp-cloudflare-page-cache"),min:1,max:31536e4},{id:"cf_browser_maxage",type:"number",label:(0,d.__)("Browser Cache-Control max-age","wp-cloudflare-page-cache"),description:(0,d.__)("Don't touch if you don't know what is it. Must be greater than zero. Recommended a value between 60 and 600","wp-cloudflare-page-cache"),min:1,max:31536e4}];return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Cache Lifetime Settings","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:c}))),(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Cloudflare Cache Behavior","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:t}))))};var ke=t(8068),Ae=t(8309),Ce=t(3160);const Pe=(0,p.A)("trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]),Re=()=>{const{logDownloadURL:e,logViewURL:a}=window.SPCDash,{lockAsync:t,asyncLocked:c}=(0,i.C)(),[o,n]=(0,E.useState)(!1);return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(r.A,{variant:"ghost",target:"_blank",href:e,icon:Ae.A},(0,d.__)("Download Log File","wp-cloudflare-page-cache")),(0,l.createElement)(r.A,{variant:"ghost",target:"_blank",href:a,icon:Ce.A},(0,d.__)("View Log File","wp-cloudflare-page-cache")),(0,l.createElement)(r.A,{variant:"destructive",loader:o,disabled:c,onClick:async()=>{t(!0),n(!0);const e=await ke.R.clearLogs();t(!1),n(!1),e.success?g.oR.success(e.message):g.oR.error(e.message)},icon:Pe},(0,d.__)("Clear logs now","wp-cloudflare-page-cache")))},je=()=>{const{isToggleOn:e}=(0,s.C)(),a=[{id:"log_enabled",type:"toggle",label:(0,d.__)("Log mode","wp-cloudflare-page-cache"),description:(0,d.__)("Enable this option if you want to log all activity of this plugin.","wp-cloudflare-page-cache")},{id:"log_max_file_size",type:"number",label:(0,d.__)("Max log file size in MB","wp-cloudflare-page-cache"),description:(0,d.__)("Automatically reset the log file when it exceeded the max file size. Set 0 to never reset it.","wp-cloudflare-page-cache"),hide:!e("log_enabled")},{id:"log_verbosity",type:"select",label:(0,d.__)("Log verbosity","wp-cloudflare-page-cache"),options:[{value:"1",label:(0,d.__)("Standard","wp-cloudflare-page-cache")},{value:"2",label:(0,d.__)("High","wp-cloudflare-page-cache")}],hide:!e("log_enabled")}];return(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Logs Settings","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:a})),e("log_enabled")&&(0,l.createElement)(k.wL,{className:"md:justify-end grid md:flex gap-4"},(0,l.createElement)(Re,null)))};var Se=t(6284);const Le=({content:e})=>(0,l.createElement)("div",{className:"flex mt-5"},(0,l.createElement)(Se.p,{className:"rounded-r-none border-r-0 grow h-auto",disabled:!0,value:null!=e?e:""}),(0,l.createElement)(r.A,{icon:_.A,onClick:()=>{navigator.clipboard.writeText(e),g.oR.success((0,d.__)("Copied to clipboard!","wp-cloudflare-page-cache"))},className:"rounded-l-none",size:"icon"},(0,l.createElement)("span",{className:"sr-only"},(0,d.__)("Copy to clipboard","wp-cloudflare-page-cache"))));var Ie=t(3040);const ze=()=>{const{wordpressRoles:e}=window.SPCDash,{settings:a,updateSetting:t}=(0,s.C)(),{asyncLocked:c}=(0,i.C)();return(0,l.createElement)("div",{className:"grid gap-3 mt-5 md:grid-cols-2 lg:grid-cols-1 xl:grid-cols-2 w-full"},Object.entries(e).map((([e,r],o)=>(0,l.createElement)("div",{key:`${e}-${o}`,className:"grid gap-3"},0!==o&&1!==o&&(0,l.createElement)(f.A,null),(0,l.createElement)("div",{className:"flex items-center gap-2"},(0,l.createElement)(Ie.A,{value:a.cf_purge_roles.includes(e)||!1,id:e,label:r,onChange:l=>((e,l)=>{let c=[...a.cf_purge_roles||[]];l?c.push(e):c=c.filter((a=>a!=e)),t("cf_purge_roles",c)})(e,l),disabled:c}))))))},Te=()=>{const{settings:e}=(0,s.C)(),{cronjobPurgeURL:a}=window.SPCDash,t=a.replace("replace:cf_purge_url_secret_key",e.cf_purge_url_secret_key||""),c=[{id:"cf_opcache_purge_on_flush",type:"toggle",label:(0,d.__)("Automatically purge the OPcache cache is purged","wp-cloudflare-page-cache")},{id:"cf_object_cache_purge_on_flush",type:"toggle",label:(0,d.__)("Automatically purge the object cache when cache is purged","wp-cloudflare-page-cache")},{id:"cronjob_purge_url",type:"custom",label:(0,d.__)("Purge the whole cache via Cronjob","wp-cloudflare-page-cache"),description:(0,d.__)("If you want purge the whole cache at specific intervals decided by you, you can create a cronjob that hits the following URL:","wp-cloudflare-page-cache"),component:(0,l.createElement)(Le,{content:t})},{id:"cf_purge_url_secret_key",type:"text",label:(0,d.__)("Purge cache URL secret key","wp-cloudflare-page-cache"),description:(0,d.__)("Secret key to use to purge the whole Cloudflare cache via URL. Don't touch if you don't know how to use it.","wp-cloudflare-page-cache")},{id:"cf_remove_purge_option_toolbar",type:"toggle",label:(0,d.__)("Remove purge option from toolbar","wp-cloudflare-page-cache")},{id:"cf_disable_single_metabox",type:"toggle",label:(0,d.__)("\tHide Metaboxes","wp-cloudflare-page-cache"),description:(0,d.__)("Disable the metaboxes on single pages and posts to avoid conflicts with other plugins.","wp-cloudflare-page-cache")},{id:"cf_seo_redirect",type:"toggle",label:(0,d.__)("SEO redirect","wp-cloudflare-page-cache"),description:(0,d.__)("Enable this option if you want to redirect the user to the correct page when the page is not found.","wp-cloudflare-page-cache")},{id:"purge_roles_custom",label:(0,d.__)("Select user roles allowed to purge the cache","wp-cloudflare-page-cache"),description:(0,d.__)("Admins are always allowed.","wp-cloudflare-page-cache"),type:"custom",component:(0,l.createElement)(ze,null)},{id:"cf_prefetch_urls_viewport",type:"toggle",label:(0,d.__)("Auto prefetch URLs in viewport","wp-cloudflare-page-cache"),description:(0,d.__)("If enabled, the browser prefetches in background all the internal URLs found in the viewport.","wp-cloudflare-page-cache")},{id:"cf_prefetch_urls_on_hover",type:"toggle",label:(0,d.__)("Auto prefetch URLs on mouse hover","wp-cloudflare-page-cache"),description:(0,d.__)("If enabled, the browser prefetches in background all the internal URLs found in the viewport.","wp-cloudflare-page-cache")},{type:"toggle",id:"cf_remove_cache_buster",label:(0,d.__)("Remove Cache Buster Query Parameter","wp-cloudflare-page-cache"),description:(0,d.__)("Stop adding cache buster query parameter when using the default page rule mode.","wp-cloudflare-page-cache"),hide:window.SPCDash.settings?.cf_remove_cache_buster||1},{type:"toggle",id:"keep_settings_on_deactivation",label:(0,d.__)("Keep settings on deactivation","wp-cloudflare-page-cache"),description:(0,d.__)("Keep settings on plugin deactivation.","wp-cloudflare-page-cache")}];return(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Other Settings","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:c})))},Ue=()=>{const[e,a]=(0,E.useState)(!1),{asyncLocked:t,lockAsync:c}=(0,i.C)();return(0,l.createElement)(r.A,{variant:"orange",onClick:async()=>{c(!0),a(!0);const e=await ke.R.startPreloader();c(!1),a(!1),e.success?g.oR.success(e.message):g.oR.error(e.message)},disabled:e||t,loader:e},e?(0,d.__)("Starting Preloader","wp-cloudflare-page-cache")+"...":(0,d.__)("Start Preloader","wp-cloudflare-page-cache"))},Oe=()=>{const{wordpressMenus:e}=window.SPCDash,{settings:a,isToggleOn:t,updateSetting:c}=(0,s.C)(),{asyncLocked:r}=(0,i.C)(),o=a.cf_preloader_nav_menus||[];return(0,l.createElement)("div",{className:"grid gap-3 mt-5"},Object.entries(e).map((([e,t],n)=>[0!==n&&(0,l.createElement)(f.A,{key:`separator-${e}`}),(0,l.createElement)("div",{className:"flex items-center gap-2",key:e},(0,l.createElement)(Ie.A,{value:a.cf_preloader_nav_menus.includes(e)||!1,id:e,label:(0,l.createElement)("span",null," ",(0,E.createInterpolateElement)(/* translators: %s is the menu name */ /* translators: %s is the menu name */(0,d.sprintf)((0,d.__)("Preload all internal links in <strong>%s</strong> WP Menu","wp-cloudflare-page-cache"),t),{strong:(0,l.createElement)("strong",{className:"font-bold opacity-75"})})),onChange:a=>((e,a)=>{let t=[...o];a?t.push(e):t=t.filter((a=>a!=e)),c("cf_preloader_nav_menus",t)})(e,a),disabled:r}))])),Object.keys(e).length>0&&(0,l.createElement)(f.A,null),(0,l.createElement)("div",{className:"flex items-center gap-2"},(0,l.createElement)(Ie.A,{value:t("cf_preload_last_urls"),id:"cf_preload_last_urls",label:(0,d.__)("Preload last 20 published/updated posts, pages & CPTs combined","wp-cloudflare-page-cache"),disabled:r,onChange:e=>{c("cf_preload_last_urls",e?1:0)}})))},De=()=>{const{settings:e,isToggleOn:a}=(0,s.C)(),{cronjobURL:t}=window.SPCDash,c=t.replace("replace:cf_preloader_url_secret_key",e.cf_preloader_url_secret_key||""),r=[{id:"cf_preloader",type:"toggle",label:(0,d.__)("Enable preloader","wp-cloudflare-page-cache")},{id:"cf_preloader_start_on_purge",type:"toggle",label:(0,d.__)("Automatically preload the pages you have purged from cache.","wp-cloudflare-page-cache"),hide:!a("cf_preloader")},{id:"preloader-custom-operation",type:"custom",label:(0,d.__)("Preloader operation","wp-cloudflare-page-cache"),description:(0,d.__)("Choose the URLs preloading logic that the preloader must use. If no option is chosen, the most recently published URLs and the home page will be preloaded.","wp-cloudflare-page-cache"),component:(0,l.createElement)(Oe,null),hide:!a("cf_preloader")},{id:"cf_preload_sitemap_urls",type:"textarea",label:(0,d.__)("Preload all URLs into the following sitemaps","wp-cloudflare-page-cache"),description:(0,l.createElement)(l.Fragment,null,(0,d.__)("One sitemap per line.","wp-cloudflare-page-cache"),(0,l.createElement)("br",null),(0,l.createElement)("br",null),(0,d.__)("Example","wp-cloudflare-page-cache")+":",(0,l.createElement)("br",null),(0,l.createElement)("pre",null,"/post-sitemap.xml",(0,l.createElement)("br",null),"/page-sitemap.xml",(0,l.createElement)("br",null))),hide:!a("cf_preloader")},{id:"preloader_cronjob_info",type:"custom",label:(0,d.__)("Start the preloader via Cronjob","wp-cloudflare-page-cache"),description:(0,d.__)("If you want start the preloader at specific intervals decided by you, you can create a cronjob that hits the following URL:","wp-cloudflare-page-cache"),component:(0,l.createElement)(Le,{content:c}),hide:!a("cf_preloader")},{id:"cf_preloader_url_secret_key",type:"text",label:(0,d.__)("Cronjob secret key","wp-cloudflare-page-cache"),description:(0,d.__)("Secret key to use to start the preloader via URL. Don't touch if you don't know how to use it.","wp-cloudflare-page-cache"),hide:!a("cf_preloader")}];return(0,l.createElement)(k.Ay,{className:(0,n.cn)({"pb-0":a("cf_preloader")})},(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Preloader","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:r})),a("cf_preloader")&&(0,l.createElement)(k.wL,{className:"flex justify-end"},(0,l.createElement)(Ue,null)))},Fe=()=>{const{i18n:e}=window.SPCDash,{asyncLocked:a,lockAsync:t}=(0,i.C)(),[c,o]=(0,E.useState)(!1);return(0,l.createElement)(r.A,{variant:"destructive",onClick:async()=>{t(!0),o(!0);const a=await ke.R.purgeCacheVarnish();t(!1),o(!1),a.success?g.oR.success(a.message):g.oR.error(a.message||e.genericError)},loader:c,disabled:c||a,className:"flex items-center gap-2"},c?(0,d.__)("Purging Varnish Cache","wp-cloudflare-page-cache")+"...":(0,d.__)("Purge Varnish Cache","wp-cloudflare-page-cache"))},Me=()=>{const{isToggleOn:e}=(0,s.C)(),a=[{id:"cf_varnish_support",type:"toggle",label:(0,d.__)("Varnish Support","wp-cloudflare-page-cache")},{id:"cf_varnish_hostname",type:"text",label:(0,d.__)("Hostname","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")},{id:"cf_varnish_port",type:"number",label:(0,d.__)("Port","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support"),min:0,max:65535},{id:"cf_varnish_purge_method",type:"text",label:(0,d.__)("HTTP method for single page cache purge","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")},{id:"cf_varnish_purge_all_method",type:"text",label:(0,d.__)("HTTP method for whole page cache purge","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")},{id:"cf_varnish_cw",type:"text",label:(0,d.__)("Cloudways Varnish","wp-cloudflare-page-cache"),description:(0,d.__)("Enable this option if you are using Varnish on Cloudways.","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")},{id:"cf_varnish_auto_purge",type:"toggle",label:(0,d.__)("Automatically purge Varnish cache when the cache is purged.","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")}];return(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Varnish Settings","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:a})),e("cf_varnish_support")&&(0,l.createElement)(k.wL,{className:"flex justify-end"},(0,l.createElement)(Fe,null)))},We=()=>(0,l.createElement)(c.A,null,(0,l.createElement)(xe,null),(0,l.createElement)(Ne,null),(0,l.createElement)(De,null),(0,l.createElement)(Me,null),(0,l.createElement)(je,null),(0,l.createElement)(Te,null))},7158:(e,a,t)=>{t.d(a,{A:()=>p});var l=t(1609),c=t(7213),r=t(6674),o=t(2748);function n({delayDuration:e=0,...a}){return(0,l.createElement)(r.Kq,{"data-slot":"tooltip-provider",delayDuration:e,...a})}function s({...e}){return(0,l.createElement)(n,null,(0,l.createElement)(r.bL,{"data-slot":"tooltip",...e}))}function i({...e}){return(0,l.createElement)(r.l9,{"data-slot":"tooltip-trigger",...e})}function d({className:e,sideOffset:a=0,children:t,...c}){return(0,l.createElement)(r.ZL,null,(0,l.createElement)(r.UC,{"data-slot":"tooltip-content",sideOffset:a,className:(0,o.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...c},t,(0,l.createElement)(r.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})))}const p=({children:e,className:a="",icon:t=null,text:r=""})=>{if(!e)return null;const n=t||c.A;return(0,l.createElement)(s,null,(0,l.createElement)(i,null,(0,l.createElement)(n,{size:16,className:(0,o.cn)("text-muted-foreground ml-1",a)}),r&&(0,l.createElement)("span",{className:"sr-only"},r)),(0,l.createElement)(d,null,e))}}}]); -
wp-cloudflare-page-cache/tags/5.2.3/assets/src/pages/settings/content/advanced/AdvancedCache.tsx
r3329008 r3454474 35 35 hide: !isToggleOn('cf_fallback_cache'), 36 36 children: <pre className="text-xs mt-1">cache-control, set-cookie, X-WP-CF-Super-Cache*</pre> 37 }, 38 { 39 id: 'cf_fallback_cache_http_response_code', 40 type: 'toggle', 41 label: __('Don\'t cache 4xx / 5xx responses', 'wp-cloudflare-page-cache'), 42 description: __('Exclude 4xx and 5xx HTTP error responses from being cached.', 'wp-cloudflare-page-cache'), 43 hide: !isToggleOn('cf_fallback_cache'), 37 44 }, 38 45 { -
wp-cloudflare-page-cache/tags/5.2.3/bootstrap.php
r3437972 r3454474 22 22 define( 'SWCFPC_LOGS_STANDARD_VERBOSITY', 1 ); 23 23 define( 'SWCFPC_LOGS_HIGH_VERBOSITY', 2 ); 24 define( 'SWCFPC_VERSION', '5.2. 2' );24 define( 'SWCFPC_VERSION', '5.2.3' ); 25 25 if ( ! defined( 'SPC_METRICS_DIR' ) ) { 26 26 $home_url_parts = parse_url( home_url() ); -
wp-cloudflare-page-cache/tags/5.2.3/languages/wp-cloudflare-page-cache.pot
r3437972 r3454474 82 82 83 83 #. translators: %s is the path to the .htaccess file 84 #: libs/cache_controller.class.php:21 6284 #: libs/cache_controller.class.php:2172 85 85 #, php-format 86 86 msgid "The .htaccess file (%s) could not be edited. Check if the file has write permissions." 87 87 msgstr "" 88 88 89 #: libs/cache_controller.class.php:22 1290 #: libs/cache_controller.class.php:22 3291 #: libs/cache_controller.class.php:22 5589 #: libs/cache_controller.class.php:2222 90 #: libs/cache_controller.class.php:2242 91 #: libs/cache_controller.class.php:2265 92 92 msgid "Permission denied" 93 93 msgstr "" 94 94 95 #: libs/cache_controller.class.php:22 1996 #: libs/cache_controller.class.php:22 3997 #: libs/cache_controller.class.php:22 7195 #: libs/cache_controller.class.php:2229 96 #: libs/cache_controller.class.php:2249 97 #: libs/cache_controller.class.php:2281 98 98 msgid "Cache purged successfully! It may take up to 30 seconds for the cache to be permanently cleaned." 99 99 msgstr "" 100 100 101 #: libs/cache_controller.class.php:22 65101 #: libs/cache_controller.class.php:2275 102 102 msgid "An error occurred while cleaning the cache. Please check log file for further details." 103 103 msgstr "" 104 104 105 #: libs/cache_controller.class.php:2 391105 #: libs/cache_controller.class.php:2401 106 106 msgid "Super Page Cache - Purge Cache Cron Interval" 107 107 msgstr "" 108 108 109 109 #. translators: %1$s is the name of the sitemap, %2$s is the error message 110 #: libs/cache_controller.class.php:25 84110 #: libs/cache_controller.class.php:2594 111 111 #, php-format 112 112 msgid "Connection error while retriving the sitemap %1$s: %2$s" -
wp-cloudflare-page-cache/tags/5.2.3/libs/cache_controller.class.php
r3405353 r3454474 1726 1726 } 1727 1727 1728 // Bypass 4xx or 5xx HTTP status codes (security blocks, errors, etc.) 1729 if ( Settings_Store::get_instance()->get( Constants::SETTING_FALLBACK_CACHE_HTTP_RESPONSE_CODE ) ) { 1730 $http_status = http_response_code(); 1731 1732 if ( $http_status !== false && $http_status >= 400 && $http_status < 600 ) { 1733 Helpers::bypass_reason_header( sprintf( 'HTTP Status %d', $http_status ) ); 1734 return true; 1735 } 1736 } 1737 1728 1738 return false; 1729 1739 } -
wp-cloudflare-page-cache/tags/5.2.3/libs/html_cache.class.php
r3328083 r3454474 63 63 64 64 if ( isset( $wp_query ) && function_exists( 'is_404' ) && is_404() ) { 65 $this->main_instance->get_logger()->add_log( 'html_cache::add_current_url_to_cache', "The URL {$current_url} cannot be cached because it returns 404.", true );65 $this->main_instance->get_logger()->add_log( 'html_cache::add_current_url_to_cache', 'The URL ' . esc_url_raw( $current_url ) . ' cannot be cached because it returns 404.', true ); 66 66 67 67 return; -
wp-cloudflare-page-cache/tags/5.2.3/libs/logs.class.php
r3328083 r3454474 151 151 152 152 if ( $_GET['swcfpc_download_log'] === 'view' ) { 153 echo '<pre>' . file_get_contents( $this->log_file_path) . '</pre>';153 echo '<pre>' . esc_html( file_get_contents( $this->log_file_path ) ) . '</pre>'; 154 154 155 155 exit; -
wp-cloudflare-page-cache/tags/5.2.3/readme.txt
r3447704 r3454474 5 5 Requires PHP: 7.4 6 6 Tested up to: 6.9 7 Stable tag: 5.2. 27 Stable tag: 5.2.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 186 186 == Changelog == 187 187 188 ##### Version 5.2.2 (2026-01-12) 189 190 - Fixed translation updates no longer reappear after being successfully updated when using Super Page Cache. 191 - Fixed Database Optimization now respects the configured schedule and no longer deletes trashed posts immediately when the feature is enabled. 192 - Update dependencies 188 ##### Version 5.2.3 (2026-02-05) 189 190 - Enhanced security 193 191 194 192 -
wp-cloudflare-page-cache/tags/5.2.3/src/Constants.php
r3405353 r3454474 50 50 public const SETTING_PURGE_ONLY_HTML = 'cf_purge_only_html'; 51 51 public const SETTING_DISABLE_PURGING_QUEUE = 'cf_disable_cache_purging_queue'; 52 public const SETTING_FALLBACK_CACHE_HTTP_RESPONSE_CODE = 'cf_fallback_cache_http_response_code'; 52 53 53 54 // Bypass Settings. -
wp-cloudflare-page-cache/tags/5.2.3/src/Modules/Settings_Manager.php
r3341154 r3454474 212 212 'type' => self::SETTING_TYPE_BOOLEAN, 213 213 'default' => 0, 214 ], 215 Constants::SETTING_FALLBACK_CACHE_HTTP_RESPONSE_CODE => [ 216 'type' => self::SETTING_TYPE_BOOLEAN, 217 'bust_cache' => true, 218 'default' => 1, 214 219 ], 215 220 Constants::SETTING_BYPASS_404 => [ -
wp-cloudflare-page-cache/tags/5.2.3/vendor/composer/installed.php
r3437972 r3454474 2 2 'root' => array( 3 3 'name' => 'codeinwp/wp-cloudflare-super-page-cache', 4 'pretty_version' => 'v5.2. 2',5 'version' => '5.2. 2.0',6 'reference' => ' 0d86bcdc77c60f1bf4049a1cc190ec6bf1291db2',4 'pretty_version' => 'v5.2.3', 5 'version' => '5.2.3.0', 6 'reference' => '9d99dd640381a4984bbe18ee96fa57e4501093c1', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 'codeinwp/wp-cloudflare-super-page-cache' => array( 23 'pretty_version' => 'v5.2. 2',24 'version' => '5.2. 2.0',25 'reference' => ' 0d86bcdc77c60f1bf4049a1cc190ec6bf1291db2',23 'pretty_version' => 'v5.2.3', 24 'version' => '5.2.3.0', 25 'reference' => '9d99dd640381a4984bbe18ee96fa57e4501093c1', 26 26 'type' => 'library', 27 27 'install_path' => __DIR__ . '/../../', -
wp-cloudflare-page-cache/tags/5.2.3/wp-cloudflare-super-page-cache.php
r3437972 r3454474 4 4 * Plugin URI: https://wordpress.org/plugins/wp-cloudflare-page-cache/ 5 5 * Description: A WordPress performance plugin that lets you get Edge Caching enabled on a Cloudflare free plan. 6 * Version: 5.2. 26 * Version: 5.2.3 7 7 * Author: Themeisle 8 8 * Author URI: https://themeisle.com -
wp-cloudflare-page-cache/trunk/CHANGELOG.md
r3437972 r3454474 1 ##### Version 5.2.3 (2026-02-05) 2 3 - Enhanced security 4 1 5 ##### Version 5.2.2 (2026-01-12) 2 6 -
wp-cloudflare-page-cache/trunk/assets/advanced-cache.php
r3327334 r3454474 189 189 190 190 if ( ! file_exists( $cache_path . $cache_key ) || $swcfpc_objects['fallback_cache']->fallback_cache_is_expired_page( $cache_key ) ) { 191 192 // Bypass 4xx or 5xx HTTP status codes (security blocks, errors, etc.) 193 if ( SPC\Services\Settings_Store::get_instance()->get( SPC\Constants::SETTING_FALLBACK_CACHE_HTTP_RESPONSE_CODE ) ) { 194 $http_status = http_response_code(); 195 if ( $http_status !== false && $http_status >= 400 && $http_status < 600 ) { 196 return $html; 197 } 198 } 191 199 192 200 if ( $sw_cloudflare_pagecache->get_single_config( 'cf_fallback_cache_ttl', 0 ) == 0 ) { -
wp-cloudflare-page-cache/trunk/assets/build/154.js
r3405353 r3454474 1 "use strict";(globalThis.webpackChunkwp_cloudflare_page_cache=globalThis.webpackChunkwp_cloudflare_page_cache||[]).push([[154],{341:(e,a,t)=>{t.d(a,{BE:()=>u,Uz:()=>n,_s:()=>o,cp:()=>i,gk:()=>m,uT:()=>s,zj:()=>p});var l=t(1609),c=t(7248),r=t(2748);function o({...e}){return(0,l.createElement)(c._s.Root,{"data-slot":"drawer",...e})}function n({...e}){return(0,l.createElement)(c._s.Trigger,{"data-slot":"drawer-trigger",...e})}function s({...e}){return(0,l.createElement)(c._s.Portal,{"data-slot":"drawer-portal",...e})}function i({...e}){return(0,l.createElement)(c._s.Close,{"data-slot":"drawer-close",...e})}function d({className:e,...a}){return(0,l.createElement)(c._s.Overlay,{"data-slot":"drawer-overlay",className:(0,r.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[9999] bg-black/50",e),...a})}function p({className:e,children:a,...t}){return(0,l.createElement)(s,{"data-slot":"drawer-portal"},(0,l.createElement)(d,null),(0,l.createElement)(c._s.Content,{"data-slot":"drawer-content",className:(0,r.cn)("group/drawer-content bg-background fixed z-[10000] isolate flex flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...t},a))}function u({className:e,...a}){return(0,l.createElement)("div",{"data-slot":"drawer-header",className:(0,r.cn)("flex flex-col gap-1.5 p-3",e),...a})}function m({className:e,...a}){return(0,l.createElement)(c._s.Title,{"data-slot":"drawer-title",className:(0,r.cn)("text-foreground font-semibold",e),...a})}},1747:(e,a,t)=>{t.d(a,{F:()=>o});var l=t(1609),c=t(4674),r=t(2748);function o({className:e,children:a,...t}){return(0,l.createElement)(c.bL,{"data-slot":"scroll-area",className:(0,r.cn)("relative",e),...t},(0,l.createElement)(c.LM,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"},a),(0,l.createElement)(n,null),(0,l.createElement)(c.OK,null))}function n({className:e,orientation:a="vertical",...t}){return(0,l.createElement)(c.VM,{"data-slot":"scroll-area-scrollbar",orientation:a,className:(0,r.cn)("flex touch-none p-px transition-colors select-none","vertical"===a&&"h-full w-2.5 border-l border-l-transparent","horizontal"===a&&"h-2.5 flex-col border-t border-t-transparent",e),...t},(0,l.createElement)(c.lr,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"}))}},2154:(e,a,t)=>{t.r(a),t.d(a,{default:()=>We});var l=t(1609),c=t(3781),r=t(5975),o=t(341),n=t(2748),s=t(4585),i=t(4758),d=t(7723),p=t(9407);const u=(0,p.A)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);var m=t(8697),h=t(827), g=t(5404),_=t(4721),f=t(7102),b=t(9391),w=t(1747),y=t(504),E=t(6087);const v=()=>{const{darkMode:e}=(0,i.C)(),{isToggleOn:a,settings:t}=(0,s.C)(),{i18n:c}=window.SPCDash,p=e=>{navigator.clipboard.writeText(e),_.oR.success((0,d.__)("Copied to clipboard!","wp-cloudflare-page-cache"))},v=(0,d.sprintf)("map $upstream_http_x_wp_cf_super_cache_active $wp_cf_super_cache_active {\n default 'no-cache, no-store, must-revalidate, max-age=0';\n '1' 's-maxage=%s, max-age=%s';\n}",t.cf_maxage,t.cf_browser_maxage),x="more_clear_headers 'Pragma';\nmore_clear_headers 'Expires';\nmore_clear_headers 'Cache-Control';\nadd_header Cache-Control $wp_cf_super_cache_active;";let N="";return a("cf_bypass_sitemap")&&(N+='location ~* \\.(xml|xsl)$ { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; }\n'),a("cf_bypass_file_robots")&&(N+='location /robots.txt { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; }\n'),a("cf_browser_caching_htaccess")&&(N+='location ~* \\.(css|js|pdf)$ { add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=2592000, stale-while-revalidate=86400, stale-if-error=604800"; expires 30d; }\n',N+='location ~* \\.(jpg|jpeg|png|gif|ico|eot|swf|svg|webp|avif|ttf|otf|woff|woff2|ogg|mp4|mpeg|avi|mkv|webm|mp3)$ { add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=31536000, stale-while-revalidate=86400, stale-if-error=604800"; expires 365d; }\n'),N+='location /wp-cron.php { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; }\n',(0,l.createElement)(o._s,null,(0,l.createElement)(o.Uz,{className:"underline text-current cursor-pointer"},(0,d.__)("here","wp-cloudflare-page-cache")),(0,l.createElement)(o.uT,null,(0,l.createElement)(o.zj,{className:(0,n.cn)("overflow-hidden",{dark:e})},(0,l.createElement)(o.BE,{className:"border-b border-border bg-muted"},(0,l.createElement)(y.A,{className:"text-left flex items-center justify-between w-full"},(0,l.createElement)(o.gk,null,(0,l.createElement)("h2",{className:"flex items-center text-lg mb-0"},(0,l.createElement)(u,{className:"size-6 text-orange-500 mr-3"}),(0,d.__)("Nginx Instructions","wp-cloudflare-page-cache"))),(0,l.createElement)(o.cp,null,(0,l.createElement)(r.A,{variant:"ghost",size:"icon",icon:m.A},(0,l.createElement)("span",{className:"sr-only"},c.close))))),(0,l.createElement)(w.F,{className:"overflow-auto max-w-full max-h-[80vh] py-5"},(0,l.createElement)(y.A,{className:"py-0"},a("cf_cache_control_htaccess")&&(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",{className:"flex items-center mb-3"},(0,l.createElement)(h.A,{className:"size-5 mr-2 text-blue-500"}),(0,l.createElement)("h3",{className:"text-base"},(0,d.__)("Overwrite the cache-control header","wp-cloudflare-page-cache"))),(0,l.createElement)("div",{className:"space-y-4"},(0,l.createElement)("p",{className:"text-sm mb-2 text-muted-foreground"},(0,E.createInterpolateElement)((0,d.__)("Edit the main Nginx configuration file, usually <code>/etc/nginx.conf</code>, and enter these rules immediately after opening the http block:","wp-cloudflare-page-cache"),{code:(0,l.createElement)("code",{className:"px-2 py-1 rounded bg-muted font-mono"},"/etc/nginx.conf")})),(0,l.createElement)("div",{className:"relative"},(0,l.createElement)(r.A,{variant:"default",size:"icon",onClick:()=>p(v),icon:g.A,className:"absolute top-2 right-2 z-10"},(0,l.createElement)("span",{className:"sr-only"},(0,d.__)("Copy to clipboard","wp-cloudflare-page-cache"))),(0,l.createElement)("pre",{className:"text-muted-foreground bg-muted border border-border break-all p-4 rounded-2xl overflow-x-auto text-sm whitespace-pre-wrap"},v)),(0,l.createElement)("div",null,(0,l.createElement)("p",{className:"text-sm mb-2 text-muted-foreground"},(0,d.__)("Now open the configuration file of your domain and add the following rules inside the block that deals with the management of PHP pages:","wp-cloudflare-page-cache")),(0,l.createElement)("div",{className:"relative"},(0,l.createElement)(r.A,{variant:"default",size:"icon",onClick:()=>p(x),className:"absolute top-2 right-2 z-10",icon:g.A},(0,l.createElement)("span",{className:"sr-only"},(0,d.__)("Copy to clipboard","wp-cloudflare-page-cache"))),(0,l.createElement)("pre",{className:"text-muted-foreground bg-muted border border-border p-4 rounded-2xl overflow-y-auto text-sm whitespace-pre-wrap"},x)))),(0,l.createElement)(f.A,{className:"my-5"})),(0,l.createElement)("div",{className:"flex items-center mb-3"},(0,l.createElement)(h.A,{className:"size-5 mr-2 text-blue-500"}),(0,l.createElement)("h3",{className:"text-base"},(0,d.__)("Browser caching rules","wp-cloudflare-page-cache"))),(0,l.createElement)("div",{className:"space-y-4"},(0,l.createElement)("div",null,(0,l.createElement)("p",{className:"text-sm mb-2 text-muted-foreground"},(0,d.__)("Open the configuration file of your domain and add the following rules:","wp-cloudflare-page-cache")),(0,l.createElement)("div",{className:"relative"},(0,l.createElement)(r.A,{variant:"default",size:"icon",onClick:()=>p(N),className:"absolute top-2 right-2 z-10",icon:g.A},(0,l.createElement)("span",{className:"sr-only"},(0,d.__)("Copy to clipboard","wp-cloudflare-page-cache"))),(0,l.createElement)("pre",{className:"text-muted-foreground bg-muted border border-border p-4 rounded-2xl overflow-y-auto text-sm whitespace-pre-wrap"},N)))),(0,l.createElement)(b.A,{type:"info",className:"my-5",title:(0,d.__)("Save and restart Nginx.","wp-cloudflare-page-cache")}))))))};var x=t(7158),N=t(2318),k=t(5181),A=t(2133),C=t(6214),P=t(1071),R=t(9957),j=t(1351),S=t(2579),L=t(8834),I=t(1104),z=t(1427),T=t(4848),U="Accordion",O=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[D,F,M]=(0,C.N)(U),[W,V]=(0,A.A)(U,[M,L.z3]),H=(0,L.z3)(),$=l.forwardRef(((e,a)=>{const{type:t,...l}=e,c=l,r=l;return(0,T.jsx)(D.Provider,{scope:e.__scopeAccordion,children:"multiple"===t?(0,T.jsx)(J,{...r,ref:a}):(0,T.jsx)(G,{...c,ref:a})})}));$.displayName=U;var[q,B]=W(U),[K,X]=W(U,{collapsible:!1}),G=l.forwardRef(((e,a)=>{const{value:t,defaultValue:c,onValueChange:r=()=>{},collapsible:o=!1,...n}=e,[s,i]=(0,j.i)({prop:t,defaultProp:c??"",onChange:r,caller:U});return(0,T.jsx)(q,{scope:e.__scopeAccordion,value:l.useMemo((()=>s?[s]:[]),[s]),onItemOpen:i,onItemClose:l.useCallback((()=>o&&i("")),[o,i]),children:(0,T.jsx)(K,{scope:e.__scopeAccordion,collapsible:o,children:(0,T.jsx)(Y,{...n,ref:a})})})})),J=l.forwardRef(((e,a)=>{const{value:t,defaultValue:c,onValueChange:r=()=>{},...o}=e,[n,s]=(0,j.i)({prop:t,defaultProp:c??[],onChange:r,caller:U}),i=l.useCallback((e=>s(((a=[])=>[...a,e]))),[s]),d=l.useCallback((e=>s(((a=[])=>a.filter((a=>a!==e))))),[s]);return(0,T.jsx)(q,{scope:e.__scopeAccordion,value:n,onItemOpen:i,onItemClose:d,children:(0,T.jsx)(K,{scope:e.__scopeAccordion,collapsible:!0,children:(0,T.jsx)(Y,{...o,ref:a})})})})),[Q,Z]=W(U),Y=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,disabled:c,dir:r,orientation:o="vertical",...n}=e,s=l.useRef(null),i=(0,P.s)(s,a),d=F(t),p="ltr"===(0,z.jH)(r),u=(0,R.m)(e.onKeyDown,(e=>{if(!O.includes(e.key))return;const a=e.target,t=d().filter((e=>!e.ref.current?.disabled)),l=t.findIndex((e=>e.ref.current===a)),c=t.length;if(-1===l)return;e.preventDefault();let r=l;const n=c-1,s=()=>{r=l+1,r>n&&(r=0)},i=()=>{r=l-1,r<0&&(r=n)};switch(e.key){case"Home":r=0;break;case"End":r=n;break;case"ArrowRight":"horizontal"===o&&(p?s():i());break;case"ArrowDown":"vertical"===o&&s();break;case"ArrowLeft":"horizontal"===o&&(p?i():s());break;case"ArrowUp":"vertical"===o&&i()}const u=r%c;t[u].ref.current?.focus()}));return(0,T.jsx)(Q,{scope:t,disabled:c,direction:r,orientation:o,children:(0,T.jsx)(D.Slot,{scope:t,children:(0,T.jsx)(S.sG.div,{...n,"data-orientation":o,ref:i,onKeyDown:c?void 0:u})})})})),ee="AccordionItem",[ae,te]=W(ee),le=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,value:l,...c}=e,r=Z(ee,t),o=B(ee,t),n=H(t),s=(0,I.B)(),i=l&&o.value.includes(l)||!1,d=r.disabled||e.disabled;return(0,T.jsx)(ae,{scope:t,open:i,disabled:d,triggerId:s,children:(0,T.jsx)(L.bL,{"data-orientation":r.orientation,"data-state":de(i),...n,...c,ref:a,disabled:d,open:i,onOpenChange:e=>{e?o.onItemOpen(l):o.onItemClose(l)}})})}));le.displayName=ee;var ce="AccordionHeader",re=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,...l}=e,c=Z(U,t),r=te(ce,t);return(0,T.jsx)(S.sG.h3,{"data-orientation":c.orientation,"data-state":de(r.open),"data-disabled":r.disabled?"":void 0,...l,ref:a})}));re.displayName=ce;var oe="AccordionTrigger",ne=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,...l}=e,c=Z(U,t),r=te(oe,t),o=X(oe,t),n=H(t);return(0,T.jsx)(D.ItemSlot,{scope:t,children:(0,T.jsx)(L.l9,{"aria-disabled":r.open&&!o.collapsible||void 0,"data-orientation":c.orientation,id:r.triggerId,...n,...l,ref:a})})}));ne.displayName=oe;var se="AccordionContent",ie=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,...l}=e,c=Z(U,t),r=te(se,t),o=H(t);return(0,T.jsx)(L.UC,{role:"region","aria-labelledby":r.triggerId,"data-orientation":c.orientation,...o,...l,ref:a,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})}));function de(e){return e?"open":"closed"}ie.displayName=se;var pe=$,ue=le,me=re,he=ne,ge=ie;const _e=(0,p.A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);function fe({...e}){return(0,l.createElement)(pe,{"data-slot":"accordion",...e})}function be({className:e,...a}){return(0,l.createElement)(ue,{"data-slot":"accordion-item",className:e,...a})}function we({className:e,children:a,...t}){return(0,l.createElement)(me,{className:"flex",as:"p"},(0,l.createElement)(he,{"data-slot":"accordion-trigger",className:(0,n.cn)("cursor-pointer focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-center justify-between gap-4 py-2 text-left text-sm w-full font-medium transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),...t},a,(0,l.createElement)(_e,{className:"ml-auto text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})))}function ye({className:e,children:a,...t}){return(0,l.createElement)(ge,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...t},(0,l.createElement)("div",{className:(0,n.cn)("py-4",e)},a))}var Ee=t(3327);const ve=()=>(0,l.createElement)("div",{className:"grid gap-1"},(0,l.createElement)(fe,{type:"single",collapsible:!0,className:"rounded-sm border overflow-hidden"},(0,l.createElement)(be,{value:"htaccess"},(0,l.createElement)(we,{className:"!m-0 bg-muted px-4 py-3 !text-sm"},(0,d.__)("Additional info","wp-cloudflare-page-cache")),(0,l.createElement)(ye,{className:"p-4 bg-muted/20"},(0,l.createElement)(b.A,{type:"warning",title:(0,d.__)("Important Notes","wp-cloudflare-page-cache"),description:(0,E.createInterpolateElement)((0,d.__)("This option is not essential as in most cases this plugin works out of the box. If the page cache does not work after a considerable number of attempts or you see that max-age and s-maxage values of <code>X-WP-CF-Super-Cache-Cache-Control</code> response header are not the same of the ones in <code>Cache-Control</code> response header, activate this option.","wp-cloudflare-page-cache"),{code:(0,l.createElement)("code",null)})}),(0,l.createElement)("div",{className:"grid lg:grid-cols-2 gap-4 mt-4"},(0,l.createElement)(b.A,{type:"success",title:`${(0,d.__)("Read here if you use Apache","wp-cloudflare-page-cache")} (.htaccess):`,description:(0,E.createInterpolateElement)((0,d.__)("For overwriting to work, make sure that the rules added by Super Page Cache are placed at the bottom of the <code>.htaccess</code> file. If they are present <strong>BEFORE</strong> other caching rules of other plugins, move them to the bottom manually.","wp-cloudflare-page-cache"),{code:(0,l.createElement)("code",null),strong:(0,l.createElement)("strong",null)})}),(0,l.createElement)(b.A,{type:"info",title:`${(0,d.__)("Read here if you use Nginx","wp-cloudflare-page-cache")}:`,description:(0,E.createInterpolateElement)((0,d.__)("It is not possible for Super Page Cache to automatically change the settings to allow this option to work immediately. For it to work, update these settings and then follow the instructions <button>here</button>.","wp-cloudflare-page-cache"),{button:(0,l.createElement)(v,null)})})))))),xe=()=>{const{isToggleOn:e}=(0,s.C)(),a=[{id:"cf_fallback_cache_curl",type:"toggle",label:(0,d.__)("Use cURL","wp-cloudflare-page-cache"),description:(0,d.__)("Use cURL instead of WordPress advanced-cache.php to generate the Page page. It can increase the time it takes to generate the Page cache but improves compatibility with other performance plugins.","wp-cloudflare-page-cache")},{id:"cf_fallback_cache_ttl",type:"number",min:0,label:`${(0,d.__)("Cache Lifespan","wp-cloudflare-page-cache")} (${(0,d.__)("seconds","wp-cloudflare-page-cache")})`,description:(0,d.__)("Enter 0 for no expiration.","wp-cloudflare-page-cache"),hide:!e("cf_fallback_cache")},{id:"cf_fallback_cache_save_headers",type:"toggle",label:(0,d.__)("Save response headers","wp-cloudflare-page-cache"),description:`${(0,d.__)("Save response headers together with HTML code.","wp-cloudflare-page-cache")} ${(0,d.__)("The following response header will never be saved:","wp-cloudflare-page-cache")}`,hide:!e("cf_fallback_cache"),children:(0,l.createElement)("pre",{className:"text-xs mt-1"},"cache-control, set-cookie, X-WP-CF-Super-Cache*")},{id:"cf_fallback_cache_prevent_cache_urls_without_trailing_slash",type:"toggle",label:(0,d.__)("Prevent to cache URLs without trailing slash","wp-cloudflare-page-cache"),hide:!e("cf_fallback_cache")},{id:"cf_auto_purge_on_comments",type:"toggle",label:(0,d.__)("Auto-Purge Cache on Comment Activity","wp-cloudflare-page-cache"),description:(0,d.__)("Automatically purge single post cache when a new comment is inserted into the database or when a comment is approved or deleted","wp-cloudflare-page-cache")},{id:"cf_auto_purge_on_upgrader_process_complete",type:"toggle",label:(0,d.__)("Auto-purge on Updates","wp-cloudflare-page-cache"),description:(0,d.__)("Automatically purge the cache when the plugin update process is complete","wp-cloudflare-page-cache")},{id:"cf_strip_cookies",type:"toggle",label:(0,d.__)("Strip response cookies","wp-cloudflare-page-cache"),description:(0,d.__)("Cloudflare will not cache when there are cookies in responses unless you strip out them to overwrite the behavior. If the cache does not work due to response cookies and you are sure that these cookies are not essential for the website to works, enable this option.","wp-cloudflare-page-cache")},{id:"cf_cache_control_htaccess",type:"toggle",label:(0,d.__)("Overwrite the cache-control header for WordPress's pages using web server rules","wp-cloudflare-page-cache"),description:(0,l.createElement)(N.A,{variant:"destructive"},(0,d.__)("Writes into .htaccess","wp-cloudflare-page-cache")),children:(0,l.createElement)("div",{className:"grid gap-2 mt-2"},(0,l.createElement)(b.A,{description:(0,d.__)("This option is useful if you use Super Page Cache together with other performance plugins that could affect the Cloudflare cache with their cache-control headers. It works automatically if you are using Apache as web server or as backend web server.","wp-cloudflare-page-cache")}),(0,l.createElement)(ve,null))},{id:"cf_purge_only_html",type:"toggle",label:(0,d.__)("Purge HTML pages only","wp-cloudflare-page-cache"),description:(0,d.__)("Purge only the cached HTML pages instead of the whole cache (assets & pages).","wp-cloudflare-page-cache")},{id:"cf_disable_cache_purging_queue",type:"toggle",label:(0,d.__)("Disable cache purging using queue","wp-cloudflare-page-cache"),description:(0,d.__)("By default this plugin purge the cache after 10 seconds from the purging action, to avoid a high number of purge requests in case of multiple events triggered by third party plugins. This is done using a classic WordPress scheduled event. If you notice any errors regarding the scheduled intervals, you can deactivate this mode by enabling this option.","wp-cloudflare-page-cache")},{id:"advanced_exclude_dynamic_content",type:"checkbox-group",label:(0,d.__)("Don't cache the following dynamic contents:","wp-cloudflare-page-cache"),controls:[{id:"cf_bypass_404",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("404 Page","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_404"))," ")},{id:"cf_bypass_single_post",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Single posts","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_single"))," ")},{id:"cf_bypass_pages",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Pages","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_page"))," ")},{id:"cf_bypass_front_page",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Front Page","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_front_page"))," ")},{id:"cf_bypass_home",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Home","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_home"))," ")},{id:"cf_bypass_archives",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Archives","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_archive"))," ")},{id:"cf_bypass_tags",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Tags","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_tag"))," ")},{id:"cf_bypass_category",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Categories","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_category"))," ")},{id:"cf_bypass_feeds",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Feeds","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_feed"))," ")},{id:"cf_bypass_search_pages",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Search Pages","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_search"))," ")},{id:"cf_bypass_author_pages",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Author Pages","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_author"))," ")},{id:"cf_bypass_amp",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("AMP pages","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_amp"))," ")},{id:"cf_bypass_ajax",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Ajax requests","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_ajax"))," ")},{id:"cf_bypass_query_var",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Pages with query args","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_query_var"))," ")},{id:"cf_bypass_wp_json_rest",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("WP JSON endpoints","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_wp_json_rest"))," ")}]},{id:"advanced_exclude_dynamic_content",type:"checkbox-group",label:(0,d.__)("Don't cache the following static contents:","wp-cloudflare-page-cache"),stack:!0,description:(0,l.createElement)(l.Fragment,null,(0,E.createInterpolateElement)((0,d.__)("<strong>If you use Nginx:</strong> It is recommended to add the browser caching rules that you find in the instructions <button>here</button>.","wp-cloudflare-page-cache"),{strong:(0,l.createElement)("strong",null),button:(0,l.createElement)(v,null)}),(0,l.createElement)("br",null),(0,l.createElement)(N.A,{variant:"destructive",className:"mt-3"},(0,d.__)("Writes into .htaccess","wp-cloudflare-page-cache"))),controls:[{id:"cf_bypass_sitemap",type:"checkbox",label:(0,d.__)("XML sitemaps","wp-cloudflare-page-cache")},{id:"cf_bypass_file_robots",type:"checkbox",label:(0,d.__)("Robots.txt","wp-cloudflare-page-cache")}]},{id:"cf_post_per_page",type:"number",min:1,max:100,label:(0,d.__)("Posts per page","wp-cloudflare-page-cache"),description:(0,d.__)("Enter how many posts per page (or category) the theme shows to your users. It will be use to clean up the pagination on cache purge.","wp-cloudflare-page-cache")}],t=[{id:"cf_browser_caching_htaccess",type:"toggle",label:(0,d.__)("Add browser caching rules for static assets","wp-cloudflare-page-cache"),description:(0,l.createElement)(l.Fragment,null,(0,E.createInterpolateElement)((0,d.__)("<strong>If you use Nginx:</strong> it is not possible for Super Page Cache to automatically change the settings to allow this option to work immediately. For it to work, update these settings and then follow the instructions <button>here</button>."),{button:(0,l.createElement)(v,null),strong:(0,l.createElement)("strong",null)}),(0,l.createElement)("br",null),(0,l.createElement)(N.A,{variant:"destructive",className:"mt-3"},(0,d.__)("Writes into .htaccess","wp-cloudflare-page-cache"))),children:(0,l.createElement)(b.A,{type:"warning",className:"mt-5"},(0,d.__)('If you are using Plesk, make sure you have disabled the options "Smart static files processing" and "Serve static files directly by Nginx" on "Apache & Nginx Settings" page of your Plesk panel or ask your hosting provider to update browser caching rules for you.',"wp-cloudflare-page-cache"))}];return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Cache","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:a}))),(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Browser Caching","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)("div",{className:"p-4"},(0,l.createElement)(b.A,{description:(0,d.__)("This option is useful if you want to use Super Page Cache to enable browser caching rules for assets such like images, CSS, scripts, etc. It works automatically if you use Apache as web server or as backend web server.","wp-cloudflare-page-cache")})),(0,l.createElement)(Ee.A,{controls:t}))))},Ne=()=>{const{settings:e,isToggleOn:a}=(0,s.C)();e.cf_page_rule_id;const t=[{id:"group-cf-behavior",type:"checkbox-group",label:(0,d.__)("Automatically purge the Cloudflare's cache when something changes on the website","wp-cloudflare-page-cache"),stack:!0,description:(0,l.createElement)(l.Fragment,null,(0,d.__)("Example: update/publish a post/page","wp-cloudflare-page-cache"),(0,l.createElement)("br",null),(0,E.createInterpolateElement)((0,d.__)("It is recommended to add the browser caching rules that you find <button>here</button>.","wp-cloudflare-page-cache"),{button:(0,l.createElement)(v,null)})),controls:[{id:"cf_auto_purge",type:"checkbox",label:(0,d.__)("Purge cache for related pages only","wp-cloudflare-page-cache"),recommended:!0},{id:"cf_auto_purge_all",type:"checkbox",label:(0,d.__)("Purge whole cache","wp-cloudflare-page-cache")}]},{id:"cf_fallback_cache_auto_purge",type:"toggle",label:(0,d.__)("Automatically purge the Page cache when Cloudflare cache is purged","wp-cloudflare-page-cache"),hide:!a("cf_fallback_cache")},{id:"cf_bypass_backend_page_rule",type:"toggle",label:(0,d.__)("Force cache bypassing for backend with an additional Cloudflare page rule","wp-cloudflare-page-cache"),description:(0,E.createInterpolateElement)((0,d.__)("<strong>Read here:</strong> by default, all back-end URLs are not cached thanks to some response headers, but if for some circumstances your backend pages are still cached, you can enable this option which will add an <strong>additional page rule on Cloudflare</strong> to force cache bypassing for the whole WordPress backend directly from Cloudflare.","wp-cloudflare-page-cache"),{strong:(0,l.createElement)("strong",null)}),hide:a("cf_woker_enabled")}],c=[{id:"cf_maxage",type:"number",label:(0,d.__)("Cache-Control max-age","wp-cloudflare-page-cache"),description:(0,d.__)("Don't touch if you don't know what is it. Must be greater than zero. Recommended 31536000 (1 year)","wp-cloudflare-page-cache"),min:1,max:31536e4},{id:"cf_browser_maxage",type:"number",label:(0,d.__)("Browser Cache-Control max-age","wp-cloudflare-page-cache"),description:(0,d.__)("Don't touch if you don't know what is it. Must be greater than zero. Recommended a value between 60 and 600","wp-cloudflare-page-cache"),min:1,max:31536e4}];return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Cache Lifetime Settings","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:c}))),(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Cloudflare Cache Behavior","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:t}))))};var ke=t(8068),Ae=t(8309),Ce=t(3160);const Pe=(0,p.A)("trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]),Re=()=>{const{logDownloadURL:e,logViewURL:a}=window.SPCDash,{lockAsync:t,asyncLocked:c}=(0,i.C)(),[o,n]=(0,E.useState)(!1);return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(r.A,{variant:"ghost",target:"_blank",href:e,icon:Ae.A},(0,d.__)("Download Log File","wp-cloudflare-page-cache")),(0,l.createElement)(r.A,{variant:"ghost",target:"_blank",href:a,icon:Ce.A},(0,d.__)("View Log File","wp-cloudflare-page-cache")),(0,l.createElement)(r.A,{variant:"destructive",loader:o,disabled:c,onClick:async()=>{t(!0),n(!0);const e=await ke.R.clearLogs();t(!1),n(!1),e.success?_.oR.success(e.message):_.oR.error(e.message)},icon:Pe},(0,d.__)("Clear logs now","wp-cloudflare-page-cache")))},je=()=>{const{isToggleOn:e}=(0,s.C)(),a=[{id:"log_enabled",type:"toggle",label:(0,d.__)("Log mode","wp-cloudflare-page-cache"),description:(0,d.__)("Enable this option if you want to log all activity of this plugin.","wp-cloudflare-page-cache")},{id:"log_max_file_size",type:"number",label:(0,d.__)("Max log file size in MB","wp-cloudflare-page-cache"),description:(0,d.__)("Automatically reset the log file when it exceeded the max file size. Set 0 to never reset it.","wp-cloudflare-page-cache"),hide:!e("log_enabled")},{id:"log_verbosity",type:"select",label:(0,d.__)("Log verbosity","wp-cloudflare-page-cache"),options:[{value:"1",label:(0,d.__)("Standard","wp-cloudflare-page-cache")},{value:"2",label:(0,d.__)("High","wp-cloudflare-page-cache")}],hide:!e("log_enabled")}];return(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Logs Settings","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:a})),e("log_enabled")&&(0,l.createElement)(k.wL,{className:"md:justify-end grid md:flex gap-4"},(0,l.createElement)(Re,null)))};var Se=t(6284);const Le=({content:e})=>(0,l.createElement)("div",{className:"flex mt-5"},(0,l.createElement)(Se.p,{className:"rounded-r-none border-r-0 grow h-auto",disabled:!0,value:null!=e?e:""}),(0,l.createElement)(r.A,{icon:g.A,onClick:()=>{navigator.clipboard.writeText(e),_.oR.success((0,d.__)("Copied to clipboard!","wp-cloudflare-page-cache"))},className:"rounded-l-none",size:"icon"},(0,l.createElement)("span",{className:"sr-only"},(0,d.__)("Copy to clipboard","wp-cloudflare-page-cache"))));var Ie=t(3040);const ze=()=>{const{wordpressRoles:e}=window.SPCDash,{settings:a,updateSetting:t}=(0,s.C)(),{asyncLocked:c}=(0,i.C)();return(0,l.createElement)("div",{className:"grid gap-3 mt-5 md:grid-cols-2 lg:grid-cols-1 xl:grid-cols-2 w-full"},Object.entries(e).map((([e,r],o)=>(0,l.createElement)("div",{key:`${e}-${o}`,className:"grid gap-3"},0!==o&&1!==o&&(0,l.createElement)(f.A,null),(0,l.createElement)("div",{className:"flex items-center gap-2"},(0,l.createElement)(Ie.A,{value:a.cf_purge_roles.includes(e)||!1,id:e,label:r,onChange:l=>((e,l)=>{let c=[...a.cf_purge_roles||[]];l?c.push(e):c=c.filter((a=>a!=e)),t("cf_purge_roles",c)})(e,l),disabled:c}))))))},Te=()=>{const{settings:e}=(0,s.C)(),{cronjobPurgeURL:a}=window.SPCDash,t=a.replace("replace:cf_purge_url_secret_key",e.cf_purge_url_secret_key||""),c=[{id:"cf_opcache_purge_on_flush",type:"toggle",label:(0,d.__)("Automatically purge the OPcache cache is purged","wp-cloudflare-page-cache")},{id:"cf_object_cache_purge_on_flush",type:"toggle",label:(0,d.__)("Automatically purge the object cache when cache is purged","wp-cloudflare-page-cache")},{id:"cronjob_purge_url",type:"custom",label:(0,d.__)("Purge the whole cache via Cronjob","wp-cloudflare-page-cache"),description:(0,d.__)("If you want purge the whole cache at specific intervals decided by you, you can create a cronjob that hits the following URL:","wp-cloudflare-page-cache"),component:(0,l.createElement)(Le,{content:t})},{id:"cf_purge_url_secret_key",type:"text",label:(0,d.__)("Purge cache URL secret key","wp-cloudflare-page-cache"),description:(0,d.__)("Secret key to use to purge the whole Cloudflare cache via URL. Don't touch if you don't know how to use it.","wp-cloudflare-page-cache")},{id:"cf_remove_purge_option_toolbar",type:"toggle",label:(0,d.__)("Remove purge option from toolbar","wp-cloudflare-page-cache")},{id:"cf_disable_single_metabox",type:"toggle",label:(0,d.__)("\tHide Metaboxes","wp-cloudflare-page-cache"),description:(0,d.__)("Disable the metaboxes on single pages and posts to avoid conflicts with other plugins.","wp-cloudflare-page-cache")},{id:"cf_seo_redirect",type:"toggle",label:(0,d.__)("SEO redirect","wp-cloudflare-page-cache"),description:(0,d.__)("Enable this option if you want to redirect the user to the correct page when the page is not found.","wp-cloudflare-page-cache")},{id:"purge_roles_custom",label:(0,d.__)("Select user roles allowed to purge the cache","wp-cloudflare-page-cache"),description:(0,d.__)("Admins are always allowed.","wp-cloudflare-page-cache"),type:"custom",component:(0,l.createElement)(ze,null)},{id:"cf_prefetch_urls_viewport",type:"toggle",label:(0,d.__)("Auto prefetch URLs in viewport","wp-cloudflare-page-cache"),description:(0,d.__)("If enabled, the browser prefetches in background all the internal URLs found in the viewport.","wp-cloudflare-page-cache")},{id:"cf_prefetch_urls_on_hover",type:"toggle",label:(0,d.__)("Auto prefetch URLs on mouse hover","wp-cloudflare-page-cache"),description:(0,d.__)("If enabled, the browser prefetches in background all the internal URLs found in the viewport.","wp-cloudflare-page-cache")},{type:"toggle",id:"cf_remove_cache_buster",label:(0,d.__)("Remove Cache Buster Query Parameter","wp-cloudflare-page-cache"),description:(0,d.__)("Stop adding cache buster query parameter when using the default page rule mode.","wp-cloudflare-page-cache"),hide:window.SPCDash.settings?.cf_remove_cache_buster||1},{type:"toggle",id:"keep_settings_on_deactivation",label:(0,d.__)("Keep settings on deactivation","wp-cloudflare-page-cache"),description:(0,d.__)("Keep settings on plugin deactivation.","wp-cloudflare-page-cache")}];return(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Other Settings","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:c})))},Ue=()=>{const[e,a]=(0,E.useState)(!1),{asyncLocked:t,lockAsync:c}=(0,i.C)();return(0,l.createElement)(r.A,{variant:"orange",onClick:async()=>{c(!0),a(!0);const e=await ke.R.startPreloader();c(!1),a(!1),e.success?_.oR.success(e.message):_.oR.error(e.message)},disabled:e||t,loader:e},e?(0,d.__)("Starting Preloader","wp-cloudflare-page-cache")+"...":(0,d.__)("Start Preloader","wp-cloudflare-page-cache"))},Oe=()=>{const{wordpressMenus:e}=window.SPCDash,{settings:a,isToggleOn:t,updateSetting:c}=(0,s.C)(),{asyncLocked:r}=(0,i.C)(),o=a.cf_preloader_nav_menus||[];return(0,l.createElement)("div",{className:"grid gap-3 mt-5"},Object.entries(e).map((([e,t],n)=>[0!==n&&(0,l.createElement)(f.A,{key:`separator-${e}`}),(0,l.createElement)("div",{className:"flex items-center gap-2",key:e},(0,l.createElement)(Ie.A,{value:a.cf_preloader_nav_menus.includes(e)||!1,id:e,label:(0,l.createElement)("span",null," ",(0,E.createInterpolateElement)(/* translators: %s is the menu name */ /* translators: %s is the menu name */(0,d.sprintf)((0,d.__)("Preload all internal links in <strong>%s</strong> WP Menu","wp-cloudflare-page-cache"),t),{strong:(0,l.createElement)("strong",{className:"font-bold opacity-75"})})),onChange:a=>((e,a)=>{let t=[...o];a?t.push(e):t=t.filter((a=>a!=e)),c("cf_preloader_nav_menus",t)})(e,a),disabled:r}))])),Object.keys(e).length>0&&(0,l.createElement)(f.A,null),(0,l.createElement)("div",{className:"flex items-center gap-2"},(0,l.createElement)(Ie.A,{value:t("cf_preload_last_urls"),id:"cf_preload_last_urls",label:(0,d.__)("Preload last 20 published/updated posts, pages & CPTs combined","wp-cloudflare-page-cache"),disabled:r,onChange:e=>{c("cf_preload_last_urls",e?1:0)}})))},De=()=>{const{settings:e,isToggleOn:a}=(0,s.C)(),{cronjobURL:t}=window.SPCDash,c=t.replace("replace:cf_preloader_url_secret_key",e.cf_preloader_url_secret_key||""),r=[{id:"cf_preloader",type:"toggle",label:(0,d.__)("Enable preloader","wp-cloudflare-page-cache")},{id:"cf_preloader_start_on_purge",type:"toggle",label:(0,d.__)("Automatically preload the pages you have purged from cache.","wp-cloudflare-page-cache"),hide:!a("cf_preloader")},{id:"preloader-custom-operation",type:"custom",label:(0,d.__)("Preloader operation","wp-cloudflare-page-cache"),description:(0,d.__)("Choose the URLs preloading logic that the preloader must use. If no option is chosen, the most recently published URLs and the home page will be preloaded.","wp-cloudflare-page-cache"),component:(0,l.createElement)(Oe,null),hide:!a("cf_preloader")},{id:"cf_preload_sitemap_urls",type:"textarea",label:(0,d.__)("Preload all URLs into the following sitemaps","wp-cloudflare-page-cache"),description:(0,l.createElement)(l.Fragment,null,(0,d.__)("One sitemap per line.","wp-cloudflare-page-cache"),(0,l.createElement)("br",null),(0,l.createElement)("br",null),(0,d.__)("Example","wp-cloudflare-page-cache")+":",(0,l.createElement)("br",null),(0,l.createElement)("pre",null,"/post-sitemap.xml",(0,l.createElement)("br",null),"/page-sitemap.xml",(0,l.createElement)("br",null))),hide:!a("cf_preloader")},{id:"preloader_cronjob_info",type:"custom",label:(0,d.__)("Start the preloader via Cronjob","wp-cloudflare-page-cache"),description:(0,d.__)("If you want start the preloader at specific intervals decided by you, you can create a cronjob that hits the following URL:","wp-cloudflare-page-cache"),component:(0,l.createElement)(Le,{content:c}),hide:!a("cf_preloader")},{id:"cf_preloader_url_secret_key",type:"text",label:(0,d.__)("Cronjob secret key","wp-cloudflare-page-cache"),description:(0,d.__)("Secret key to use to start the preloader via URL. Don't touch if you don't know how to use it.","wp-cloudflare-page-cache"),hide:!a("cf_preloader")}];return(0,l.createElement)(k.Ay,{className:(0,n.cn)({"pb-0":a("cf_preloader")})},(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Preloader","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:r})),a("cf_preloader")&&(0,l.createElement)(k.wL,{className:"flex justify-end"},(0,l.createElement)(Ue,null)))},Fe=()=>{const{i18n:e}=window.SPCDash,{asyncLocked:a,lockAsync:t}=(0,i.C)(),[c,o]=(0,E.useState)(!1);return(0,l.createElement)(r.A,{variant:"destructive",onClick:async()=>{t(!0),o(!0);const a=await ke.R.purgeCacheVarnish();t(!1),o(!1),a.success?_.oR.success(a.message):_.oR.error(a.message||e.genericError)},loader:c,disabled:c||a,className:"flex items-center gap-2"},c?(0,d.__)("Purging Varnish Cache","wp-cloudflare-page-cache")+"...":(0,d.__)("Purge Varnish Cache","wp-cloudflare-page-cache"))},Me=()=>{const{isToggleOn:e}=(0,s.C)(),a=[{id:"cf_varnish_support",type:"toggle",label:(0,d.__)("Varnish Support","wp-cloudflare-page-cache")},{id:"cf_varnish_hostname",type:"text",label:(0,d.__)("Hostname","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")},{id:"cf_varnish_port",type:"number",label:(0,d.__)("Port","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support"),min:0,max:65535},{id:"cf_varnish_purge_method",type:"text",label:(0,d.__)("HTTP method for single page cache purge","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")},{id:"cf_varnish_purge_all_method",type:"text",label:(0,d.__)("HTTP method for whole page cache purge","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")},{id:"cf_varnish_cw",type:"text",label:(0,d.__)("Cloudways Varnish","wp-cloudflare-page-cache"),description:(0,d.__)("Enable this option if you are using Varnish on Cloudways.","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")},{id:"cf_varnish_auto_purge",type:"toggle",label:(0,d.__)("Automatically purge Varnish cache when the cache is purged.","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")}];return(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Varnish Settings","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:a})),e("cf_varnish_support")&&(0,l.createElement)(k.wL,{className:"flex justify-end"},(0,l.createElement)(Fe,null)))},We=()=>(0,l.createElement)(c.A,null,(0,l.createElement)(xe,null),(0,l.createElement)(Ne,null),(0,l.createElement)(De,null),(0,l.createElement)(Me,null),(0,l.createElement)(je,null),(0,l.createElement)(Te,null))},7158:(e,a,t)=>{t.d(a,{A:()=>p});var l=t(1609),c=t(7213),r=t(6674),o=t(2748);function n({delayDuration:e=0,...a}){return(0,l.createElement)(r.Kq,{"data-slot":"tooltip-provider",delayDuration:e,...a})}function s({...e}){return(0,l.createElement)(n,null,(0,l.createElement)(r.bL,{"data-slot":"tooltip",...e}))}function i({...e}){return(0,l.createElement)(r.l9,{"data-slot":"tooltip-trigger",...e})}function d({className:e,sideOffset:a=0,children:t,...c}){return(0,l.createElement)(r.ZL,null,(0,l.createElement)(r.UC,{"data-slot":"tooltip-content",sideOffset:a,className:(0,o.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...c},t,(0,l.createElement)(r.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})))}const p=({children:e,className:a="",icon:t=null,text:r=""})=>{if(!e)return null;const n=t||c.A;return(0,l.createElement)(s,null,(0,l.createElement)(i,null,(0,l.createElement)(n,{size:16,className:(0,o.cn)("text-muted-foreground ml-1",a)}),r&&(0,l.createElement)("span",{className:"sr-only"},r)),(0,l.createElement)(d,null,e))}}}]);1 "use strict";(globalThis.webpackChunkwp_cloudflare_page_cache=globalThis.webpackChunkwp_cloudflare_page_cache||[]).push([[154],{341:(e,a,t)=>{t.d(a,{BE:()=>u,Uz:()=>n,_s:()=>o,cp:()=>i,gk:()=>m,uT:()=>s,zj:()=>p});var l=t(1609),c=t(7248),r=t(2748);function o({...e}){return(0,l.createElement)(c._s.Root,{"data-slot":"drawer",...e})}function n({...e}){return(0,l.createElement)(c._s.Trigger,{"data-slot":"drawer-trigger",...e})}function s({...e}){return(0,l.createElement)(c._s.Portal,{"data-slot":"drawer-portal",...e})}function i({...e}){return(0,l.createElement)(c._s.Close,{"data-slot":"drawer-close",...e})}function d({className:e,...a}){return(0,l.createElement)(c._s.Overlay,{"data-slot":"drawer-overlay",className:(0,r.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[9999] bg-black/50",e),...a})}function p({className:e,children:a,...t}){return(0,l.createElement)(s,{"data-slot":"drawer-portal"},(0,l.createElement)(d,null),(0,l.createElement)(c._s.Content,{"data-slot":"drawer-content",className:(0,r.cn)("group/drawer-content bg-background fixed z-[10000] isolate flex flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...t},a))}function u({className:e,...a}){return(0,l.createElement)("div",{"data-slot":"drawer-header",className:(0,r.cn)("flex flex-col gap-1.5 p-3",e),...a})}function m({className:e,...a}){return(0,l.createElement)(c._s.Title,{"data-slot":"drawer-title",className:(0,r.cn)("text-foreground font-semibold",e),...a})}},1747:(e,a,t)=>{t.d(a,{F:()=>o});var l=t(1609),c=t(4674),r=t(2748);function o({className:e,children:a,...t}){return(0,l.createElement)(c.bL,{"data-slot":"scroll-area",className:(0,r.cn)("relative",e),...t},(0,l.createElement)(c.LM,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"},a),(0,l.createElement)(n,null),(0,l.createElement)(c.OK,null))}function n({className:e,orientation:a="vertical",...t}){return(0,l.createElement)(c.VM,{"data-slot":"scroll-area-scrollbar",orientation:a,className:(0,r.cn)("flex touch-none p-px transition-colors select-none","vertical"===a&&"h-full w-2.5 border-l border-l-transparent","horizontal"===a&&"h-2.5 flex-col border-t border-t-transparent",e),...t},(0,l.createElement)(c.lr,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"}))}},2154:(e,a,t)=>{t.r(a),t.d(a,{default:()=>We});var l=t(1609),c=t(3781),r=t(5975),o=t(341),n=t(2748),s=t(4585),i=t(4758),d=t(7723),p=t(9407);const u=(0,p.A)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);var m=t(8697),h=t(827),_=t(5404),g=t(4721),f=t(7102),b=t(9391),w=t(1747),y=t(504),E=t(6087);const v=()=>{const{darkMode:e}=(0,i.C)(),{isToggleOn:a,settings:t}=(0,s.C)(),{i18n:c}=window.SPCDash,p=e=>{navigator.clipboard.writeText(e),g.oR.success((0,d.__)("Copied to clipboard!","wp-cloudflare-page-cache"))},v=(0,d.sprintf)("map $upstream_http_x_wp_cf_super_cache_active $wp_cf_super_cache_active {\n default 'no-cache, no-store, must-revalidate, max-age=0';\n '1' 's-maxage=%s, max-age=%s';\n}",t.cf_maxage,t.cf_browser_maxage),x="more_clear_headers 'Pragma';\nmore_clear_headers 'Expires';\nmore_clear_headers 'Cache-Control';\nadd_header Cache-Control $wp_cf_super_cache_active;";let N="";return a("cf_bypass_sitemap")&&(N+='location ~* \\.(xml|xsl)$ { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; }\n'),a("cf_bypass_file_robots")&&(N+='location /robots.txt { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; }\n'),a("cf_browser_caching_htaccess")&&(N+='location ~* \\.(css|js|pdf)$ { add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=2592000, stale-while-revalidate=86400, stale-if-error=604800"; expires 30d; }\n',N+='location ~* \\.(jpg|jpeg|png|gif|ico|eot|swf|svg|webp|avif|ttf|otf|woff|woff2|ogg|mp4|mpeg|avi|mkv|webm|mp3)$ { add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=31536000, stale-while-revalidate=86400, stale-if-error=604800"; expires 365d; }\n'),N+='location /wp-cron.php { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; }\n',(0,l.createElement)(o._s,null,(0,l.createElement)(o.Uz,{className:"underline text-current cursor-pointer"},(0,d.__)("here","wp-cloudflare-page-cache")),(0,l.createElement)(o.uT,null,(0,l.createElement)(o.zj,{className:(0,n.cn)("overflow-hidden",{dark:e})},(0,l.createElement)(o.BE,{className:"border-b border-border bg-muted"},(0,l.createElement)(y.A,{className:"text-left flex items-center justify-between w-full"},(0,l.createElement)(o.gk,null,(0,l.createElement)("h2",{className:"flex items-center text-lg mb-0"},(0,l.createElement)(u,{className:"size-6 text-orange-500 mr-3"}),(0,d.__)("Nginx Instructions","wp-cloudflare-page-cache"))),(0,l.createElement)(o.cp,null,(0,l.createElement)(r.A,{variant:"ghost",size:"icon",icon:m.A},(0,l.createElement)("span",{className:"sr-only"},c.close))))),(0,l.createElement)(w.F,{className:"overflow-auto max-w-full max-h-[80vh] py-5"},(0,l.createElement)(y.A,{className:"py-0"},a("cf_cache_control_htaccess")&&(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",{className:"flex items-center mb-3"},(0,l.createElement)(h.A,{className:"size-5 mr-2 text-blue-500"}),(0,l.createElement)("h3",{className:"text-base"},(0,d.__)("Overwrite the cache-control header","wp-cloudflare-page-cache"))),(0,l.createElement)("div",{className:"space-y-4"},(0,l.createElement)("p",{className:"text-sm mb-2 text-muted-foreground"},(0,E.createInterpolateElement)((0,d.__)("Edit the main Nginx configuration file, usually <code>/etc/nginx.conf</code>, and enter these rules immediately after opening the http block:","wp-cloudflare-page-cache"),{code:(0,l.createElement)("code",{className:"px-2 py-1 rounded bg-muted font-mono"},"/etc/nginx.conf")})),(0,l.createElement)("div",{className:"relative"},(0,l.createElement)(r.A,{variant:"default",size:"icon",onClick:()=>p(v),icon:_.A,className:"absolute top-2 right-2 z-10"},(0,l.createElement)("span",{className:"sr-only"},(0,d.__)("Copy to clipboard","wp-cloudflare-page-cache"))),(0,l.createElement)("pre",{className:"text-muted-foreground bg-muted border border-border break-all p-4 rounded-2xl overflow-x-auto text-sm whitespace-pre-wrap"},v)),(0,l.createElement)("div",null,(0,l.createElement)("p",{className:"text-sm mb-2 text-muted-foreground"},(0,d.__)("Now open the configuration file of your domain and add the following rules inside the block that deals with the management of PHP pages:","wp-cloudflare-page-cache")),(0,l.createElement)("div",{className:"relative"},(0,l.createElement)(r.A,{variant:"default",size:"icon",onClick:()=>p(x),className:"absolute top-2 right-2 z-10",icon:_.A},(0,l.createElement)("span",{className:"sr-only"},(0,d.__)("Copy to clipboard","wp-cloudflare-page-cache"))),(0,l.createElement)("pre",{className:"text-muted-foreground bg-muted border border-border p-4 rounded-2xl overflow-y-auto text-sm whitespace-pre-wrap"},x)))),(0,l.createElement)(f.A,{className:"my-5"})),(0,l.createElement)("div",{className:"flex items-center mb-3"},(0,l.createElement)(h.A,{className:"size-5 mr-2 text-blue-500"}),(0,l.createElement)("h3",{className:"text-base"},(0,d.__)("Browser caching rules","wp-cloudflare-page-cache"))),(0,l.createElement)("div",{className:"space-y-4"},(0,l.createElement)("div",null,(0,l.createElement)("p",{className:"text-sm mb-2 text-muted-foreground"},(0,d.__)("Open the configuration file of your domain and add the following rules:","wp-cloudflare-page-cache")),(0,l.createElement)("div",{className:"relative"},(0,l.createElement)(r.A,{variant:"default",size:"icon",onClick:()=>p(N),className:"absolute top-2 right-2 z-10",icon:_.A},(0,l.createElement)("span",{className:"sr-only"},(0,d.__)("Copy to clipboard","wp-cloudflare-page-cache"))),(0,l.createElement)("pre",{className:"text-muted-foreground bg-muted border border-border p-4 rounded-2xl overflow-y-auto text-sm whitespace-pre-wrap"},N)))),(0,l.createElement)(b.A,{type:"info",className:"my-5",title:(0,d.__)("Save and restart Nginx.","wp-cloudflare-page-cache")}))))))};var x=t(7158),N=t(2318),k=t(5181),A=t(2133),C=t(6214),P=t(1071),R=t(9957),j=t(1351),S=t(2579),L=t(8834),I=t(1104),z=t(1427),T=t(4848),U="Accordion",O=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[D,F,M]=(0,C.N)(U),[W,V]=(0,A.A)(U,[M,L.z3]),H=(0,L.z3)(),$=l.forwardRef(((e,a)=>{const{type:t,...l}=e,c=l,r=l;return(0,T.jsx)(D.Provider,{scope:e.__scopeAccordion,children:"multiple"===t?(0,T.jsx)(J,{...r,ref:a}):(0,T.jsx)(G,{...c,ref:a})})}));$.displayName=U;var[q,B]=W(U),[K,X]=W(U,{collapsible:!1}),G=l.forwardRef(((e,a)=>{const{value:t,defaultValue:c,onValueChange:r=()=>{},collapsible:o=!1,...n}=e,[s,i]=(0,j.i)({prop:t,defaultProp:c??"",onChange:r,caller:U});return(0,T.jsx)(q,{scope:e.__scopeAccordion,value:l.useMemo((()=>s?[s]:[]),[s]),onItemOpen:i,onItemClose:l.useCallback((()=>o&&i("")),[o,i]),children:(0,T.jsx)(K,{scope:e.__scopeAccordion,collapsible:o,children:(0,T.jsx)(Y,{...n,ref:a})})})})),J=l.forwardRef(((e,a)=>{const{value:t,defaultValue:c,onValueChange:r=()=>{},...o}=e,[n,s]=(0,j.i)({prop:t,defaultProp:c??[],onChange:r,caller:U}),i=l.useCallback((e=>s(((a=[])=>[...a,e]))),[s]),d=l.useCallback((e=>s(((a=[])=>a.filter((a=>a!==e))))),[s]);return(0,T.jsx)(q,{scope:e.__scopeAccordion,value:n,onItemOpen:i,onItemClose:d,children:(0,T.jsx)(K,{scope:e.__scopeAccordion,collapsible:!0,children:(0,T.jsx)(Y,{...o,ref:a})})})})),[Q,Z]=W(U),Y=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,disabled:c,dir:r,orientation:o="vertical",...n}=e,s=l.useRef(null),i=(0,P.s)(s,a),d=F(t),p="ltr"===(0,z.jH)(r),u=(0,R.m)(e.onKeyDown,(e=>{if(!O.includes(e.key))return;const a=e.target,t=d().filter((e=>!e.ref.current?.disabled)),l=t.findIndex((e=>e.ref.current===a)),c=t.length;if(-1===l)return;e.preventDefault();let r=l;const n=c-1,s=()=>{r=l+1,r>n&&(r=0)},i=()=>{r=l-1,r<0&&(r=n)};switch(e.key){case"Home":r=0;break;case"End":r=n;break;case"ArrowRight":"horizontal"===o&&(p?s():i());break;case"ArrowDown":"vertical"===o&&s();break;case"ArrowLeft":"horizontal"===o&&(p?i():s());break;case"ArrowUp":"vertical"===o&&i()}const u=r%c;t[u].ref.current?.focus()}));return(0,T.jsx)(Q,{scope:t,disabled:c,direction:r,orientation:o,children:(0,T.jsx)(D.Slot,{scope:t,children:(0,T.jsx)(S.sG.div,{...n,"data-orientation":o,ref:i,onKeyDown:c?void 0:u})})})})),ee="AccordionItem",[ae,te]=W(ee),le=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,value:l,...c}=e,r=Z(ee,t),o=B(ee,t),n=H(t),s=(0,I.B)(),i=l&&o.value.includes(l)||!1,d=r.disabled||e.disabled;return(0,T.jsx)(ae,{scope:t,open:i,disabled:d,triggerId:s,children:(0,T.jsx)(L.bL,{"data-orientation":r.orientation,"data-state":de(i),...n,...c,ref:a,disabled:d,open:i,onOpenChange:e=>{e?o.onItemOpen(l):o.onItemClose(l)}})})}));le.displayName=ee;var ce="AccordionHeader",re=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,...l}=e,c=Z(U,t),r=te(ce,t);return(0,T.jsx)(S.sG.h3,{"data-orientation":c.orientation,"data-state":de(r.open),"data-disabled":r.disabled?"":void 0,...l,ref:a})}));re.displayName=ce;var oe="AccordionTrigger",ne=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,...l}=e,c=Z(U,t),r=te(oe,t),o=X(oe,t),n=H(t);return(0,T.jsx)(D.ItemSlot,{scope:t,children:(0,T.jsx)(L.l9,{"aria-disabled":r.open&&!o.collapsible||void 0,"data-orientation":c.orientation,id:r.triggerId,...n,...l,ref:a})})}));ne.displayName=oe;var se="AccordionContent",ie=l.forwardRef(((e,a)=>{const{__scopeAccordion:t,...l}=e,c=Z(U,t),r=te(se,t),o=H(t);return(0,T.jsx)(L.UC,{role:"region","aria-labelledby":r.triggerId,"data-orientation":c.orientation,...o,...l,ref:a,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})}));function de(e){return e?"open":"closed"}ie.displayName=se;var pe=$,ue=le,me=re,he=ne,_e=ie;const ge=(0,p.A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);function fe({...e}){return(0,l.createElement)(pe,{"data-slot":"accordion",...e})}function be({className:e,...a}){return(0,l.createElement)(ue,{"data-slot":"accordion-item",className:e,...a})}function we({className:e,children:a,...t}){return(0,l.createElement)(me,{className:"flex",as:"p"},(0,l.createElement)(he,{"data-slot":"accordion-trigger",className:(0,n.cn)("cursor-pointer focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-center justify-between gap-4 py-2 text-left text-sm w-full font-medium transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),...t},a,(0,l.createElement)(ge,{className:"ml-auto text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})))}function ye({className:e,children:a,...t}){return(0,l.createElement)(_e,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...t},(0,l.createElement)("div",{className:(0,n.cn)("py-4",e)},a))}var Ee=t(3327);const ve=()=>(0,l.createElement)("div",{className:"grid gap-1"},(0,l.createElement)(fe,{type:"single",collapsible:!0,className:"rounded-sm border overflow-hidden"},(0,l.createElement)(be,{value:"htaccess"},(0,l.createElement)(we,{className:"!m-0 bg-muted px-4 py-3 !text-sm"},(0,d.__)("Additional info","wp-cloudflare-page-cache")),(0,l.createElement)(ye,{className:"p-4 bg-muted/20"},(0,l.createElement)(b.A,{type:"warning",title:(0,d.__)("Important Notes","wp-cloudflare-page-cache"),description:(0,E.createInterpolateElement)((0,d.__)("This option is not essential as in most cases this plugin works out of the box. If the page cache does not work after a considerable number of attempts or you see that max-age and s-maxage values of <code>X-WP-CF-Super-Cache-Cache-Control</code> response header are not the same of the ones in <code>Cache-Control</code> response header, activate this option.","wp-cloudflare-page-cache"),{code:(0,l.createElement)("code",null)})}),(0,l.createElement)("div",{className:"grid lg:grid-cols-2 gap-4 mt-4"},(0,l.createElement)(b.A,{type:"success",title:`${(0,d.__)("Read here if you use Apache","wp-cloudflare-page-cache")} (.htaccess):`,description:(0,E.createInterpolateElement)((0,d.__)("For overwriting to work, make sure that the rules added by Super Page Cache are placed at the bottom of the <code>.htaccess</code> file. If they are present <strong>BEFORE</strong> other caching rules of other plugins, move them to the bottom manually.","wp-cloudflare-page-cache"),{code:(0,l.createElement)("code",null),strong:(0,l.createElement)("strong",null)})}),(0,l.createElement)(b.A,{type:"info",title:`${(0,d.__)("Read here if you use Nginx","wp-cloudflare-page-cache")}:`,description:(0,E.createInterpolateElement)((0,d.__)("It is not possible for Super Page Cache to automatically change the settings to allow this option to work immediately. For it to work, update these settings and then follow the instructions <button>here</button>.","wp-cloudflare-page-cache"),{button:(0,l.createElement)(v,null)})})))))),xe=()=>{const{isToggleOn:e}=(0,s.C)(),a=[{id:"cf_fallback_cache_curl",type:"toggle",label:(0,d.__)("Use cURL","wp-cloudflare-page-cache"),description:(0,d.__)("Use cURL instead of WordPress advanced-cache.php to generate the Page page. It can increase the time it takes to generate the Page cache but improves compatibility with other performance plugins.","wp-cloudflare-page-cache")},{id:"cf_fallback_cache_ttl",type:"number",min:0,label:`${(0,d.__)("Cache Lifespan","wp-cloudflare-page-cache")} (${(0,d.__)("seconds","wp-cloudflare-page-cache")})`,description:(0,d.__)("Enter 0 for no expiration.","wp-cloudflare-page-cache"),hide:!e("cf_fallback_cache")},{id:"cf_fallback_cache_save_headers",type:"toggle",label:(0,d.__)("Save response headers","wp-cloudflare-page-cache"),description:`${(0,d.__)("Save response headers together with HTML code.","wp-cloudflare-page-cache")} ${(0,d.__)("The following response header will never be saved:","wp-cloudflare-page-cache")}`,hide:!e("cf_fallback_cache"),children:(0,l.createElement)("pre",{className:"text-xs mt-1"},"cache-control, set-cookie, X-WP-CF-Super-Cache*")},{id:"cf_fallback_cache_http_response_code",type:"toggle",label:(0,d.__)("Don't cache 4xx / 5xx responses","wp-cloudflare-page-cache"),description:(0,d.__)("Exclude 4xx and 5xx HTTP error responses from being cached.","wp-cloudflare-page-cache"),hide:!e("cf_fallback_cache")},{id:"cf_fallback_cache_prevent_cache_urls_without_trailing_slash",type:"toggle",label:(0,d.__)("Prevent to cache URLs without trailing slash","wp-cloudflare-page-cache"),hide:!e("cf_fallback_cache")},{id:"cf_auto_purge_on_comments",type:"toggle",label:(0,d.__)("Auto-Purge Cache on Comment Activity","wp-cloudflare-page-cache"),description:(0,d.__)("Automatically purge single post cache when a new comment is inserted into the database or when a comment is approved or deleted","wp-cloudflare-page-cache")},{id:"cf_auto_purge_on_upgrader_process_complete",type:"toggle",label:(0,d.__)("Auto-purge on Updates","wp-cloudflare-page-cache"),description:(0,d.__)("Automatically purge the cache when the plugin update process is complete","wp-cloudflare-page-cache")},{id:"cf_strip_cookies",type:"toggle",label:(0,d.__)("Strip response cookies","wp-cloudflare-page-cache"),description:(0,d.__)("Cloudflare will not cache when there are cookies in responses unless you strip out them to overwrite the behavior. If the cache does not work due to response cookies and you are sure that these cookies are not essential for the website to works, enable this option.","wp-cloudflare-page-cache")},{id:"cf_cache_control_htaccess",type:"toggle",label:(0,d.__)("Overwrite the cache-control header for WordPress's pages using web server rules","wp-cloudflare-page-cache"),description:(0,l.createElement)(N.A,{variant:"destructive"},(0,d.__)("Writes into .htaccess","wp-cloudflare-page-cache")),children:(0,l.createElement)("div",{className:"grid gap-2 mt-2"},(0,l.createElement)(b.A,{description:(0,d.__)("This option is useful if you use Super Page Cache together with other performance plugins that could affect the Cloudflare cache with their cache-control headers. It works automatically if you are using Apache as web server or as backend web server.","wp-cloudflare-page-cache")}),(0,l.createElement)(ve,null))},{id:"cf_purge_only_html",type:"toggle",label:(0,d.__)("Purge HTML pages only","wp-cloudflare-page-cache"),description:(0,d.__)("Purge only the cached HTML pages instead of the whole cache (assets & pages).","wp-cloudflare-page-cache")},{id:"cf_disable_cache_purging_queue",type:"toggle",label:(0,d.__)("Disable cache purging using queue","wp-cloudflare-page-cache"),description:(0,d.__)("By default this plugin purge the cache after 10 seconds from the purging action, to avoid a high number of purge requests in case of multiple events triggered by third party plugins. This is done using a classic WordPress scheduled event. If you notice any errors regarding the scheduled intervals, you can deactivate this mode by enabling this option.","wp-cloudflare-page-cache")},{id:"advanced_exclude_dynamic_content",type:"checkbox-group",label:(0,d.__)("Don't cache the following dynamic contents:","wp-cloudflare-page-cache"),controls:[{id:"cf_bypass_404",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("404 Page","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_404"))," ")},{id:"cf_bypass_single_post",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Single posts","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_single"))," ")},{id:"cf_bypass_pages",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Pages","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_page"))," ")},{id:"cf_bypass_front_page",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Front Page","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_front_page"))," ")},{id:"cf_bypass_home",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Home","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_home"))," ")},{id:"cf_bypass_archives",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Archives","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_archive"))," ")},{id:"cf_bypass_tags",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Tags","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_tag"))," ")},{id:"cf_bypass_category",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Categories","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_category"))," ")},{id:"cf_bypass_feeds",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Feeds","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_feed"))," ")},{id:"cf_bypass_search_pages",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Search Pages","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_search"))," ")},{id:"cf_bypass_author_pages",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Author Pages","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_author"))," ")},{id:"cf_bypass_amp",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("AMP pages","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_amp"))," ")},{id:"cf_bypass_ajax",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Ajax requests","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_ajax"))," ")},{id:"cf_bypass_query_var",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("Pages with query args","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_query_var"))," ")},{id:"cf_bypass_wp_json_rest",type:"checkbox",label:(0,l.createElement)("div",{className:"flex items-center"},(0,d.__)("WP JSON endpoints","wp-cloudflare-page-cache")," ",(0,l.createElement)(x.A,null,(0,l.createElement)("code",null,"is_wp_json_rest"))," ")}]},{id:"advanced_exclude_dynamic_content",type:"checkbox-group",label:(0,d.__)("Don't cache the following static contents:","wp-cloudflare-page-cache"),stack:!0,description:(0,l.createElement)(l.Fragment,null,(0,E.createInterpolateElement)((0,d.__)("<strong>If you use Nginx:</strong> It is recommended to add the browser caching rules that you find in the instructions <button>here</button>.","wp-cloudflare-page-cache"),{strong:(0,l.createElement)("strong",null),button:(0,l.createElement)(v,null)}),(0,l.createElement)("br",null),(0,l.createElement)(N.A,{variant:"destructive",className:"mt-3"},(0,d.__)("Writes into .htaccess","wp-cloudflare-page-cache"))),controls:[{id:"cf_bypass_sitemap",type:"checkbox",label:(0,d.__)("XML sitemaps","wp-cloudflare-page-cache")},{id:"cf_bypass_file_robots",type:"checkbox",label:(0,d.__)("Robots.txt","wp-cloudflare-page-cache")}]},{id:"cf_post_per_page",type:"number",min:1,max:100,label:(0,d.__)("Posts per page","wp-cloudflare-page-cache"),description:(0,d.__)("Enter how many posts per page (or category) the theme shows to your users. It will be use to clean up the pagination on cache purge.","wp-cloudflare-page-cache")}],t=[{id:"cf_browser_caching_htaccess",type:"toggle",label:(0,d.__)("Add browser caching rules for static assets","wp-cloudflare-page-cache"),description:(0,l.createElement)(l.Fragment,null,(0,E.createInterpolateElement)((0,d.__)("<strong>If you use Nginx:</strong> it is not possible for Super Page Cache to automatically change the settings to allow this option to work immediately. For it to work, update these settings and then follow the instructions <button>here</button>."),{button:(0,l.createElement)(v,null),strong:(0,l.createElement)("strong",null)}),(0,l.createElement)("br",null),(0,l.createElement)(N.A,{variant:"destructive",className:"mt-3"},(0,d.__)("Writes into .htaccess","wp-cloudflare-page-cache"))),children:(0,l.createElement)(b.A,{type:"warning",className:"mt-5"},(0,d.__)('If you are using Plesk, make sure you have disabled the options "Smart static files processing" and "Serve static files directly by Nginx" on "Apache & Nginx Settings" page of your Plesk panel or ask your hosting provider to update browser caching rules for you.',"wp-cloudflare-page-cache"))}];return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Cache","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:a}))),(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Browser Caching","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)("div",{className:"p-4"},(0,l.createElement)(b.A,{description:(0,d.__)("This option is useful if you want to use Super Page Cache to enable browser caching rules for assets such like images, CSS, scripts, etc. It works automatically if you use Apache as web server or as backend web server.","wp-cloudflare-page-cache")})),(0,l.createElement)(Ee.A,{controls:t}))))},Ne=()=>{const{settings:e,isToggleOn:a}=(0,s.C)();e.cf_page_rule_id;const t=[{id:"group-cf-behavior",type:"checkbox-group",label:(0,d.__)("Automatically purge the Cloudflare's cache when something changes on the website","wp-cloudflare-page-cache"),stack:!0,description:(0,l.createElement)(l.Fragment,null,(0,d.__)("Example: update/publish a post/page","wp-cloudflare-page-cache"),(0,l.createElement)("br",null),(0,E.createInterpolateElement)((0,d.__)("It is recommended to add the browser caching rules that you find <button>here</button>.","wp-cloudflare-page-cache"),{button:(0,l.createElement)(v,null)})),controls:[{id:"cf_auto_purge",type:"checkbox",label:(0,d.__)("Purge cache for related pages only","wp-cloudflare-page-cache"),recommended:!0},{id:"cf_auto_purge_all",type:"checkbox",label:(0,d.__)("Purge whole cache","wp-cloudflare-page-cache")}]},{id:"cf_fallback_cache_auto_purge",type:"toggle",label:(0,d.__)("Automatically purge the Page cache when Cloudflare cache is purged","wp-cloudflare-page-cache"),hide:!a("cf_fallback_cache")},{id:"cf_bypass_backend_page_rule",type:"toggle",label:(0,d.__)("Force cache bypassing for backend with an additional Cloudflare page rule","wp-cloudflare-page-cache"),description:(0,E.createInterpolateElement)((0,d.__)("<strong>Read here:</strong> by default, all back-end URLs are not cached thanks to some response headers, but if for some circumstances your backend pages are still cached, you can enable this option which will add an <strong>additional page rule on Cloudflare</strong> to force cache bypassing for the whole WordPress backend directly from Cloudflare.","wp-cloudflare-page-cache"),{strong:(0,l.createElement)("strong",null)}),hide:a("cf_woker_enabled")}],c=[{id:"cf_maxage",type:"number",label:(0,d.__)("Cache-Control max-age","wp-cloudflare-page-cache"),description:(0,d.__)("Don't touch if you don't know what is it. Must be greater than zero. Recommended 31536000 (1 year)","wp-cloudflare-page-cache"),min:1,max:31536e4},{id:"cf_browser_maxage",type:"number",label:(0,d.__)("Browser Cache-Control max-age","wp-cloudflare-page-cache"),description:(0,d.__)("Don't touch if you don't know what is it. Must be greater than zero. Recommended a value between 60 and 600","wp-cloudflare-page-cache"),min:1,max:31536e4}];return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Cache Lifetime Settings","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:c}))),(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Cloudflare Cache Behavior","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:t}))))};var ke=t(8068),Ae=t(8309),Ce=t(3160);const Pe=(0,p.A)("trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]),Re=()=>{const{logDownloadURL:e,logViewURL:a}=window.SPCDash,{lockAsync:t,asyncLocked:c}=(0,i.C)(),[o,n]=(0,E.useState)(!1);return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(r.A,{variant:"ghost",target:"_blank",href:e,icon:Ae.A},(0,d.__)("Download Log File","wp-cloudflare-page-cache")),(0,l.createElement)(r.A,{variant:"ghost",target:"_blank",href:a,icon:Ce.A},(0,d.__)("View Log File","wp-cloudflare-page-cache")),(0,l.createElement)(r.A,{variant:"destructive",loader:o,disabled:c,onClick:async()=>{t(!0),n(!0);const e=await ke.R.clearLogs();t(!1),n(!1),e.success?g.oR.success(e.message):g.oR.error(e.message)},icon:Pe},(0,d.__)("Clear logs now","wp-cloudflare-page-cache")))},je=()=>{const{isToggleOn:e}=(0,s.C)(),a=[{id:"log_enabled",type:"toggle",label:(0,d.__)("Log mode","wp-cloudflare-page-cache"),description:(0,d.__)("Enable this option if you want to log all activity of this plugin.","wp-cloudflare-page-cache")},{id:"log_max_file_size",type:"number",label:(0,d.__)("Max log file size in MB","wp-cloudflare-page-cache"),description:(0,d.__)("Automatically reset the log file when it exceeded the max file size. Set 0 to never reset it.","wp-cloudflare-page-cache"),hide:!e("log_enabled")},{id:"log_verbosity",type:"select",label:(0,d.__)("Log verbosity","wp-cloudflare-page-cache"),options:[{value:"1",label:(0,d.__)("Standard","wp-cloudflare-page-cache")},{value:"2",label:(0,d.__)("High","wp-cloudflare-page-cache")}],hide:!e("log_enabled")}];return(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Logs Settings","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:a})),e("log_enabled")&&(0,l.createElement)(k.wL,{className:"md:justify-end grid md:flex gap-4"},(0,l.createElement)(Re,null)))};var Se=t(6284);const Le=({content:e})=>(0,l.createElement)("div",{className:"flex mt-5"},(0,l.createElement)(Se.p,{className:"rounded-r-none border-r-0 grow h-auto",disabled:!0,value:null!=e?e:""}),(0,l.createElement)(r.A,{icon:_.A,onClick:()=>{navigator.clipboard.writeText(e),g.oR.success((0,d.__)("Copied to clipboard!","wp-cloudflare-page-cache"))},className:"rounded-l-none",size:"icon"},(0,l.createElement)("span",{className:"sr-only"},(0,d.__)("Copy to clipboard","wp-cloudflare-page-cache"))));var Ie=t(3040);const ze=()=>{const{wordpressRoles:e}=window.SPCDash,{settings:a,updateSetting:t}=(0,s.C)(),{asyncLocked:c}=(0,i.C)();return(0,l.createElement)("div",{className:"grid gap-3 mt-5 md:grid-cols-2 lg:grid-cols-1 xl:grid-cols-2 w-full"},Object.entries(e).map((([e,r],o)=>(0,l.createElement)("div",{key:`${e}-${o}`,className:"grid gap-3"},0!==o&&1!==o&&(0,l.createElement)(f.A,null),(0,l.createElement)("div",{className:"flex items-center gap-2"},(0,l.createElement)(Ie.A,{value:a.cf_purge_roles.includes(e)||!1,id:e,label:r,onChange:l=>((e,l)=>{let c=[...a.cf_purge_roles||[]];l?c.push(e):c=c.filter((a=>a!=e)),t("cf_purge_roles",c)})(e,l),disabled:c}))))))},Te=()=>{const{settings:e}=(0,s.C)(),{cronjobPurgeURL:a}=window.SPCDash,t=a.replace("replace:cf_purge_url_secret_key",e.cf_purge_url_secret_key||""),c=[{id:"cf_opcache_purge_on_flush",type:"toggle",label:(0,d.__)("Automatically purge the OPcache cache is purged","wp-cloudflare-page-cache")},{id:"cf_object_cache_purge_on_flush",type:"toggle",label:(0,d.__)("Automatically purge the object cache when cache is purged","wp-cloudflare-page-cache")},{id:"cronjob_purge_url",type:"custom",label:(0,d.__)("Purge the whole cache via Cronjob","wp-cloudflare-page-cache"),description:(0,d.__)("If you want purge the whole cache at specific intervals decided by you, you can create a cronjob that hits the following URL:","wp-cloudflare-page-cache"),component:(0,l.createElement)(Le,{content:t})},{id:"cf_purge_url_secret_key",type:"text",label:(0,d.__)("Purge cache URL secret key","wp-cloudflare-page-cache"),description:(0,d.__)("Secret key to use to purge the whole Cloudflare cache via URL. Don't touch if you don't know how to use it.","wp-cloudflare-page-cache")},{id:"cf_remove_purge_option_toolbar",type:"toggle",label:(0,d.__)("Remove purge option from toolbar","wp-cloudflare-page-cache")},{id:"cf_disable_single_metabox",type:"toggle",label:(0,d.__)("\tHide Metaboxes","wp-cloudflare-page-cache"),description:(0,d.__)("Disable the metaboxes on single pages and posts to avoid conflicts with other plugins.","wp-cloudflare-page-cache")},{id:"cf_seo_redirect",type:"toggle",label:(0,d.__)("SEO redirect","wp-cloudflare-page-cache"),description:(0,d.__)("Enable this option if you want to redirect the user to the correct page when the page is not found.","wp-cloudflare-page-cache")},{id:"purge_roles_custom",label:(0,d.__)("Select user roles allowed to purge the cache","wp-cloudflare-page-cache"),description:(0,d.__)("Admins are always allowed.","wp-cloudflare-page-cache"),type:"custom",component:(0,l.createElement)(ze,null)},{id:"cf_prefetch_urls_viewport",type:"toggle",label:(0,d.__)("Auto prefetch URLs in viewport","wp-cloudflare-page-cache"),description:(0,d.__)("If enabled, the browser prefetches in background all the internal URLs found in the viewport.","wp-cloudflare-page-cache")},{id:"cf_prefetch_urls_on_hover",type:"toggle",label:(0,d.__)("Auto prefetch URLs on mouse hover","wp-cloudflare-page-cache"),description:(0,d.__)("If enabled, the browser prefetches in background all the internal URLs found in the viewport.","wp-cloudflare-page-cache")},{type:"toggle",id:"cf_remove_cache_buster",label:(0,d.__)("Remove Cache Buster Query Parameter","wp-cloudflare-page-cache"),description:(0,d.__)("Stop adding cache buster query parameter when using the default page rule mode.","wp-cloudflare-page-cache"),hide:window.SPCDash.settings?.cf_remove_cache_buster||1},{type:"toggle",id:"keep_settings_on_deactivation",label:(0,d.__)("Keep settings on deactivation","wp-cloudflare-page-cache"),description:(0,d.__)("Keep settings on plugin deactivation.","wp-cloudflare-page-cache")}];return(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Other Settings","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:c})))},Ue=()=>{const[e,a]=(0,E.useState)(!1),{asyncLocked:t,lockAsync:c}=(0,i.C)();return(0,l.createElement)(r.A,{variant:"orange",onClick:async()=>{c(!0),a(!0);const e=await ke.R.startPreloader();c(!1),a(!1),e.success?g.oR.success(e.message):g.oR.error(e.message)},disabled:e||t,loader:e},e?(0,d.__)("Starting Preloader","wp-cloudflare-page-cache")+"...":(0,d.__)("Start Preloader","wp-cloudflare-page-cache"))},Oe=()=>{const{wordpressMenus:e}=window.SPCDash,{settings:a,isToggleOn:t,updateSetting:c}=(0,s.C)(),{asyncLocked:r}=(0,i.C)(),o=a.cf_preloader_nav_menus||[];return(0,l.createElement)("div",{className:"grid gap-3 mt-5"},Object.entries(e).map((([e,t],n)=>[0!==n&&(0,l.createElement)(f.A,{key:`separator-${e}`}),(0,l.createElement)("div",{className:"flex items-center gap-2",key:e},(0,l.createElement)(Ie.A,{value:a.cf_preloader_nav_menus.includes(e)||!1,id:e,label:(0,l.createElement)("span",null," ",(0,E.createInterpolateElement)(/* translators: %s is the menu name */ /* translators: %s is the menu name */(0,d.sprintf)((0,d.__)("Preload all internal links in <strong>%s</strong> WP Menu","wp-cloudflare-page-cache"),t),{strong:(0,l.createElement)("strong",{className:"font-bold opacity-75"})})),onChange:a=>((e,a)=>{let t=[...o];a?t.push(e):t=t.filter((a=>a!=e)),c("cf_preloader_nav_menus",t)})(e,a),disabled:r}))])),Object.keys(e).length>0&&(0,l.createElement)(f.A,null),(0,l.createElement)("div",{className:"flex items-center gap-2"},(0,l.createElement)(Ie.A,{value:t("cf_preload_last_urls"),id:"cf_preload_last_urls",label:(0,d.__)("Preload last 20 published/updated posts, pages & CPTs combined","wp-cloudflare-page-cache"),disabled:r,onChange:e=>{c("cf_preload_last_urls",e?1:0)}})))},De=()=>{const{settings:e,isToggleOn:a}=(0,s.C)(),{cronjobURL:t}=window.SPCDash,c=t.replace("replace:cf_preloader_url_secret_key",e.cf_preloader_url_secret_key||""),r=[{id:"cf_preloader",type:"toggle",label:(0,d.__)("Enable preloader","wp-cloudflare-page-cache")},{id:"cf_preloader_start_on_purge",type:"toggle",label:(0,d.__)("Automatically preload the pages you have purged from cache.","wp-cloudflare-page-cache"),hide:!a("cf_preloader")},{id:"preloader-custom-operation",type:"custom",label:(0,d.__)("Preloader operation","wp-cloudflare-page-cache"),description:(0,d.__)("Choose the URLs preloading logic that the preloader must use. If no option is chosen, the most recently published URLs and the home page will be preloaded.","wp-cloudflare-page-cache"),component:(0,l.createElement)(Oe,null),hide:!a("cf_preloader")},{id:"cf_preload_sitemap_urls",type:"textarea",label:(0,d.__)("Preload all URLs into the following sitemaps","wp-cloudflare-page-cache"),description:(0,l.createElement)(l.Fragment,null,(0,d.__)("One sitemap per line.","wp-cloudflare-page-cache"),(0,l.createElement)("br",null),(0,l.createElement)("br",null),(0,d.__)("Example","wp-cloudflare-page-cache")+":",(0,l.createElement)("br",null),(0,l.createElement)("pre",null,"/post-sitemap.xml",(0,l.createElement)("br",null),"/page-sitemap.xml",(0,l.createElement)("br",null))),hide:!a("cf_preloader")},{id:"preloader_cronjob_info",type:"custom",label:(0,d.__)("Start the preloader via Cronjob","wp-cloudflare-page-cache"),description:(0,d.__)("If you want start the preloader at specific intervals decided by you, you can create a cronjob that hits the following URL:","wp-cloudflare-page-cache"),component:(0,l.createElement)(Le,{content:c}),hide:!a("cf_preloader")},{id:"cf_preloader_url_secret_key",type:"text",label:(0,d.__)("Cronjob secret key","wp-cloudflare-page-cache"),description:(0,d.__)("Secret key to use to start the preloader via URL. Don't touch if you don't know how to use it.","wp-cloudflare-page-cache"),hide:!a("cf_preloader")}];return(0,l.createElement)(k.Ay,{className:(0,n.cn)({"pb-0":a("cf_preloader")})},(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Preloader","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:r})),a("cf_preloader")&&(0,l.createElement)(k.wL,{className:"flex justify-end"},(0,l.createElement)(Ue,null)))},Fe=()=>{const{i18n:e}=window.SPCDash,{asyncLocked:a,lockAsync:t}=(0,i.C)(),[c,o]=(0,E.useState)(!1);return(0,l.createElement)(r.A,{variant:"destructive",onClick:async()=>{t(!0),o(!0);const a=await ke.R.purgeCacheVarnish();t(!1),o(!1),a.success?g.oR.success(a.message):g.oR.error(a.message||e.genericError)},loader:c,disabled:c||a,className:"flex items-center gap-2"},c?(0,d.__)("Purging Varnish Cache","wp-cloudflare-page-cache")+"...":(0,d.__)("Purge Varnish Cache","wp-cloudflare-page-cache"))},Me=()=>{const{isToggleOn:e}=(0,s.C)(),a=[{id:"cf_varnish_support",type:"toggle",label:(0,d.__)("Varnish Support","wp-cloudflare-page-cache")},{id:"cf_varnish_hostname",type:"text",label:(0,d.__)("Hostname","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")},{id:"cf_varnish_port",type:"number",label:(0,d.__)("Port","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support"),min:0,max:65535},{id:"cf_varnish_purge_method",type:"text",label:(0,d.__)("HTTP method for single page cache purge","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")},{id:"cf_varnish_purge_all_method",type:"text",label:(0,d.__)("HTTP method for whole page cache purge","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")},{id:"cf_varnish_cw",type:"text",label:(0,d.__)("Cloudways Varnish","wp-cloudflare-page-cache"),description:(0,d.__)("Enable this option if you are using Varnish on Cloudways.","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")},{id:"cf_varnish_auto_purge",type:"toggle",label:(0,d.__)("Automatically purge Varnish cache when the cache is purged.","wp-cloudflare-page-cache"),hide:!e("cf_varnish_support")}];return(0,l.createElement)(k.Ay,null,(0,l.createElement)(k.aR,{className:"bg-muted"},(0,l.createElement)("h3",{className:"font-semibold text-base flex items-center"},(0,d.__)("Varnish Settings","wp-cloudflare-page-cache"))),(0,l.createElement)(k.Wu,{className:"p-0"},(0,l.createElement)(Ee.A,{controls:a})),e("cf_varnish_support")&&(0,l.createElement)(k.wL,{className:"flex justify-end"},(0,l.createElement)(Fe,null)))},We=()=>(0,l.createElement)(c.A,null,(0,l.createElement)(xe,null),(0,l.createElement)(Ne,null),(0,l.createElement)(De,null),(0,l.createElement)(Me,null),(0,l.createElement)(je,null),(0,l.createElement)(Te,null))},7158:(e,a,t)=>{t.d(a,{A:()=>p});var l=t(1609),c=t(7213),r=t(6674),o=t(2748);function n({delayDuration:e=0,...a}){return(0,l.createElement)(r.Kq,{"data-slot":"tooltip-provider",delayDuration:e,...a})}function s({...e}){return(0,l.createElement)(n,null,(0,l.createElement)(r.bL,{"data-slot":"tooltip",...e}))}function i({...e}){return(0,l.createElement)(r.l9,{"data-slot":"tooltip-trigger",...e})}function d({className:e,sideOffset:a=0,children:t,...c}){return(0,l.createElement)(r.ZL,null,(0,l.createElement)(r.UC,{"data-slot":"tooltip-content",sideOffset:a,className:(0,o.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...c},t,(0,l.createElement)(r.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})))}const p=({children:e,className:a="",icon:t=null,text:r=""})=>{if(!e)return null;const n=t||c.A;return(0,l.createElement)(s,null,(0,l.createElement)(i,null,(0,l.createElement)(n,{size:16,className:(0,o.cn)("text-muted-foreground ml-1",a)}),r&&(0,l.createElement)("span",{className:"sr-only"},r)),(0,l.createElement)(d,null,e))}}}]); -
wp-cloudflare-page-cache/trunk/assets/src/pages/settings/content/advanced/AdvancedCache.tsx
r3329008 r3454474 35 35 hide: !isToggleOn('cf_fallback_cache'), 36 36 children: <pre className="text-xs mt-1">cache-control, set-cookie, X-WP-CF-Super-Cache*</pre> 37 }, 38 { 39 id: 'cf_fallback_cache_http_response_code', 40 type: 'toggle', 41 label: __('Don\'t cache 4xx / 5xx responses', 'wp-cloudflare-page-cache'), 42 description: __('Exclude 4xx and 5xx HTTP error responses from being cached.', 'wp-cloudflare-page-cache'), 43 hide: !isToggleOn('cf_fallback_cache'), 37 44 }, 38 45 { -
wp-cloudflare-page-cache/trunk/bootstrap.php
r3437972 r3454474 22 22 define( 'SWCFPC_LOGS_STANDARD_VERBOSITY', 1 ); 23 23 define( 'SWCFPC_LOGS_HIGH_VERBOSITY', 2 ); 24 define( 'SWCFPC_VERSION', '5.2. 2' );24 define( 'SWCFPC_VERSION', '5.2.3' ); 25 25 if ( ! defined( 'SPC_METRICS_DIR' ) ) { 26 26 $home_url_parts = parse_url( home_url() ); -
wp-cloudflare-page-cache/trunk/languages/wp-cloudflare-page-cache.pot
r3437972 r3454474 82 82 83 83 #. translators: %s is the path to the .htaccess file 84 #: libs/cache_controller.class.php:21 6284 #: libs/cache_controller.class.php:2172 85 85 #, php-format 86 86 msgid "The .htaccess file (%s) could not be edited. Check if the file has write permissions." 87 87 msgstr "" 88 88 89 #: libs/cache_controller.class.php:22 1290 #: libs/cache_controller.class.php:22 3291 #: libs/cache_controller.class.php:22 5589 #: libs/cache_controller.class.php:2222 90 #: libs/cache_controller.class.php:2242 91 #: libs/cache_controller.class.php:2265 92 92 msgid "Permission denied" 93 93 msgstr "" 94 94 95 #: libs/cache_controller.class.php:22 1996 #: libs/cache_controller.class.php:22 3997 #: libs/cache_controller.class.php:22 7195 #: libs/cache_controller.class.php:2229 96 #: libs/cache_controller.class.php:2249 97 #: libs/cache_controller.class.php:2281 98 98 msgid "Cache purged successfully! It may take up to 30 seconds for the cache to be permanently cleaned." 99 99 msgstr "" 100 100 101 #: libs/cache_controller.class.php:22 65101 #: libs/cache_controller.class.php:2275 102 102 msgid "An error occurred while cleaning the cache. Please check log file for further details." 103 103 msgstr "" 104 104 105 #: libs/cache_controller.class.php:2 391105 #: libs/cache_controller.class.php:2401 106 106 msgid "Super Page Cache - Purge Cache Cron Interval" 107 107 msgstr "" 108 108 109 109 #. translators: %1$s is the name of the sitemap, %2$s is the error message 110 #: libs/cache_controller.class.php:25 84110 #: libs/cache_controller.class.php:2594 111 111 #, php-format 112 112 msgid "Connection error while retriving the sitemap %1$s: %2$s" -
wp-cloudflare-page-cache/trunk/libs/cache_controller.class.php
r3405353 r3454474 1726 1726 } 1727 1727 1728 // Bypass 4xx or 5xx HTTP status codes (security blocks, errors, etc.) 1729 if ( Settings_Store::get_instance()->get( Constants::SETTING_FALLBACK_CACHE_HTTP_RESPONSE_CODE ) ) { 1730 $http_status = http_response_code(); 1731 1732 if ( $http_status !== false && $http_status >= 400 && $http_status < 600 ) { 1733 Helpers::bypass_reason_header( sprintf( 'HTTP Status %d', $http_status ) ); 1734 return true; 1735 } 1736 } 1737 1728 1738 return false; 1729 1739 } -
wp-cloudflare-page-cache/trunk/libs/html_cache.class.php
r3328083 r3454474 63 63 64 64 if ( isset( $wp_query ) && function_exists( 'is_404' ) && is_404() ) { 65 $this->main_instance->get_logger()->add_log( 'html_cache::add_current_url_to_cache', "The URL {$current_url} cannot be cached because it returns 404.", true );65 $this->main_instance->get_logger()->add_log( 'html_cache::add_current_url_to_cache', 'The URL ' . esc_url_raw( $current_url ) . ' cannot be cached because it returns 404.', true ); 66 66 67 67 return; -
wp-cloudflare-page-cache/trunk/libs/logs.class.php
r3328083 r3454474 151 151 152 152 if ( $_GET['swcfpc_download_log'] === 'view' ) { 153 echo '<pre>' . file_get_contents( $this->log_file_path) . '</pre>';153 echo '<pre>' . esc_html( file_get_contents( $this->log_file_path ) ) . '</pre>'; 154 154 155 155 exit; -
wp-cloudflare-page-cache/trunk/readme.txt
r3447704 r3454474 5 5 Requires PHP: 7.4 6 6 Tested up to: 6.9 7 Stable tag: 5.2. 27 Stable tag: 5.2.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 186 186 == Changelog == 187 187 188 ##### Version 5.2.2 (2026-01-12) 189 190 - Fixed translation updates no longer reappear after being successfully updated when using Super Page Cache. 191 - Fixed Database Optimization now respects the configured schedule and no longer deletes trashed posts immediately when the feature is enabled. 192 - Update dependencies 188 ##### Version 5.2.3 (2026-02-05) 189 190 - Enhanced security 193 191 194 192 -
wp-cloudflare-page-cache/trunk/src/Constants.php
r3405353 r3454474 50 50 public const SETTING_PURGE_ONLY_HTML = 'cf_purge_only_html'; 51 51 public const SETTING_DISABLE_PURGING_QUEUE = 'cf_disable_cache_purging_queue'; 52 public const SETTING_FALLBACK_CACHE_HTTP_RESPONSE_CODE = 'cf_fallback_cache_http_response_code'; 52 53 53 54 // Bypass Settings. -
wp-cloudflare-page-cache/trunk/src/Modules/Settings_Manager.php
r3341154 r3454474 212 212 'type' => self::SETTING_TYPE_BOOLEAN, 213 213 'default' => 0, 214 ], 215 Constants::SETTING_FALLBACK_CACHE_HTTP_RESPONSE_CODE => [ 216 'type' => self::SETTING_TYPE_BOOLEAN, 217 'bust_cache' => true, 218 'default' => 1, 214 219 ], 215 220 Constants::SETTING_BYPASS_404 => [ -
wp-cloudflare-page-cache/trunk/vendor/composer/installed.php
r3437972 r3454474 2 2 'root' => array( 3 3 'name' => 'codeinwp/wp-cloudflare-super-page-cache', 4 'pretty_version' => 'v5.2. 2',5 'version' => '5.2. 2.0',6 'reference' => ' 0d86bcdc77c60f1bf4049a1cc190ec6bf1291db2',4 'pretty_version' => 'v5.2.3', 5 'version' => '5.2.3.0', 6 'reference' => '9d99dd640381a4984bbe18ee96fa57e4501093c1', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 'codeinwp/wp-cloudflare-super-page-cache' => array( 23 'pretty_version' => 'v5.2. 2',24 'version' => '5.2. 2.0',25 'reference' => ' 0d86bcdc77c60f1bf4049a1cc190ec6bf1291db2',23 'pretty_version' => 'v5.2.3', 24 'version' => '5.2.3.0', 25 'reference' => '9d99dd640381a4984bbe18ee96fa57e4501093c1', 26 26 'type' => 'library', 27 27 'install_path' => __DIR__ . '/../../', -
wp-cloudflare-page-cache/trunk/wp-cloudflare-super-page-cache.php
r3437972 r3454474 4 4 * Plugin URI: https://wordpress.org/plugins/wp-cloudflare-page-cache/ 5 5 * Description: A WordPress performance plugin that lets you get Edge Caching enabled on a Cloudflare free plan. 6 * Version: 5.2. 26 * Version: 5.2.3 7 7 * Author: Themeisle 8 8 * Author URI: https://themeisle.com
Note: See TracChangeset
for help on using the changeset viewer.