-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwpdrift-worker.php
More file actions
92 lines (81 loc) · 2.71 KB
/
Copy pathwpdrift-worker.php
File metadata and controls
92 lines (81 loc) · 2.71 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
<?php
/**
* Plugin Name: Runn Tools - Worker
* Plugin URI: https://runn.tools/
* Description: Analytics, automation, tools, and much more for WordPress.
* Author: upnrunn™ technologies
* Author URI: https://upnrunn.com/
* Text Domain: runn-tools-worker
* Domain Path: /languages
* Version: 1.0.3
*
* @package Runn_Tools_Worker
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
/**
* 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( 'WPDRIFT_WORKER_VERSION', '1.0.3' );
define( 'WPDRIFT_WORKER_PATH', plugin_dir_path( __FILE__ ) );
define( 'WPDRIFT_WORKER_URL', plugin_dir_url( __FILE__ ) );
/**
* [if description]
* @var [type]
*/
if ( ! defined( 'WPDRIFT_WORKER_FILE' ) ) {
define( 'WPDRIFT_WORKER_FILE', __FILE__ );
}
/**
* The code that runs during plugin activation.
* This action is documented in includes/class-wpdrift-worker-activator.php
*/
function activate_wpdrift_worker( $network_wide ) {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wpdrift-worker-activator.php';
WPdrift_Worker_Activator::activate( $network_wide );
}
/**
* The code that runs during plugin deactivation.
* This action is documented in includes/class-wpdrift-worker-deactivator.php
*/
function deactivate_wpdrift_worker( $network_wide ) {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wpdrift-worker-deactivator.php';
WPdrift_IO_Deactivator::deactivate( $network_wide );
}
register_activation_hook( __FILE__, 'activate_wpdrift_worker' );
register_deactivation_hook( __FILE__, 'deactivate_wpdrift_worker' );
/**
* 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-wpdrift-worker.php';
// Returns the main instance of WPdrift_Worker.
function _wpdw() {
return WPdrift_Worker::instance();
}
/**
* 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_wpdrift_worker() {
_wpdw()->run();
}
run_wpdrift_worker();
/**
* Detect EDD plugin. Then add edd webhooks
*/
if ( in_array( 'easy-digital-downloads/easy-digital-downloads.php', (array) get_option( 'active_plugins', array() ) ) ) {
/**
* EDD Web Hooks for wpdrift, so that whenever any records added/updated/deleted then
* intimation go to app site.
* @var [type]
*/
require_once( dirname( WPDRIFT_WORKER_FILE ) . '/includes/rest-api/edd/class-edd-webhooks.php' );
}