PluginProbe
FakerPress / 0.1.1
FakerPress v0.1.1
0.9.2 trunk 0.1.0 0.1.1 0.1.2 0.1.3 0.5.2 0.5.3 0.6.1 0.6.2 0.6.3 0.6.4 0.6.5 0.6.6 0.7.0 0.7.1 0.7.2 0.8.0 0.9.0 0.9.1
fakerpress / fakerpress.php

fakerpress.php in FakerPress 0.1.1, at fakerpress.php

70 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * FakerPress
4 *
5 * @package fakerpress
6 * @author Gustavo Bordoni <gustavo@bordoni.me>
7 * @license GPL-2.0+
8 * @link http://bordoni.me
9 * @copyright 2014 Bordoni
10 *
11 * Plugin Name: FakerPress
12 * Plugin URI: https://github.com/iryz/fakerpress
13 * Description: FakerPress is a clean way to generate fake data to your WordPress instalation, great for developers who need testing
14 * Version: 0.1.1
15 * Author: Iryz
16 * Author URI: http://iryz.org
17 * Text Domain: fakerpress
18 * License: GPL-2.0+
19 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
20 * Domain Path: /l10n
21 * GitHub Plugin URI: https://github.com/iryz/fakerpress
22 */
23
24 // If this file is called directly, abort.
25 if ( ! defined( 'WPINC' ) ){
26 die;
27 }
28
29 // Need to store this variable before leaving this file
30 define( '__FP_FILE__', __FILE__ );
31
32 /**
33 * To allow internacionalization for the errors strings the text domain is
34 * loaded in a 5.2 way, no Fatal Errors, only a message to the user.
35 * @return null;
36 */
37
38 function _fp_l10n() {
39 load_plugin_textdomain( 'fakerpress', false, 'fakerpress' . DIRECTORY_SEPARATOR . 'l10n' );
40 }
41 add_action( 'plugins_loaded', '_fp_l10n' );
42
43 /**
44 * Version compare to PHP 5.3, so we can use Namespaces, anonymous functions
45 * and a lot of packages require 5.3, so...
46 *
47 * For now 3.8 or bigger is needed for the admin interface, later on the
48 * intention is to bring this number lower
49 */
50
51 if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
52 if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
53 require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
54
55 if ( ! is_plugin_active( plugin_basename( __FP_FILE__ ) ) ){
56 wp_print_styles( 'open-sans' );
57 echo "<style>body{margin: 0 2px;font-family: 'Open Sans',sans-serif;font-size: 13px;line-height: 1.5em;}</style>";
58 echo wp_kses_post( __( '<b>FakerPress</b> requires PHP 5.3 or higher, and the plugin has now disabled itself.', 'fakerpress' ) ) .
59 '<br />' .
60 __( 'To allow better control over dates, advanced security improvements and performance gain.', 'fakerpress' ) .
61 '<br />' .
62 __( 'Contact your Hosting or your system administrator and ask for this Upgrade to version 5.3 of PHP.', 'vsh' );
63 exit();
64 }
65
66 deactivate_plugins( __FP_FILE__ );
67 }
68 } else {
69 require_once plugin_dir_path( __FP_FILE__ ) . 'inc' . DIRECTORY_SEPARATOR . 'load.php';
70 }