🚀 Advanced Web Server Manager
Complete File Manager & Terminal - Standalone Version
By Sid Gifari | Gifari Industries
Current path:
/
/
home
/
duzhbywe
/
sonogahotels.com
/
wp-content
/
plugins
/
surerank
/
build
/
divi
✏️
Editing: index.js
"use strict";(globalThis.webpackChunksurerank=globalThis.webpackChunksurerank||[]).push([[177],{38679(e,t,r){var n=r(9607),o=r(1671),s=r(47143),i=r(27723),a=r(11936),l=r(61701),c=r(76016),u=r(89920),d=r(27163);const p=(e,t)=>{if(!e||!t)return;const r=document.createElement("div");r.className="surerank-root";const o=document.createElement("div");o.className=(0,n.cn)("surerank-tooltip","absolute","bg-black/95","text-white","px-3","py-[0.3125rem]","rounded","text-xs","font-normal","leading-normal","whitespace-nowrap","invisible","opacity-0","pointer-events-none","z-[9999]","top-0","left-0"),o.textContent=t,r.appendChild(o),document.body.appendChild(r);const s=()=>{(()=>{const t=e.getBoundingClientRect(),r=t.left+t.width/2;o.style.top=t.bottom+10+"px",o.style.left=r+"px"})(),o.classList.remove("invisible"),o.classList.add("visible","opacity-100")},i=()=>{o.classList.remove("visible","opacity-100"),o.classList.add("invisible","opacity-0")},a=()=>{s()},l=()=>{i()};return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",l),e.addEventListener("focus",s),e.addEventListener("blur",i),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",l),e.removeEventListener("focus",s),e.removeEventListener("blur",i),r.parentNode&&r.parentNode.removeChild(r)}},g=()=>{let e=null,t=null,r=null;const o=()=>{const r=document.querySelector(".et-vb-page-bar-tools-action-buttons");if(!r)return;if(r.querySelector(".surerank-divi-btn-wrapper"))return;e&&(e(),e=null),t&&(t(),t=null);const o=document.createElement("div");o.className="surerank-root surerank-divi-btn-wrapper";const s=document.createElement("button");s.className="et-vb-page-bar-button",s.type="button",s.setAttribute("aria-label",(0,i.__)("Open SureRank SEO","surerank")),s.tabIndex=0;const g=document.createElement("div");g.className="relative",g.style.cssText="width:28px;min-width:28px;height:28px;display:flex;align-items:center;justify-content:center;",g.innerHTML=(0,l.R)("w-5 h-5"),s.appendChild(g),s.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),(0,l.J)()}),o.appendChild(s),r.appendChild(o);const h=()=>{const e=g.querySelector(".surerank-status-indicator");e&&e.remove();const t=(()=>{const{status:e,counts:t}=(0,u.C)();if(!e||!c.Jj)return null;const r=(0,n.ns)(e),o=(0,n.x7)(t.errorAndWarnings),s=document.createElement("div");return s.className=(0,n.cn)("surerank-status-indicator","absolute top-0.5 right-0.5 size-2 rounded-full z-10 duration-200",r),s.setAttribute("aria-label",o),s.setAttribute("title",o),s})();t&&g.appendChild(t)};h(),(0,u.o)(),t=wp?.data?.subscribe?.(()=>{h(),(()=>{e&&e();const{counts:t}=(0,u.C)();e=p(s,(0,a.R)(t))})()});const{counts:f}=(0,u.C)();e=p(s,(0,a.R)(f)),(0,d.A)({triggerSelectors:[".surerank-divi-btn-wrapper button"],getStatusEl:()=>document.querySelector(".surerank-divi-btn-wrapper .surerank-status-indicator")})};o(),r=new MutationObserver(o),r.observe(document.body,{childList:!0,subtree:!0}),window.addEventListener("beforeunload",()=>{e&&(e(),e=null),t&&"function"===typeof t&&(t(),t=null),r&&(r.disconnect(),r=null)})};(()=>{let e=0,t=null,r=!1;const n=()=>{t&&"function"===typeof t&&(t(),t=null)},i=()=>{if(!r)try{const a=(0,s.select)(o.E);if(!a||"function"!==typeof a.getVariables)return void(e<50&&(e++,setTimeout(i,100)));a.getVariables()?(r=!0,n(),g()):t||(t=wp?.data?.subscribe?.(()=>{try{const e=(0,s.select)(o.E)?.getVariables();e&&!r&&(r=!0,n(),g())}catch(e){}}),setTimeout(()=>{if(!r){const e=(0,s.select)(o.E)?.getVariables();e&&(r=!0,n(),g())}},3e3))}catch(a){e<50&&(e++,setTimeout(i,100))}};i()})()},89920(e,t,r){r.d(t,{C:()=>p,o:()=>d});var n=r(47143),o=r(1671),s=r(54486),i=r(74801),a=r(76016);let l={isChecking:!1,checkedLinks:new Set,brokenLinks:new Set,allLinks:[]},c=!1;const u=e=>{l="function"===typeof e?e(l):e},d=async()=>{const e=(0,n.dispatch)(o.E),t=(0,n.select)(o.E);if(t&&e&&a.Jj&&!c)try{c=!0;const r=t.getPageSeoChecks()||{};await(0,i.OV)(()=>{},u,e.setPageSeoCheck,n.select,r,l)}catch(r){}},p=()=>{try{const e=(0,n.select)(o.E);if(!e||"function"!==typeof e.getPageSeoChecks)return{status:null,initializing:!0,counts:{errorAndWarnings:0,error:0,warning:0}};const t=e.getPageSeoChecks()||{},{categorizedChecks:r={},initializing:i=!0}=t,{status:a,counts:l}=(0,s.F)(r);return i&&(0,n.dispatch)(o.E).setPageSeoCheck("initializing",!1),{status:a,initializing:i,counts:l}}catch(e){return{status:null,initializing:!1,counts:{errorAndWarnings:0,error:0,warning:0}}}}},27163(e,t,r){r.d(t,{A:()=>p});var n=r(27723),o=r(1671),s=r(76016);const i=["#surerank-toolbar-portal button","#surerank-classic-seo-popup-trigger button","#seo-popup button"];let a=!1;const l="surerank_editor_tour_seen",c="surerank-editor-tour-style",u=()=>{try{window.localStorage.setItem(l,"1")}catch(e){}},d=()=>{try{return!!window.wp?.data?.select?.(o.E)?.getModalState?.()}catch(e){return!1}},p=({trigger:e,triggerSelectors:t=i,getStatusEl:p,stagePadding:g}={})=>{(()=>{try{return"1"===window.localStorage.getItem(l)}catch(e){return!1}})()||a||(a=!0,(async()=>{if(d())return void u();let i=!1,a=()=>{};try{window.wp?.data?.subscribe&&(a=window.wp.data.subscribe(()=>{d()&&(i=!0,u(),a())}))}catch(y){}const l=e?()=>e:()=>(e=>{for(const t of e){const e=document.querySelector(t);if(e)return e}return null})(t),h=await(f=()=>{const e=l();return e&&(e=>{if(!e||!e.isConnected)return!1;const t=e.getBoundingClientRect();if(t.width<=0||t.height<=0)return!1;const r=t.left+t.width/2,n=t.top+t.height/2;if(r<0||n<0||r>window.innerWidth||n>window.innerHeight)return!0;const o=document.elementFromPoint(r,n);return!o||e===o||e.contains(o)||o.contains(e)})(e)?e:null},new Promise(e=>{const t=Date.now();let r=null;const n=()=>{const o=f();if(o){const t=o.getBoundingClientRect(),n=[t.left,t.top,t.width,t.height].map(Math.round).join();if(n===r)return void e(o);r=n}else r=null;Date.now()-t>=8e3?e(o||null):window.setTimeout(n,350)};n()}));var f;if(!h||i)return void a();await new Promise(e=>{if(!s.Jj)return void e();const t=()=>{try{const e=window.wp?.data?.select?.(o.E)?.getPageSeoChecks?.();return!e||!1===e.initializing}catch(y){return!0}};if(t())return void e();const r=window.setInterval(()=>{t()&&(window.clearInterval(r),window.clearTimeout(n),e())},200),n=window.setTimeout(()=>{window.clearInterval(r),e()},2e4)});const k=p||(()=>(e=>{const t=e.closest(".relative")||e.parentElement;return t?t.querySelector(".size-2.rounded-full"):null})(h)),w=!!await(e=>new Promise(t=>{const r=e();if(r)return void t(r);let n=!1;const o=e=>{n||(n=!0,i.disconnect(),window.clearInterval(a),window.clearTimeout(l),t(e))},s=()=>{const t=e();t&&o(t)},i=new window.MutationObserver(s);i.observe(document.body,{childList:!0,subtree:!0});const a=window.setInterval(s,300),l=window.setTimeout(()=>o(null),2e3)}))(k);if(i)return void a();const{driver:v}=await r.e(502).then(r.bind(r,78818));if(i)return void a();a();const m=[{element:()=>l()||h,popover:{title:(0,n.__)("Optimize this page for search","surerank"),description:(0,n.__)("Open the SureRank Metabox from this icon to edit your SEO title, meta description, and social preview, along with other settings that help this page rank higher in search results.","surerank"),side:"bottom",align:"end"}}];w&&m.push({element:()=>k()||l()||h,popover:{title:(0,n.__)("Check your SEO health at a glance","surerank"),description:(0,n.__)("This dot reflects the SEO status of your page. Green means all checks pass, while red, yellow, or blue flag errors, warnings, or suggestions to review.","surerank"),side:"bottom",align:"end"}});let b=!1;(()=>{if(document.getElementById(c))return;const e=document.createElement("style");e.id=c,e.textContent="\n.driver-overlay{z-index:999999998 !important}\n.driver-popover{all:unset;box-sizing:border-box;position:fixed;top:0;right:0;z-index:1000000000;min-width:280px;max-width:340px;padding:20px;background-color:#fff;border:1px solid #E5E7EB;border-radius:12px;box-shadow:0 12px 32px -8px rgba(17,24,39,.18),0 4px 8px -4px rgba(17,24,39,.1);color:#111827;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif}\n.driver-popover *{box-sizing:border-box;font-family:inherit}\n.driver-popover-title{display:block;margin:0;padding-right:24px;font-size:15px;font-weight:600;line-height:1.4;letter-spacing:-.01em;color:#111827}\n.driver-popover-description{margin:8px 0 0;font-size:13px;font-weight:400;line-height:1.6;color:#4B5563}\n.driver-popover .driver-popover-close-btn{all:unset;position:absolute;top:14px;right:14px;left:auto;bottom:auto;width:24px;height:24px;border-radius:6px;cursor:pointer;font-size:18px;line-height:24px;text-align:center;color:#9CA3AF;transition:color .15s ease,background-color .15s ease}\n.driver-popover .driver-popover-close-btn:hover,.driver-popover .driver-popover-close-btn:focus{color:#111827;background-color:#F9FAFB}\n.driver-popover-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:18px}\n.driver-popover-progress-text{font-size:12px;font-weight:500;color:#9CA3AF}\n.driver-popover-navigation-btns{display:flex;flex-grow:1;align-items:center;justify-content:flex-end;gap:8px}\n.driver-popover-footer button{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;padding:7px 14px;border-radius:8px;font-size:13px;font-weight:500;line-height:1.2;cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease}\n.driver-popover-footer .driver-popover-prev-btn{background-color:#fff;color:#4B5563;border:1px solid #E5E7EB}\n.driver-popover-footer .driver-popover-prev-btn:hover,.driver-popover-footer .driver-popover-prev-btn:focus{background-color:#F9FAFB;color:#111827}\n.driver-popover-footer .driver-popover-next-btn{background-color:#4F46E5;color:#fff;border:1px solid #4F46E5}\n.driver-popover-footer .driver-popover-next-btn:hover,.driver-popover-footer .driver-popover-next-btn:focus{background-color:#3730A3;border-color:#3730A3}\n.driver-popover-footer .driver-popover-btn-disabled{opacity:.45;pointer-events:none}\n.driver-popover-arrow{content:'';position:absolute;border:6px solid #fff}\n.driver-popover-arrow-side-over{display:none}\n.driver-popover-arrow-side-left{left:100%;border-right-color:transparent;border-bottom-color:transparent;border-top-color:transparent}\n.driver-popover-arrow-side-right{right:100%;border-left-color:transparent;border-bottom-color:transparent;border-top-color:transparent}\n.driver-popover-arrow-side-top{top:100%;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}\n.driver-popover-arrow-side-bottom{bottom:100%;border-left-color:transparent;border-top-color:transparent;border-right-color:transparent}\n.driver-popover-arrow-side-center{display:none}\n.driver-popover-arrow-side-left.driver-popover-arrow-align-start,.driver-popover-arrow-side-right.driver-popover-arrow-align-start{top:16px}\n.driver-popover-arrow-side-top.driver-popover-arrow-align-start,.driver-popover-arrow-side-bottom.driver-popover-arrow-align-start{left:16px}\n.driver-popover-arrow-align-end.driver-popover-arrow-side-left,.driver-popover-arrow-align-end.driver-popover-arrow-side-right{bottom:16px}\n.driver-popover-arrow-side-top.driver-popover-arrow-align-end,.driver-popover-arrow-side-bottom.driver-popover-arrow-align-end{right:16px}\n.driver-popover-arrow-side-left.driver-popover-arrow-align-center,.driver-popover-arrow-side-right.driver-popover-arrow-align-center{top:50%;margin-top:-6px}\n.driver-popover-arrow-side-top.driver-popover-arrow-align-center,.driver-popover-arrow-side-bottom.driver-popover-arrow-align-center{left:50%;margin-left:-6px}\n.driver-popover-arrow-none{display:none}\n",document.head.appendChild(e)})();const _="number"===typeof g?g:(e=>{const t=e.querySelector("svg, img");if(!t)return;const r=e.getBoundingClientRect(),n=t.getBoundingClientRect(),o=Math.min(r.width,r.height),s=Math.min(n.width,n.height);return o&&s?Math.max(2,Math.min(10,Math.round(14-(o-s)/2))):void 0})(h);v({showProgress:m.length>1,allowClose:!0,nextBtnText:(0,n.__)("Next","surerank"),prevBtnText:(0,n.__)("Back","surerank"),doneBtnText:(0,n.__)("Done","surerank"),steps:m,..."number"===typeof _?{stagePadding:_}:{},onDestroyed:()=>{b||(b=!0,u())}}).drive()})().catch(()=>{}))}},18947(e,t,r){r.d(t,{SZ:()=>c,_e:()=>d,aS:()=>l,bY:()=>s,cd:()=>u,jU:()=>a});var n=r(27723),o=r(76016);const s=({id:e,title:t,status:r,description:n,data:o,showImages:s,type:i="page"})=>({id:e,title:t,status:r,description:n,data:o,showImages:s,type:i}),i=async()=>{if(window?.tinymce?.editors?.length)return document.querySelector("#set-post-thumbnail>img");const e=window?.wp?.data?.select("core/editor");if(e&&"function"===typeof e.getEditedPostContent){const t=e.getEditedPostAttribute("featured_media");if(t){const e=await new Promise(e=>{const r=wp.media.attachment(t);"function"===typeof r.fetch&&r.fetch().then(t=>e(t)).catch(()=>{e({})})});return{alt:e?.alt??"",src:e?.url??""}}}},a=async e=>{let t=[];const r=await i();if(r&&t.push(r),t=[...t,...Array.from(e.querySelectorAll("img"))?.filter(e=>e?.src)],0===t.length)return;const o=t.filter(Boolean).filter(e=>!e?.alt?.trim());if(0===o.length)return s({id:"image_alt_text",title:(0,n.__)("All images on this page have alt text attributes.","surerank"),status:"success",type:"page"});const a=window?.surerank_seo_popup?.image_seo,l=(0,n.__)("One or more images are missing alt text attributes.","surerank");let c=`${l} ${(0,n.__)("You can add them manually, or generate descriptive alt text with AI.","surerank")}`;return a&&(c=`${l} ${(0,n.__)("But don't worry, we will add them automatically for you on the front end (using the file name). For more descriptive alt text, generate it with AI.","surerank")}`),s({id:"image_alt_text",title:c,status:"suggestion",data:Array.from(new Set(o.map(e=>e.src))),showImages:!0,type:"page"})},l=async e=>{const t=!!await i(),r=e.querySelectorAll("img, figure img, figure picture, figure.is-type-photo").length>0||t,o=e.querySelectorAll("video, figure.is-type-video").length>0;return s(r||o?!r&&o?{id:"media_present",title:(0,n.__)("This page includes video(s) but no images.","surerank"),status:"warning",type:"page"}:{id:"media_present",title:(0,n.__)("This page includes images or videos to enhance content.","surerank"),status:"success",type:"page"}:{id:"media_present",title:(0,n.__)("No images or videos found on this page.","surerank"),status:"warning",type:"page"})},c=e=>{const t=Array.from(e.querySelectorAll("a[href]"));return 0===t.length?s({id:"links_present",title:(0,n.__)("No links found on this page.","surerank"),status:"warning",type:"page"}):t.length>0?s({id:"links_present",title:(0,n.__)("Links are present on this page.","surerank"),status:"success",type:"page"}):void 0},u=e=>{const t=e.length,r=(0,n.sprintf)((0,n.__)("Page URL is longer than %s characters and may affect SEO and readability.","surerank"),o.X);return s(t>o.X?{id:"url_length",title:r,status:"warning",type:"page"}:{id:"url_length",title:(0,n.__)("Page URL is short and SEO-friendly.","surerank"),status:"success",type:"page"})},d=e=>{const t=Array.from(e.querySelectorAll("h2, h3, h4, h5, h6"));return s(t.length?{id:"h2_subheadings",title:(0,n.__)("Page contains at least one subheading.","surerank"),status:"success",type:"page"}:{id:"h2_subheadings",title:(0,n.__)("Page does not contain at least one subheading.","surerank"),status:"warning",type:"page"})}},84038(e,t,r){r.d(t,{Q7:()=>f,SW:()=>c,Tq:()=>g,aO:()=>h,dT:()=>d,f0:()=>l,lO:()=>u});var n=r(27723),o=r(18947),s=r(1455),i=r.n(s);const a=new Map,l=e=>(e||"").trim().replace(/\/+$/,""),c=()=>new Set((window?.surerank_seo_popup?.broken_link_ignored_urls||[]).map(l)),u=e=>{a.delete(e);const t=window?.surerank_seo_popup;t&&(t.broken_link_ignored_urls=[...new Set([...t.broken_link_ignored_urls||[],e])])},d=e=>{a.delete(e);const t=window?.surerank_seo_popup;t&&(t.broken_link_ignored_urls=(t.broken_link_ignored_urls||[]).filter(t=>l(t)!==l(e)))},p=e=>{if(!e?.length)return[];const t=[];for(const r of e){const e=a.get(r);e?.broken&&t.push({url:r,...e})}return t},g=async(e,t,r=window.navigator.userAgent,s)=>{if(!e||!t)return;const i=(e=>{if(!e)return[];const t=Array.from(e.querySelectorAll("a[href]")).map(e=>{const t=e.getAttribute("href");if(!t)return null;const r=t.trim();if((e=>{if(!e)return!0;const t=e.trim();if(""===t)return!0;if(t.startsWith("#"))return!0;try{const e=(new URL(t,surerank_globals.site_url).protocol||"").replace(":","").toLowerCase();return!("http"===e||"https"===e)}catch(r){return t.includes(":")}})(r))return null;if(!r.startsWith("http")){const e=(r.startsWith("/")?"":"/")+r;return`${surerank_globals.site_url}${e}`}return r}).filter(Boolean);return[...new Set(t)]})(e);if(!i.length)return;const u=c(),d=i.filter(e=>!u.has(l(e))),g=d.length?await(async({links:e,postId:t,userAgent:r,onProgress:o})=>{if((e=>{if(!e?.length)return a.clear();Array.from(a.keys()).forEach(t=>{e.includes(t)||a.delete(t)})})(e),!e.length)return[];const s=e.filter(e=>!a.has(e)),i=p(e);if(0===s.length)return i;const l=e.length;let c=e.length-s.length;"function"===typeof o&&(o("isCheckingLinks",!0),o("linkCheckProgress",{current:c,total:l}));for(const d of s){try{const n=await f({postId:t,userAgent:r,url:d,allLinks:e}),{success:o,...s}=n;a.set(d,{broken:!o,...s})}catch(u){a.set(d,{broken:!0,status:u?.data?.status??u?.code??"error",details:u.message,message:(0,n.__)("Failed to check link","surerank")})}c++,"function"===typeof o&&o("linkCheckProgress",{current:c,total:l}),c<l&&await new Promise(e=>setTimeout(e,100))}return o("isCheckingLinks",!1),p(e)})({links:d,postId:t,userAgent:r,onProgress:s}):[],h=c(),k=i.filter(e=>h.has(l(e)));return g.length?{...(0,o.bY)({id:"broken_links",title:(0,n.__)("One or more broken links found on the page.","surerank"),status:"error",data:g,type:"page"}),ignoredBrokenLinks:k}:{...(0,o.bY)({id:"broken_links",title:(0,n.__)("No broken links found on the page.","surerank"),status:"success",description:[],type:"page"}),ignoredBrokenLinks:k}},h=e=>(0,o.bY)(e?{id:"canonical_url",title:(0,n.__)("Canonical tag is present on the page.","surerank"),status:"success",type:"page"}:{id:"canonical_url",title:(0,n.__)("Canonical tag is not present on the page.","surerank"),status:"warning",type:"page"}),f=async({postId:e,userAgent:t,url:r,allLinks:n})=>await i()({path:"/surerank/v1/checks/broken-link",method:"POST",data:{post_id:e,user_agent:t,url:r,urls:n}})},74801(e,t,r){r.d(t,{OV:()=>f,QZ:()=>S,Rm:()=>b,bj:()=>x,ep:()=>v,fJ:()=>k,jK:()=>C,jp:()=>w,qQ:()=>_,sv:()=>E,tr:()=>y,uf:()=>m});var n=r(1455),o=r.n(n),s=r(27723),i=r(93832),a=r(88029),l=r(60443),c=r(9607),u=r(1671),d=r(84038),p=r(14060),g=r(76016),h=r(10790);const f=async(e,t,r,n,a,p)=>{const h=x(),f=!h&&"1"===surerank_seo_popup?.is_taxonomy,k=n(u.E).getVariables()?.post?.ID?.value||n(u.E).getVariables()?.user?.ID?.value||n(u.E).getActivePostId()||(h?surerank_seo_popup?.user_id:0)||f&&surerank_seo_popup?.term_id||0;e(!0);const w=Date.now();let v="/surerank/v1/checks/page",m={post_ids:[k],_t:w};h?(v="/surerank/v1/checks/user",m={user_ids:[k],_t:w}):f&&(v="/surerank/v1/checks/taxonomy",m={term_ids:[k],_t:w});try{const e=await o()({path:(0,i.addQueryArgs)(v,m),method:"GET"}),n=(0,c.mT)(e?.data[k]?.checks),a=e.data[k]?.checks?.all_links||[];t(e=>{const t=new Set(a),r=new Set;return e.brokenLinks.forEach(e=>{t.has(e)&&r.add(e)}),{isChecking:!1,checkedLinks:new Set,brokenLinks:r,allLinks:a}});const l=n.filter(e=>!0===e.ignore).map(e=>e.id);r("ignoredList",l);const u=[...n].filter(e=>"broken_links"!==e.id);g.Tv.forEach(e=>{r(e,u.filter(t=>t.type===e))}),r("initializing",!1),0===a.length?(r("isCheckingLinks",!1),r("linkCheckProgress",{current:0,total:0})):(r("isCheckingLinks",!0),r("linkCheckProgress",{current:0,total:a.length}),await(async(e,t,r,n,o,i,a)=>{const l=(0,d.SW)(),c=e.filter(e=>!l.has((0,d.f0)(e))),u=r.filter(e=>l.has((0,d.f0)(e))),p=c.length,h=[];for(const g of c){let e=null;try{const n=await(0,d.Q7)({postId:t,userAgent:window.navigator.userAgent,url:g,allLinks:r});if(!n.success){const{success:t,...r}=n;e={url:g,broken:!0,...r}}}catch(f){e={url:g,broken:!0,status:f?.data?.status??f?.code??"error",details:f?.message,message:(0,s.__)("Failed to check link","surerank")}}n(t=>{const r=new Set(t.checkedLinks),n=new Set(t.brokenLinks);return r.add(g),e&&(n.add(g),h.push(e)),o("linkCheckProgress",{current:r.size,total:p}),{...t,checkedLinks:r,brokenLinks:n}})}n(e=>{const t=[...a].filter(e=>"broken_links"!==e.id);return h.length>0?t.push({id:"broken_links",title:(0,s.__)("One or more broken links found on the page.","surerank"),status:"error",type:"page",data:[...h],ignoredBrokenLinks:u}):u.length>0&&t.push({id:"broken_links",title:(0,s.__)("No broken links found on the page.","surerank"),status:"success",type:"page",data:[],ignoredBrokenLinks:u}),g.Tv.forEach(e=>{o(e,t.filter(t=>t.type===e))}),o("isCheckingLinks",!1),o("linkCheckProgress",{current:p,total:p}),{...e,isChecking:!1}})})(a,k,a,t,r,0,u))}catch(b){l.o.error(b.message),t({isChecking:!1,checkedLinks:new Set,brokenLinks:new Set,allLinks:[]}),r("isCheckingLinks",!1),r("linkCheckProgress",{current:0,total:0})}finally{e(!1)}},k=()=>!!surerank_seo_popup?.is_frontend,w=()=>"undefined"!==typeof window&&"undefined"!==typeof window.elementor&&window.elementor.hasOwnProperty("elements"),v=()=>!!surerank_globals?.is_bricks,m=()=>!!surerank_globals?.is_breakdance,b=()=>"undefined"!==typeof window&&"undefined"!==typeof window.FusionPageBuilder,_=()=>"listing"===surerank_seo_popup?.editor_type,y=()=>"block"===surerank_seo_popup?.editor_type,x=()=>"user"===surerank_seo_popup?.editor_type||!!surerank_seo_popup?.is_user||"user"===window?.surerank_seo_bar?.type,C=()=>v()||m()||w()||b()||k()||_()||x(),S=()=>!g.Jj||b(),E=({isRefreshing:e,isChecking:t,onClick:r})=>(0,h.jsx)(a.A,{variant:"outline",size:"xs",onClick:r,disabled:e||t,icon:(0,h.jsx)(p.A,{className:(0,c.cn)("size-4",(e||t)&&"animate-spin")}),children:(0,s.__)(e||t?"Refreshing":"Refresh","surerank")})},54486(e,t,r){r.d(t,{F:()=>n});const n=(e={})=>{const t=e.badChecks||[],r=e.fairChecks||[],n=e.suggestionChecks||[];let o="success";return t.length>0?o="error":r.length>0?o="warning":n.length>0&&(o="suggestion"),{status:o,counts:{errorAndWarnings:t.length+r.length,success:(e.passedChecks||[]).length,error:t.length,warning:r.length,suggestion:n.length}}}},61701(e,t,r){r.d(t,{J:()=>i,R:()=>a});var n=r(9607),o=r(1671),s=r(47143);const i=()=>{(0,s.dispatch)(o.E).updateModalState(!0)},a=e=>`<svg class="${(0,n.cn)(e)}" width="12" height="12" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M13.5537 1.5C17.8453 1.5 21.3251 4.97895 21.3252 9.27051C21.3252 12.347 19.5368 15.0056 16.9434 16.2646H21.3252V22.5H18.0889C14.9086 22.5 12.2861 20.1186 11.9033 17.042H11.9014L11.9033 13.7852C14.8283 13.7661 17.0342 11.3894 17.0342 8.45996V6.0293C14.137 6.02947 11.6948 7.97682 10.9443 10.6338C10.1605 9.53345 8.87383 8.8165 7.41992 8.81641H6.38086V9.85352H6.38379C6.44515 12.0356 8.23375 13.786 10.4307 13.7861H10.7061L10.6934 17.042H10.6865C10.2943 20.1082 7.67678 22.4785 4.50391 22.4785H2.6748V1.5H13.5537Z" fill="white"/>\n </svg>`},11936(e,t,r){r.d(t,{R:()=>o});var n=r(27723);const o=e=>{if(!e||"object"!==typeof e)return(0,n.__)("SureRank Meta Box","surerank");const t="number"===typeof e.error?e.error:0,r="number"===typeof e.warning?e.warning:0;return t>0?(0,n.sprintf)((0,n._n)("%s Issue Detected","%s Issues Detected",t,"surerank"),t):r>0?(0,n.sprintf)((0,n._n)("%s Warning Detected","%s Warnings Detected",r,"surerank"),r):(0,n.__)("SureRank Meta Box","surerank")}},9607(e,t,r){r.d(t,{Ac:()=>B,EJ:()=>g,MI:()=>F,OY:()=>E,P$:()=>y,P3:()=>m,PA:()=>x,RL:()=>W,VX:()=>R,XY:()=>p,ZV:()=>A,_t:()=>j,b7:()=>q,bF:()=>f,cn:()=>v,d_:()=>J,e$:()=>w,jP:()=>_,jT:()=>z,mT:()=>M,mv:()=>I,ns:()=>D,pk:()=>b,rj:()=>h,rt:()=>Y,sI:()=>T,sL:()=>L,sz:()=>H,tI:()=>U,tX:()=>P,we:()=>V,x7:()=>$,xZ:()=>N,xx:()=>C});var n=r(27723),o=r(65313),s=r(6463),i=r(80696),a=r(81301),l=r(34164),c=r(86087),u=r(50856),d=r(76016);const p=e=>{const t=e.match(/<p>(.*?)<\/p>/g);return t?.length?t[0].replace(/(<([^>]+)>)/gi,""):e.replace(/(<([^>]+)>)/gi,"").replace(/\s+/g," ")},g=(e,t,r="...")=>!e?.length||!t||t<0||e.length<=t?e:e.slice(0,t)+r,h=e=>e&&"string"===typeof e?e.trim().split(/\s+/).filter(Boolean).length:0,f=(e,t,r=100)=>{if("string"!==typeof e||!e.trim())return;if(!k(t))return;const n=document.querySelector(e);n&&setTimeout(()=>{(0,c.createRoot)(n).render(t)},r)},k=e=>e&&e?.$$typeof===Symbol.for("react.element"),w=()=>({surerank_general:"general_settings",surerank_social:"social_settings",surerank_advanced:"advanced_settings"}[new URLSearchParams(window.location.search).get("page")]||"general_settings"),v=(...e)=>(0,u.QP)((0,l.A)(...e)),m=(e,t="value")=>{const r=e?.root?.children[0]?.children;if(!r||!r?.length)return"";let n="";return r.forEach(e=>{switch(e.type){case"text":n+=e.text;break;case"mention":n+=e.data[t];break;case"linebreak":n+="\n"}}),n},b=(e,t=[],r="value",n={type:"mention",version:1,data:{},size:"md",by:"label"})=>{const o={root:{children:[{children:[],direction:null,format:"",indent:0,type:"paragraph",version:1,textFormat:0,textStyle:""}],direction:null,format:"",indent:0,type:"root",version:1}};return("string"===typeof e?e:"").trim().split(/(\s+|%[\w\-_.]+%)/).filter(Boolean).forEach(e=>{if("\n"===e)o.root.children[0].children.push({type:"linebreak",version:1});else if(e?.startsWith("%")&&e?.endsWith("%")){const s=t?.find(t=>t[r]===e.trim());o.root.children[0].children.push(s?{...n,data:{...s}}:{detail:0,format:0,mode:"normal",style:"",text:e,type:"text",version:1})}else o.root.children[0].children.push({detail:0,format:0,mode:"normal",style:"",text:e,type:"text",version:1})}),JSON.stringify(o)};function _(e,t=65){if(!e)return"";const r=e.split("/");let n=`${r.slice(0,3).join("/")} \u203a ${r.slice(3).filter(Boolean).join(" \u203a ")}`;return n.length>t&&(n=n.substring(0,t-3)+"..."),n}const y=e=>{const t=window.location.pathname;return Array.isArray(e)?e.some(e=>t.includes(e)):t.includes(e)},x=(e,t={})=>{if(!e)return;const{delay:r=1e3,retryDelay:n=200,maxRetries:o=5}=t,s=(t=0)=>{const i=document.getElementById(e);i?setTimeout(()=>{i.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})},r):t<o&&setTimeout(()=>{s(t+1)},n)};window.requestAnimationFrame(()=>{s()})},C=(e,t)=>{try{return new URL(window.location.href).searchParams.get(e)===t}catch(r){return!1}},S=(e,t="yyyy-MM-dd")=>{try{if(!e||isNaN(new Date(e).getTime()))throw new Error((0,n.__)("Invalid Date","surerank"));return(0,o.GP)(new Date(e),t)}catch(r){return(0,n.__)("No Date","surerank")}},E=(e,t=!0)=>{if(isNaN(e))return{from:"",to:""};const r=t?(0,i.R)():(0,a.K)();let n=new Date(r);return n.setDate(r.getDate()-e),n=(0,s.o)(n),{from:n,to:r}},A=(e,t={})=>{const{decimals:r=1,forceDecimals:n=!1}=t;if("number"!==typeof e||isNaN(e))return"0";const o=e<0,s=Math.abs(e);if(s<1e3)return o?`-${s}`:s.toString();const i=[{value:1e3,suffix:"k"},{value:1e6,suffix:"m"},{value:1e9,suffix:"b"},{value:1e12,suffix:"t"},{value:1e15,suffix:"p"},{value:1e18,suffix:"e"},{value:1e21,suffix:"z"},{value:1e24,suffix:"y"},{value:1e27,suffix:"r"},{value:1e30,suffix:"q"}],a=i.find(({value:e})=>s<1e3*e)||i[i.length-1],l=(s/a.value).toFixed(r);return`${o?"-":""}${n?l:l.replace(/\.?0+$/,"")}${a.suffix}`},L=e=>{const t=new Date(e);return new Date(t.getTime()-6e4*t.getTimezoneOffset()).toISOString()},P=(e,t,r,o="MMM dd, yyyy")=>{if(!e)return"";const s=new Date(e),i=t?new Date(t):null,a=r?new Date(r):null;return isNaN(s.getTime())?(0,n.__)("Invalid Date","surerank"):i&&a?i.getMonth()===a.getMonth()&&i.getFullYear()===a.getFullYear()?S(s,"dd"):i.getFullYear()===a.getFullYear()?S(s,"MMM dd"):S(s,o):S(s,o)},T=e=>{let t,r="pending";const n=e.then(e=>{r="success",t=e},e=>{r="error",t=e});return{read(){if("pending"===r)throw n;if("error"===r)throw t;if("success"===r)return t}}},z=e=>e&&"string"===typeof e?(new DOMParser).parseFromString(e,"text/html").documentElement.textContent??e:e,I=e=>{try{return/^(https?:\/\/)?((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|localhost|\d{1,3}(\.\d{1,3}){3})(:\d+)?(\/[-a-z\d%_.~+]*)*(\?[;&a-z\d%_.~+=-]*)?(\#[-a-z\d_]*)?(\s.*)?$/i.test(e)}catch(t){return!1}},B=e=>{if(!Array.isArray(e))return[];const t=[];return e.forEach(e=>{e&&"object"===typeof e&&Array.isArray(e.list)?t.push(...e.list):e&&"object"===typeof e&&e.url&&t.push(e)}),t.filter(e=>e&&"object"===typeof e&&e.url)},O=e=>(e||"").trim().replace(/\/+$/,""),R=(e,t=[])=>{const r=e.findIndex(e=>"broken_links"===e?.id);if(-1===r)return e;const o=new Set((window?.surerank_seo_popup?.broken_link_ignored_urls||[]).map(O)),s=(t||[]).filter(e=>o.has(O(e))),i=B(e[r].data).filter(e=>!o.has(O(e.url)));return i.length||s.length?(e[r]={...e[r],data:i,ignoredBrokenLinks:s,status:i.length?"error":"success",title:(0,n.__)(i.length?"One or more broken links found on the page.":"No broken links found on the page.","surerank")},e):e},M=e=>e?Object.entries(e).map(([e,t])=>{const r=e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return{...t,id:e,title:t?.message||r,data:t?.description,showImages:"image_alt_text"===e}}):[],N=(e,t=[])=>e.filter(Boolean).reduce((e,r)=>(t.includes(r.id)?(r.ignore=!0,e.ignoredChecks.push(r)):(r.ignore=!1,"error"===r.status?e.badChecks.push(r):"warning"===r.status?e.fairChecks.push(r):"suggestion"===r.status?e.suggestionChecks.push(r):"success"===r.status&&e.passedChecks.push(r)),e),{badChecks:[],fairChecks:[],suggestionChecks:[],passedChecks:[],ignoredChecks:[]}),j=(e,t)=>"error"===e?(0,n.sprintf)("%1$s %2$s",t,(0,n._n)("Issue","Issues",t,"surerank")):"warning"===e?(0,n.sprintf)("%1$s %2$s",t,(0,n._n)("Warning","Warnings",t,"surerank")):(0,n.__)("SEO is Optimized","surerank"),D=e=>{switch(e){case"error":return"bg-support-error";case"warning":return"bg-support-warning";case"suggestion":return"bg-support-info";case"success":return"bg-support-success";default:return"bg-background-secondary"}},$=e=>e>0?(0,n.sprintf)((0,n._n)("%d issue needs attention.","%d issues need attention.",e,"surerank"),e):(0,n.__)("All SEO checks passed.","surerank"),F=(e,t="")=>{try{const r=new URL(e,window.location.origin).searchParams;return t?r.get(t)||"":Object.fromEntries(r.entries())}catch(r){return t?"":{}}},q=(e,t)=>{try{const r=new URL(e,window.location.origin),n=r.searchParams;return Array.isArray(t)?t.forEach(e=>n.delete(e)):n.delete(t),r.toString()}catch(r){return e}},V=(e,t)=>(e&&"object"===typeof e&&Object.keys(e).forEach(r=>{e[r]&&"object"===typeof e[r]&&(e[r].category=t)}),e),W=(e,t,r)=>{const n=[];return d.Tv.forEach(o=>{if(o===t)n.push(...r);else{const t=H(o).type;n.push(...e.pageSeoChecks?.[t]||[])}}),n},H=e=>({type:`${e}Checks`,categorizedType:`categorized${e.charAt(0).toUpperCase()+e.slice(1)}Checks`}),U=e=>{let t=e??"";return t.includes("sc-domain:")&&(t=t.replace(/sc-domain:/,"")),t.includes("https://")||t.includes("http://")||(t=`https://${t}`),t},J=e=>{let t="";switch(e.percentageType){case"danger":t="text-support-error [&>*]:text-support-error";break;case"success":t="text-support-success [&>*]:text-support-success";break;default:t=""}let r="";return null===e.value&&null===e.previous&&(r="text-text-tertiary [&>*]:text-text-tertiary"),{differenceClassName:t,fallbackClassName:r}},Y=e=>({renderValue:null===e.value&&null===e.previous?"N/A":A(e.value),renderDifference:null===e.value&&null===e.previous?"N/A":A(Math.abs(e?.value-e?.previous))})},76016(e,t,r){r.d(t,{$K:()=>i,HH:()=>w,Jj:()=>p,KT:()=>g,Op:()=>o,Rw:()=>h,Tv:()=>k,UM:()=>l,X:()=>u,dc:()=>f,de:()=>a,oI:()=>v,qt:()=>c,vr:()=>s,x8:()=>d});var n=r(27723);r(10790);const o=window?.surerank_globals?.input_variable_suggestions??null,s=[{id:"post_no_index",value:"no",label:(0,n.__)("No index","surerank"),description:(0,n.__)("Prevents search engines from listing your page in search results.","surerank")},{id:"post_no_follow",value:"no",label:(0,n.__)("No follow","surerank"),description:(0,n.__)("Tells search engines not to follow any links on your page.","surerank")},{id:"post_no_archive",value:"no",label:(0,n.__)("No archive","surerank"),description:(0,n.__)("Blocks search engines from storing a cached version of your page.","surerank")}],i=()=>(0,n.__)("This content will be set as the meta description tag and may appear in search results. Keep it short and clearly explain what the page is about.","surerank"),a=window?.surerank_globals?.wp_dashboard_url??"",l=window?.surerank_globals?.description_length??160,c=window?.surerank_globals?.title_length??60,u=window?.surerank_globals?.url_length??90,d=500,p=window?.surerank_globals?.enable_page_level_seo??!1,g=window?.surerank_globals?.enable_google_console??!1,h=window?.surerank_globals?.enable_schemas??!1,f=window?.surerank_globals?.enable_migration??!1,k=["page","keyword"],w="https://surerank.com/surerank-ai/?utm_source=surerank_plugin&utm_medium=wordpress_plugin&utm_campaign=core_plugin&utm_content=surerank_ai_learn_more",v=e=>e?e.includes("title")?c:e.includes("url")||e.includes("slug")?u:(e.includes("description"),l):l},1671(e,t,r){r.d(t,{E:()=>n});const n="surerank"},51609(e){e.exports=window.React},10790(e){e.exports=window.ReactJSXRuntime},1455(e){e.exports=window.wp.apiFetch},47143(e){e.exports=window.wp.data},86087(e){e.exports=window.wp.element},27723(e){e.exports=window.wp.i18n},93832(e){e.exports=window.wp.url}},e=>{e.O(0,[502],()=>e(e.s=38679)),e.O()}]);
💾 Save Changes
❌ Cancel