-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathipdata.php
More file actions
61 lines (55 loc) · 2.23 KB
/
Copy pathipdata.php
File metadata and controls
61 lines (55 loc) · 2.23 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
<?php
/**
* Plugin Name: IPData.info Geolocation
* Plugin URI: https://github.com/IPDataInfo/ipdata-wordpress
* Description: Show visitor geolocation, ASN and security flags (proxy/VPN/Tor/hosting) via a shortcode or Gutenberg block, with optional country blocking/redirect. Calls the external ipdata.info API (https://ipdata.info) to resolve the visitor's IP address.
* Version: 1.0.0
* Requires at least: 5.8
* Requires PHP: 7.4
* Author: IPData.info
* Author URI: https://ipdata.info
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: ipdatainfo
* Domain Path: /languages
*
* @package IPDataInfo
*/
defined( 'ABSPATH' ) || exit;
/**
* Core plugin constants.
*/
define( 'IPDATAINFO_VERSION', '1.0.0' );
define( 'IPDATAINFO_PLUGIN_FILE', __FILE__ );
define( 'IPDATAINFO_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'IPDATAINFO_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'IPDATAINFO_OPTION_KEY', 'ipdatainfo_settings' );
define( 'IPDATAINFO_API_BASE', 'https://ipdata.info' );
/**
* Load plugin includes.
*/
require_once IPDATAINFO_PLUGIN_DIR . 'includes/class-ipdata-client.php';
require_once IPDATAINFO_PLUGIN_DIR . 'includes/class-ipdata-shortcode.php';
require_once IPDATAINFO_PLUGIN_DIR . 'includes/class-ipdata-block.php';
require_once IPDATAINFO_PLUGIN_DIR . 'includes/class-ipdata-settings.php';
require_once IPDATAINFO_PLUGIN_DIR . 'includes/class-ipdata-geo-guard.php';
/**
* Bootstrap the plugin once all core WP APIs are available.
*/
function ipdatainfo_bootstrap() {
load_plugin_textdomain( 'ipdatainfo', false, dirname( plugin_basename( IPDATAINFO_PLUGIN_FILE ) ) . '/languages' );
IPData_Settings::instance()->init();
IPData_Shortcode::instance()->init();
IPData_Block::instance()->init();
IPData_Geo_Guard::instance()->init();
}
add_action( 'plugins_loaded', 'ipdatainfo_bootstrap' );
/**
* Deactivation hook: clear any transient locks (options/transients data
* itself is intentionally kept until uninstall so settings survive a
* deactivate/reactivate cycle).
*/
function ipdatainfo_deactivate() {
wp_cache_flush();
}
register_deactivation_hook( __FILE__, 'ipdatainfo_deactivate' );