diff --git a/admin/includes/class-free-plugins-manager.php b/admin/includes/class-free-plugins-manager.php
index 988a89e..de88bc0 100644
--- a/admin/includes/class-free-plugins-manager.php
+++ b/admin/includes/class-free-plugins-manager.php
@@ -81,9 +81,12 @@ class WP_Allstars_Free_Plugins_Manager {
-
-
-
+
+
+
+
+
Loading plugin data...
+
@@ -94,16 +97,16 @@ class WP_Allstars_Free_Plugins_Manager {
e.preventDefault();
var category = $(this).data('category');
+ var $container = $('#wpa-plugin-list');
// Update filter UI
$('#wpa-plugin-filters .filter-links a').removeClass('current');
$(this).addClass('current');
- // Show loading spinner
- $('.wp-allstars-loading-overlay').show();
-
- // Clear existing plugins
- $('#wpa-plugin-list').empty();
+ // Create new loading overlay
+ $container.empty();
+ var $loadingOverlay = $('
');
+ $container.append($loadingOverlay);
// Load plugins in selected category
$.ajax({
@@ -115,18 +118,20 @@ class WP_Allstars_Free_Plugins_Manager {
nonce: ''
},
success: function(response) {
+ $loadingOverlay.remove();
+
if (response.success) {
- // Hide loading spinner
- $('.wp-allstars-loading-overlay').hide();
-
// Add plugins to the container
- $('#wpa-plugin-list').html(response.data);
+ $container.html(response.data);
} else {
+ $container.html('
');
console.error('Error loading plugins:', response.data);
}
},
error: function(xhr, status, error) {
- console.error('AJAX error:', error);
+ $loadingOverlay.remove();
+ $container.html('
Failed to load plugins. Please try again. Error: ' + error + '
');
+ console.error('AJAX error:', xhr.responseText);
}
});
});