API ISsues fixes pluigna dn app, plugin v udapte 1.4.0

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-13 04:42:58 +00:00
parent a91e22895b
commit a361dea528
9 changed files with 728 additions and 27 deletions

View File

@@ -236,12 +236,21 @@ foreach ($all_post_types as $pt) {
</div>
</div>
<button type="submit" class="igny8-btn igny8-btn-primary">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 16px; height: 16px;">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/>
</svg>
<?php _e('Save Settings', 'igny8-bridge'); ?>
</button>
<div style="display: flex; gap: 12px; align-items: center;">
<button type="submit" class="igny8-btn igny8-btn-primary">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 16px; height: 16px;">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/>
</svg>
<?php _e('Save Settings', 'igny8-bridge'); ?>
</button>
<button type="button" id="igny8-clear-update-cache" class="igny8-btn" style="background: var(--igny8-surface); border: 1px solid var(--igny8-stroke);">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 16px; height: 16px;">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"/>
</svg>
<?php _e('Clear Update Cache', 'igny8-bridge'); ?>
</button>
</div>
</form>
<style>
@@ -283,6 +292,46 @@ jQuery(document).ready(function($) {
card.slideUp(200);
}
});
// Handle clear update cache button
$('#igny8-clear-update-cache').on('click', function(e) {
e.preventDefault();
var $btn = $(this);
var originalText = $btn.html();
$btn.prop('disabled', true).html('<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 16px; height: 16px; animation: spin 1s linear infinite;"><circle cx="12" cy="12" r="10" stroke-width="4" stroke="currentColor" stroke-opacity="0.25"></circle><path fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> Clearing...');
$.ajax({
url: ajaxurl,
type: 'POST',
data: {
action: 'igny8_clear_update_cache',
nonce: '<?php echo wp_create_nonce('igny8_clear_cache'); ?>'
},
success: function(response) {
if (response.success) {
$btn.html('<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 16px; height: 16px;"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/></svg> Cache Cleared!').css('background', '#10b981').css('color', 'white').css('border-color', '#10b981');
setTimeout(function() {
$btn.prop('disabled', false).html(originalText).css('background', '').css('color', '').css('border-color', '');
}, 2000);
} else {
$btn.html('<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 16px; height: 16px;"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/></svg> Failed').css('background', '#ef4444').css('color', 'white');
setTimeout(function() {
$btn.prop('disabled', false).html(originalText).css('background', '').css('color', '');
}, 2000);
}
},
error: function() {
$btn.html('<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 16px; height: 16px;"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/></svg> Error').css('background', '#ef4444').css('color', 'white');
setTimeout(function() {
$btn.prop('disabled', false).html(originalText).css('background', '').css('color', '');
}, 2000);
}
});
});
});
</script>