wordpress-popular-posts
Last commit date
assets
5 years ago
i18n
5 years ago
src
5 years ago
vendor
5 years ago
LICENSE
5 years ago
index.php
5 years ago
readme.txt
5 years ago
uninstall.php
5 years ago
wordpress-popular-posts.php
5 years ago
wordpress-popular-posts.php
61 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * The plugin bootstrap file |
| 5 | * |
| 6 | * This file is read by WordPress to generate the plugin information in the plugin |
| 7 | * admin area. This file also includes all of the dependencies used by the plugin, |
| 8 | * registers the activation and deactivation functions, and defines a function |
| 9 | * that starts the plugin. |
| 10 | * |
| 11 | * @link https://cabrerahector.com/ |
| 12 | * @since 4.0.0 |
| 13 | * @package WordPressPopularPosts |
| 14 | * |
| 15 | * @wordpress-plugin |
| 16 | * Plugin Name: WordPress Popular Posts |
| 17 | * Plugin URI: https://wordpress.org/plugins/wordpress-popular-posts/ |
| 18 | * Description: A highly customizable widget that displays the most popular posts on your blog. |
| 19 | * Version: 5.2.0 |
| 20 | * Author: Hector Cabrera |
| 21 | * Author URI: https://cabrerahector.com/ |
| 22 | * License: GPL-2.0+ |
| 23 | * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 24 | * Text Domain: wordpress-popular-posts |
| 25 | * Domain Path: /languages |
| 26 | */ |
| 27 | |
| 28 | if ( ! defined( 'WPINC' ) ) { |
| 29 | die(); |
| 30 | } |
| 31 | |
| 32 | define('WPP_VERSION', '5.2.0'); |
| 33 | define('WPP_MIN_PHP_VERSION', '5.4'); |
| 34 | define('WPP_MIN_WP_VERSION', '4.9'); |
| 35 | |
| 36 | /** Requirements check */ |
| 37 | global $wp_version; |
| 38 | |
| 39 | // We're good, continue! |
| 40 | if ( version_compare(PHP_VERSION, WPP_MIN_PHP_VERSION, '>=') && version_compare($wp_version, WPP_MIN_WP_VERSION, '>=') ) { |
| 41 | $wpp_main_plugin_file = __FILE__; |
| 42 | // Load plugin bootstrap |
| 43 | require __DIR__ . '/src/Bootstrap.php'; |
| 44 | } // Nope. |
| 45 | else { |
| 46 | if ( isset($_GET['activate']) ) |
| 47 | unset($_GET['activate']); |
| 48 | |
| 49 | function wpp_render_min_requirements_notice() { |
| 50 | global $wp_version; |
| 51 | echo '<div class="notice notice-error"><p>' . sprintf( |
| 52 | __('WordPress Popular Posts requires at least PHP %1$s and WordPress %2$s to function correctly. Your site uses PHP %3$s and WordPress %4$s.', 'wordpress-popular-posts'), |
| 53 | WPP_MIN_PHP_VERSION, |
| 54 | WPP_MIN_WP_VERSION, |
| 55 | PHP_VERSION, |
| 56 | $wp_version |
| 57 | ) . '</p></div>'; |
| 58 | } |
| 59 | add_action('admin_notices', 'wpp_render_min_requirements_notice'); |
| 60 | } |
| 61 |