| @@ -103,11 +103,20 @@ | ||
| 103 | 103 | else |
| 104 | 104 | { |
| 105 | 105 | //260906.0738 If requested static delivery cannot be used, prefer full WordPress so normal-plugin hooks/customizations that caused the fallback are preserved. |
| 106 | 106 | $dynamic_css_url = c_ws_plugin__s2member_utils_assets::dynamic_asset_url(!empty($GLOBALS['WS_PLUGIN__']['s2member']['o']['static_css'])).'?ws_plugin__s2member_css=1&qcABC=1'; |
| 107 | - $dynamic_css_delivery = (strpos($dynamic_css_url, $GLOBALS['WS_PLUGIN__']['s2member']['c']['s2o_url'].'?') === 0) ? 'dynamic-lightweight' : 'dynamic-wordpress'; | |
| 107 | + $dynamic_css_delivery = (strpos($dynamic_css_url, $GLOBALS['WS_PLUGIN__']['s2member']['c']['s2o_url'].'?') === 0) ? 'dynamic-s2member-o' : 'dynamic-wordpress'; //260910.0709 Runtime diagnostics name the physical route; the saved loader preference intentionally remains the legacy `s2o` value. | |
| 108 | + $static_css_failed_id = ''; | |
| 109 | + if(!empty($static['assets']) && is_array($static['assets'])) | |
| 110 | + foreach($static['assets'] as $_static_css_id => $_static_css_asset) | |
| 111 | + if(empty($_static_css_asset['ok'])) | |
| 112 | + { | |
| 113 | + $static_css_failed_id = (string)$_static_css_id; | |
| 114 | + break; | |
| 115 | + } | |
| 108 | 116 | wp_enqueue_style('ws-plugin--s2member', $dynamic_css_url, array(), c_ws_plugin__s2member_utilities::ver_checksum(), 'all'); |
| 109 | - c_ws_plugin__s2member_utils_assets::register_page_asset_expectations('', 'css', $dynamic_css_url, $dynamic_css_delivery); | |
| 117 | + //260913.2001 Preserve static-route context server-side; compatibility-required Dynamic delivery stays Healthy, while real fallback retains its specific Last issue cause. | |
| 118 | + c_ws_plugin__s2member_utils_assets::register_page_asset_expectations($static_css_failed_id, 'css', $dynamic_css_url, $dynamic_css_delivery, 0, (!empty($static['error'])) ? (string)$static['error'] : '', !empty($static['dynamic_required'])); | |
| 110 | 119 | } |
| 111 | 120 | |
| 112 | 121 | //260903.1918 Static CSS keeps Framework/Pro files separate by default, with optional combining; any incompatible hook/build failure retains the single legacy dynamic response. |
| 113 | 122 | do_action('ws_plugin__s2member_during_add_css', get_defined_vars()); |
| @@ -117,9 +126,9 @@ | ||
| 117 | 126 | |
| 118 | 127 | /** |
| 119 | 128 | * Enqueues JS file for theme integration. |
| 120 | 129 | * |
| 121 | - * Be sure s2Member's API Constants are already defined before firing this. | |
| 130 | + * Current-user inline globals tolerate unusually early script printing before s2Member's normal API Constants setup. | |
| 122 | 131 | * |
| 123 | 132 | * @package s2Member\CSS_JS |
| 124 | 133 | * @since 3.5 |
| 125 | 134 | * |
| @@ -161,11 +170,20 @@ | ||
| 161 | 170 | //260906.0738 A static-JS compatibility fallback uses full WordPress so runtime gettext/plugin customizations remain available; static-disabled sites retain their selected dynamic loader. |
| 162 | 171 | $dynamic_asset_url = c_ws_plugin__s2member_utils_assets::dynamic_asset_url(!empty($GLOBALS['WS_PLUGIN__']['s2member']['o']['static_js'])); |
| 163 | 172 | $dynamic_js_value = (is_user_logged_in()) ? WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5 : '1'; |
| 164 | 173 | $dynamic_js_url = $dynamic_asset_url.'?ws_plugin__s2member_js_w_globals='.urlencode($dynamic_js_value).'&qcABC=1'; |
| 165 | - $dynamic_js_delivery = (strpos($dynamic_js_url, $GLOBALS['WS_PLUGIN__']['s2member']['c']['s2o_url'].'?') === 0) ? 'dynamic-lightweight' : 'dynamic-wordpress'; | |
| 174 | + $dynamic_js_delivery = (strpos($dynamic_js_url, $GLOBALS['WS_PLUGIN__']['s2member']['c']['s2o_url'].'?') === 0) ? 'dynamic-s2member-o' : 'dynamic-wordpress'; //260910.0709 Runtime diagnostics name the physical route; the saved loader preference intentionally remains the legacy `s2o` value. | |
| 175 | + $static_js_failed_id = ''; | |
| 176 | + if(!empty($static['assets']) && is_array($static['assets'])) | |
| 177 | + foreach($static['assets'] as $_static_js_id => $_static_js_asset) | |
| 178 | + if(empty($_static_js_asset['ok'])) | |
| 179 | + { | |
| 180 | + $static_js_failed_id = (string)$_static_js_id; | |
| 181 | + break; | |
| 182 | + } | |
| 166 | 183 | wp_enqueue_script('ws-plugin--s2member', $dynamic_js_url, array('jquery'), c_ws_plugin__s2member_utilities::ver_checksum(), TRUE); |
| 167 | - c_ws_plugin__s2member_utils_assets::register_page_asset_expectations('', 'js', $dynamic_js_url, $dynamic_js_delivery); | |
| 184 | + //260913.2001 Preserve static-route context server-side; compatibility-required Dynamic delivery stays Healthy, while real fallback retains its specific Last issue cause. | |
| 185 | + c_ws_plugin__s2member_utils_assets::register_page_asset_expectations($static_js_failed_id, 'js', $dynamic_js_url, $dynamic_js_delivery, 0, (!empty($static['error'])) ? (string)$static['error'] : '', !empty($static['dynamic_required'])); | |
| 168 | 186 | } |
| 169 | 187 | |
| 170 | 188 | do_action('ws_plugin__s2member_during_add_js_w_globals', get_defined_vars()); |
| 171 | 189 | } |