Prep Plugin for release on WordPress.org (#23)

* Update translation text domain
* 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.
* Add Proper Build script
* Use emojii flags
* Fix i18n deprecation  notice for translating too early
* Put all scripts in footer and load async
This commit is contained in:
David Stone
2025-04-14 11:36:46 -06:00
committed by GitHub
parent a31cfcb565
commit d88e50df38
1087 changed files with 12586 additions and 18535 deletions

View File

@ -6,20 +6,14 @@
*/
?>
<div id="dashboard-filters" class="wp-filter wu-filter">
<ul class="filter-links">
<?php foreach ($views as $tab => $view) : ?>
<li class="<?php echo $tab === $active_tab ? 'current' : ''; ?>">
<a href="<?php echo esc_attr($view['url']); ?>"
class="<?php echo $tab === $active_tab ? 'current wu-font-medium' : ''; ?> wu-loader">
<?php echo $view['label']; ?>
</a>
</li>
<?php endforeach; ?>
<?php foreach ($views as $tab => $view) : ?>
<li class="<?php echo esc_attr($tab === $active_tab ? 'current' : ''); ?>">
<a href="<?php echo esc_url($view['url']); ?>" class="wu-loader <?php echo esc_attr($tab === $active_tab ? 'current wu-font-medium' : ''); ?>">
<?php echo esc_html($view['label']); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<ul class="filter-links sm:wu-float-right sm:wu-w-1/2 lg:wu-w-1/4 wu--mx-2 wu-block sm:wu-inline-block">
@ -29,38 +23,29 @@
id="wu-date-range"
style="min-height: 28px;"
class="wu-border-0 wu-border-l wu-border-gray-300 wu-bg-gray-100 wu-w-full wu-text-right wu-py-3 wu-outline-none wu-rounded-none"
placeholder="Loading..."
placeholder="<?php esc_html_e('Loading...'); ?>'"
>
</li>
</ul>
<ul class="wu-hidden md:wu-inline-block filter-links sm:wu-float-right md:wu-mr-6">
<?php foreach ($preset_options as $slug => $preset) : ?>
<?php
$link = add_query_arg(
$link = add_query_arg(
[
'start_date' => $preset['start_date'],
'end_date' => $preset['end_date'],
'preset' => $slug,
]
);
$request_slug = wu_request('preset', 'none');
?>
<li class="<?php echo $slug === $request_slug ? 'current' : ''; ?>">
<a href="<?php echo esc_attr($link); ?>"
class="<?php echo $slug === $request_slug ? 'current wu-font-medium' : ''; ?> wu-loader">
<?php echo $preset['label']; ?>
</a>
</li>
<?php endforeach; ?>
<li class="<?php echo esc_attr($slug === $request_slug ? 'current' : ''); ?>">
<a href="<?php echo esc_url($link); ?>" class="wu-loader <?php echo esc_attr($slug === $request_slug ? 'current wu-font-medium' : ''); ?>">
<?php echo esc_html($preset['label']); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>