π Root
/
home
/
artorgp
/
www
/
wp-content
/
plugins
/
eli-php-compatibility-scanner
/
assets
/
dist
/
Editing: admin.js
!function(){"use strict";var t={149:function(t,e,s){s.r(e),s.d(e,{ScanManager:function(){return i}});var a=s(669),n=s.n(a);class i{constructor(t,e,s){this.ajaxClient=t,this.optionsManager=e,this.targetsManager=s,this.isScanning=!1,this.currentScanId=null}init(){this.bindEvents()}bindEvents(){n()("#phpcompat-start-scan").on("click",()=>{this.startScan()}),n()("#phpcompat-stop-scan").on("click",()=>{this.stopScan()})}async startScan(){if(this.isScanning)return;const t=n()("#phpcompat-start-scan"),e=n()("#phpcompat-stop-scan"),s=n()("#phpcompat-scan-status");if(this.targetsManager.hasSelectedTargets()){this.isScanning=!0,s.text("Runningβ¦"),t.prop("disabled",!0),e.show().prop("disabled",!1);try{const t=this.targetsManager.getSelectedTargets();await this.processTargets(t)}catch(t){console.error("Scan failed:",t),s.text("Scan failed")}finally{this.isScanning=!1,t.prop("disabled",!1),e.hide()}}else s.text("Select at least one target")}async stopScan(){if(!this.isScanning)return;const t=n()("#phpcompat-start-scan"),e=n()("#phpcompat-stop-scan"),s=n()("#phpcompat-scan-status");e.prop("disabled",!0).text("Stopping...");try{const a=await this.ajaxClient.stopScan();a&&a.success&&(t.prop("disabled",!1).text("Start Scan"),e.prop("disabled",!1).text("Stop Scan").hide(),s.html(`β ${a.data.message||"Scan stopped"}`),n()(".phpcompat-progress").remove(),n()(".phpcompat-batch-results").remove())}catch(t){console.error("Failed to stop scan:",t),e.prop("disabled",!1).text("Stop Scan"),s.html("β Failed to stop scan")}this.isScanning=!1}async processTargets(t){let e=!1;for(let s=0;s<t.length&&this.isScanning;s++){const a=t[s];try{await this.processTarget(a)}catch(t){console.error(`Failed to process target ${a.name}:`,t),e=!0}}this.isScanning&&n()("#phpcompat-scan-status").text(e?"Some scans failed":"Done")}async processTarget(t){const e=n()(t.element),s=e.closest(".phpcompat-target-item"),a=n()("#phpcompat-scan-status"),i=`pcp-result-${t.type}-${t.slug.replace(/[^a-z0-9_-]/gi,"_")}`;let o=n()(`#${i}`);o.length?o.text(""):(o=n()("<div/>",{id:i,class:"phpcompat-output main_output",css:{marginTop:"8px"}}),e.closest(".phpcompat-target-item").after(o));let p=s.find(".phpcompat-flag");p.length||(p=n()("<span/>",{class:"phpcompat-flag",css:{marginLeft:"6px"}}).appendTo(s)),p.html('<span class="spinner is-active"></span>'),a.text(`Scanning ${t.name}...`),this.targetsManager.setTargetScanning(t.type,t.slug);const r=this.optionsManager.getBatchSize(),c=this.optionsManager.getSkipVendor(),h=await this.ajaxClient.getProgress(t.type,t.slug,r,c);if(h&&h.success&&h.data){const e=h.data;e.total_files>0?(o.html(this.createProgressSection(e)),await this.processBatches(e,o,p,t)):(o.html('<div class="phpcompat-progress"><strong>No PHP files found to scan</strong><br>The selected target does not contain any PHP files.</div>'),this.targetsManager.setTargetComplete(t.type,t.slug,0,0))}}createProgressSection(t){return`<div class="phpcompat-progress">\n <strong>Scan Progress:</strong>\n Total files: ${t.total_files}\n Estimated batches: ${t.estimated_batches}\n <div class="phpcompat-progress-bar"><div class="phpcompat-progress-fill" style="width: 0%"></div></div>\n <div class="phpcompat-progress-text">Preparing to scan...</div>\n </div>`}async processBatches(t,e,s,a){const n=t.estimated_batches,i=t.scan_id,o=[];for(let t=1;t<=n&&this.isScanning;t++){this.updateProgressBar(e,t,n);try{const s=await this.ajaxClient.processBatch(i,t);if(!s||!s.success)throw new Error(s?.data?.message||"Batch failed");{const t=s.data;o.push(t),this.showProgressiveResults(e,t)}}catch(a){return console.error(`Batch ${t} failed:`,a),s.html('β <span class="phpcompat-status-count">Batch failed</span>'),void e.html(`Batch ${t} failed: ${a.message}`)}t<n&&await new Promise(t=>setTimeout(t,100))}this.finalizeScan(e,s,o,t,a)}updateProgressBar(t,e,s){const a=Math.round((e-1)/s*100),n=t.find(".phpcompat-progress-fill"),i=t.find(".phpcompat-progress-text");n.length&&n.css("width",`${a}%`),i.length&&i.text(`Processing batch ${e} of ${s}...`)}showProgressiveResults(t,e){const s=`<div class="phpcompat-batch">\n <strong>Batch ${e.batch_number}:</strong>\n ${e.output&&e.output.length>0?'<pre class="phpcompat-batch-output"></pre>':"<em>No issues found in this batch</em>"}\n </div>`;let a=t.find(".phpcompat-batch-results");0===a.length&&(t.append('<div class="phpcompat-batch-results"></div>'),a=t.find(".phpcompat-batch-results")),a.append(s),e.output&&e.output.length>0&&a.find(".phpcompat-batch-output").last().text(e.output)}finalizeScan(t,e,s,a,n){const i=s.reduce((t,e)=>t+(parseInt(e.errors,10)||0),0),o=s.reduce((t,e)=>t+(parseInt(e.warnings,10)||0),0),p=i+o,r=this.optionsManager.getPhpVersion();if(p>0){let t="";t=i>0&&o>0?`${p} issue${p>1?"s":""} (${i} error${i>1?"s":""}, ${o} warning${o>1?"s":""}) - PHP ${r}`:i>0?`${i} error${i>1?"s":""} - PHP ${r}`:`${o} warning${o>1?"s":""} - PHP ${r}`,i>0?e.html(`β <span class="phpcompat-status-count">${t}</span>`):e.html(`β οΈ <span class="phpcompat-status-count">${t}</span>`)}else e.html(`β <span class="phpcompat-status-count">No issues found - PHP ${r}</span>`);this.showFinalResults(t,s,a,r),this.targetsManager.setTargetComplete(n.type,n.slug,i,o)}showFinalResults(t,e,s,a){const i=`<div class="phpcompat-output-left">\n <div class="phpcompat-progress">\n <strong>Scan Progress:</strong>\n Total files: ${s.total_files}\n Estimated batches: ${s.estimated_batches}\n <div class="phpcompat-progress-bar"><div class="phpcompat-progress-fill" style="width: 100%"></div></div>\n <div class="phpcompat-progress-text">Scan Complete!</div>\n </div>\n <div class="phpcompat-summary">\n <strong>Scan Complete!</strong>\n Total files scanned: ${s.total_files}\n Batches processed: ${e.length}\n Target PHP version: ${a}\n </div>\n </div>`;let o="";e.length>0&&(o=`<div class="phpcompat-output-right">\n <div class="phpcompat-batch-results">\n <div class="phpcompat-batch-results-toggle">\n <span>Batch Results (${e.length} batches)</span>\n <span class="toggle-icon">βΌ</span>\n </div>\n <div class="phpcompat-batch-results-content">`,e.forEach((t,e)=>{o+=`<div class="phpcompat-batch">\n <strong>Batch ${t.batch_number}:</strong>\n ${t.output&&t.output.length>0?`<pre class="phpcompat-batch-output" data-batch="${e}"></pre>`:"<em>No issues found in this batch</em>"}\n </div>`}),o+="</div></div></div>"),t.find(".phpcompat-progress").remove(),t.find(".phpcompat-batch-results").remove(),t.html(i+o),e.forEach((e,s)=>{e.output&&e.output.length>0&&t.find(`.phpcompat-batch-output[data-batch="${s}"]`).text(e.output)}),t.find(".phpcompat-batch-results-toggle").on("click",function(t){t.preventDefault();const e=n()(this).closest(".phpcompat-batch-results"),s=n()(this).find(".toggle-icon");e.toggleClass("collapsed"),e.hasClass("collapsed")?s.text("βΆ"):s.text("βΌ")});const p=t.find(".phpcompat-progress-fill");p.length&&p.css("width","100%")}isCurrentlyScanning(){return this.isScanning}}},292:function(t,e,s){s.r(e),s.d(e,{UIManager:function(){return i}});var a=s(669),n=s.n(a);class i{constructor(){this.init()}init(){this.bindEvents(),this.initializeUI()}bindEvents(){n()(document).on("click",".phpcompat-how-to-use h2",function(){n()(this).closest(".phpcompat-how-to-use").toggleClass("collapsed")}),n()(document).on("click","#phpcompat-pin-overview",function(){n()(".phpcompat-sticky-controls").toggleClass("pinned"),n()(this).toggleClass("active")})}initializeUI(){n()("#phpcompat-stop-scan").hide(),this.enhanceFormElements(),this.enhanceProgressBars()}enhanceFormElements(){n()(".phpcompat-form-group input, .phpcompat-form-group select").on("focus",function(){n()(this).closest(".phpcompat-form-group").addClass("focused")}).on("blur",function(){n()(this).closest(".phpcompat-form-group").removeClass("focused")}),n()(".phpcompat-target-item").on("mouseenter",function(){n()(this).addClass("hovered")}).on("mouseleave",function(){n()(this).removeClass("hovered")})}enhanceProgressBars(){n()(".phpcompat-progress-fill").css("transition","width 0.3s ease")}showLoading(t,e="Loading..."){t.prop("disabled",!0);const s=t.text();return t.data("original-text",s),t.text(e),s}hideLoading(t){t.prop("disabled",!1);const e=t.data("original-text");e&&t.text(e)}showSuccess(t,e=3e3){this.showMessage(t,"success",e)}showError(t,e=5e3){this.showMessage(t,"error",e)}showWarning(t,e=4e3){this.showMessage(t,"warning",e)}showInfo(t,e=3e3){this.showMessage(t,"info",e)}showMessage(t,e="info",s=3e3){const a=n()("#phpcompat-messages");a.length||n()('<div id="phpcompat-messages"></div>').insertAfter("#phpcompat-scan-status");const i=`<div class="phpcompat-message phpcompat-message-${e}">\n <span class="message-text">${t}</span>\n <button class="message-close">×</button>\n </div>`,o=n()(i);a.append(o),setTimeout(()=>{o.fadeOut(300,function(){n()(this).remove()})},s),o.find(".message-close").on("click",function(){o.fadeOut(300,function(){n()(this).remove()})})}updateStatus(t,e="info"){const s=n()("#phpcompat-scan-status"),a=this.getStatusIcon(e);s.html(`${a} ${t}`)}getStatusIcon(t){switch(t){case"success":return"β ";case"error":return"β";case"warning":return"β οΈ";default:return"βΉοΈ"}}toggleElement(t,e=!0,s=300){e?t.slideDown(s):t.slideUp(s)}fadeInElement(t,e=300){t.fadeIn(e)}fadeOutElement(t,e=300){t.fadeOut(e)}scrollToElement(t,e=0){n()("html, body").animate({scrollTop:t.offset().top-e},500)}highlightElement(t,e=2e3){t.addClass("highlighted"),setTimeout(()=>{t.removeClass("highlighted")},e)}disableForm(){n()(".phpcompat-form-group input, .phpcompat-form-group select, .phpcompat-form-group button").prop("disabled",!0)}enableForm(){n()(".phpcompat-form-group input, .phpcompat-form-group select, .phpcompat-form-group button").prop("disabled",!1)}resetForm(){n()('.phpcompat-form-group input[type="text"], .phpcompat-form-group input[type="number"]').val(""),n()(".phpcompat-form-group select").prop("selectedIndex",0),n()('.phpcompat-form-group input[type="checkbox"]').prop("checked",!1)}clearScanResults(){n()(".phpcompat-output").remove(),n()(".phpcompat-progress").remove(),n()(".phpcompat-batch-results").remove(),n()(".phpcompat-flag").remove()}updateProgress(t,e=""){const s=n()(".phpcompat-progress-fill"),a=n()(".phpcompat-progress-text");s.length&&s.css("width",`${t}%`),a.length&&e&&a.text(e)}}},293:function(t,e,s){s.r(e),s.d(e,{SystemChecker:function(){return i}});var a=s(669),n=s.n(a);class i{constructor(t){this.ajaxClient=t,this.isSystemReady=!1}async init(){await this.runPreflightCheck()}async runPreflightCheck(){try{const t=n()("#phpcompat-system-check"),e=n()("#phpcompat-start-scan"),s=n()("#phpcompat-scan-status"),a=await this.ajaxClient.preflightCheck(),i=a&&a.success,o=a&&a.data?a.data:{},p=[];p.push(`${o.execEnabled?"β ":"β"} exec() ${o.execEnabled?"enabled":"disabled"}`),p.push(`${o.phpBinaryExists?"β ":"β"} PHP binary: ${o.phpBinary||"(unknown)"}`),p.push(`${o.phpcsExists?"β ":"β"} phpcs: ${o.phpcsPath||"(unknown)"}`),o.phpcsVersionOutput&&p.push(`Version: ${o.phpcsVersionOutput}`),o.messages&&o.messages.length&&p.push(...o.messages),t.text(p.join("\n")),i?(e.prop("disabled",!1),this.isSystemReady=!0):(e.prop("disabled",!0),s.text("System check failed"),this.isSystemReady=!1)}catch(t){console.error("System check failed:",t),n()("#phpcompat-system-check").text("System check failed to run"),n()("#phpcompat-start-scan").prop("disabled",!0),this.isSystemReady=!1}}isReady(){return this.isSystemReady}getStatusMessage(){return this.isSystemReady?"System ready for scanning":"System check failed - scanning disabled"}}},374:function(t,e,s){s.d(e,{App:function(){return i}});var a=s(669),n=s.n(a);class i{constructor(t){this.config=t,this.ajaxClient=null,this.optionsManager=null,this.targetsManager=null,this.systemChecker=null,this.scanManager=null,this.uiManager=null,this.isInitialized=!1}async init(){try{if(!this.validateConfig())throw new Error("Invalid configuration");await this.initializeComponents(),this.isInitialized=!0,console.log("PHP Compatibility Checker initialized successfully")}catch(t){console.error("Failed to initialize application:",t),this.showInitializationError(t)}}validateConfig(){return this.config&&this.config.ajaxUrl&&this.config.nonce}async initializeComponents(){this.ajaxClient=new((await Promise.resolve().then(s.bind(s,704))).AjaxClient)(this.config),this.optionsManager=new((await Promise.resolve().then(s.bind(s,620))).OptionsManager)(this.ajaxClient),this.targetsManager=new((await Promise.resolve().then(s.bind(s,480))).TargetsManager)(this.ajaxClient),this.systemChecker=new((await Promise.resolve().then(s.bind(s,293))).SystemChecker)(this.ajaxClient),this.scanManager=new((await Promise.resolve().then(s.bind(s,149))).ScanManager)(this.ajaxClient,this.optionsManager,this.targetsManager),this.uiManager=new((await Promise.resolve().then(s.bind(s,292))).UIManager),await this.optionsManager.init(),await this.targetsManager.init(),await this.systemChecker.init(),this.scanManager.init()}showInitializationError(t){const e=`Failed to initialize PHP Compatibility Checker: ${t.message}`;console.error(e);const s=n()("#phpcompat-scan-status");s.length&&s.html(`β ${e}`);const a=n()("#phpcompat-start-scan");a.length&&a.prop("disabled",!0)}getAjaxClient(){return this.ajaxClient}getOptionsManager(){return this.optionsManager}getTargetsManager(){return this.targetsManager}getSystemChecker(){return this.systemChecker}getScanManager(){return this.scanManager}getUIManager(){return this.uiManager}isReady(){return this.isInitialized}getStatus(){if(!this.isInitialized)return"Not initialized";const t=!!this.systemChecker&&this.systemChecker.isReady();return this.scanManager&&this.scanManager.isCurrentlyScanning()?"Scanning in progress":t?"Ready for scanning":"System not ready"}async refresh(){try{this.systemChecker&&await this.systemChecker.runPreflightCheck(),this.targetsManager&&await this.targetsManager.loadTargets()}catch(t){console.error("Failed to refresh application:",t)}}reset(){try{this.uiManager&&this.uiManager.clearScanResults(),this.targetsManager&&this.targetsManager.uncheckAllTargets()}catch(t){console.error("Failed to reset application:",t)}}destroy(){try{this.scanManager&&this.scanManager.isCurrentlyScanning()&&this.scanManager.stopScan(),this.isInitialized=!1,console.log("PHP Compatibility Checker destroyed")}catch(t){console.error("Error during application destruction:",t)}}}},480:function(t,e,s){s.r(e),s.d(e,{TargetsManager:function(){return i}});var a=s(669),n=s.n(a);class i{constructor(t){this.ajaxClient=t,this.targets={plugins:[],themes:[]}}async init(){await this.loadTargets(),this.bindEvents(),this.updateOverviewDisplay()}async loadTargets(){try{n()("#phpcompat-targets").html('<div class="phpcompat-loader">Loading targets...</div>');const t=await this.ajaxClient.getTargets();t&&t.success&&t.data&&(this.targets={plugins:t.data.plugins||[],themes:t.data.themes||[]},this.renderTargets())}catch(t){console.error("Failed to load targets:",t),n()("#phpcompat-targets").html('<div class="phpcompat-error">Failed to load targets</div>')}}renderTargets(){const t=n()("#phpcompat-targets");let e="";this.targets.plugins.length>0&&(e+='<div class="phpcompat-target-group"><strong>Plugins</strong></div>',this.targets.plugins.forEach(t=>{e+=this.renderTargetItem(t,"plugin")})),this.targets.themes.length>0&&(e+='<div class="phpcompat-target-group"><strong>Themes</strong></div>',this.targets.themes.forEach(t=>{e+=this.renderTargetItem(t,"theme")})),t.html(e)}renderTargetItem(t,e){const s=t.slug.replace(/"/g,"""),a=n()("<div/>").text(t.name).html(),i=t.active?' <span class="phpcompat-target-active">Active</span>':"",o=t.active?' data-active="1"':"";return`<label class="phpcompat-target-item" data-name="${a.replace(/"/g,""")}"${o}>\n <input type="checkbox" class="phpcompat-target" data-type="${e}" data-slug="${s}"> \n ${a}${i}\n </label>`}bindEvents(){n()(document).on("change",".phpcompat-target",()=>{this.updateOverviewDisplay()}),n()("#phpcompat-select-all").on("click",()=>{const t=n()(".phpcompat-target"),e=t.length>0&&t.length===t.filter(":checked").length;t.prop("checked",!e),this.updateOverviewDisplay()}),n()("#phpcompat-select-active").on("click",()=>{n()(".phpcompat-target").prop("checked",!1),n()('.phpcompat-target-item[data-active="1"]').find(".phpcompat-target").prop("checked",!0),this.updateOverviewDisplay()}),n()(document).on("click",".phpcompat-overview-tag",function(){const t=n()(this).data("slug"),e=n()(this).data("type"),s=n()(`.phpcompat-target[data-slug="${t}"][data-type="${e}"]`).closest(".phpcompat-target-item");if(!s.length)return;const a=n()("#wpadminbar").outerHeight()||32,i=n()(".phpcompat-sticky-controls"),o=a+(i.hasClass("pinned")?i.outerHeight()+10:10);n()("html, body").animate({scrollTop:s.offset().top-o},400),s.addClass("phpcompat-highlight"),setTimeout(()=>s.removeClass("phpcompat-highlight"),1500)})}_targetKey(t,e){return`${t}--${e}`}updateOverviewDisplay(){const t=n()("#phpcompat-overview-list"),e=n()(".phpcompat-target:checked");if(0===e.length)return void t.html('<span class="phpcompat-overview-empty">No targets selected</span>');const s={};t.find(".phpcompat-overview-tag").each(function(){s[n()(this).data("key")]=n()(this)});let a="";const i=new Set;e.each((t,e)=>{const o=n()(e),p=o.data("type"),r=o.data("slug"),c=`${p}--${r}`,h=o.closest(".phpcompat-target-item").data("name")||o.closest(".phpcompat-target-item").text().trim();i.add(c),s[c]||(a+=`<span class="phpcompat-overview-tag pending" data-key="${c}" data-type="${p}" data-slug="${r}"><span class="phpcompat-overview-tag-name">${h}</span></span>`)});for(const t in s)i.has(t)||s[t].remove();a&&(t.find(".phpcompat-overview-empty").remove(),t.append(a)),0===t.find(".phpcompat-overview-tag").length&&t.html('<span class="phpcompat-overview-empty">No targets selected</span>')}setTargetScanning(t,e){const s=this._targetKey(t,e),a=n()(`#phpcompat-overview-list .phpcompat-overview-tag[data-key="${s}"]`);if(!a.length)return;a.removeClass("pending success errors warnings").addClass("scanning");const i=a.find(".phpcompat-overview-tag-name").text();a.html(`<span class="phpcompat-overview-tag-name">${i}</span><span class="phpcompat-spinner"></span>`)}setTargetComplete(t,e,s,a){const i=this._targetKey(t,e),o=n()(`#phpcompat-overview-list .phpcompat-overview-tag[data-key="${i}"]`);if(!o.length)return;o.removeClass("pending scanning");const p=o.find(".phpcompat-overview-tag-name").text();let r,c,h;s>0?(r="errors",c="β",h=`${s} error${s>1?"s":""}`,a>0&&(h+=`, ${a} warning${a>1?"s":""}`)):a>0?(r="warnings",c="β οΈ",h=`${a} warning${a>1?"s":""}`):(r="success",c="β ",h="No issues"),o.addClass(r),o.html(`<span class="phpcompat-overview-tag-name">${p}</span><span class="phpcompat-overview-tag-detail">${c} ${h}</span>`)}getSelectedTargets(){return n()(".phpcompat-target:checked").toArray().map(t=>{const e=n()(t),s=e.closest(".phpcompat-target-item");return{element:t,type:e.data("type"),slug:e.data("slug"),name:s.data("name")||s.text().trim()}})}hasSelectedTargets(){return n()(".phpcompat-target:checked").length>0}uncheckAllTargets(){n()(".phpcompat-target:checked").prop("checked",!1),this.updateOverviewDisplay()}}},617:function(t,e,s){var a=s(669),n=s.n(a);t=s.hmd(t);let i=null;async function o(t){try{const{App:e}=await Promise.resolve().then(s.bind(s,374));i=new e(t),await i.init(),"undefined"!=typeof window&&(window.PHPCompatCheckerApp=i),console.log("PHP Compatibility Checker application initialized successfully")}catch(t){console.error("Failed to initialize PHP Compatibility Checker application:",t),function(t){const e=n()("#phpcompat-scan-status"),s=n()("#phpcompat-start-scan");e.length&&e.html(`β Failed to initialize: ${t.message}`),s.length&&s.prop("disabled",!0)}(t)}}n()(function(t){const e="undefined"!=typeof window&&window.PHPCompatChecker?window.PHPCompatChecker:null;e&&e.ajaxUrl&&e.nonce?o(e):console.error("PHP Compatibility Checker: Missing required configuration")}),t.exports&&(t.exports={initializeApp:o,getApp:function(){return i},isAppReady:function(){return i&&i.isReady()}})},620:function(t,e,s){s.r(e),s.d(e,{OptionsManager:function(){return i}});var a=s(669),n=s.n(a);class i{constructor(t){this.ajaxClient=t,this.options={batch_size:"50",php_version:"8.3",skip_vendor:!0}}async init(){await this.loadOptions(),this.bindEvents()}async loadOptions(){try{const t=await this.ajaxClient.loadOptions();t&&t.success&&t.data&&(this.options={batch_size:t.data.batch_size||"50",php_version:t.data.php_version||"8.3",skip_vendor:"0"!==t.data.skip_vendor},this.updateUI())}catch(t){console.error("Failed to load options:",t)}}async saveOptions(){try{const t={batch_size:this.options.batch_size,php_version:this.options.php_version,skip_vendor:this.options.skip_vendor?"1":"0"};await this.ajaxClient.saveOptions(t)}catch(t){console.error("Failed to save options:",t)}}updateUI(){const t=n()("#batch-size"),e=n()("#php-version"),s=n()("#skip-vendor");t.length&&t.val(this.options.batch_size),e.length&&e.val(this.options.php_version),s.length&&s.prop("checked",this.options.skip_vendor)}bindEvents(){n()("#batch-size").on("change",t=>{this.options.batch_size=t.target.value,this.saveOptions()}),n()("#php-version").on("change",t=>{this.options.php_version=t.target.value,this.saveOptions()}),n()("#skip-vendor").on("change",t=>{this.options.skip_vendor=t.target.checked,this.saveOptions()})}getOptions(){return{...this.options}}getBatchSize(){return parseInt(this.options.batch_size,10)||50}getPhpVersion(){return this.options.php_version}getSkipVendor(){return this.options.skip_vendor}}},669:function(t){t.exports=jQuery},704:function(t,e,s){s.r(e),s.d(e,{AjaxClient:function(){return a}});class a{constructor(t){this.ajaxUrl=t.ajaxUrl,this.nonce=t.nonce}async post(t,e={}){const s={action:t,nonce:this.nonce,...e};try{const t=await fetch(this.ajaxUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(s)});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}catch(t){throw console.error("AJAX request failed:",t),t}}async loadOptions(){return this.post("phpcompat_checker_load_options")}async saveOptions(t){return this.post("phpcompat_checker_save_options",{report_mode:"detailed",...t})}async preflightCheck(){return this.post("phpcompat_checker_preflight")}async getTargets(){return this.post("phpcompat_checker_targets")}async getProgress(t,e,s,a){return this.post("phpcompat_checker_progress",{type:t,slug:e,batch_size:s,skip_vendor:a?"1":"0"})}async processBatch(t,e){return this.post("phpcompat_checker_process_batch",{scan_id:t,batch_number:e})}async stopScan(){return this.post("phpcompat_checker_stop_scan")}}}},e={};function s(a){var n=e[a];if(void 0!==n)return n.exports;var i=e[a]={id:a,loaded:!1,exports:{}};return t[a](i,i.exports,s),i.loaded=!0,i.exports}s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,{a:e}),e},s.d=function(t,e){for(var a in e)s.o(e,a)&&!s.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},s.hmd=function(t){return(t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s(617)}();
Save
Cancel