| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
Plugin Name: MC4WP: Mailchimp Top Bar |
| 5 |
Plugin URI: https://www.mc4wp.com/ |
| 6 |
Description: Adds a Mailchimp opt-in bar to the top of your site. |
| 7 |
Version: 1.7.7 |
| 8 |
Author: ibericode |
| 9 |
Author URI: https://www.ibericode.com/ |
| 10 |
Text Domain: mailchimp-top-bar |
| 11 |
Requires Plugins: mailchimp-for-wp |
| 12 |
Requires PHP: 7.4 |
| 13 |
License: GPL-3.0-or-later |
| 14 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html |
| 15 |
|
| 16 |
|
| 17 |
Mailchimp Top Bar |
| 18 |
Copyright (C) 2015, Danny van Kooten, hi@dannyvankooten.com |
| 19 |
|
| 20 |
This program is free software: you can redistribute it and/or modify |
| 21 |
it under the terms of the GNU General Public License as published by |
| 22 |
the Free Software Foundation, either version 3 of the License, or |
| 23 |
(at your option) any later version. |
| 24 |
|
| 25 |
This program is distributed in the hope that it will be useful, |
| 26 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 27 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 28 |
GNU General Public License for more details. |
| 29 |
|
| 30 |
You should have received a copy of the GNU General Public License |
| 31 |
along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 32 |
*/ |
| 33 |
|
| 34 |
if (! defined('ABSPATH')) { |
| 35 |
exit; |
| 36 |
} |
| 37 |
|
| 38 |
add_action( |
| 39 |
"plugins_loaded", |
| 40 |
function () { |
| 41 |
// check for PHP 7.4 or higher |
| 42 |
if (PHP_VERSION_ID < 70400) { |
| 43 |
return; |
| 44 |
} |
| 45 |
|
| 46 |
define("MAILCHIMP_TOP_BAR_FILE", __FILE__); |
| 47 |
define("MAILCHIMP_TOP_BAR_DIR", __DIR__); |
| 48 |
define('MAILCHIMP_TOP_BAR_VERSION', '1.7.7'); |
| 49 |
|
| 50 |
require __DIR__ . "/src/functions.php"; |
| 51 |
|
| 52 |
if (is_admin()) { |
| 53 |
require __DIR__ . "/src/class-admin.php"; |
| 54 |
$admin = new MailChimp\TopBar\Admin(); |
| 55 |
$admin->add_hooks(); |
| 56 |
} else { |
| 57 |
require __DIR__ . "/src/class-bar.php"; |
| 58 |
$bar = new MailChimp\TopBar\Bar(); |
| 59 |
add_action("wp", [$bar, "init"]); |
| 60 |
} |
| 61 |
}, |
| 62 |
30 |
| 63 |
); |
| 64 |
|