WebP Express CloudHost.es Fix v0.25.9-cloudhost
✅ Fixed bulk conversion getting stuck on missing files ✅ Added robust error handling and timeout protection ✅ Improved JavaScript response parsing ✅ Added file existence validation ✅ Fixed missing PHP class imports ✅ Added comprehensive try-catch error recovery 🔧 Key fixes: - File existence checks before conversion attempts - 30-second timeout protection per file - Graceful handling of 500 errors and JSON parsing issues - Automatic continuation to next file on failures - Cache busting for JavaScript updates 🎯 Result: Bulk conversion now completes successfully even with missing files 🚀 Generated with Claude Code (https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1
lib/wcfm/index.0c25b0fb.css
Normal file
1
lib/wcfm/index.0c25b0fb.css
Normal file
File diff suppressed because one or more lines are too long
23
lib/wcfm/index.be5d792e.js
Normal file
23
lib/wcfm/index.be5d792e.js
Normal file
File diff suppressed because one or more lines are too long
16
lib/wcfm/vendor.fa68d508.js
Normal file
16
lib/wcfm/vendor.fa68d508.js
Normal file
File diff suppressed because one or more lines are too long
72
lib/wcfm/wcfm-options.js
Normal file
72
lib/wcfm/wcfm-options.js
Normal file
@@ -0,0 +1,72 @@
|
||||
|
||||
window["wcfmoptions"] = {};
|
||||
|
||||
window["wcfmoptions"]['poster'] = function(action, options, successCallback, errorCallback) {
|
||||
|
||||
//console.log('wcfmoptions.poster called. Action: ' + action);
|
||||
console.log('wcfmoptions.poster called. Options: ' + JSON.stringify(options));
|
||||
|
||||
// Call the API
|
||||
var data = {
|
||||
'action': 'webpexpress-wcfm-api',
|
||||
'nonce' : window.webpExpressWCFMNonce,
|
||||
'command': action,
|
||||
//'args': options
|
||||
'args': JSON.stringify(options)
|
||||
};
|
||||
|
||||
jQuery.ajax({
|
||||
type: "POST",
|
||||
url: ajaxurl,
|
||||
data: data,
|
||||
//contentType: "application/json; charset=utf-8",
|
||||
dataType: 'text', // text or json?
|
||||
timeout: 30000,
|
||||
error: function (jqXHR, status, errorThrown) {
|
||||
console.log(errorThrown);
|
||||
},
|
||||
/*success: function(responseObj) {
|
||||
console.log('ajax response', responseObj);
|
||||
successCallback(responseObj);
|
||||
}*/
|
||||
|
||||
success: function(responseText) {
|
||||
//console.log('ajax response', responseText);
|
||||
//response = "[{name:'hello'}]";
|
||||
//console.log('response:');
|
||||
//console.log(responseText);
|
||||
try {
|
||||
responseObj = JSON.parse(responseText);
|
||||
} catch (e) {
|
||||
console.log('The "' + action + '" response could not be parsed as JSON. ' + e.name + ':' + e.message);
|
||||
console.log('response:' + responseText);
|
||||
errorCallback(responseText);
|
||||
return
|
||||
}
|
||||
successCallback(responseObj);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function adjustWCFMHeight() {
|
||||
var usedHeight =
|
||||
document.getElementById('wpadminbar').offsetHeight +
|
||||
document.getElementById('wpfooter').offsetHeight +
|
||||
document.getElementById('screen-meta').offsetHeight +
|
||||
document.getElementById('wcfmintro').offsetHeight;
|
||||
|
||||
var wcfm = document.getElementById('webpconvert-filemanager');
|
||||
|
||||
var h = Math.max(document.body.clientHeight - usedHeight - 30, 300);
|
||||
//console.log('setting height', h, document.body.clientHeight, usedHeight);
|
||||
wcfm.style.height = h + 'px';
|
||||
}
|
||||
|
||||
window.addEventListener('load', function(event) {
|
||||
adjustWCFMHeight();
|
||||
});
|
||||
|
||||
|
||||
window.addEventListener('resize', function(event) {
|
||||
adjustWCFMHeight();
|
||||
});
|
||||
Reference in New Issue
Block a user