s2member
s2member copied to clipboard
Make compatible with jQuery v3.0. Replace deprecated functions.
EXPLANATION OF THE ISSUE
The s2member JavaScript file /wp-content/plugins/s2member/s2member-o.php
uses functions that are deprecated in jQuery 3.0.
Using:
- s2member v170722 (with Pro add-on)
- WordPress 4.9
- jQuery 3.2.1
- jQuery Migrate 3.0.0
This is just a heads up, as these functions still exist in v3.0, but may be removed in the next major version.
STEPS TO REPRODUCE THE ISSUE
Visit a page that loads the s2member JavaScript file (e.g., authorize.net or paypal checkout page) with jQuery 3 and jQuery migrate loaded, and it'll report the following within console.log()
JQMIGRATE: jQuery.fn.removeAttr no longer sets boolean properties: disabled
JQMIGRATE: jQuery.fn.bind() is deprecated
The following page lists the jQuery deprecation warnings and how to resolve them: https://github.com/jquery/jquery-migrate/blob/master/warnings.md
Solution for jQuery.fn.removeAttr()
:
https://github.com/jquery/jquery-migrate/blob/master/warnings.md#jqmigrate-jqueryfnremoveattr-no-longer-sets-boolean-properties
Solution for jQuery.fn.bind()
:
https://github.com/jquery/jquery-migrate/blob/master/warnings.md#jqmigrate-jqueryfnbind-is-deprecated
Thanks.
WordPress doesn't use jQuery v3. It uses v1.12. s2Member reflects that.