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:
@ -42,7 +42,7 @@ class Membership_Line_Item_List_Table extends Product_List_Table {
|
||||
* @param integer $per_page Items per page. This gets overridden as well.
|
||||
* @param integer $page_number The page number.
|
||||
* @param boolean $count Return as count or not.
|
||||
* @return array
|
||||
* @return array|int
|
||||
*/
|
||||
public function get_items($per_page = 5, $page_number = 1, $count = false) {
|
||||
|
||||
@ -74,19 +74,20 @@ class Membership_Line_Item_List_Table extends Product_List_Table {
|
||||
$item = $item['product'];
|
||||
|
||||
if ( ! $item) {
|
||||
echo wu_responsive_table_row(
|
||||
echo wu_responsive_table_row( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
[
|
||||
'url' => false,
|
||||
'id' => 'not-found',
|
||||
'title' => __('Product not found', 'wp-ultimo'),
|
||||
'title' => __('Product not found', 'wp-multisite-waas'),
|
||||
'status' => '',
|
||||
'image' => $this->column_featured_image_id(new \WP_Ultimo\Models\Product()),
|
||||
],
|
||||
[
|
||||
'quantity' => [
|
||||
'icon' => 'dashicons-wu-package wu-align-middle wu-mr-1',
|
||||
'label' => __('Quantity', 'wp-ultimo'),
|
||||
'value' => sprintf(__('x%d', 'wp-ultimo'), $quantity),
|
||||
'label' => __('Quantity', 'wp-multisite-waas'),
|
||||
// translators: %d is a quantity number
|
||||
'value' => sprintf(__('x%d', 'wp-multisite-waas'), $quantity),
|
||||
],
|
||||
]
|
||||
);
|
||||
@ -97,12 +98,13 @@ class Membership_Line_Item_List_Table extends Product_List_Table {
|
||||
$first_row = [
|
||||
'quantity' => [
|
||||
'icon' => 'dashicons-wu-package wu-align-middle wu-mr-1',
|
||||
'label' => __('Quantity', 'wp-ultimo'),
|
||||
'value' => sprintf(__('x%d', 'wp-ultimo'), $quantity),
|
||||
'label' => __('Quantity', 'wp-multisite-waas'),
|
||||
// translators: %d = quantity
|
||||
'value' => sprintf(__('x%d', 'wp-multisite-waas'), $quantity),
|
||||
],
|
||||
'total' => [
|
||||
'icon' => 'dashicons-wu-shopping-bag1 wu-align-middle wu-mr-1',
|
||||
'label' => __('Price description', 'wp-ultimo'),
|
||||
'label' => __('Price description', 'wp-multisite-waas'),
|
||||
'value' => $item->get_price_description(),
|
||||
],
|
||||
];
|
||||
@ -110,7 +112,7 @@ class Membership_Line_Item_List_Table extends Product_List_Table {
|
||||
$second_row = [
|
||||
'slug' => [
|
||||
'icon' => 'dashicons-wu-bookmark1 wu-align-middle wu-mr-1',
|
||||
'label' => __('Product Slug', 'wp-ultimo'),
|
||||
'label' => __('Product Slug', 'wp-multisite-waas'),
|
||||
'value' => $item->get_slug(),
|
||||
],
|
||||
];
|
||||
@ -120,7 +122,7 @@ class Membership_Line_Item_List_Table extends Product_List_Table {
|
||||
'wrapper_classes' => 'wubox',
|
||||
'icon' => 'dashicons-wu-edit1 wu-align-middle wu-mr-1',
|
||||
'label' => '',
|
||||
'value' => __('Upgrade or Downgrade', 'wp-ultimo'),
|
||||
'value' => __('Upgrade or Downgrade', 'wp-multisite-waas'),
|
||||
'url' => wu_get_form_url(
|
||||
'change_membership_plan',
|
||||
[
|
||||
@ -134,7 +136,7 @@ class Membership_Line_Item_List_Table extends Product_List_Table {
|
||||
'wrapper_classes' => 'wu-text-red-500 wubox',
|
||||
'icon' => 'dashicons-wu-trash-2 wu-align-middle wu-mr-1',
|
||||
'label' => '',
|
||||
'value' => __('Remove', 'wp-ultimo'),
|
||||
'value' => __('Remove', 'wp-multisite-waas'),
|
||||
'url' => wu_get_form_url(
|
||||
'remove_membership_product',
|
||||
[
|
||||
@ -145,7 +147,7 @@ class Membership_Line_Item_List_Table extends Product_List_Table {
|
||||
];
|
||||
}
|
||||
|
||||
echo wu_responsive_table_row(
|
||||
echo wu_responsive_table_row( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
[
|
||||
'id' => $item->get_id(),
|
||||
'title' => $item->get_name(),
|
||||
|
Reference in New Issue
Block a user