function __construct() { parent::__construct(); $this->plugin_url = plugins_url(plugin_basename(dirname(bpModLoader::file()))); $this->options = get_site_option('bp_moderation_options'); }
/** * Check compatibility and display an error message displayed when trying * to activate on non compatible envoriment */ function checkCompatibleOrFail() { $wpv = $GLOBALS['wp_version']; $wpr = $this->min_wp_ver; $bpv = @constant('BP_VERSION'); $bpr = $this->min_bp_ver; $failmessage = ''; if (version_compare($wpv, $wpr, '<')) { $failmessage .= sprintf(__('You are using WordPress %s, please upgrade.', 'bp-moderation'), $wpv) . '<br/>'; } if (!$bpv) { $failmessage .= __(' Please install <a href="http://buddypress.org/" target="_blank" >Buddypress</a>.', 'bp-moderation') . '<br/>'; } elseif (version_compare($bpv, $bpr, '<')) { $failmessage .= sprintf(__('You are using BuddyPress %s, please upgrade.', 'bp-moderation'), $bpv) . '<br/>'; } if (!$failmessage) { return; } $failmessage = sprintf(__('BuddyPress Moderation require at least WordPress %1$s and BuddyPress %2$s to work.', 'bp-moderation'), $wpr, $bpr) . '<br/>' . $failmessage; include_once ABSPATH . 'wp-admin/includes/plugin.php'; deactivate_plugins(bpModLoader::file()); die($failmessage); }