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

@ -3,9 +3,12 @@
* Actions field view.
*
* @since 2.0.0
/**
* @package MyPlugin
*/
?>
<li class="wu-bg-gray-100 <?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="wu-bg-gray-100 <?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<?php foreach ($field->actions as $action_slug => $action) : ?>
@ -13,21 +16,22 @@
<?php $action = new \WP_Ultimo\UI\Field($action_slug, $action); ?>
<button class="button <?php echo esc_attr($action->classes); ?>" id="action_button" data-action="<?php echo $action->action; ?>" data-object="<?php echo $action->object_id; ?>" value="<?php echo wp_create_nonce($action->action); ?>" <?php echo $field->get_html_attributes(); ?> >
<button class="button <?php echo esc_attr($action->classes); ?>" id="action_button" data-action="<?php echo esc_attr($action->action); ?>" data-object="<?php echo esc_attr($action->object_id); ?>" value="<?php echo esc_attr(wp_create_nonce($action->action)); ?>" <?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> >
<?php echo $action->title; ?>
<?php echo esc_html($action->title); ?>
<?php if ($action->tooltip) : ?>
<?php echo wu_tooltip($action->tooltip); ?>
<?php endif; ?>
<?php echo wu_tooltip($action->tooltip); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php endif; ?>
</button>
<span data-loading="wu_action_button_loading_<?php echo $action->object_id; ?>" id="wu_action_button_loading" class="wu-blinking-animation wu-text-gray-600 wu-my-1 wu-text-2xs wu-uppercase wu-font-semibold wu-text-center wu-self-center wu-px-4 wu-py wu-mt-1 hidden" >
<span data-loading="wu_action_button_loading_<?php echo esc_attr($action->object_id); ?>" id="wu_action_button_loading" class="wu-blinking-animation wu-text-gray-600 wu-my-1 wu-text-2xs wu-uppercase wu-font-semibold wu-text-center wu-self-center wu-px-4 wu-py wu-mt-1 hidden" >
<?php echo $action->loading_text; ?>
<?php echo esc_html($action->loading_text); ?>
</span>

View File

@ -5,7 +5,7 @@
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo($field->get_wrapper_html_attributes()); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu-block wu-w-full">
@ -25,7 +25,7 @@
?>
<textarea id="field-<?php echo esc_attr($field->id); ?>" data-init="0" data-code-editor="<?php echo esc_attr($field->lang); ?>" class="form-control wu-w-full wu-my-1 <?php echo esc_attr($field->classes); ?>" name="<?php echo esc_attr($field->id); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" <?php echo $field->get_html_attributes(); ?>><?php echo esc_attr($field->value); ?></textarea>
<textarea id="field-<?php echo esc_attr($field->id); ?>" data-init="0" data-code-editor="<?php echo esc_attr($field->lang); ?>" class="form-control wu-w-full wu-my-1 <?php echo esc_attr($field->classes); ?>" name="<?php echo esc_attr($field->id); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" <?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>><?php echo esc_attr($field->value); ?></textarea>
<?php

View File

@ -5,7 +5,7 @@
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu-block">
@ -27,7 +27,7 @@
<div class="wu-mt-2">
<color-picker class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="hidden" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>></color-picker>
<color-picker class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="hidden" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>></color-picker>
</div>

View File

@ -6,7 +6,7 @@
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu-block wu-w-full">
@ -28,11 +28,11 @@
<select class="wu_select_icon" name="<?php echo esc_attr($field->id); ?>">
<option value=""><?php echo __('No Icon', 'wp-ultimo'); ?></option>
<option value=""><?php echo esc_html__('No Icon', 'wp-multisite-waas'); ?></option>
<?php foreach (wu_get_icons_list() as $category_label => $category_array) : ?>
<optgroup label="<?php echo $category_label; ?>">
<optgroup label="<?php echo esc_attr($category_label); ?>">
<?php foreach ($category_array as $option_key => $option_value) : ?>
@ -40,7 +40,7 @@
value="<?php echo esc_attr($option_value); ?>"
<?php selected($field->value, $option_value); ?>
>
<?php echo $option_value; ?>
<?php echo esc_html($option_value); ?>
</option>
<?php endforeach; ?>

View File

@ -5,7 +5,7 @@
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu-block wu-w-full <?php echo esc_attr($field->classes); ?>">
@ -50,7 +50,7 @@
<div class="wu-mt-2 wu-block wu-bg-gray-100 wu-rounded wu-border-solid wu-border-gray-400 wu-border-t wu-border-l wu-border-b wu-border-r wu-text-2xs wu-py-2 wu-p-2">
<?php echo $field->desc; ?>
<?php echo $field->desc; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>

View File

@ -5,17 +5,17 @@
* @since 2.0.0
*/
?>
<li class="wu-bg-gray-100 wu-py-4 <?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="wu-bg-gray-100 wu-py-4 <?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu-block wu-w-full">
<h3 class="wu-my-1 wu-text-base wu-text-gray-800">
<?php echo $field->title; ?>
<?php echo $field->title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php if ($field->tooltip) : ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php echo wu_tooltip($field->tooltip); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php endif; ?>
@ -25,7 +25,7 @@
<p class="wu-mt-1 wu-mb-0 wu-text-gray-700">
<?php echo $field->desc; ?>
<?php echo $field->desc; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</p>

View File

@ -7,6 +7,6 @@
?>
<li class="wu-hidden wu-m-0">
<input class="form-control wu-w-full" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<input class="form-control wu-w-full" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
</li>

View File

@ -5,7 +5,7 @@
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu-block wu-w-full">
@ -39,7 +39,7 @@
<div class="wu-block wu-w-full wu-mt-4 <?php echo esc_attr($field->classes); ?>">
<?php echo $field->content; ?>
<?php echo $field->content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>

View File

@ -20,11 +20,11 @@ $content_wrapper_classes = $field->content_wrapper_classes
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="<?php echo $mq; ?>md:wu-flex wu-items-center wu-w-full">
<div class="<?php echo esc_attr($mq); ?>md:wu-flex wu-items-center wu-w-full">
<div class="<?php echo $mq; ?>md:wu-w-10/12">
<div class="<?php echo esc_attr($mq); ?>md:wu-w-10/12">
<?php
@ -42,7 +42,7 @@ $content_wrapper_classes = $field->content_wrapper_classes
?>
<div class="<?php echo $mq; ?>md:wu-w-9/12">
<div class="<?php echo esc_attr($mq); ?>md:wu-w-9/12">
<?php
@ -70,24 +70,24 @@ $content_wrapper_classes = $field->content_wrapper_classes
<div class="wu-relative wu-w-full wu-overflow-hidden">
<div class="wu-self-center wu-rounded wu-flex <?php echo $mq; ?>md:wu-max-w-full wu-min-w-full <?php echo $mq; ?>md:wu-max-h-20 wu-overflow-hidden">
<div class="wu-self-center wu-rounded wu-flex <?php echo esc_attr($mq); ?>md:wu-max-w-full wu-min-w-full <?php echo esc_attr($mq); ?>md:wu-max-h-20 wu-overflow-hidden">
<img
class="<?php echo $field->img ? '' : 'wu-absolute'; ?> wu-self-center wu-rounded sm:wu-max-w-full wu-min-w-full"
src="<?php echo $field->img; ?>"
src="<?php echo esc_url($field->img); ?>"
>
</div>
<div class="wu-wrapper-image-field-upload-actions wu-absolute wu-top-4 wu-right-4 <?php echo $mq; ?>md:wu-top-2 <?php echo $mq; ?>md:wu-right-2 wu-scale-150 <?php echo $mq; ?>md:wu-scale-100">
<div class="wu-wrapper-image-field-upload-actions wu-absolute wu-top-4 wu-right-4 <?php echo esc_attr($mq); ?>md:wu-top-2 <?php echo esc_attr($mq); ?>md:wu-right-2 wu-scale-150 <?php echo esc_attr($mq); ?>md:wu-scale-100">
<a title="<?php _e('Preview Image', 'wp-ultimo'); ?>" href="<?php echo $field->img; ?>" class="wubox wu-no-underline wu-text-center wu-inline-block wu-bg-black wu-opacity-60 wu-rounded-full wu-text-white wu-w-5 wu-h-5 wu-shadow-sm">
<a title="<?php esc_attr_e('Preview Image', 'wp-multisite-waas'); ?>" href="<?php echo esc_url($field->img); ?>" class="wubox wu-no-underline wu-text-center wu-inline-block wu-bg-black wu-opacity-60 wu-rounded-full wu-text-white wu-w-5 wu-h-5 wu-shadow-sm">
<span class="dashicons-wu-eye1 wu-align-middle" style="top: -2px;"></span>
</a>
<a title="<?php _e('Remove Image', 'wp-ultimo'); ?>" href="#" class="wu-remove-image wu-no-underline wu-text-center wu-inline-block wu-bg-black wu-opacity-60 wu-rounded-full wu-text-white wu-w-5 wu-h-5 wu-shadow-sm">
<a title="<?php esc_attr_e('Remove Image', 'wp-multisite-waas'); ?>" href="#" class="wu-remove-image wu-no-underline wu-text-center wu-inline-block wu-bg-black wu-opacity-60 wu-rounded-full wu-text-white wu-w-5 wu-h-5 wu-shadow-sm">
<span class="dashicons-wu-cross wu-align-middle"></span>
@ -97,13 +97,13 @@ $content_wrapper_classes = $field->content_wrapper_classes
</div>
<input name="<?php echo esc_attr($field_slug); ?>" type="hidden" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?> />
<input name="<?php echo esc_attr($field_slug); ?>" type="hidden" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> />
<div class="wu-add-image-wrapper <?php echo $mq; ?>md:wu-mt-0 wu-w-full" style="display: none;">
<div class="wu-add-image-wrapper <?php echo esc_attr($mq); ?>md:wu-mt-0 wu-w-full" style="display: none;">
<a class="button wu-w-full wu-text-center wu-add-image">
<span class="dashicons-wu-upload"></span> <?php _e('Upload Image', 'wp-ultimo'); ?>
<span class="dashicons-wu-upload"></span> <?php esc_html_e('Upload Image', 'wp-multisite-waas'); ?>
</a>

View File

@ -5,7 +5,7 @@
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu-block wu-w-full">
@ -25,9 +25,9 @@
?>
<a class="form-control <?php echo esc_attr($field->classes); ?>" type="<?php echo esc_attr($field->type); ?>" <?php echo $field->get_html_attributes(); ?>>
<a class="form-control <?php echo esc_attr($field->classes); ?>" type="<?php echo esc_attr($field->type); ?>" <?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<?php echo $field->display_value; ?>
<?php echo esc_html($field->display_value); ?>
</a>

View File

@ -7,7 +7,7 @@
?>
<li
class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>"
<?php echo $field->get_wrapper_html_attributes(); ?>
<?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
>
<div class="wu-w-full">
@ -52,7 +52,7 @@
<span class="wu-my-1 wu-text-xs wu-font-bold wu-block">
<?php echo $option['title']; ?>
<?php echo esc_html($option['title']); ?>
</span>
@ -60,7 +60,7 @@
<span class="wu-my-1 wu-inline-block wu-text-xs">
<?php echo $option['desc']; ?>
<?php echo esc_html($option['desc']); ?>
</span>
@ -72,7 +72,7 @@
<div class="wu-toggle">
<input <?php checked(in_array($value, (array) $field->value, true)); ?> value="<?php echo esc_attr($value); ?>" id="<?php echo esc_attr("{$field->id}_{$value}"); ?>" type="checkbox" name="<?php echo esc_attr("{$field->id}[]"); ?>" class="wu-tgl wu-tgl-ios" <?php echo $field->get_html_attributes(); ?>>
<input <?php checked(in_array($value, (array) $field->value, true)); ?> value="<?php echo esc_attr($value); ?>" id="<?php echo esc_attr("{$field->id}_{$value}"); ?>" type="checkbox" name="<?php echo esc_attr("{$field->id}[]"); ?>" class="wu-tgl wu-tgl-ios" <?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<label for="<?php echo esc_attr("{$field->id}_{$value}"); ?>" class="wu-tgl-btn wp-ui-highlight"></label>

View File

@ -5,7 +5,7 @@
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<?php
@ -25,7 +25,7 @@
<div class="<?php echo esc_attr('wu-my-0 ' . $field->classes); ?>">
<?php echo $field->desc; ?>
<?php echo $field->desc; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>

View File

@ -9,7 +9,7 @@
<?php if ( $field->title ) : ?>
<li id=""
class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu-w-full wu-block">
@ -81,7 +81,7 @@ if (is_array($field->values)) {
++$position;
?>
<li id="<?php echo esc_attr($field_id); ?>-line"
class="field-repeater wu-bg-gray-100 <?php echo esc_attr($field->wrapper_classes); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
class="field-repeater wu-bg-gray-100 <?php echo esc_attr($field->wrapper_classes); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu-w-full <?php echo esc_attr($field->classes); ?>">
<?php
foreach ($value as $field_name => $field_value) {
@ -105,7 +105,7 @@ if (is_array($field->values)) {
} else {
?>
<li id="<?php echo esc_attr($field->id); ?>-line"
class="field-repeater wu-bg-gray-100 <?php echo esc_attr($field->wrapper_classes); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
class="field-repeater wu-bg-gray-100 <?php echo esc_attr($field->wrapper_classes); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu-w-full <?php echo esc_attr($field->classes); ?>">
@ -135,11 +135,11 @@ if (is_array($field->values)) {
?>
<li class="<?php echo esc_attr($field->wrapper_classes); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr($field->wrapper_classes); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<a class="button wu-w-full wu-text-center" href="#"
v-on:click.prevent="duplicate_and_clean($event, '.field-repeater')">
<?php esc_html_e('Add new Line', 'wp-ultimo'); ?>
<?php esc_html_e('Add new Line', 'wp-multisite-waas'); ?>
</a>
</li>

View File

@ -5,7 +5,7 @@
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu-block wu-w-full">
@ -59,15 +59,15 @@
<label class="wu-w-full wu-relative wu-rounded wu-p-1 wu-border-solid wu-border wu-flex wu-items-center wu-justify-center wu-bg-gray-100 wu-text-gray-600 wu-border-gray-300" v-bind:class="require('<?php echo esc_attr($field->id); ?>', '<?php echo esc_attr($option_value); ?>') ? 'wu-bg-gray-200 wu-text-gray-700 wu-border-gray-400 selected' : '' " for="<?php echo esc_attr($field->id . '-' . $option_value); ?>">
<div class="wu-text-center" <?php echo wu_tooltip_text($option['tooltip']); ?>>
<div class="wu-text-center" <?php echo wu_tooltip_text($option['tooltip']); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<span class="wu-block wu-text-2xl wu-mb-2 <?php echo esc_attr($option['icon']); ?>"></span>
<input class="wu-w-0 wu-h-0 wu-hidden" id="<?php echo esc_attr($field->id . '-' . $option_value); ?>" type="radio" <?php checked($option_value, $field->value); ?> value="<?php echo esc_attr($option_value); ?>" name="<?php echo esc_attr($field->id); ?>" <?php echo $field->get_html_attributes(); ?>>
<input class="wu-w-0 wu-h-0 wu-hidden" id="<?php echo esc_attr($field->id . '-' . $option_value); ?>" type="radio" <?php checked($option_value, $field->value); ?> value="<?php echo esc_attr($option_value); ?>" name="<?php echo esc_attr($field->id); ?>" <?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<span class="wu-uppercase wu-text-2xs wu-font-semibold">
<?php echo $option['title']; ?>
<?php echo esc_html($option['title']); ?>
</span>

View File

@ -5,7 +5,7 @@
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu-block wu-w-full">
@ -25,13 +25,13 @@
?>
<select class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?><?php echo isset($field->html_attr['multiple']) && $field->html_attr['multiple'] ? '[]' : ''; ?>" <?php echo $field->get_html_attributes(); ?> placeholder="<?php echo $field->placeholder; ?>">
<select class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?><?php echo isset($field->html_attr['multiple']) && $field->html_attr['multiple'] ? '[]' : ''; ?>" <?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> placeholder="<?php echo esc_attr($field->placeholder); ?>">
<?php foreach ($field->options as $option_value => $option_label) : ?>
<option <?php selected($field->value === $option_value || (is_array($field->value) && in_array($option_value, $field->value))); ?> value="<?php echo esc_attr($option_value); ?>">
<option <?php selected($field->value === $option_value || (is_array($field->value) && in_array($option_value, $field->value, true))); ?> value="<?php echo esc_attr($option_value); ?>">
<?php echo $option_label; ?>
<?php echo esc_html($option_label); ?>
</option>
@ -39,7 +39,17 @@
<?php if ($field->options_template) : ?>
<?php echo $field->options_template; ?>
<?php
echo wp_kses(
$field->options_template,
array(
'option' => array(
'value' => array(),
'selected' => array(),
),
)
);
?>
<?php endif; ?>

View File

@ -5,7 +5,7 @@
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu-block">
@ -27,7 +27,7 @@
<?php if ($field->desc) : ?>
<span class="wu-my-1 wu-inline-block wu-text-xs"><?php echo $field->desc; ?></span>
<span class="wu-my-1 wu-inline-block wu-text-xs"><?php echo $field->desc; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
<?php endif; ?>

View File

@ -5,11 +5,11 @@
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes) . (! str_contains($field->wrapper_classes, '-bg-') ? ' wu-bg-gray-200' : '')); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes) . (! str_contains($field->wrapper_classes, '-bg-') ? ' wu-bg-gray-200' : '')); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<button id="<?php echo esc_attr($field->id); ?>" type="submit" name="submit_button" value="<?php echo esc_attr($field->id); ?>" <?php echo $field->get_html_attributes(); ?> class="<?php echo esc_attr(trim($field->classes)); ?>">
<button id="<?php echo esc_attr($field->id); ?>" type="submit" name="submit_button" value="<?php echo esc_attr($field->id); ?>" <?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> class="<?php echo esc_attr(trim($field->classes)); ?>">
<?php echo $field->title; ?>
<?php echo esc_html($field->title); ?>
</button>

View File

@ -5,7 +5,7 @@
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?> wu-bg-gray-200" style="margin-bottom: -1px;" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?> wu-bg-gray-200" style="margin-bottom: -1px;" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu--m-4 wu-px-1">
@ -16,9 +16,9 @@
v-bind:class="'<?php echo esc_attr($option_value); ?>' == <?php echo esc_attr($field->id); ?> ? 'wu-bg-white wu-text-gray-600 wu-border-gray-300' : ''"
>
<?php echo $option_label; ?>
<?php echo esc_html($option_label); ?>
<input class="wu-w-0 wu-h-0 wu-overflow-hidden wu-hidden" type="radio" name="<?php echo esc_attr($field->id); ?>" value="<?php echo esc_attr($option_value); ?>" <?php echo $field->get_html_attributes(); ?>>
<input class="wu-w-0 wu-h-0 wu-overflow-hidden wu-hidden" type="radio" name="<?php echo esc_attr($field->id); ?>" value="<?php echo esc_attr($option_value); ?>" <?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
</label>

View File

@ -5,7 +5,7 @@
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu-block">
@ -36,12 +36,12 @@
$formatted_value = date_i18n(get_option('date_format'), $time);
$placeholder = wu_get_current_time('timestamp') > $time ? __('%s ago', 'wp-ultimo') : __('In %s', 'wp-ultimo'); // phpcs:ignore
$placeholder = wu_get_current_time('timestamp') > $time ? esc_html__('%s ago', 'wp-multisite-waas') : esc_html__('In %s', 'wp-multisite-waas'); // phpcs:ignore
printf('<time datetime="%3$s">%1$s</time><br><small>%2$s</small>', $formatted_value, sprintf($placeholder, human_time_diff($time, wu_get_current_time('timestamp'))), get_date_from_gmt($date));
printf('<time datetime="%3$s">%1$s</time><br><small>%2$s</small>', esc_html($formatted_value), esc_html(sprintf($placeholder, human_time_diff($time, wu_get_current_time('timestamp')))), esc_attr(get_date_from_gmt($date)));
} else {
_e('None', 'wp-ultimo');
} // end if;
esc_html_e('None', 'wp-multisite-waas');
}
?>
@ -49,11 +49,11 @@
<span class="wu-my-1 wu-inline-block">
<span id="<?php echo $field->id; ?>_value"><?php echo $field->display_value; ?></span>
<span id="<?php echo esc_attr($field->id); ?>_value"><?php echo $field->display_value; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
<?php if ($field->copy) : ?>
<a <?php echo wu_tooltip_text(__('Copy', 'wp-ultimo')); ?> class="wu-no-underline wp-ui-text-highlight wu-copy" data-clipboard-action="copy" data-clipboard-target="#<?php echo $field->id; ?>_value">
<a <?php echo wu_tooltip_text(esc_html__('Copy', 'wp-multisite-waas')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> class="wu-no-underline wp-ui-text-highlight wu-copy" data-clipboard-action="copy" data-clipboard-target="#<?php echo esc_attr($field->id); ?>_value">
<span class="dashicons-wu-copy wu-align-middle"></span>

View File

@ -30,8 +30,8 @@
<?php
if (wu_validate_date($field->value)) {
if (false == $field->display_value) {
echo __('No date', 'wp-ultimo');
if ( ! $field->display_value) {
esc_html_e('No date', 'wp-multisite-waas');
} else {
$date = $field->value;
@ -39,13 +39,13 @@
$formatted_value = date_i18n(get_option('date_format'), $time);
$placeholder = wu_get_current_time('timestamp') > $time ? __('%s ago', 'wp-ultimo') : __('In %s', 'wp-ultimo'); // phpcs:ignore
printf('<time datetime="%3$s">%1$s</time><br><small>%2$s</small>', $formatted_value, sprintf($placeholder, human_time_diff($time, wu_get_current_time('timestamp'))), get_date_from_gmt($date));
} // end if;
// translators: %s a unit of time.
$placeholder = wu_get_current_time('timestamp') > $time ? __('%s ago', 'wp-multisite-waas') : __('In %s', 'wp-multisite-waas');
printf('<time datetime="%3$s">%1$s</time><br><small>%2$s</small>', esc_html($formatted_value), esc_html(sprintf($placeholder, human_time_diff($time, wu_get_current_time('timestamp')))), esc_html(get_date_from_gmt($date)));
}
} else {
_e('None', 'wp-ultimo');
} // end if;
esc_html_e('None', 'wp-multisite-waas');
}
?>
@ -53,7 +53,7 @@
<span class="wu-my-1 wu-inline-block">
<?php echo $field->display_value; ?>
<?php echo $field->display_value; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</span>
@ -65,7 +65,7 @@
<div class="wu-block" v-show="!edit">
<a href="#" class="wu-p-2 wu--m-2 wp-ui-text-highlight" v-on:click="open($event)" data-field="<?php echo esc_attr($field_slug); ?>">
<?php echo wu_tooltip(__('Edit'), 'dashicons-edit'); ?>
<?php echo wu_tooltip(__('Edit'), 'dashicons-edit'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</a>
</div>
@ -87,7 +87,7 @@
?>
<input class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="text" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<input class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="text" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<?php
@ -113,7 +113,7 @@
<div class="wu-block" v-show="!edit">
<a href="#" class="wu-p-2 wu--m-2" v-on:click="edit($event, '<?php echo esc_js($field_slug); ?>')" data-field="<?php echo esc_attr($field_slug); ?>">
<?php echo wu_tooltip(__('Copy'), 'dashicons-admin-page'); ?>
<?php echo wu_tooltip(__('Copy'), 'dashicons-admin-page'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</a>
</div>

View File

@ -5,7 +5,7 @@
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu-block wu-w-full">
@ -30,18 +30,18 @@
<div class="wu-flex">
<div class="wu-w-full wu-my-1">
<input class="form-control wu-w-full" name="<?php echo esc_attr($field->id); ?>" type="text" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<input class="form-control wu-w-full" name="<?php echo esc_attr($field->id); ?>" type="text" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
</div>
<?php if (wu_get_isset($field->html_attr, 'data-base-link')) : ?>
<div class="wu-ml-1 wu-my-1" v-cloak>
<a
v-bind:href="'<?php echo wu_get_isset($field->html_attr, 'data-base-link'); ?>' + '=' + <?php echo wu_get_isset($field->html_attr, 'v-model'); ?>"
v-bind:href="'<?php echo esc_js(wu_get_isset($field->html_attr, 'data-base-link')); ?>' + '=' + <?php echo esc_js(wu_get_isset($field->html_attr, 'v-model')); ?>"
target="_blank"
class="button"
v-show='<?php echo wu_get_isset($field->html_attr, 'v-model'); ?>'
<?php echo wu_tooltip_text(__('View', 'wp-ultimo')); ?>
v-show='<?php echo esc_js(wu_get_isset($field->html_attr, 'v-model')); ?>'
<?php echo wu_tooltip_text(__('View', 'wp-multisite-waas')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
>
<span class="dashicons-wu-popup wu-m-0 wu-p-0"></span>
</a>
@ -53,13 +53,13 @@
<?php elseif ($field->money) : ?>
<money class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>></money>
<money class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>></money>
<input class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?> v-if="false">
<input class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> v-if="false">
<?php else : ?>
<input class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<input class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<?php endif; ?>

View File

@ -5,7 +5,7 @@
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu-block wu-w-full">
@ -25,7 +25,7 @@
?>
<textarea class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>" name="<?php echo esc_attr($field->id); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" <?php echo $field->get_html_attributes(); ?>><?php echo esc_attr($field->value); ?></textarea>
<textarea class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>" name="<?php echo esc_attr($field->id); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" <?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>><?php echo esc_attr($field->value); ?></textarea>
<?php

View File

@ -5,7 +5,7 @@
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu-block">
@ -27,7 +27,7 @@
<?php if ($field->desc) : ?>
<span class="wu-my-1 wu-inline-block wu-text-xs"><?php echo $field->desc; ?></span>
<span class="wu-my-1 wu-inline-block wu-text-xs"><?php echo $field->desc; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
<?php endif; ?>
@ -37,7 +37,7 @@
<div class="wu-toggle">
<input class="wu-tgl wu-tgl-ios" value="1" <?php checked(1 == $field->value); ?> id="wu-tg-<?php echo esc_attr($field->id); ?>" type="checkbox" name="<?php echo esc_attr($field_slug); ?>" <?php echo $field->get_html_attributes(); ?> />
<input class="wu-tgl wu-tgl-ios" value="1" <?php checked('1' === (string) $field->value); ?> id="wu-tg-<?php echo esc_attr($field->id); ?>" type="checkbox" name="<?php echo esc_attr($field_slug); ?>" <?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> />
<label class="wu-tgl-btn wp-ui-highlight wu-bg-blue-500" for="wu-tg-<?php echo esc_attr($field->id); ?>"></label>

View File

@ -5,7 +5,7 @@
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="wu-block wu-w-full">
@ -35,7 +35,7 @@
name="<?php echo esc_attr($field->id); ?>"
id="<?php echo esc_attr($field->id); ?>"
value="<?php echo esc_html($field->value); ?>"
<?php echo $field->get_html_attributes(); ?>
<?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
/>
</div>

View File

@ -7,7 +7,7 @@
?>
<div class="wu-styling">
<?php echo $form->before; ?>
<?php echo $form->before; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<div class="wu-flex wu-flex-wrap">
@ -17,14 +17,14 @@
id="<?php echo esc_attr($form_slug); ?>"
action="<?php echo esc_attr($form->action); ?>"
method="<?php echo esc_attr($form->method); ?>"
<?php echo $form->get_html_attributes(); ?>
<?php echo $form->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
>
<?php endif; ?>
<ul id="wp-ultimo-form-<?php echo esc_attr($form->id); ?>" class="wu-flex-grow <?php echo esc_attr(trim($form->classes)); ?>" <?php echo $form->get_html_attributes(); ?>>
<ul id="wp-ultimo-form-<?php echo esc_attr($form->id); ?>" class="wu-flex-grow <?php echo esc_attr(trim($form->classes)); ?>" <?php echo $form->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<?php echo $rendered_fields; ?>
<?php echo $rendered_fields; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</ul>
@ -34,7 +34,7 @@
<?php endif; ?>
<?php echo $form->after; ?>
<?php echo $form->after; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>

View File

@ -8,9 +8,9 @@
<?php if ($field->desc) : ?>
<p class="description wu-text-2xs" id="<?php echo $field->id; ?>-desc">
<p class="description wu-text-2xs" id="<?php echo esc_attr($field->id); ?>-desc">
<?php echo $field->desc; ?>
<?php echo $field->desc; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</p>

View File

@ -10,11 +10,11 @@
<span class="wu-my-1 wu-text-2xs wu-uppercase wu-font-bold wu-block">
<?php echo $field->title; ?>
<?php echo $field->title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php if ($field->tooltip) : ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php echo wu_tooltip($field->tooltip); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php endif; ?>