| @@ -64,12 +64,25 @@ | ||
| 64 | 64 | if(is_dir($logs_dir) && is_writable($logs_dir)) |
| 65 | 65 | if(!is_file($htaccess = $logs_dir.'/.htaccess') || !apply_filters('ws_plugin__s2member_preserve_logs_dir_htaccess', !is_writable($logs_dir.'/.htaccess'), get_defined_vars())) |
| 66 | 66 | file_put_contents($htaccess, trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($GLOBALS['WS_PLUGIN__']['s2member']['c']['logs_dir_htaccess'])))); |
| 67 | 67 | |
| 68 | + //260916.2137 Detect a genuinely fresh activation before creating the options row; missing options on any prior installation must retain legacy EOT demotion behavior. | |
| 69 | + $fresh_install = !get_option('ws_plugin__s2member_activated_version') && !is_array(get_option('ws_plugin__s2member_options')); | |
| 70 | + | |
| 68 | 71 | (!is_array(get_option('ws_plugin__s2member_cache'))) ? update_option('ws_plugin__s2member_cache', array()) : NULL; |
| 69 | 72 | (!is_array(get_option('ws_plugin__s2member_notices'))) ? update_option('ws_plugin__s2member_notices', array()) : NULL; |
| 70 | 73 | (!is_array(get_option('ws_plugin__s2member_options'))) ? update_option('ws_plugin__s2member_options', array()) : NULL; |
| 71 | 74 | (!is_numeric(get_option('ws_plugin__s2member_configured'))) ? update_option('ws_plugin__s2member_configured', '0') : NULL; |
| 75 | + | |
| 76 | + $options = (array)get_option('ws_plugin__s2member_options'); | |
| 77 | + if(!array_key_exists('eot_demotion_from', $options)) | |
| 78 | + { | |
| 79 | + $options['eot_demotion_from'] = $fresh_install ? 's2member_level' : 'all'; | |
| 80 | + update_option('ws_plugin__s2member_options', $options); | |
| 81 | + if(is_multisite() && is_main_site()) | |
| 82 | + update_site_option('ws_plugin__s2member_options', $options); | |
| 83 | + } | |
| 84 | + unset($fresh_install, $options); | |
| 72 | 85 | |
| 73 | 86 | //260902.0420 A Framework activation/update invalidates cached Pro update availability; the next admin request will refresh it in the background. |
| 74 | 87 | if($reactivation_reason === '' || $reactivation_reason === 'version') |
| 75 | 88 | { |