function openDeleteLogFilesPopup() {
var html = '';
html += '<p><b>Are you sure you want to do that?</b></p>';
html += '<p>' +
'The log files contain information about the conversion settings used for each webp and the libraries ' +
'used, and the versions. This information will be visible in the conversion manager in a not too far future. ' +
'The information might also be used to notify you if the libraries / version of a library you have is ' +
'significantly better than the one used for the conversion. ' +
'If you delete the log files, you will not benefit from this functionality. ' +
'</p>';
html += '<p>' +
'The log files are btw located in <i>wp-content/webp-express/log/</i>, if you want to have a closer look.' +
'</p>';
html += '<button onclick="purgeLog()" class="button button-secondary" type="button">Yes, delete!</button>';
document.getElementById('purgelogcontent').innerHTML = '<div>' + html + '</div>';
tb_show('Delete all log Files?', '#TB_inline?inlineId=purgelogpopup&height=320&width=450');
}
function closePurgeLogDialog() {
tb_remove();
}
function purgeLog() {
var data = {
'action': 'webpexpress_purge_log',
'nonce' : window.webpExpress['ajax-nonces']['purge-log'],
};
jQuery.post(ajaxurl, data, function(response) {
if ((typeof response == 'object') && (response['success'] == false)) {
if (response['data'] && ((typeof response['data']) == 'string')) {
alert(response['data']);
} else {
alert('Something failed');
}