| Server IP : 69.72.244.102 / Your IP : 216.73.216.164 Web Server : LiteSpeed System : Linux s3434.fra1.stableserver.net 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64 User : konzalta ( 1271) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/cwd/wp-content/plugins/woocommerce/assets/js/admin/ |
Upload File : |
/**
* WooCommerce Status Widget Async Loading
*/
jQuery(function($) {
'use strict';
// Only run on admin dashboard
if (!$('#wc-status-widget-loading').length) {
return;
}
// Load the widget content via AJAX
function loadStatusWidget() {
$.ajax({
url: wc_status_widget_params.ajax_url,
data: {
action: 'woocommerce_load_status_widget',
security: wc_status_widget_params.security
},
type: 'GET',
dataType: 'json',
success: function(response) {
if (response && response.success && response.data.content) {
$('#wc-status-widget-content').html(response.data.content).show();
$('#wc-status-widget-loading').hide();
} else {
showErrorMessage();
}
},
error: function() {
showErrorMessage();
}
});
}
function showErrorMessage() {
$('#wc-status-widget-loading').html('<p>' + 'Error loading widget' + '</p>');
}
// Start loading the widget after a very short delay
// This allows the dashboard to render quickly first
setTimeout(loadStatusWidget, 100);
});