forked from pixelgrade/pixproof
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpixproof.php
70 lines (56 loc) · 1.81 KB
/
pixproof.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/*
* @package PixProof
* @author PixelGrade <[email protected]>
* @license GPL-2.0+
* @link http://pixelgrade.com
* @copyright 2014 PixelGrade
*
* @wordpress-plugin
Plugin Name: PixProof
Plugin URI: http://pixelgrade.com
Description: WordPress photo gallery proofing plugin.
Version: 1.2.1
Author: PixelGrade
Author URI: http://pixelgrade.com
Author Email: [email protected]
Text Domain: proof
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
Domain Path: /lang
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
// ensure EXT is defined
if ( ! defined('EXT')) {
define('EXT', '.php');
}
require 'core/bootstrap'.EXT;
$config = include 'plugin-config'.EXT;
// set textdomain
pixproof::settextdomain($config['textdomain']);
// Ensure Test Data
// ----------------
$defaults = include 'plugin-defaults'.EXT;
$current_data = get_option($config['settings-key']);
if ($current_data === false) {
add_option($config['settings-key'], $defaults);
}
else if (count(array_diff_key($defaults, $current_data)) != 0) {
$plugindata = array_merge($defaults, $current_data);
update_option($config['settings-key'], $plugindata);
}
# else: data is available; do nothing
// Load Callbacks
// --------------
$basepath = dirname(__FILE__).DIRECTORY_SEPARATOR;
$callbackpath = $basepath.'callbacks'.DIRECTORY_SEPARATOR;
pixproof::require_all($callbackpath);
require_once( plugin_dir_path( __FILE__ ) . 'class-pixproof.php' );
// Register hooks that are fired when the plugin is activated, deactivated, and uninstalled, respectively.
register_activation_hook( __FILE__, array( 'PixProofPlugin', 'activate' ) );
//register_deactivation_hook( __FILE__, array( 'PixTypesPlugin', 'deactivate' ) );
global $pixproof_plugin;
$pixproof_plugin = PixProofPlugin::get_instance();