-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpac.php
115 lines (100 loc) · 2.94 KB
/
pac.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
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
<?php
/**
* The plugin bootstrap file
*
* Main class for the Product Availability Tracker Plugin.
*
* @link https://jordiplana.com
* @since 1.0.0
* @package Pac
*
* @wordpress-plugin
* Plugin Name: Amazon Product Availability Tracker
* Description: Scans your Amazon Affiliate site for links to products that are out of stock, or no longer available.
* Version: 1.4.5
* Author: Jordi Plana
* Author URI: https://jordiplana.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: pac
* Domain Path: /languages
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* Currently plugin version.
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
define( 'PAC_VERSION', '1.4.5' );
/**
* Plugin name to be used.
*/
define( 'PAC_DB_VERSION', '1.0.0' );
/**
* Plugin name to be used.
*/
define( 'PAC_TITLE', 'Amazon Product Availability Tracker' );
/**
* Plugin name to be used for menus.
*/
define( 'PAC_TITLE_SHORT', 'Amazon Products' );
// Plugin Folder Path.
if ( ! defined( 'PAC_PLUGIN_DIR' ) ) {
define( 'PAC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
}
// Plugin Folder Path.
if ( ! defined( 'PAC_PLUGIN_BASE_NAME' ) ) {
define( 'PAC_PLUGIN_BASE_NAME', plugin_basename( plugin_dir_path( __FILE__ ) ) );
}
// Availability status.
define( 'PAC_STATUS_AVAILABLE', 1 );
define( 'PAC_STATUS_NOT_AVAILABLE', 0 );
/**
* The code that runs during plugin activation.
* This action is documented in includes/class-pac-activator.php
*/
function activate_pac() {
include_once plugin_dir_path( __FILE__ ) . 'includes/class-pac-activator.php';
Pac_Activator::activate();
}
/**
* The code that runs during plugin update.
* This action is documented in includes/class-pac-update.php
*/
function update_pac() {
include_once plugin_dir_path( __FILE__ ) . 'includes/class-pac-activator.php';
Pac_Activator::update();
}
/**
* The code that runs during plugin deactivation.
* This action is documented in includes/class-pac-deactivator.php
*/
function deactivate_pac() {
include_once plugin_dir_path( __FILE__ ) . 'includes/class-pac-deactivator.php';
Pac_Deactivator::deactivate();
}
register_activation_hook( __FILE__, 'activate_pac' );
register_deactivation_hook( __FILE__, 'deactivate_pac' );
add_action( 'plugins_loaded', 'update_pac' );
/**
* The core plugin class that is used to define internationalization,
* admin-specific hooks, and public-facing site hooks.
*/
require plugin_dir_path( __FILE__ ) . 'includes/class-pac.php';
/**
* Begins execution of the plugin.
*
* Since everything within the plugin is registered via hooks,
* then kicking off the plugin from this point in the file does
* not affect the page life cycle.
*
* @since 1.0.0
*/
function run_pac() {
$plugin = new Pac();
$plugin->run();
}
run_pac();