mailchimp-for-wp
Last commit date
assets
12 years ago
includes
12 years ago
index.php
12 years ago
license.txt
12 years ago
mailchimp-for-wp.php
12 years ago
readme.txt
12 years ago
mailchimp-for-wp.php
68 lines
| 1 | <?php |
| 2 | /* |
| 3 | Plugin Name: MailChimp for WordPress Lite |
| 4 | Plugin URI: http://dannyvankooten.com/mailchimp-for-wordpress/ |
| 5 | Description: Lite version of MailChimp for WordPress. Adds various sign-up methods to your website. |
| 6 | Version: 1.5.8 |
| 7 | Author: Danny van Kooten |
| 8 | Author URI: http://dannyvanKooten.com |
| 9 | License: GPL v3 |
| 10 | |
| 11 | MailChimp for WordPress |
| 12 | Copyright (C) 2012-2013, Danny van Kooten, hi@dannyvankooten.com |
| 13 | |
| 14 | This program is free software: you can redistribute it and/or modify |
| 15 | it under the terms of the GNU General Public License as published by |
| 16 | the Free Software Foundation, either version 3 of the License, or |
| 17 | (at your option) any later version. |
| 18 | |
| 19 | This program is distributed in the hope that it will be useful, |
| 20 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 | GNU General Public License for more details. |
| 23 | |
| 24 | You should have received a copy of the GNU General Public License |
| 25 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 26 | */ |
| 27 | |
| 28 | // Prevent direct file access |
| 29 | if( ! defined( 'ABSPATH' ) ) { |
| 30 | header( 'Status: 403 Forbidden' ); |
| 31 | header( 'HTTP/1.1 403 Forbidden' ); |
| 32 | exit; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Loads the MailChimp for WP plugin files |
| 37 | * |
| 38 | * @return boolean True if the plugin files were loaded, false otherwise. |
| 39 | */ |
| 40 | function mc4wp_load_plugin() { |
| 41 | |
| 42 | // don't load plugin if user has the premium version installed and activated |
| 43 | if( defined( "MC4WP_VERSION" ) ) { |
| 44 | return false; |
| 45 | } |
| 46 | |
| 47 | // bootstrap the lite plugin |
| 48 | define( "MC4WP_LITE_VERSION", "1.5.8" ); |
| 49 | define( "MC4WP_LITE_PLUGIN_DIR", plugin_dir_path( __FILE__ ) ); |
| 50 | define( "MC4WP_LITE_PLUGIN_URL", plugins_url( '/' , __FILE__ ) ); |
| 51 | |
| 52 | require_once MC4WP_LITE_PLUGIN_DIR . 'includes/functions.php'; |
| 53 | require_once MC4WP_LITE_PLUGIN_DIR . 'includes/class-plugin.php'; |
| 54 | $GLOBALS['mc4wp'] = new MC4WP_Lite(); |
| 55 | |
| 56 | if( is_admin() && ( ! defined( "DOING_AJAX" ) || ! DOING_AJAX ) ) { |
| 57 | |
| 58 | // ADMIN |
| 59 | require_once MC4WP_LITE_PLUGIN_DIR . 'includes/class-admin.php'; |
| 60 | new MC4WP_Lite_Admin(); |
| 61 | |
| 62 | } |
| 63 | |
| 64 | return true; |
| 65 | } |
| 66 | |
| 67 | add_action( 'plugins_loaded', 'mc4wp_load_plugin', 20 ); |
| 68 |