-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcf-geoplugin.php
More file actions
128 lines (115 loc) · 3.52 KB
/
cf-geoplugin.php
File metadata and controls
128 lines (115 loc) · 3.52 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
/**
* @wordpress-plugin
*
* Geo Controller
*
* Plugin Name: Geo Controller
* Plugin URI: https://wpgeocontroller.com/
* Description: Unlock the power of location-based functionality of WordPress – The ultimate all-in-one geolocation plugin for WordPress.
* Version: 8.9.6
* Requires at least: 6.0
* Requires PHP: 7.0
* Author: INFINITUM FORM
* Author URI: https://infinitumform.com/
* License: GPL v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: cf-geoplugin
* Domain Path: /languages
* Network: true
*
* Copyright (C) 2015-2022 Ivijan-Stefan Stipic
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// If someone try to called this file directly via URL, abort.
if (!defined('WPINC')) {
die("Don't mess with us.");
}
if (!defined('ABSPATH')) {
exit;
}
// Start calculate runtime
if (!defined('CFGP_START_RUNTIME')) {
define('CFGP_START_RUNTIME', microtime());
}
// Library version
if (!defined('CFGP_LIBRARY_VERSION')) {
define('CFGP_LIBRARY_VERSION', '1.0.1');
}
// Database version
if (!defined('CFGP_DATABASE_VERSION')) {
define('CFGP_DATABASE_VERSION', '1.0.3');
}
// Globals
global $cfgp_version;
/*
* Main plugin constants
*/
$CFGEO = [];
// Main plugin file
if (!defined('CFGP_FILE')) {
define('CFGP_FILE', __FILE__);
}
/*
* Require plugin general setup
*/
include_once __DIR__ . DIRECTORY_SEPARATOR . 'constants.php';
/*
* Requirements
*/
include_once CFGP_CLASS . DIRECTORY_SEPARATOR . 'Requirements.php';
/*
* Check requiremant
*/
$CFGP_Requirements = new CFGP_Requirements(['file' => CFGP_FILE]);
if ($CFGP_Requirements->passes()) :
// Dynamic action
do_action('cfgp/before_plugin_setup');
// Initializing class
include_once CFGP_INC . DIRECTORY_SEPARATOR . 'Init.php';
// Register database tables
CFGP_Init::wpdb_tables();
// Include dependencies
CFGP_Init::dependencies();
// Plugin activation
CFGP_Init::activation();
// Plugin deactivation
CFGP_Init::deactivation();
// Plugin upgrade
CFGP_Init::upgrade();
// Run plugin
CFGP_Init::run();
// Run plugin debug
CFGP_Init::debug();
// Dynamic action
do_action('cfgp/after_plugin_setup');
endif;
/*
* HEY!!! YOU NEED HELP AROUND THE PLUGIN IN PHP?
*
* I believe you need the CFGP_U class located in /inc/classes/Utilities.php
*
* There is a set of very useful functions and the most important and most commonly
* used is CFGP_U::api() which returns an array of geo objects or an individual object
* such as CFGP_U::api('country_code').
*
* Within the /inc/classes folder are all the classes of our plugin and the file names
* are named according to their purpose. Everywhere you have some action hooks or
* filters you can hook up to.
*
* If you want to help document our plugin, contact us at office@infinitumform.com
*
* Happy coding! Cheers!
*/