wpsharks / s2member

s2Member® Framework (membership management for WordPress®).
64 stars 36 forks source link

Missing Javascript/CSS Breaks Subscription Forms After 220318 Update #1226

Open billalive opened 2 years ago

billalive commented 2 years ago

EXPLANATION OF THE ISSUE

After updating to version 220318 for both s2member and s2member Pro, our Authorize.net Pro-Forms for Level #1 Access or higher appeared to be broken. Instead of the usual four fields and option to choose a credit card, too many fields were displayed, and the credit card icons were invisible.

The broken forms could not be submitted.

STEPS TO REPRODUCE THE ISSUE

Update to 220318 on a WordPress website that is already running the previous version of s2member Pro.

BEHAVIOR THAT I EXPECTED

I expected the Authorize.net Pro-Forms to remain unchanged.

BEHAVIOR THAT I OBSERVED

Instead, the forms were broken.

POSSIBLE FIX

When I examined the browser Console, there seemed to be errors loading Javascript and CSS which were supposed to be generated by wp-content/plugins/s2member/s2member-o-.php

This led me to a previous bug, which may be the same issue: #1174.

Based on that, and the information here, I created a small must use plugin in this file:

wp-content/mu-plugins/s2-o-hacks.php

<?php
function s2_hacks() {
    $GLOBALS[ 'WS_PLUGIN__' ][ 's2member' ][ 'c' ][ 's2o_url' ] = site_url( '/' );
}
add_action( 'ws_plugin__s2member_after_loaded', 's2_hacks' );

That code is taken from https://github.com/wpsharks/s2member/issues/1174#issuecomment-626214249

This appears to fix the problem. All Javascript and CSS now load correctly, and the forms appear as they did before.

But this seems like a workaround. Can you fix this bug in the s2member Pro code?

Thank you!