blockonomics / woocommerce-plugin

Accept bitcoins on your wordpress site, payments go directly into your wallet
25 stars 31 forks source link

Fixed JS script url and added defer attribute #358

Closed ashthecoder05 closed 11 months ago

ashthecoder05 commented 1 year ago

Previously we used clear_url filter hook to added the defer attribute to the script tag. Which recently has been deprecated and is generating a invalid url for scripts. It looks something like this

<script src="js/checkout.js?ver=3.6.7' defer='defer'"></script>

Now changed this by passing a stratergy defer to the wp_register_script() and this creates the url correctly as below

<script src="js/checkout.js?ver=3.6.9" defer="defer" data-wp-strategy="defer"></script>