| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: FakerPress |
| 4 |
* Plugin URI: https://fakerpress.com |
| 5 |
* Description: FakerPress is a clean way to generate fake data to your WordPress installation, great for developers who need testing |
| 6 |
* Version: 0.5.2 |
| 7 |
* Author: Gustavo Bordoni |
| 8 |
* Author URI: http://bordoni.me |
| 9 |
* Text Domain: fakerpress |
| 10 |
* License: GPL-2.0+ |
| 11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 12 |
* Domain Path: /languages |
| 13 |
* GitHub Plugin URI: https://github.com/bordoni/fakerpress |
| 14 |
*/ |
| 15 |
|
| 16 |
// Need to store this variable before leaving this file |
| 17 |
define( '__FP_FILE__', __FILE__ ); |
| 18 |
|
| 19 |
/** |
| 20 |
* To allow internationalization for the errors strings the text domain is |
| 21 |
* loaded in a 5.2 way, no Fatal Errors, only a message to the user. |
| 22 |
* |
| 23 |
* @return bool; |
| 24 |
*/ |
| 25 |
|
| 26 |
function _fp_l10n() { |
| 27 |
// Doing that to use the real folder that the plugin is living, not a static string |
| 28 |
$plugin_folder = str_replace( DIRECTORY_SEPARATOR . basename( __FILE__ ), '', plugin_basename( __FP_FILE__ ) ); |
| 29 |
return load_plugin_textdomain( 'fakerpress', false, $plugin_folder . DIRECTORY_SEPARATOR . 'languages' . DIRECTORY_SEPARATOR ); |
| 30 |
} |
| 31 |
add_action( 'plugins_loaded', '_fp_l10n' ); |
| 32 |
|
| 33 |
/** |
| 34 |
* Version compare to PHP 5.3, so we can use namespaces, anonymous functions |
| 35 |
* and a lot of packages require 5.3, so... |
| 36 |
* |
| 37 |
* For now 3.8 or bigger is needed for the admin interface, later on the |
| 38 |
* intention is to bring this number lower |
| 39 |
*/ |
| 40 |
if ( PHP_VERSION_ID < 50600 ) { |
| 41 |
if ( ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) && is_admin() ) { |
| 42 |
require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 43 |
|
| 44 |
if ( ! is_plugin_active( plugin_basename( __FP_FILE__ ) ) ) { |
| 45 |
wp_print_styles( 'open-sans' ); |
| 46 |
echo "<style>body{margin: 0 2px;font-family: 'Open Sans',sans-serif;font-size: 13px;line-height: 1.5em;}</style>"; |
| 47 |
echo wp_kses_post( __( '<b>FakerPress</b> requires PHP 5.6 or higher, and the plugin has now disabled itself.', 'fakerpress' ) ) . |
| 48 |
'<br />' . |
| 49 |
esc_attr__( 'To allow better control over dates, advanced security improvements and performance gain.', 'fakerpress' ) . |
| 50 |
'<br />' . |
| 51 |
esc_attr__( 'Contact your Hosting or your system administrator and ask for this Upgrade to version 5.6 of PHP.', 'fakerpress' ); |
| 52 |
exit; |
| 53 |
} |
| 54 |
|
| 55 |
deactivate_plugins( __FP_FILE__ ); |
| 56 |
} |
| 57 |
} else { |
| 58 |
require_once plugin_dir_path( __FP_FILE__ ) . 'load.php'; |
| 59 |
} |
| 60 |
|