PluginProbe
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions / 261001
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions v261001
261001 260927 260917 260913 260909 260829 260814 260805 110710 110731 110812 110815 110912 110913 110915 110926 110927 111002 111003 111011 111017 111029 111105 111206 111216 All 191 releases
← All changes | src/includes/classes/installation.inc.php +13 -16 260909 → 261001 View file →
@@ -64,13 +64,26 @@
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;
72 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 +
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 {
76 89 $options = (array)get_option('ws_plugin__s2member_options');
@@ -279,22 +292,6 @@
279 292 }
280 293 do_action('ws_plugin__s2member_after_uninstall', get_defined_vars());
281 294 }
282 295
283 - /**
284 - * Disallow automatic updates of s2Member w/ Pro is installed.
285 - *
286 - * @package s2Member\Installation
287 - * @since 150717
288 - *
289 - * @attaches-to `auto_update_plugin` filter.
290 - */
291 - public static function auto_update_filter($update = NULL, $item = NULL)
292 - {
293 - if(is_object($item) && !empty($item->slug) && $item->slug === 's2member')
294 - if(c_ws_plugin__s2member_utils_conds::pro_is_installed())
295 - $update = FALSE; // Disallow.
296 -
297 - return $update; // Filter through.
298 - }
299 296 }
300 297 }