michelve / software-license-manager

🔐Wordpress Software License Management. Supports WooCommerce, and WP eStore.
https://epikly.com
GNU General Public License v3.0
77 stars 27 forks source link

Would you ming using wp_enqueue_script & wp_enqueue_style in wc_licenses_class.php? #43

Closed k-kikuchi-waverworks closed 3 years ago

k-kikuchi-waverworks commented 3 years ago

Thank you for fixing #33. I say big thanks to you.

However, this fix caused an another issue.

You added following code on 5.5.8 ` <?php if (SLM_Helper_Class::slm_get_option('slm_front_conflictmode') == 1) : ?>

        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
    <?php endif; ?>

` This may caused an issue for theme & plugin using bootstrap, so that I want to request to rewrite this code like following.

<?php if (SLM_Helper_Class::slm_get_option('slm_front_conflictmode') == 1) : ?> <?php add_action( 'wp_footer', function() { wp_enqueue_style( 'slm-bootstrap', esc_url( "https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" ), array(), '', 'all' ); wp_enqueue_script( 'slm-bootstrap', esc_url( 'https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js' ), array(), '', true ); } ); ?> <?php endif; ?>

This change will allow site owners to remove your bootstrap loading when using these on theme, and prevent from causing an issue due to duplicate loading or another.

I tested this in my site, and it looks work.

King Regards KAZUKI