fix: handle invalid package uploads

This commit is contained in:
Keith Solomon
2026-04-26 20:45:18 -05:00
parent 90b56e13bb
commit cce40907d5
4 changed files with 98 additions and 2 deletions
+14
View File
@@ -26,6 +26,20 @@ if ( ! defined( 'ABSPATH' ) ) {
</p>
</div>
<?php // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Displays redirect status only. ?>
<?php if ( isset( $_GET['wpcs_import_error'] ) ) : ?>
<div class="notice notice-error">
<p><?php echo esc_html( sanitize_text_field( wp_unslash( $_GET['wpcs_import_error'] ) ) ); ?></p>
</div>
<?php endif; ?>
<?php // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Displays redirect status only. ?>
<?php if ( isset( $_GET['wpcs_imported'] ) ) : ?>
<div class="notice notice-success">
<p><?php echo esc_html__( 'The package JSON file was validated successfully.', 'wp-content-sync' ); ?></p>
</div>
<?php endif; ?>
<h2><?php echo esc_html__( 'Current Defaults', 'wp-content-sync' ); ?></h2>
<table class="widefat striped">
<tbody>