pronamic / wp-pronamic-pay-mollie

Mollie driver for the WordPress payment processing library.
http://www.wp-pay.org/gateways/mollie/
6 stars 1 forks source link

Functions `wp_register_script` and `wp_register_style` are called incorrectly #42

Closed rvdsteege closed 7 months ago

rvdsteege commented 7 months ago

I'm seeing PHP notices regarding incorrect registration of scripts and a style:

Notice: Function wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mollie.js handle.
Notice: Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the pronamic-pay-mollie-card-field handle.
Notice: Function wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the pronamic-pay-mollie-wc-legacy-checkout handle.

https://github.com/pronamic/wp-pronamic-pay-mollie/blob/4c7fd4ce8ee25da6777cf25bf047ec9788946be2/src/ScriptsController.php#L49-L92