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:
@ -360,7 +360,7 @@ abstract class Base_Signup_Field {
|
||||
|
||||
$selected = array_filter($selected);
|
||||
|
||||
$field['html_attr']['data-selected'] = json_encode($selected);
|
||||
$field['html_attr']['data-selected'] = wp_json_encode($selected);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,7 +200,7 @@ class Signup_Field_Payment extends Base_Signup_Field {
|
||||
],
|
||||
'wrapper_html_attr' => [
|
||||
'v-cloak' => 1,
|
||||
'v-show' => sprintf('%s.includes(gateway) && order.should_collect_payment && order.has_recurring', json_encode($auto_renewable_gateways)),
|
||||
'v-show' => sprintf('%s.includes(gateway) && order.should_collect_payment && order.has_recurring', wp_json_encode($auto_renewable_gateways)),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ class Signup_Field_Products extends Base_Signup_Field {
|
||||
});";
|
||||
|
||||
if (did_action('wu-checkout')) {
|
||||
wp_add_inline_script('wu-checkout', sprintf($script, json_encode($products)), 'before');
|
||||
wp_add_inline_script('wu-checkout', sprintf($script, wp_json_encode($products)), 'before');
|
||||
|
||||
return;
|
||||
}
|
||||
@ -225,7 +225,7 @@ class Signup_Field_Products extends Base_Signup_Field {
|
||||
'wp_enqueue_scripts',
|
||||
function () use ($script, $products) {
|
||||
|
||||
wp_add_inline_script('wu-checkout', sprintf($script, json_encode($products)), 'before');
|
||||
wp_add_inline_script('wu-checkout', sprintf($script, wp_json_encode($products)), 'before');
|
||||
},
|
||||
11
|
||||
);
|
||||
|
Reference in New Issue
Block a user