PluginProbe
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions / 260927
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions v260927
260927 260917 260913 260909 260829 260814 260805 110710 110731 110812 110815 110912 110913 110915 110926 110927 111002 111003 111011 111017 111029 111105 111206 111216 111220 All 190 releases
← All changes | src/includes/classes/installation.inc.php +28 -0 260829 → 260927 View file →
@@ -64,12 +64,40 @@
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);
85 +
86 + //260902.0420 A Framework activation/update invalidates cached Pro update availability; the next admin request will refresh it in the background.
87 + if($reactivation_reason === '' || $reactivation_reason === 'version')
88 + {
89 + $options = (array)get_option('ws_plugin__s2member_options');
90 + if(isset($options['pro_latest_version']))
91 + {
92 + unset($options['pro_latest_version']);
93 + $options = ws_plugin__s2member_configure_options_and_their_defaults($options);
94 + update_option('ws_plugin__s2member_options', $options);
95 + if(is_multisite() && is_main_site())
96 + update_site_option('ws_plugin__s2member_options', $options);
97 + }
98 + unset($options);
99 + }
72 100
73 101 //260809 Seed hashed Defuse key mappings on activation after installation or updates; migration is idempotent.
74 102 c_ws_plugin__s2member_utils_defuse::migrate_legacy_defuse_key_mappings();
75 103