Main.0d6fb734.js 12.7 KB
import r from"./BadBotBlocker.25bc9cbd.js";import{C as l}from"./Index.bd5fc4bf.js";import c from"./DatabaseTools.eb13efea.js";import{a as d,m as u}from"./vuex.esm.8fdeb4b6.js";import{C as p}from"./index.3c70e00e.js";import{C as m}from"./Card.27307535.js";import{C as h}from"./Tabs.94a491a6.js";import{C as g}from"./Index.6dd703b2.js";import{C as _}from"./NetworkSiteSelector.f2545193.js";import{C as f}from"./SettingsRow.edbb3005.js";import{B as b}from"./Checkbox.60ba2f56.js";import{G as v,a as A}from"./Row.830f6397.js";import{n}from"./_plugin-vue2_normalizer.61652a7c.js";import{S as w}from"./Caret.19b10233.js";import $ from"./HtaccessEditor.2b3eb659.js";import y from"./ImportExport.6c458103.js";import k from"./RobotsEditor.735d8089.js";import C from"./SystemStatus.877cae77.js";import"./Textarea.ce149d81.js";import"./client.e62d6c37.js";import"./_commonjsHelpers.f84db168.js";import"./translations.c394afe3.js";import"./default-i18n.3a91e0e5.js";import"./index.ec9852b3.js";import"./isArrayLikeObject.9b4b678d.js";import"./helpers.de7566d0.js";import"./constants.0d8c074c.js";import"./portal-vue.esm.98f2e05b.js";import"./Tooltip.68a8a92b.js";import"./Slide.15a07930.js";/* empty css             */import"./params.597cd0f5.js";import"./WpTable.ee9185a7.js";import"./attachments.6af710f9.js";import"./cleanForSlug.51ef7354.js";import"./html.14f2a8b9.js";import"./SaveChanges.e40a9083.js";import"./Header.10fd4a81.js";import"./LicenseKeyBar.f7493613.js";import"./LogoGear.16108a75.js";import"./AnimatedNumber.932b583a.js";import"./Logo.8785cc9f.js";import"./Support.85587a91.js";import"./Exclamation.fd45a7b0.js";import"./Url.c71d5763.js";import"./Gear.184e0c65.js";import"./Checkmark.f26f6201.js";import"./Blur.f36c594d.js";import"./Index.235069bb.js";import"./TruSeoScore.339d22e1.js";import"./Information.93f80cbf.js";import"./Editor.17682c4e.js";import"./Plus.6984df43.js";import"./History.3424d012.js";import"./Refresh.8f2b379b.js";import"./Download.ef366516.js";import"./Radio.7965b35c.js";import"./External.4c957e9a.js";import"./Row.2f03c6a0.js";const D={components:{BaseCheckbox:b,GridColumn:v,GridRow:A},props:{loading:Boolean,disabled:Boolean},data(){return{options:{},strings:{updateOptions:this.$t.__("Update Options",this.$td)}}},mounted(){this.$aioseo.deprecatedOptions.forEach(s=>{s.enabled&&this.$set(this.options,s.value,!0)})}};var M=function(){var t=this,e=t._self._c;return e("div",{staticClass:"aioseo-deprecated-options"},[e("grid-row",{staticClass:"settings"},t._l(t.$aioseo.deprecatedOptions,function(o,i){return e("grid-column",{key:i,attrs:{xl:"6",sm:"12"}},[e("base-checkbox",{attrs:{size:"medium",disabled:t.disabled},model:{value:t.options[o.value],callback:function(a){t.$set(t.options,o.value,a)},expression:"options[option.value]"}},[t._v(" "+t._s(o.label)+" ")])],1)}),1),e("br"),e("base-button",{attrs:{type:"blue",size:"medium",loading:t.loading,disabled:t.disabled},on:{click:function(o){return t.$emit("update",t.options)}}},[t._v(" "+t._s(t.strings.updateOptions)+" ")]),e("br"),e("br")],1)},T=[],S=n(D,M,T,!1,null,null,null,null);const x=S.exports;const L={computed:{...d(["internalOptions"]),infoItems(){return[{label:"Migrated Version",value:this.internalOptions.internal.migratedVersion},{label:"First Activated",value:this.internalOptions.internal.firstActivated!==0?this.$dateTime.fromMillis(this.internalOptions.internal.firstActivated*1e3).toFormat("MMMM d, yyyy"):!1}]}}};var O=function(){var t=this,e=t._self._c;return e("div",{staticClass:"v3-migration-info aioseo-description"},[e("ul",{staticClass:"info-items"},t._l(t.infoItems,function(o,i){return e("li",{key:i},[o.value?e("span",[t._v(t._s(o.label))]):t._e(),o.value?e("span",[t._v(t._s(o.value))]):t._e()])}),0)])},R=[],I=n(L,O,R,!1,null,null,null,null);const B=I.exports;const N={props:{extraActions:{type:Array,required:!1}},components:{CoreAlert:p,CoreCard:m,CoreMainTabs:h,CoreModal:g,CoreNetworkSiteSelector:_,CoreSettingsRow:f,DeprecatedOptions:x,MigrationInfo:B,SvgClose:w},data(){return{site:{},tabsKey:0,doingActionKey:0,activeTab:"general",currentAction:"",showAreYouSureModal:!1,doingAction:[],strings:{selectSite:"Select Site",cardLabel:"Debug",selectLabel:"Select a Debug Action:",buttonLabel:"Run Action",alertWarning:"Before you run any action, please make sure that you have fully read the description and understand the consequences as these cannot be reverted.",cannotBeUndone:"This action cannot be undone.",yesDoAction:"Yes, run this action",noChangedMind:"No, I changed my mind"},alertLink:this.$links.getPlainLink("Click here to open to the Scheduled Actions panel",this.$aioseo.urls.admin.scheduledActions,!0)}},computed:{areYouSureTitle(){return`Are you sure you want to run the "${this.currentAction.label}" action?`},tabs(){const s=this.$t.sprintf('<a href="%1$s" target="_blank">Scheduled Actions</a>',this.$aioseo.urls.admin.scheduledActions),t=this.$aioseo.data.isNetworkAdmin?"<br><strong>NOTE: If no site is selected, this will clear the network cache.</strong>":"",e=this.$aioseo.data.isNetworkAdmin?"<br><strong>NOTE: If no site is selected, this will clear the network plugin updates transient.</strong>":"";return[{slug:"general",name:"General",actions:[{label:"Clear Cache",slug:"clear-cache",shortDescription:`This action deletes all records of the <code>aioseo_cache</code> table in the database.${t}`,longDescription:"",showModal:!1,network:!0},{label:"Clear Plugin Updates Transient",slug:"clear-plugin-updates-transient",shortDescription:`This action clears the plugin updates transient, which forces WordPress Core to check for plugin updates.${e}`,longDescription:"",showModal:!1,network:!0},{label:"Readd Capabilities",slug:"readd-capabilities",shortDescription:"This action will readd our capabilities (access permissions) for all users.",longDescription:"",showModal:!1},{label:"Reset Data",slug:"reset-data",shortDescription:"This action will <strong>delete</strong> all our custom tables and options.",longDescription:"",showModal:!0}]},{slug:"sitemap",name:"Sitemap",actions:[{label:"Clear Image Data",slug:"clear-image-data",shortDescription:"This action removes all image data from the database, forcing a site-wide rescan via Action Scheduler.",longDescription:this.$t.sprintf("To speed up the image scan, go to %1$s and run the <code>aioseo_image_sitemap_scan</code> action.",s),showModal:!1}]},{slug:"migrations",name:"Migrations",actions:[{label:"Rerun V4+ Migrations",slug:"rerun-migrations",shortDescription:"This action will rerun all update migrations since 4.0.0, excluding the V3 migration.",longDescription:"",showModal:!0}]},{slug:"old-issues",name:"Old Issues",actions:[{label:"Remove Duplicates",slug:"remove-duplicates",shortDescription:"This action will delete any duplicate records that are found in the <code>aioseo_posts</code> and <code>aioseo_terms</code> tables.",longDescription:"",showModal:!1},{label:"Unescape Data",slug:"unescape-data",shortDescription:"This action will clean <code>aioseo_posts</code> and <code>aioseo_term</code> records whose data is corrupted.",longDescription:this.$t.sprintf("The action will trigger a routine which runs in batches via Action Scheduler. It may take some time for this routine to complete, To speed up this process, go to %1$s and run the <code>aioseo_unslash_escaped_data_posts</code> or <code>aioseo_unslash_escaped_data_terms</code> action.",s),showModal:!1}]},{slug:"deprecated-options",name:"Deprecated Options",actions:[{label:"Deprecated Options",slug:"deprecated-options",shortDescription:"Enable or disable any options that have been deprecated in AIOSEO.",longDescription:"<strong>These options are not guaranteed to work and all support has been dropped.</strong>",showModal:!1,component:"deprecated-options"}]}]},activeTabObject(){return this.tabs.find(s=>s.slug===this.activeTab)}},methods:{...u(["doTask"]),isActionDisabled(s){return this.$aioseo.data.isNetworkAdmin?this.site.blog_id?this.site.blog_id==="network"&&s.network?!1:this.site.blog_id==="network"&&!s.network:!0:!1},isLoading(s){return!!this.doingAction[s.slug]},getSelectedActionObject(s){let t=null;return this.actions.forEach(e=>{const o=e.options.find(i=>i.value===s);o&&(t=o)}),t},maybeDoAction(s,t){if(this.currentAction=s,s.showModal){this.showAreYouSureModal=!0;return}this.doAction(t)},doAction(s){this.doingAction[this.currentAction.slug]=!0,this.showAreYouSureModal=!1,this.doingActionKey++,this.doTask({action:this.currentAction.slug,siteId:this.site.blog_id,data:s}).then(()=>{console.log(`Action "${this.currentAction.label}" has been completed.`)}).catch(t=>{console.error(`Action "${this.currentAction.label}" could not be completed: `,t)}).finally(()=>{this.doingAction[this.currentAction.slug]=!1,this.doingActionKey++})}},beforeMount(){var t;let s=-1;if(this.$aioseo.data.v3Options&&(s=this.tabs.findIndex(e=>e.slug.toLowerCase()==="migrations"),s!==-1)){const e=this.$t.sprintf('<a href="%1$s" target="_blank">Scheduled Actions</a>',this.$aioseo.urls.admin.scheduledActions);this.tabs[s].actions.push({label:"Rerun V3 Migration",slug:"restart-v3-migration",shortDescription:"This action restarts the migration from V3 to V4.",longDescription:this.$t.sprintf("All settings will be migrated immediately. However, the post/term meta needs to be migrated via a routine which runs in batches via Action Scheduler. To speed up the post/term meta migration, go to %1$s and run the <code>aioseo_migrate_post_meta</code> or <code>aioseo_migrate_term_meta</code> action.",e),infoComponent:"MigrationInfo",showModal:!0})}(t=this.extraActions)!=null&&t.length&&this.extraActions.forEach(e=>{if(s=this.tabs.findIndex(o=>o.slug.toLowerCase()===e.slug.toLowerCase()),s!==-1){this.tabs[s].actions=this.tabs[s].actions.concat(e.actions);return}this.tabs.push(e)})}};var Y=function(){var t=this,e=t._self._c;return e("div",{staticClass:"aioseo-tools-debug"},[e("core-card",{attrs:{slug:"debug","header-text":t.strings.cardLabel}},[t.$aioseo.data.isNetworkAdmin?e("div",{staticClass:"aioseo-settings-row"},[e("div",{staticClass:"select-site"},[t._v(" "+t._s(t.strings.selectSite)+" ")]),e("core-network-site-selector",{attrs:{"show-network":""},on:{"selected-site":function(o){t.site=o}}})],1):t._e(),e("core-alert",{attrs:{type:"yellow"}},[e("div",[t._v(t._s(t.strings.alertWarning))]),e("div",{domProps:{innerHTML:t._s(t.alertLink)}})]),e("core-main-tabs",{key:t.tabsKey,attrs:{internal:"",tabs:t.tabs,active:t.activeTab,showSaveButton:!1},on:{changed:o=>t.activeTab=o}}),t._l(t.activeTabObject.actions,function(o,i){return e("core-settings-row",{key:t.activeTab+i,attrs:{name:o.label,align:""},scopedSlots:t._u([{key:"content",fn:function(){return[o.component?[e(o.component,{tag:"component",attrs:{loading:t.doingAction[o.slug],disabled:t.isActionDisabled(o)},on:{update:a=>t.maybeDoAction(o,a)}})]:e("base-button",{key:t.doingActionKey,attrs:{type:"blue",size:"medium",loading:t.doingAction[o.slug],disabled:t.isActionDisabled(o)},on:{click:function(a){return t.maybeDoAction(o)}}},[t._v(" "+t._s(t.strings.buttonLabel)+" ")]),e("div",{staticClass:"aioseo-description",domProps:{innerHTML:t._s(o.shortDescription)}}),e("div",{staticClass:"aioseo-description",domProps:{innerHTML:t._s(o.longDescription)}}),o.infoComponent?[e(o.infoComponent,{tag:"component"})]:t._e()]},proxy:!0}],null,!0)})}),t.showAreYouSureModal?e("core-modal",{attrs:{"no-header":""},on:{close:function(o){t.showAreYouSureModal=!1}},scopedSlots:t._u([{key:"body",fn:function(){return[e("div",{staticClass:"aioseo-modal-body"},[e("button",{staticClass:"close",on:{click:function(o){o.stopPropagation(),t.showAreYouSureModal=!1}}},[e("svg-close",{on:{click:function(o){t.showAreYouSureModal=!1}}})],1),e("h3",[t._v(t._s(t.areYouSureTitle))]),e("div",{staticClass:"description",domProps:{innerHTML:t._s(t.strings.cannotBeUndone)}}),e("base-button",{attrs:{type:"blue",size:"medium"},on:{click:t.doAction}},[t._v(" "+t._s(t.strings.yesDoAction)+" ")]),e("base-button",{attrs:{type:"gray",size:"medium"},on:{click:function(o){t.showAreYouSureModal=!1}}},[t._v(" "+t._s(t.strings.noChangedMind)+" ")])],1)]},proxy:!0}],null,!1,499519329)}):t._e()],2)],1)},E=[],P=n(N,Y,E,!1,null,null,null,null);const F=P.exports,U={components:{Debug:F}};var V=function(){var t=this,e=t._self._c;return e("debug")},z=[],H=n(U,V,z,!1,null,null,null,null);const K=H.exports,G={components:{BadBotBlocker:r,CoreMain:l,DatabaseTools:c,Debug:K,HtaccessEditor:$,ImportExport:y,RobotsEditor:k,SystemStatus:C},data(){return{strings:{pageName:this.$aioseo.data.isNetworkAdmin?this.$t.__("Network Tools",this.$td):this.$t.__("Tools",this.$td)}}},computed:{showSaveButton(){return this.$route.name!=="system-status"&&this.$route.name!=="import-export"&&this.$route.name!=="database-tools"&&this.$route.name!=="debug"}}};var W=function(){var t=this,e=t._self._c;return e("core-main",{attrs:{"page-name":t.strings.pageName,"show-save-button":t.showSaveButton}},[e(t.$route.name,{tag:"component"})],1)},q=[],j=n(G,W,q,!1,null,null,null,null);const ee=j.exports;export{ee as default};