| 1 |
<?php |
| 2 |
/** |
| 3 |
* The plugin bootstrap file |
| 4 |
* |
| 5 |
* This file is read by WordPress to generate the plugin information in the plugin |
| 6 |
* admin area. This file also includes all of the dependencies used by the plugin, |
| 7 |
* registers the activation and deactivation functions, and defines a function |
| 8 |
* that starts the plugin. |
| 9 |
* |
| 10 |
* @link http://www.boldgrid.com |
| 11 |
* @since 1.0.0 |
| 12 |
* @package Boldgrid_Seo |
| 13 |
* |
| 14 |
* Plugin Name: BoldGrid Easy SEO |
| 15 |
* Plugin URI: https://www.boldgrid.com/boldgrid-seo/ |
| 16 |
* Description: Easily manage your website's search engine optimization with Easy SEO by BoldGrid! |
| 17 |
* Version: 1.6.17 |
| 18 |
* Author: BoldGrid <support@boldgrid.com> |
| 19 |
* Author URI: https://www.boldgrid.com/ |
| 20 |
* License: GPL-2.0+ |
| 21 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 22 |
* Text Domain: bgseo |
| 23 |
* Domain Path: /languages |
| 24 |
* |
| 25 |
* BoldGrid SEO is free software: you can redistribute it and/or modify |
| 26 |
* it under the terms of the GNU General Public License as published by |
| 27 |
* the Free Software Foundation, either version 2 of the License, or |
| 28 |
* any later version. |
| 29 |
* |
| 30 |
* BoldGrid SEO is distributed in the hope that it will be useful, |
| 31 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 32 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 33 |
* GNU General Public License for more details. |
| 34 |
* |
| 35 |
* You should have received a copy of the GNU General Public License |
| 36 |
* along with BoldGrid SEO. If not, see https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html. |
| 37 |
* |
| 38 |
* This plugin is also inspired by and/or uses code from the following plugins/libraries: |
| 39 |
* |
| 40 |
* ButterBean[https://github.com/justintadlock/butterbean], licensed under GNU General Public License v2.0. |
| 41 |
* TextStatistics.js[https://github.com/cgiffard/TextStatistics.js], licensed under MIT License. |
| 42 |
* WordPress Plugin Boilerplate[https://github.com/DevinVinson/WordPress-Plugin-Boilerplate], licensed under GNU General Public License v2.0. |
| 43 |
* Sewn In Simple SEO[https://github.com/jupitercow/sewn-in-simple-seo], licensed under GNU General Public License v3.0. |
| 44 |
* All In One SEO Pack[https://github.com/semperfiwebdesign/all-in-one-seo-pack], licensed under GNU General Public License v2.0. |
| 45 |
*/ |
| 46 |
|
| 47 |
// If this file is called directly, abort. |
| 48 |
if ( ! defined( 'WPINC' ) ) { |
| 49 |
die(); |
| 50 |
} |
| 51 |
|
| 52 |
// Include the autoloader. |
| 53 |
require_once wp_normalize_path( plugin_dir_path( __FILE__ ) . '/autoload.php' ); |
| 54 |
|
| 55 |
// Define version. |
| 56 |
defined( 'BOLDGRID_SEO_VERSION' ) || define( 'BOLDGRID_SEO_VERSION', implode( get_file_data( __FILE__, array( 'Version' ), 'plugin' ) ) ); |
| 57 |
|
| 58 |
// Define boldgrid-seo path. |
| 59 |
defined( 'BOLDGRID_SEO_PATH' ) || define( 'BOLDGRID_SEO_PATH', dirname( __FILE__ ) ); |
| 60 |
|
| 61 |
/** |
| 62 |
* Check Versions. |
| 63 |
* |
| 64 |
* This will check to make sure the user has PHP 5.3 or higher, and will also |
| 65 |
* check to make sure they are using WordPress 4.0 or higher. |
| 66 |
* |
| 67 |
* @var $boldgrid_seo_php_version This checks that PHP is 5.3.0 or higher. |
| 68 |
* @var $boldgrid_seo_wp_version This checks that WordPress is 4.0 or higher. |
| 69 |
* |
| 70 |
* @since 1.0.0 |
| 71 |
*/ |
| 72 |
$easy_seo_php_version = version_compare( phpversion(), '5.3.0', '>=' ); |
| 73 |
$easy_seo_wp_version = version_compare( get_bloginfo( 'version' ), '4.0', '>=' ); |
| 74 |
|
| 75 |
if ( ! $easy_seo_php_version || ! $easy_seo_wp_version ) : |
| 76 |
/** |
| 77 |
* Display error and deactivate. |
| 78 |
*/ |
| 79 |
function easy_seo_php_error() { |
| 80 |
printf( '<div class="error"><p>%s</p></div>', |
| 81 |
esc_html__( 'Easy SEO Error: Easy SEO Supports WordPress version 4.0+, and PHP version 5.3+', 'bgseo' ) |
| 82 |
); |
| 83 |
deactivate_plugins( plugin_basename( __FILE__ ) ); |
| 84 |
} |
| 85 |
|
| 86 |
if ( defined( 'WP_CLI' ) ) : |
| 87 |
deactivate_plugins( plugin_basename( __FILE__ ) ); |
| 88 |
WP_CLI::warning( __( 'Easy SEO Error: You must have PHP 5.3 or higher and WordPress 4.0 or higher to use this plugin.', 'bgseo' ) ); |
| 89 |
else : |
| 90 |
add_action( 'admin_notices', 'easy_seo_php_error' ); |
| 91 |
endif; |
| 92 |
else : // Load the rest of the plugin that contains code suited for passing the version check. |
| 93 |
/** |
| 94 |
* Activate. |
| 95 |
*/ |
| 96 |
function activate_easy_seo() { |
| 97 |
require_once wp_normalize_path( plugin_dir_path( __FILE__ ) . 'includes/class-boldgrid-seo-activator.php' ); |
| 98 |
Boldgrid_Seo_Activator::activate(); |
| 99 |
} |
| 100 |
|
| 101 |
/** |
| 102 |
* The code that runs during plugin deactivation. |
| 103 |
* This action is documented in includes/class-boldgrid-seo-deactivator.php |
| 104 |
*/ |
| 105 |
function deactivate_easy_seo() { |
| 106 |
require_once wp_normalize_path( plugin_dir_path( __FILE__ ) . 'includes/class-boldgrid-seo-deactivator.php' ); |
| 107 |
Boldgrid_Seo_Deactivator::deactivate(); |
| 108 |
} |
| 109 |
|
| 110 |
register_activation_hook( __FILE__, 'activate_easy_seo' ); |
| 111 |
register_deactivation_hook( __FILE__, 'deactivate_easy_seo' ); |
| 112 |
|
| 113 |
/** |
| 114 |
* Begins execution of the plugin. |
| 115 |
* |
| 116 |
* Since everything within the plugin is registered via hooks, |
| 117 |
* then kicking off the plugin from this point in the file does |
| 118 |
* not affect the page life cycle. |
| 119 |
* |
| 120 |
* @since 1.0.0 |
| 121 |
*/ |
| 122 |
function run_easy_seo() { |
| 123 |
$plugin = new Boldgrid_Seo(); |
| 124 |
$plugin->run(); |
| 125 |
} |
| 126 |
run_easy_seo(); |
| 127 |
endif; |
| 128 |
|