Closed remcotolsma closed 1 year ago
From the WordPress.org plugin review team:
Your plugin is not correctly including JS and/or CSS. You should be using the built in functions for this: https://developer.wordpress.org/reference/functions/wp_enqueue_script/ https://developer.wordpress.org/reference/functions/wp_enqueue_style/ And remember you can use this function to add inline javascript: https://developer.wordpress.org/reference/functions/wp_add_inline_script/ As of WordPress 5.7, you can pass attributes like async, nonce, and type by using new functions and filters: https://make.wordpress.org/core/2021/02/23/introducing-script-attributes-related-functions-in-wordpress-5-7/ If you're trying to enqueue on the admin pages you'll want to use the admin enqueues https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/ https://developer.wordpress.org/reference/hooks/admin_print_scripts/ https://developer.wordpress.org/reference/hooks/admin_print_styles/ Example(s) from your plugin: pronamic-pay-with-mollie-for-woocommerce/packages/wp-pay/core/src/Core/Gateway.php:349: $html .= '<script type="text/javascript">document.pronamic_ideal_form.submit();</script>'; pronamic-pay-with-mollie-for-woocommerce/packages/wp-pay/core/views/meta-box-gateway-test.php:207: <script type="text/javascript"> pronamic-pay-with-mollie-for-woocommerce/packages/wp-pay/core/views/meta-box-gateway-test.php:341:<script type="text/javascript"> pronamic-pay-with-mollie-for-woocommerce/packages/wp-pay/core/views/subscription-mandate.php:269: <script type="text/javascript">
Your plugin is not correctly including JS and/or CSS. You should be using the built in functions for this:
And remember you can use this function to add inline javascript:
As of WordPress 5.7, you can pass attributes like async, nonce, and type by using new functions and filters:
If you're trying to enqueue on the admin pages you'll want to use the admin enqueues
Example(s) from your plugin:
pronamic-pay-with-mollie-for-woocommerce/packages/wp-pay/core/src/Core/Gateway.php:349: $html .= '<script type="text/javascript">document.pronamic_ideal_form.submit();</script>'; pronamic-pay-with-mollie-for-woocommerce/packages/wp-pay/core/views/meta-box-gateway-test.php:207: <script type="text/javascript"> pronamic-pay-with-mollie-for-woocommerce/packages/wp-pay/core/views/meta-box-gateway-test.php:341:<script type="text/javascript"> pronamic-pay-with-mollie-for-woocommerce/packages/wp-pay/core/views/subscription-mandate.php:269: <script type="text/javascript">
Fixed in https://github.com/pronamic/wp-pay-core/commit/ec3a7ae3be45fdd3310a447a3baf78a617dd1d1f and https://github.com/pronamic/wp-pay-core/commit/8254498ad123986810d4ec23ba44c4c28ec6cf2d.
From the WordPress.org plugin review team: