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:
@ -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>
|
||||
|
||||
|
Reference in New Issue
Block a user