%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/tradesc/www/relax/wp-content/plugins/seo-by-rank-math/assets/admin/js/
Upload File :
Create Path :
Current File : /home/tradesc/www/relax/wp-content/plugins/seo-by-rank-math/assets/admin/js/import-export.js

!function(){"use strict";var e,t={n:function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,{a:a}),a},d:function(e,a){for(var n in a)t.o(a,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:a[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},a=jQuery,n=t.n(a),r=lodash,o=wp.i18n,s=rankMathAnalyzer;function i(e,t,a){return n().ajax({url:rankMath.ajaxurl,type:a||"POST",dataType:"json",data:n().extend(!0,{action:"rank_math_"+e,security:rankMath.security},t)})}function c(e,t,a,r){t=t||"error",r=r||!1;var o=n()('<div class="notice notice-'+t+' is-dismissible"><p>'+e+"</p></div>").hide();a.next(".notice").remove(),a.after(o),o.slideDown(),n()(document).trigger("wp-updates-notice-added"),r&&setTimeout((function(){o.fadeOut((function(){o.remove()}))}),r)}(e=n())((function(){({init:function(){var t,a,r=this;a=t||".rank-math-box-tabs",n()(a).children().on("click",(function(e){e.preventDefault();var t=n()(this),a=t.attr("href").substr(1);t.addClass("active-tab").siblings().removeClass("active-tab"),n()("#"+a).addClass("active-tab").siblings().removeClass("active-tab")})),e(document.body).on("click",".rank-math-action",(function(t){var a=e(t.currentTarget).data("action");a in r&&r[a](t)})),this.importConfirm()},importConfirm:function(){var t=e("#import-me");t.on("change",(function(){t.removeClass("invalid")})),e("#rank-math-import-form").on("submit",(function(e){if(!t.get(0).files.length)return t.addClass("invalid"),void e.preventDefault();window.confirm(rankMath.importSettingsConfirm)||e.preventDefault()}))},createBackup:function(t){var a=e(t.currentTarget);a.prop("disabled",!0),i("create_backup").always((function(){a.prop("disabled",!1)})).done((function(t){if(t.success){var n=a.parent().find("tbody"),r=n.find("tr:first").clone();r.removeClass("hidden").find("th").html(t.backup),r.find("[data-action]").attr("data-key",t.key),n.prepend(r),e("#rank-math-no-backup-message").addClass("hidden"),c(t.message,"success",e(".wp-header-end"),2e3)}else c(t.error,"error",e(".wp-header-end"),2e3)}))},restoreBackup:function(t){if(window.confirm(rankMath.restoreConfirm)){var a=e(t.currentTarget);a.prop("disabled",!0),i("restore_backup",{key:a.attr("data-key")}).always((function(){a.prop("disabled",!1)})).done((function(t){t.success?c(t.message,"success",e(".wp-header-end"),2e3):c(t.error,"error",e(".wp-header-end"),2e3)}))}},deleteBackup:function(t){if(window.confirm(rankMath.deleteBackupConfirm)){var a=e(t.currentTarget);a.prop("disabled",!0),i("delete_backup",{key:a.data("key")}).always((function(){a.prop("disabled",!1)})).done((function(t){if(t.success){var n=a.closest("table");a.closest("tr").fadeOut((function(){e(this).remove(),1>n.find("tr").length&&e("#rank-math-no-backup-message").show()})),c(t.message,"success",e(".wp-header-end"),2e3)}else c(t.error,"error",e(".wp-header-end"),2e3)}))}},getAllActions:function(){return e.map(e(".import-plugins .active-tab").find(".choices").find("input:checkbox:checked"),(function(e){return e.value}))},importPlugin:function(t){var a=e(t.currentTarget),n=a.closest("form").find(".rank-math-box-tabs > .active-tab").text().trim();if(window.confirm(rankMath.importPluginConfirm.replace("%s",n))){var r=this.getAllActions();if(1>r.length)c(rankMath.importPluginSelectAction,"error",e(".wp-header-end"),5e3);else{a.prop("disabled",!0),a.data("active")&&r.push("deactivate");var o=e('<textarea id="import-progress-area" class="import-progress-area large-text" disabled="disabled" rows="8" style="margin: 20px 0;background: #eee;"></textarea>');e("#import-progress-area").remove(),a.parents(".active-tab").find("table").after(o),this.addLog("Import started...",o),this.ajaxImport(a.data("slug"),r,o,null,(function(){a.prop("disabled",!1),setTimeout((function(){o.fadeOut((function(){o.remove()}))}),1e4)}))}}},ajaxImport:function(e,t,a,n,r){var s=this;if(0===t.length)return this.addLog("Import finished.",a),void r();var c=t.shift(),d="deactivate"===c?"Deactivating plugin":"Importing "+c;n=n||1,"recalculate"===c&&(d="Starting SEO score recalculation"),this.addLog(d,a),i("import_plugin",{perform:c,pluginSlug:e,paged:n}).done((function(i){n=1,i&&i.page&&i.page<i.total_pages&&(n=i.page+1,t.unshift(c)),"recalculate"===c&&i.total_items>0?s.updateSeoScores(i.data,e,t,a,n,r):("recalculate"===c&&0===i.total_items&&(i.message=(0,o.__)("No posts found without SEO score.","rank-math")),s.addLog(i.success?i.message:i.error,a),s.ajaxImport(e,t,a,n,r))})).fail((function(n){s.addLog(n.statusText,a),s.ajaxImport(e,t,a,null,r)}))},updateSeoScores:function(t,a,n,o,i,c){var d=this,u={};if("complete"!==t)return void 0===this.postIds&&(this.postIds=[]),new Promise((function(e){(0,r.forEach)(t,(function(e,t){if(-1===d.postIds.indexOf(t)){d.postIds.push(t);var a=new s.ResultManager,n=wp.i18n,r=new s.Paper;r.setTitle(e.title),r.setDescription(e.description),r.setText(e.content),r.setKeyword(e.keyword),r.setKeywords(e.keywords),r.setPermalink(e.url),r.setUrl(e.url),e.thumbnail&&r.setThumbnail(e.thumbnail),r.setContentAI(e.hasContentAi);var o=d.getResearchesTests(e);new s.Analyzer({i18n:n,analysis:o}).analyzeSome(o,r).then((function(n){a.update(r.getKeyword(),n,!0);var o=a.getScore(e.keyword);e.isProduct&&(o=e.isReviewEnabled?o+1:o,o=e.hasProductSchema?o+1:o),u[t]=o}))}})),e()})).then((function(){e.ajax({url:rankMath.api.root+"rankmath/v1/updateSeoScore",method:"POST",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",rankMath.restNonce)},data:{action:"rank_math_update_seo_score",postScores:u},success:function(e){d.addLog("SEO Scores updated",o),d.ajaxImport(a,n,o,i,c)},error:function(e){d.addLog(e.statusText,o)}})}));this.ajaxImport(a,n,o,i,c)},getResearchesTests:function(e){var t=rankMath.assessor.researchesTests;return t=(0,r.difference)(t,["keywordNotUsed"]),e.isProduct?t=(0,r.difference)(t,["keywordInSubheadings","linksHasExternals","linksNotAllExternals","linksHasInternal","titleSentiment","titleHasNumber","contentHasTOC"]):t},addLog:function(e,t){var a=new Date,n=t.val()+"["+(10>a.getHours()?"0":"")+a.getHours()+":"+(10>a.getMinutes()?"0":"")+a.getMinutes()+":"+(10>a.getSeconds()?"0":"")+a.getSeconds()+"] "+e+"\n";t.text(n).scrollTop(t[0].scrollHeight-t.height()-20)},cleanPlugin:function(t){var a=e(t.currentTarget),n=a.closest("form").find(".rank-math-box-tabs > .active-tab").text().trim();window.confirm(rankMath.cleanPluginConfirm.replace("%s",n))&&(a.prop("disabled",!0),i("clean_plugin",{pluginSlug:a.data("slug")}).always((function(){a.prop("disabled",!1),e("html, body").animate({scrollTop:0},"fast")})).done((function(t){t.success&&a.closest("tr").fadeOut((function(){e(this).remove()})),c(t.success?t.message:t.error,t.success?"success":"error",e(".wp-header-end"),5e3)})))}}).init()}))}();

Zerion Mini Shell 1.0