Prep Plugin for release on WordPress.org

Escape everything that should be escaped.
Add nonce checks where needed.
Sanitize all inputs.
Apply Code style changes across the codebase.
Correct many deprecation notices.
Optimize load order of many filters.
This commit is contained in:
David Stone
2025-04-07 09:15:21 -06:00
parent f05ab77418
commit a815fdf179
290 changed files with 2999 additions and 3269 deletions

View File

@ -8,26 +8,26 @@
<div id="wp-ultimo-wrap" class="wrap wu-wrap <?php echo esc_attr($classes); ?>">
<h1 class="wp-heading-inline">
<!-- This is here for admin notices placement only -->
<!-- This is here for admin notices placement only -->
</h1>
<?php if ($logo) : ?>
<div class="wu-text-center">
<div class="wu-text-center">
<img style="width: 200px;" src="<?php echo esc_attr($logo); ?>" alt="">
</div>
</div>
<?php endif; ?>
<?php if (isset($_GET['deleted'])) : ?>
<?php if (isset($_GET['deleted'])) : // phpcs:ignore WordPress.Security.NonceVerification ?>
<div id="message" class="updated notice wu-admin-notice notice-success is-dismissible below-h2">
<div id="message" class="updated notice wu-admin-notice notice-success is-dismissible below-h2">
<p><?php echo $page->labels['deleted_message']; ?></p>
<p><?php echo esc_html($page->labels['deleted_message']); ?></p>
</div>
</div>
<?php endif; ?>
@ -35,11 +35,11 @@
<div id="poststuff" class="md:wu-flex wu-mr-4 md:wu-mr-0">
<div class="md:wu-w-2/12 wu-pt-10">
<div class="md:wu-w-2/12 wu-pt-10">
<span class="wu-uppercase wu-block wu-px-4 wu-text-gray-700 wu-font-bold">
<?php echo $page->get_title(); ?>
<?php echo esc_html($page->get_title()); ?>
</span>
@ -53,105 +53,105 @@
do_action('wu_page_wizard_after_title', $page);
?>
<!-- Navigator -->
<ul class="">
<!-- Navigator -->
<ul class="">
<?php
<?php
/**
* We need to set a couple of flags in here to control clickable navigation elements.
* This flag makes sure only steps the user already went through are clickable.
*/
$is_pre_current_section = true;
/**
* We need to set a couple of flags in here to control clickable navigation elements.
* This flag makes sure only steps the user already went through are clickable.
*/
$is_pre_current_section = true;
?>
?>
<?php foreach ($sections as $section_name => $section) : ?>
<?php foreach ($sections as $section_name => $section) : ?>
<?php
<?php
/**
* Updates the flag after the current section is looped.
*/
if ($current_section === $section_name) {
$is_pre_current_section = false;
} // end if;
/**
* Updates the flag after the current section is looped.
*/
if ($current_section === $section_name) {
$is_pre_current_section = false;
}
?>
?>
<?php if (wu_get_isset($section, 'separator')) : ?>
<?php if (wu_get_isset($section, 'separator')) : ?>
<!-- Separator Item -->
<li class="wu-sticky wu-py-2 wu-px-4">&nbsp;</li>
<!-- Separator Item -->
<li class="wu-sticky wu-py-2 wu-px-4">&nbsp;</li>
<?php else : ?>
<?php else : ?>
<!-- Menu Item -->
<li class="wu-sticky">
<!-- Menu Item -->
<li class="wu-sticky">
<!-- Menu Link -->
<a href="<?php echo esc_url($page->get_section_link($section_name)); ?>" class="wu-block wu-py-2 wu-px-4 wu-no-underline wu-text-sm wu-rounded <?php echo ! $clickable_navigation && ! $is_pre_current_section ? 'wu-pointer-events-none' : ''; ?> <?php echo $current_section === $section_name ? 'wu-bg-gray-300 wu-text-gray-800' : 'wu-text-gray-600 hover:wu-text-gray-700'; ?>">
<?php echo $section['title']; ?>
</a>
<!-- End Menu Link -->
<!-- Menu Link -->
<a href="<?php echo esc_url($page->get_section_link($section_name)); ?>" class="wu-block wu-py-2 wu-px-4 wu-no-underline wu-text-sm wu-rounded <?php echo ! $clickable_navigation && ! $is_pre_current_section ? 'wu-pointer-events-none' : ''; ?> <?php echo $current_section === $section_name ? 'wu-bg-gray-300 wu-text-gray-800' : 'wu-text-gray-600 hover:wu-text-gray-700'; ?>">
<?php echo esc_html($section['title']); ?>
</a>
<!-- End Menu Link -->
<?php if ( ! empty($section['sub-sections'])) : ?>
<?php if ( ! empty($section['sub-sections'])) : ?>
<!-- Sub-menu -->
<ul class="classes">
<!-- Sub-menu -->
<ul class="classes">
<?php foreach ($section['sub-sections'] as $sub_section_name => $sub_section) : ?>
<?php foreach ($section['sub-sections'] as $sub_section_name => $sub_section) : ?>
<li class="classes">
<a href="#" class="wu-block wu-py-2 wu-px-4 wu-no-underline wu-text-gray-500 hover:wu-text-gray-600 wu-text-sm">
&rarr; <?php echo $sub_section['title']; ?>
</a>
</li>
<li class="classes">
<a href="#" class="wu-block wu-py-2 wu-px-4 wu-no-underline wu-text-gray-500 hover:wu-text-gray-600 wu-text-sm">
&rarr; <?php echo esc_html($sub_section['title']); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<!-- End Sub-menu -->
<?php endif; ?>
</li>
<!-- End Menu Item -->
<?php endif; ?>
<?php endforeach; ?>
</ul>
<!-- End Sub-menu -->
</ul>
<!-- End Navigator -->
<?php endif; ?>
</div>
</li>
<!-- End Menu Item -->
<div class="md:wu-w-8/12 wu-px-4 metabox-holder">
<?php endif; ?>
<form method="post" id="<?php echo esc_attr($form_id); ?>">
<?php endforeach; ?>
<?php
</ul>
<!-- End Navigator -->
/**
* Print Side Metaboxes
*
* Allow plugin developers to add new metaboxes
*
* @since 1.8.2
* @param object Object being edited right now
*/
do_meta_boxes($screen->id, 'normal', false);
</div>
?>
<div class="md:wu-w-8/12 wu-px-4 metabox-holder">
<?php wp_nonce_field(sprintf('saving_%s', $current_section), sprintf('saving_%s', $current_section), false); ?>
<form method="post" id="<?php echo esc_attr($form_id); ?>">
<?php wp_nonce_field(sprintf('saving_%s', $current_section), '_wpultimo_nonce'); ?>
<?php
</form>
/**
* Print Side Metaboxes
*
* Allow plugin developers to add new metaboxes
*
* @since 1.8.2
* @param object Object being edited right now
*/
do_meta_boxes($screen->id, 'normal', false);
?>
<?php wp_nonce_field(sprintf('saving_%s', $current_section), sprintf('saving_%s', $current_section), false); ?>
<?php wp_nonce_field(sprintf('saving_%s', $current_section), '_wpultimo_nonce'); ?>
</form>
</div>
</div>
</div>