/**
* Loads the MailChimp for WP plugin files
*
* @return boolean True if the plugin files were loaded, false otherwise.
*/
function mc4wp_load_plugin()
{
    global $mc4wp;
    // don't load plugin if user has the premium version installed and activated
    if (defined('MC4WP_VERSION')) {
        return false;
    }
    // load autoloader
    require_once dirname(__FILE__) . '/vendor/autoload_52.php';
    // define some constants
    require dirname(__FILE__) . '/bootstrap.php';
    // Initialize the plugin and store an instance in the global scope
    $mc4wp = mc4wp();
    $mc4wp->init();
    if (is_admin() && (!defined('DOING_AJAX') || !DOING_AJAX)) {
        // load admin class
        $admin = new MC4WP_Admin(__FILE__);
        $admin->add_hooks();
        $admin->load_translations();
        // load promotional elements
        $promotional_elements = new MC4WP_Admin_Ads();
        $promotional_elements->add_hooks();
    }
    return true;
}
/**
 * Bootstrap the MailChimp for WordPress plugin
 *
 * @ignore
 * @access private
 * @return bool
 */
function _mc4wp_load_plugin()
{
    global $mc4wp;
    // Don't run if MailChimp for WP Pro 2.x is activated
    if (defined('MC4WP_VERSION')) {
        return false;
    }
    // bootstrap the core plugin
    define('MC4WP_VERSION', '4.0.9');
    define('MC4WP_PLUGIN_DIR', dirname(__FILE__) . '/');
    define('MC4WP_PLUGIN_URL', plugins_url('/', __FILE__));
    define('MC4WP_PLUGIN_FILE', __FILE__);
    // load autoloader if function not yet exists (for compat with sitewide autoloader)
    if (!function_exists('mc4wp')) {
        require_once MC4WP_PLUGIN_DIR . 'vendor/autoload_52.php';
    }
    /**
     * @global MC4WP_Container $GLOBALS['mc4wp']
     * @name $mc4wp
     */
    $mc4wp = mc4wp();
    $mc4wp['api'] = 'mc4wp_get_api_v3';
    $mc4wp['request'] = array('MC4WP_Request', 'create_from_globals');
    $mc4wp['log'] = 'mc4wp_get_debug_log';
    // forms
    $mc4wp['forms'] = new MC4WP_Form_Manager();
    $mc4wp['forms']->add_hooks();
    // integration core
    $mc4wp['integrations'] = new MC4WP_Integration_Manager();
    $mc4wp['integrations']->add_hooks();
    // bootstrap custom integrations
    require_once MC4WP_PLUGIN_DIR . 'integrations/bootstrap.php';
    // Doing cron? Load Usage Tracking class.
    if (defined('DOING_CRON') && DOING_CRON) {
        MC4WP_Usage_Tracking::instance()->add_hooks();
    }
    // Initialize admin section of plugin
    if (is_admin()) {
        $admin_tools = new MC4WP_Admin_Tools();
        if (defined('DOING_AJAX') && DOING_AJAX) {
            $ajax = new MC4WP_Admin_Ajax($admin_tools);
            $ajax->add_hooks();
        } else {
            $messages = new MC4WP_Admin_Messages();
            $mc4wp['admin.messages'] = $messages;
            $mailchimp = new MC4WP_MailChimp();
            $admin = new MC4WP_Admin($admin_tools, $messages, $mailchimp);
            $admin->add_hooks();
            $forms_admin = new MC4WP_Forms_Admin($messages, $mailchimp);
            $forms_admin->add_hooks();
            $integrations_admin = new MC4WP_Integration_Admin($mc4wp['integrations'], $messages, $mailchimp);
            $integrations_admin->add_hooks();
        }
    }
    return true;
}
/**
 * Bootstrap the MailChimp for WordPress plugin
 *
 * @ignore
 * @access private
 * @return bool
 */
function __mc4wp_load_plugin()
{
    global $mc4wp;
    // Don't run if MailChimp for WP Pro 2.x is activated
    if (defined('MC4WP_VERSION')) {
        return false;
    }
    // bootstrap the core plugin
    define('MC4WP_VERSION', '3.0.11-dev');
    define('MC4WP_PLUGIN_DIR', dirname(__FILE__) . '/');
    define('MC4WP_PLUGIN_URL', plugins_url('/', __FILE__));
    define('MC4WP_PLUGIN_FILE', __FILE__);
    // load autoloader
    require_once MC4WP_PLUGIN_DIR . 'vendor/autoload_52.php';
    /**
     * @global MC4WP_Container $GLOBALS['mc4wp']
     * @name $mc4wp
     */
    $mc4wp = mc4wp();
    $mc4wp['api'] = 'mc4wp_get_api';
    $mc4wp['request'] = array('MC4WP_Request', 'create_from_globals');
    // forms
    $mc4wp['forms'] = new MC4WP_Form_Manager();
    $mc4wp['forms']->add_hooks();
    // integration core
    $mc4wp['integrations'] = new MC4WP_Integration_Manager();
    $mc4wp['integrations']->add_hooks();
    // visitor tracking
    $mc4wp['tracking'] = new MC4WP_Visitor_Tracking();
    $mc4wp['tracking']->add_hooks();
    // bootstrap custom integrations
    require_once MC4WP_PLUGIN_DIR . 'integrations/bootstrap.php';
    // Doing cron? Load Usage Tracking class.
    if (defined('DOING_CRON') && DOING_CRON) {
        MC4WP_Usage_Tracking::instance()->add_hooks();
    }
    // Initialize admin section of plugin
    if (is_admin() && (!defined('DOING_AJAX') || !DOING_AJAX)) {
        $messages = new MC4WP_Admin_Messages();
        $mailchimp = new MC4WP_MailChimp();
        $admin = new MC4WP_Admin($messages, $mailchimp);
        $admin->add_hooks();
        $forms_admin = new MC4WP_Forms_Admin($messages, $mailchimp);
        $forms_admin->add_hooks();
        $integrations_admin = new MC4WP_Integration_Admin($mc4wp['integrations'], $messages, $mailchimp);
        $integrations_admin->add_hooks();
    }
    return true;
}
Beispiel #4
0
 public static function init()
 {
     if (!self::$instance) {
         self::$instance = new self();
     }
 }
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
if (!defined('ABSPATH')) {
    header('HTTP/1.0 403 Forbidden');
    header('X-Robots-Tag: noindex');
    exit;
}
// define some constant we need. probably already defined.
if (!defined('WP_CONTENT_DIR')) {
    define('WP_CONTENT_DIR', ABSPATH . 'wp-content');
}
if (!defined('WP_CONTENT_URL')) {
    define('WP_CONTENT_URL', site_url('wp-content'));
}
define('MC4WP_VERSION_NUMBER', "1.98.5");
define('MC4WP_PLUGIN_FILE', __FILE__);
define("MC4WP_PLUGIN_DIR", plugin_dir_path(__FILE__));
// Global Functions
require_once MC4WP_PLUGIN_DIR . 'includes/functions.php';
require_once MC4WP_PLUGIN_DIR . 'includes/log-functions.php';
require_once MC4WP_PLUGIN_DIR . 'includes/template-functions.php';
// Initialize Plugin Class
require_once MC4WP_PLUGIN_DIR . 'includes/class-plugin.php';
MC4WP::init();
// Only load the Admin class on admin requests, excluding AJAX.
if (is_admin() && (!defined("DOING_AJAX") || !DOING_AJAX)) {
    // Initialize Admin Class
    require_once MC4WP_PLUGIN_DIR . 'includes/class-admin.php';
    MC4WP_Admin::init();
}