WordPress Backup & Security Plugin – BlogVault - Version 4.64

Version Description

  • Added latest WooCommerce Real-Time-Backup support.
Download this release

Release Info

Developer ritesh.soni36
Plugin Icon 128x128 WordPress Backup & Security Plugin – BlogVault
Version 4.64
Comparing to
See all releases

Code changes from version 4.63 to 4.64

blogvault.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://blogvault.net
5
  Description: Easiest way to backup & secure your WordPress site
6
  Author: Backup by BlogVault
7
  Author URI: https://blogvault.net
8
- Version: 4.63
9
  Network: True
10
  */
11
 
@@ -143,7 +143,8 @@ if ((array_key_exists('bvplugname', $_REQUEST)) && ($_REQUEST['bvplugname'] == "
143
 
144
  if ($bvinfo->isDynSyncModuleEnabled()) {
145
  require_once dirname( __FILE__ ) . '/wp_dynsync.php';
146
- $dynsync = new BVWPDynSync($bvdb, $bvsettings);
 
147
  $dynsync->init();
148
  }
149
 
5
  Description: Easiest way to backup & secure your WordPress site
6
  Author: Backup by BlogVault
7
  Author URI: https://blogvault.net
8
+ Version: 4.64
9
  Network: True
10
  */
11
 
143
 
144
  if ($bvinfo->isDynSyncModuleEnabled()) {
145
  require_once dirname( __FILE__ ) . '/wp_dynsync.php';
146
+ $bvconfig = $bvinfo->config;
147
+ $dynsync = new BVWPDynSync($bvdb, $bvsettings, $bvconfig['dynsync']);
148
  $dynsync->init();
149
  }
150
 
callback/request.php CHANGED
@@ -70,11 +70,6 @@ if (!class_exists('BVCallbackRequest')) :
70
  if (array_key_exists('op_reset', $in_params) && function_exists('output_reset_rewrite_vars'))
71
  @output_reset_rewrite_vars();
72
 
73
- if (array_key_exists('binhead', $in_params)) {
74
- header("Content-type: application/binary");
75
- header('Content-Transfer-Encoding: binary');
76
- }
77
-
78
  if (array_key_exists('concat', $in_params)) {
79
  foreach ($in_params['concat'] as $key) {
80
  $concated = '';
70
  if (array_key_exists('op_reset', $in_params) && function_exists('output_reset_rewrite_vars'))
71
  @output_reset_rewrite_vars();
72
 
 
 
 
 
 
73
  if (array_key_exists('concat', $in_params)) {
74
  foreach ($in_params['concat'] as $key) {
75
  $concated = '';
callback/wings/db.php CHANGED
@@ -203,6 +203,32 @@ class BVDBCallback extends BVCallbackBase {
203
  $result["rows"] = $rows;
204
  $resp = $result;
205
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  case "tableinfo":
207
  $table = urldecode($params['table']);
208
  $offset = intval(urldecode($params['offset']));
203
  $result["rows"] = $rows;
204
  $resp = $result;
205
  break;
206
+ case "multitablecontent":
207
+ $tableParams = $params['table_params'];
208
+ $resp = array();
209
+ foreach($tableParams as $tableParam) {
210
+ $result = array();
211
+ $identifier = $tableParam['identifier'];
212
+ $table = $tableParam['table'];
213
+ $tname = $tableParam['tname'];
214
+ $fields = $tableParam['fields'];
215
+ $filter = (array_key_exists('filter', $tableParam)) ? $tableParam['filter'] : "";
216
+ $limit = $tableParam['limit'];
217
+ $offset = $tableParam['offset'];
218
+ $pkeys = (array_key_exists('pkeys', $tableParam)) ? $tableParam['pkeys'] : array();
219
+ $result['timestamp'] = time();
220
+ $result['table_name'] = $tname;
221
+ $rows = $db->getTableContent($table, $fields, $filter, $limit, $offset);
222
+ $srows = sizeof($rows);
223
+ if (!empty($pkeys) && $srows > 0) {
224
+ $end_row = end($rows);
225
+ $result['last_ids'] = $this->getLastID($pkeys, $end_row);
226
+ }
227
+ $result["rows"] = $rows;
228
+ $result["size"] = $srows;
229
+ $resp[$identifier] = $result;
230
+ }
231
+ break;
232
  case "tableinfo":
233
  $table = urldecode($params['table']);
234
  $offset = intval(urldecode($params['offset']));
callback/wings/info.php CHANGED
@@ -205,9 +205,6 @@ class BVInfoCallback extends BVCallbackBase {
205
 
206
  public function servicesInfo(&$data) {
207
  $settings = $this->settings;
208
- $data['dynsync'] = $settings->getOption('bvDynSyncActive');
209
- $data['woodyn'] = $settings->getOption('bvWooDynSync');
210
- $data['dynplug'] = $settings->getOption('bvdynplug');
211
  $data['protect'] = $settings->getOption('bvptconf');
212
  $data['brand'] = $settings->getOption($this->bvinfo->brand_option);
213
  $data['badgeinfo'] = $settings->getOption($this->bvinfo->badgeinfo);
205
 
206
  public function servicesInfo(&$data) {
207
  $settings = $this->settings;
 
 
 
208
  $data['protect'] = $settings->getOption('bvptconf');
209
  $data['brand'] = $settings->getOption($this->bvinfo->brand_option);
210
  $data['badgeinfo'] = $settings->getOption($this->bvinfo->badgeinfo);
info.php CHANGED
@@ -10,7 +10,7 @@ if (!class_exists('BVInfo')) :
10
  public $badgeinfo = 'bvbadge';
11
  public $ip_header_option = 'bvipheader';
12
  public $brand_option = 'bvbrand';
13
- public $version = '4.63';
14
  public $webpage = 'https://blogvault.net';
15
  public $appurl = 'https://app.blogvault.net';
16
  public $slug = 'blogvault-real-time-backup/blogvault.php';
@@ -108,8 +108,13 @@ if (!class_exists('BVInfo')) :
108
  }
109
 
110
  public function isDynSyncModuleEnabled() {
111
- return ($this->settings->getOption('bvdynplug') === $this->plugname) &&
112
- $this->isActivePlugin();
 
 
 
 
 
113
  }
114
 
115
  public function isServiceActive($service) {
10
  public $badgeinfo = 'bvbadge';
11
  public $ip_header_option = 'bvipheader';
12
  public $brand_option = 'bvbrand';
13
+ public $version = '4.64';
14
  public $webpage = 'https://blogvault.net';
15
  public $appurl = 'https://app.blogvault.net';
16
  public $slug = 'blogvault-real-time-backup/blogvault.php';
108
  }
109
 
110
  public function isDynSyncModuleEnabled() {
111
+ if ($this->isServiceActive("dynsync")) {
112
+ $dynconfig = $this->config['dynsync'];
113
+ if (array_key_exists('dynplug', $dynconfig) && ($dynconfig['dynplug'] === $this->plugname)) {
114
+ return true;
115
+ }
116
+ }
117
+ return false;
118
  }
119
 
120
  public function isServiceActive($service) {
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link: https://app.blogvault.net/home/signup
6
  Requires at least: 4.0
7
  Tested up to: 5.8
8
  Requires PHP: 5.4.0
9
- Stable tag: 4.63
10
  License: GPLv2 or later
11
  License URI: [http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html)
12
 
@@ -247,6 +247,9 @@ These are available on our website: [Terms of Service](https://blogvault.net/tos
247
  9. We power WordPress migration for WPEngine, Pantheon, FlyWheel, LiquidWeb, Cloudways, Savvii and many more. Need we say more?
248
 
249
  == CHANGELOG ==
 
 
 
250
  = 4.63 =
251
  * Updated the logos
252
 
6
  Requires at least: 4.0
7
  Tested up to: 5.8
8
  Requires PHP: 5.4.0
9
+ Stable tag: 4.64
10
  License: GPLv2 or later
11
  License URI: [http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html)
12
 
247
  9. We power WordPress migration for WPEngine, Pantheon, FlyWheel, LiquidWeb, Cloudways, Savvii and many more. Need we say more?
248
 
249
  == CHANGELOG ==
250
+ = 4.64 =
251
+ * Added latest WooCommerce Real-Time-Backup support.
252
+
253
  = 4.63 =
254
  * Updated the logos
255
 
wp_dynsync.php CHANGED
@@ -9,9 +9,11 @@ class BVWPDynSync {
9
  public $db;
10
  public $settings;
11
 
12
- public function __construct($db, $settings) {
13
  $this->db = $db;
14
  $this->settings = $settings;
 
 
15
  }
16
 
17
  function init() {
@@ -20,9 +22,6 @@ class BVWPDynSync {
20
  }
21
 
22
  public function clearConfig() {
23
- $this->settings->deleteOption('bvdynplug');
24
- $this->settings->deleteOption('bvDynSyncActive');
25
- $this->settings->deleteOption('bvWooDynSync');
26
  $this->db->dropBVTable(BVWPDynSync::$dynsync_table);
27
  }
28
 
@@ -52,7 +51,7 @@ class BVWPDynSync {
52
  $defaults = array(
53
  '_excluded_links'
54
  );
55
- $ignored_postmeta = $this->settings->getOption('bvIgnoredPostmeta');
56
  if (empty($ignored_postmeta)) {
57
  $ignored_postmeta = array();
58
  }
@@ -199,7 +198,7 @@ class BVWPDynSync {
199
  '_disqus_sync_lock',
200
  'stats_cache'
201
  );
202
- $ignored_options = $this->settings->getOption('bvIgnoredOptions');
203
  if (empty($ignored_options)) {
204
  $ignored_options = array();
205
  }
@@ -230,7 +229,7 @@ class BVWPDynSync {
230
  $msg_type = 'edit';
231
  $ping_permitted = $this->get_ping_permission($option_name);
232
  if ($ping_permitted)
233
- $this->add_db_event('options', array('option_name' => $option_name, 'msg_type' => 'delete'));
234
  return $option_name;
235
  }
236
 
@@ -247,6 +246,13 @@ class BVWPDynSync {
247
  return $file;
248
  }
249
 
 
 
 
 
 
 
 
250
  function wpmu_new_blog_create_handler($site_id) {
251
  $this->add_db_event('blogs', array('site_id' => $site_id));
252
  }
@@ -338,14 +344,14 @@ class BVWPDynSync {
338
  function woocommerce_delete_order_items_handler($postid) {
339
  $meta_ids = array();
340
  $order_item_ids = array();
341
- foreach( $this->db->getResult("SELECT {$this->db->dbprefix}woocommerce_order_itemmeta.meta_id, {$this->db->dbprefix}woocommerce_order_items.order_item_id FROM {$this->db->dbprefix}woocommerce_order_items JOIN {$this->db->dbprefix}woocommerce_order_itemmeta ON {$this->db->dbprefix}woocommerce_order_items.order_item_id = {$this->db->dbprefix}woocommerce_order_itemmeta.order_item_id WHERE {$this->db->dbprefix}woocommerce_order_items.order_id = '{$postid}'") as $key => $row) {
342
- if (!in_array($row->meta_id, $meta_ids, true)) {
343
- $meta_ids[] = $row->meta_id;
344
- $this->add_db_event('woocommerce_order_itemmeta', array('meta_id' => $row->meta_id, 'msg_type' => 'delete'));
345
  }
346
- if (!in_array($row->order_item_id, $order_item_ids, true)) {
347
- $order_item_ids[] = $row->order_item_id;
348
- $this->add_db_event('woocommerce_order_items', array('order_item_id' => $row->order_item_id, 'msg_type' => 'delete'));
349
  }
350
  }
351
  }
@@ -489,6 +495,35 @@ class BVWPDynSync {
489
  $this->add_db_event('wc_product_meta_lookup', array('product_id' => $product_id, 'msg_type' => 'edit'));
490
  }
491
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
492
  /* ADDING ACTION AND LISTENERS FOR CAPTURING EVENTS. */
493
  public function add_actions_and_listeners() {
494
  /* CAPTURING EVENTS FOR WP_COMMENTS TABLE */
@@ -571,6 +606,7 @@ class BVWPDynSync {
571
 
572
  /* CAPTURING EVENTS FOR FILES UPLOAD */
573
  add_action('wp_handle_upload', array($this, 'upload_handler'));
 
574
 
575
  /* These are applicable only in case of WPMU */
576
  /* XNOTE: Handle registration_log_handler from within the server */
@@ -579,77 +615,85 @@ class BVWPDynSync {
579
  add_action('add_site_option', array($this, 'sitemeta_handler'), 10, 1);
580
  add_action('update_site_option', array($this, 'sitemeta_handler'), 10, 1);
581
 
582
- $is_woo_dyn = $this->settings->getOption('bvWooDynSync');
583
- if ($is_woo_dyn == 'yes') {
584
- add_action('woocommerce_resume_order', array($this, 'woocommerce_resume_order_handler'), 10, 1);
585
- add_action('woocommerce_new_order_item', array($this, 'woocommerce_new_order_item_handler'), 10, 3);
586
- add_action('woocommerce_update_order_item', array($this, 'woocommerce_update_order_item_handler'), 10, 2);
587
- add_action('woocommerce_delete_order_item', array($this, 'woocommerce_delete_order_item_handler'), 10, 1);
588
- add_action('woocommerce_delete_order_items', array($this, 'woocommerce_delete_order_items_handler'), 10, 1);
589
- add_action('added_order_item_meta', array($this, 'woocommerce_order_term_meta_handler' ), 10, 4);
590
- add_action('updated_order_item_meta', array($this, 'woocommerce_order_term_meta_handler'), 10, 4);
591
- add_action('deleted_order_item_meta', array($this, 'woocommerce_order_term_meta_handler'), 10, 4);
592
-
593
- add_action('woocommerce_attribute_added', array($this, 'woocommerce_attribute_added_handler' ), 10, 2 );
594
- add_action('woocommerce_attribute_updated', array($this, 'woocommerce_attribute_updated_handler'), 10, 3 );
595
- add_action('woocommerce_attribute_deleted', array($this, 'woocommerce_attribute_deleted_handler'), 10, 3 );
596
-
597
- add_action('woocommerce_tax_rate_added', array($this, 'woocommerce_tax_rate_handler'), 10, 2);
598
- add_action('woocommerce_tax_rate_deleted', array($this, 'woocommerce_tax_rate_deleted_handler'), 10, 1);
599
- add_action('woocommerce_tax_rate_updated', array($this, 'woocommerce_tax_rate_handler'), 10, 2);
600
-
601
- add_action('woocommerce_new_webhook', array($this, 'woocommerce_webhook_handler'), 10, 1);
602
- add_action('woocommerce_webhook_updated', array($this, 'woocommerce_webhook_handler'), 10, 1);
603
- add_action('woocommerce_webhook_deleted', array($this, 'woocommerce_webhook_delete_handler'), 10, 2);
604
-
605
- add_action('woocommerce_download_product', array($this, 'woocommerce_download_product_handler'), 10, 6);
606
- add_action('woocommerce_grant_product_download_access', array($this, 'woocommerce_grant_product_download_access_handler'), 10, 1);
607
- add_action('woocommerce_ajax_revoke_access_to_product_download', array($this, 'woocommerce_revoke_access_to_product_download_handler'), 10, 4);
608
- add_action('woocommerce_deleted_order_downloadable_permissions', array($this, 'woocommerce_deleted_order_downloadable_permissions_handler'), 10, 1);
609
- add_filter('woocommerce_process_product_file_download_paths_remove_access_to_old_file', array($this, 'woocommerce_downloadable_product_permissions_delete_handler', 10, 4));
610
-
611
- add_action('woocommerce_new_payment_token', array($this, 'woocommerce_payment_token_handler'), 10, 1);
612
- add_action('woocommerce_payment_token_created', array($this, 'woocommerce_payment_token_handler'), 10, 1);
613
- add_action('woocommerce_payment_token_updated', array($this, 'woocommerce_payment_token_handler'), 10, 1);
614
- add_action('woocommerce_payment_token_deleted', array($this, 'woocommerce_payment_token_deleted_handler'), 10, 2);
615
- add_action('added_payment_token_meta', array($this, 'woocommerce_payment_token_meta_handler' ), 10, 4);
616
- add_action('updated_payment_token_meta', array($this, 'woocommerce_payment_token_meta_handler'), 10, 4);
617
- add_action('deleted_payment_token_meta', array($this, 'woocommerce_payment_token_meta_handler'), 10, 4);
618
-
619
- add_action('woocommerce_shipping_zone_method_added', array($this, 'woocommerce_shipping_zone_method_added_handler'), 10, 3);
620
- add_action('woocommerce_shipping_zone_method_status_toggled', array($this, 'woocommerce_shipping_zone_method_status_toggled_handler'), 10, 4);
621
- add_action('woocommerce_shipping_zone_method_deleted', array($this, 'woocommerce_shipping_zone_method_deleted_handler'), 10, 3);
622
-
623
- add_action('woocommerce_delete_shipping_zone', array($this, 'woocommerce_delete_shipping_zone_handler'), 10, 1);
624
- add_action('woocommerce_delete_shipping_zone_method', array($this, 'woocommerce_delete_shipping_zone_method_handler'), 10, 1);
625
-
626
- add_action('woocommerce_api_create_product_attribute', array($this, 'woocommerce_api_product_attribute_handler'), 10, 2);
627
- add_action('woocommerce_api_edit_product_attribute', array($this, 'woocommerce_api_product_attribute_handler'), 10, 2);
628
-
629
- add_action('woocommerce_note_created', array($this, 'woocommerce_note_created_handler'), 10, 1);
630
- add_action('woocommerce_note_updated', array($this, 'woocommerce_note_modification_handler'), 10, 1);
631
- add_action('woocommerce_note_deleted', array($this, 'woocommerce_note_modification_handler'), 10, 1);
632
-
633
- add_action('woocommerce_analytics_update_order_stats', array($this, 'woocommerce_analytics_order_stats_modification_handler'), 10, 1);
634
- add_action('woocommerce_analytics_delete_order_stats', array($this, 'woocommerce_analytics_order_stats_modification_handler'), 10, 1);
635
-
636
- add_action('woocommerce_analytics_update_product', array($this, 'woocommerce_analytics_product_update_handler'), 10, 2);
637
- add_action('woocommerce_analytics_delete_product', array($this, 'woocommerce_analytics_product_delete_handler'), 10, 2);
638
-
639
- add_action('woocommerce_analytics_new_customer', array($this, 'woocommerce_analytics_new_customer_handler'), 10, 1);
640
- add_action('woocommerce_analytics_update_customer', array($this, 'woocommerce_analytics_customer_modification_handler'), 10, 1);
641
- add_action('woocommerce_analytics_delete_customer', array($this, 'woocommerce_analytics_customer_modification_handler'), 10, 1);
642
-
643
- add_action('woocommerce_analytics_update_coupon', array($this, 'woocommerce_analytics_coupon_update_handler'), 10, 2);
644
- add_action('woocommerce_analytics_delete_coupon', array($this, 'woocommerce_analytics_coupon_delete_handler'), 10, 2);
645
-
646
- add_action('woocommerce_analytics_update_tax', array($this, 'woocommerce_analytics_tax_update_handler'), 10, 2);
647
- add_action('woocommerce_analytics_delete_tax', array($this, 'woocommerce_analytics_tax_delete_handler'), 10, 2);
648
-
649
- add_action('woocommerce_updated_product_stock', array($this, 'woocommerce_product_update_handler'), 10, 1);
650
- add_action('woocommerce_updated_product_sales', array($this, 'woocommerce_product_update_handler'), 10, 1);
651
- add_action('woocommerce_updated_product_price', array($this, 'woocommerce_product_update_handler'), 10, 1);
652
- }
 
 
 
 
 
 
 
 
653
  }
654
  }
655
- endif;
9
  public $db;
10
  public $settings;
11
 
12
+ public function __construct($db, $settings, $config) {
13
  $this->db = $db;
14
  $this->settings = $settings;
15
+ $this->config = $config;
16
+ $this->ignored_events = array_key_exists('ignored_events', $config) ? $config['ignored_events'] : array();
17
  }
18
 
19
  function init() {
22
  }
23
 
24
  public function clearConfig() {
 
 
 
25
  $this->db->dropBVTable(BVWPDynSync::$dynsync_table);
26
  }
27
 
51
  $defaults = array(
52
  '_excluded_links'
53
  );
54
+ $ignored_postmeta = $this->ignored_events['postmeta'];
55
  if (empty($ignored_postmeta)) {
56
  $ignored_postmeta = array();
57
  }
198
  '_disqus_sync_lock',
199
  'stats_cache'
200
  );
201
+ $ignored_options = $this->ignored_events['options'];
202
  if (empty($ignored_options)) {
203
  $ignored_options = array();
204
  }
229
  $msg_type = 'edit';
230
  $ping_permitted = $this->get_ping_permission($option_name);
231
  if ($ping_permitted)
232
+ $this->add_db_event('options', array('option_name' => $option_name, 'msg_type' => $msg_type));
233
  return $option_name;
234
  }
235
 
246
  return $file;
247
  }
248
 
249
+ function attachment_metadata_handler($data = null, $post_id = null) {
250
+ if(!empty($data) && !empty($data['file'])) {
251
+ $this->add_event('uploads', array('file' => $data['file'], 'sizes' => $data['sizes']));
252
+ }
253
+ return $data;
254
+ }
255
+
256
  function wpmu_new_blog_create_handler($site_id) {
257
  $this->add_db_event('blogs', array('site_id' => $site_id));
258
  }
344
  function woocommerce_delete_order_items_handler($postid) {
345
  $meta_ids = array();
346
  $order_item_ids = array();
347
+ foreach( $this->db->getResult("SELECT {$this->db->dbprefix()}woocommerce_order_itemmeta.meta_id, {$this->db->dbprefix()}woocommerce_order_items.order_item_id FROM {$this->db->dbprefix()}woocommerce_order_items JOIN {$this->db->dbprefix()}woocommerce_order_itemmeta ON {$this->db->dbprefix()}woocommerce_order_items.order_item_id = {$this->db->dbprefix()}woocommerce_order_itemmeta.order_item_id WHERE {$this->db->dbprefix()}woocommerce_order_items.order_id = '{$postid}'") as $key => $row) {
348
+ if (!in_array($row['meta_id'], $meta_ids, true)) {
349
+ $meta_ids[] = $row['meta_id'];
350
+ $this->add_db_event('woocommerce_order_itemmeta', array('meta_id' => $row['meta_id'], 'msg_type' => 'delete'));
351
  }
352
+ if (!in_array($row['order_item_id'], $order_item_ids, true)) {
353
+ $order_item_ids[] = $row['order_item_id'];
354
+ $this->add_db_event('woocommerce_order_items', array('order_item_id' => $row['order_item_id'], 'msg_type' => 'delete'));
355
  }
356
  }
357
  }
495
  $this->add_db_event('wc_product_meta_lookup', array('product_id' => $product_id, 'msg_type' => 'edit'));
496
  }
497
 
498
+ function woocommerce_trash_untrash_post_handler($post_id) {
499
+ if (!$post_id) {
500
+ return;
501
+ }
502
+ $results = $this->db->getResult($this->db->prepare("SELECT ID FROM {$this->db->dbprefix()}posts WHERE post_type = 'shop_order_refund' AND post_parent = %d", $post_id));
503
+ foreach ( $results as $post ) {
504
+ $this->add_db_event('posts', array('ID' => $post['ID']));
505
+ }
506
+ }
507
+
508
+ function woocommerce_product_and_order_actions_handler($post_id, $arg = null) {
509
+ $this->add_db_event('posts', array('ID' => $post_id));
510
+ }
511
+
512
+ function woocommerce_payment_token_set_default_handler($token_id, $token) {
513
+ $results = $this->db->getResult($this->db->prepare("SELECT user_id FROM {$this->db->dbprefix()}woocommerce_payment_tokens WHERE token_id = %d", $token_id));
514
+ $user_ids = array();
515
+ foreach ( $results as $tok ){
516
+ if (!in_array($tok['user_id'], $user_ids, true)) {
517
+ $user_ids[] = $tok['user_id'];
518
+ $this->add_db_event('woocommerce_payment_tokens', array('user_id' => $tok['user_id']));
519
+ }
520
+ }
521
+ }
522
+
523
+ function woocommerce_grant_product_download_permissions_handler($order_id) {
524
+ $this->add_db_event('woocommerce_downloadable_product_permissions', array('order_id' => $order_id));
525
+ }
526
+
527
  /* ADDING ACTION AND LISTENERS FOR CAPTURING EVENTS. */
528
  public function add_actions_and_listeners() {
529
  /* CAPTURING EVENTS FOR WP_COMMENTS TABLE */
606
 
607
  /* CAPTURING EVENTS FOR FILES UPLOAD */
608
  add_action('wp_handle_upload', array($this, 'upload_handler'));
609
+ add_action('wp_update_attachment_metadata', array($this, 'attachment_metadata_handler'), 10, 2);
610
 
611
  /* These are applicable only in case of WPMU */
612
  /* XNOTE: Handle registration_log_handler from within the server */
615
  add_action('add_site_option', array($this, 'sitemeta_handler'), 10, 1);
616
  add_action('update_site_option', array($this, 'sitemeta_handler'), 10, 1);
617
 
618
+ /* CAPTURING EVENTS FOR WOOCOMMERCE */
619
+ add_action('woocommerce_resume_order', array($this, 'woocommerce_resume_order_handler'), 10, 1);
620
+ add_action('woocommerce_new_order_item', array($this, 'woocommerce_new_order_item_handler'), 10, 3);
621
+ add_action('woocommerce_update_order_item', array($this, 'woocommerce_update_order_item_handler'), 10, 2);
622
+ add_action('woocommerce_delete_order_item', array($this, 'woocommerce_delete_order_item_handler'), 10, 1);
623
+ add_action('woocommerce_delete_order_items', array($this, 'woocommerce_delete_order_items_handler'), 10, 1);
624
+ add_action('added_order_item_meta', array($this, 'woocommerce_order_term_meta_handler' ), 10, 4);
625
+ add_action('updated_order_item_meta', array($this, 'woocommerce_order_term_meta_handler'), 10, 4);
626
+ add_action('deleted_order_item_meta', array($this, 'woocommerce_order_term_meta_handler'), 10, 4);
627
+
628
+ add_action('woocommerce_attribute_added', array($this, 'woocommerce_attribute_added_handler' ), 10, 2 );
629
+ add_action('woocommerce_attribute_updated', array($this, 'woocommerce_attribute_updated_handler'), 10, 3 );
630
+ add_action('woocommerce_attribute_deleted', array($this, 'woocommerce_attribute_deleted_handler'), 10, 3 );
631
+
632
+ add_action('woocommerce_tax_rate_added', array($this, 'woocommerce_tax_rate_handler'), 10, 2);
633
+ add_action('woocommerce_tax_rate_deleted', array($this, 'woocommerce_tax_rate_deleted_handler'), 10, 1);
634
+ add_action('woocommerce_tax_rate_updated', array($this, 'woocommerce_tax_rate_handler'), 10, 2);
635
+
636
+ add_action('woocommerce_new_webhook', array($this, 'woocommerce_webhook_handler'), 10, 1);
637
+ add_action('woocommerce_webhook_updated', array($this, 'woocommerce_webhook_handler'), 10, 1);
638
+ add_action('woocommerce_webhook_deleted', array($this, 'woocommerce_webhook_delete_handler'), 10, 2);
639
+
640
+ add_action('woocommerce_download_product', array($this, 'woocommerce_download_product_handler'), 10, 6);
641
+ add_action('woocommerce_grant_product_download_access', array($this, 'woocommerce_grant_product_download_access_handler'), 10, 1);
642
+ add_action('woocommerce_ajax_revoke_access_to_product_download', array($this, 'woocommerce_revoke_access_to_product_download_handler'), 10, 4);
643
+ add_action('woocommerce_deleted_order_downloadable_permissions', array($this, 'woocommerce_deleted_order_downloadable_permissions_handler'), 10, 1);
644
+ add_filter('woocommerce_process_product_file_download_paths_remove_access_to_old_file', array($this, 'woocommerce_downloadable_product_permissions_delete_handler', 10, 4));
645
+
646
+ add_action('woocommerce_new_payment_token', array($this, 'woocommerce_payment_token_handler'), 10, 1);
647
+ add_action('woocommerce_payment_token_created', array($this, 'woocommerce_payment_token_handler'), 10, 1);
648
+ add_action('woocommerce_payment_token_updated', array($this, 'woocommerce_payment_token_handler'), 10, 1);
649
+ add_action('woocommerce_payment_token_deleted', array($this, 'woocommerce_payment_token_deleted_handler'), 10, 2);
650
+ add_action('added_payment_token_meta', array($this, 'woocommerce_payment_token_meta_handler' ), 10, 4);
651
+ add_action('updated_payment_token_meta', array($this, 'woocommerce_payment_token_meta_handler'), 10, 4);
652
+ add_action('deleted_payment_token_meta', array($this, 'woocommerce_payment_token_meta_handler'), 10, 4);
653
+
654
+ add_action('woocommerce_shipping_zone_method_added', array($this, 'woocommerce_shipping_zone_method_added_handler'), 10, 3);
655
+ add_action('woocommerce_shipping_zone_method_status_toggled', array($this, 'woocommerce_shipping_zone_method_status_toggled_handler'), 10, 4);
656
+ add_action('woocommerce_shipping_zone_method_deleted', array($this, 'woocommerce_shipping_zone_method_deleted_handler'), 10, 3);
657
+
658
+ add_action('woocommerce_delete_shipping_zone', array($this, 'woocommerce_delete_shipping_zone_handler'), 10, 1);
659
+ add_action('woocommerce_delete_shipping_zone_method', array($this, 'woocommerce_delete_shipping_zone_method_handler'), 10, 1);
660
+
661
+ add_action('woocommerce_api_create_product_attribute', array($this, 'woocommerce_api_product_attribute_handler'), 10, 2);
662
+ add_action('woocommerce_api_edit_product_attribute', array($this, 'woocommerce_api_product_attribute_handler'), 10, 2);
663
+
664
+ add_action('woocommerce_note_created', array($this, 'woocommerce_note_created_handler'), 10, 1);
665
+ add_action('woocommerce_note_updated', array($this, 'woocommerce_note_modification_handler'), 10, 1);
666
+ add_action('woocommerce_note_deleted', array($this, 'woocommerce_note_modification_handler'), 10, 1);
667
+
668
+ add_action('woocommerce_analytics_update_order_stats', array($this, 'woocommerce_analytics_order_stats_modification_handler'), 10, 1);
669
+ add_action('woocommerce_analytics_delete_order_stats', array($this, 'woocommerce_analytics_order_stats_modification_handler'), 10, 1);
670
+
671
+ add_action('woocommerce_analytics_update_product', array($this, 'woocommerce_analytics_product_update_handler'), 10, 2);
672
+ add_action('woocommerce_analytics_delete_product', array($this, 'woocommerce_analytics_product_delete_handler'), 10, 2);
673
+
674
+ add_action('woocommerce_analytics_new_customer', array($this, 'woocommerce_analytics_new_customer_handler'), 10, 1);
675
+ add_action('woocommerce_analytics_update_customer', array($this, 'woocommerce_analytics_customer_modification_handler'), 10, 1);
676
+ add_action('woocommerce_analytics_delete_customer', array($this, 'woocommerce_analytics_customer_modification_handler'), 10, 1);
677
+
678
+ add_action('woocommerce_analytics_update_coupon', array($this, 'woocommerce_analytics_coupon_update_handler'), 10, 2);
679
+ add_action('woocommerce_analytics_delete_coupon', array($this, 'woocommerce_analytics_coupon_delete_handler'), 10, 2);
680
+
681
+ add_action('woocommerce_analytics_update_tax', array($this, 'woocommerce_analytics_tax_update_handler'), 10, 2);
682
+ add_action('woocommerce_analytics_delete_tax', array($this, 'woocommerce_analytics_tax_delete_handler'), 10, 2);
683
+
684
+ add_action('woocommerce_updated_product_stock', array($this, 'woocommerce_product_update_handler'), 10, 1);
685
+ add_action('woocommerce_updated_product_sales', array($this, 'woocommerce_product_update_handler'), 10, 1);
686
+ add_action('woocommerce_updated_product_price', array($this, 'woocommerce_product_update_handler'), 10, 1);
687
+
688
+ add_action('wp_trash_post', array($this, 'woocommerce_trash_untrash_post_handler'), 10, 1);
689
+ add_action('untrashed_post', array($this, 'woocommerce_trash_untrash_post_handler'), 10, 1);
690
+
691
+ add_action('woocommerce_after_single_product_ordering', array($this, 'woocommerce_product_and_order_actions_handler'), 10, 2);
692
+ add_action('woocommerce_update_product', array($this, 'woocommerce_product_and_order_actions_handler'), 10, 2);
693
+ add_action('woocommerce_update_product_variation', array($this, 'woocommerce_product_and_order_actions_handler'), 10, 2);
694
+
695
+ add_action('woocommerce_payment_token_set_default', array($this, 'woocommerce_payment_token_set_default_handler'), 10, 2);
696
+ add_action('woocommerce_grant_product_download_permissions', array($this, 'woocommerce_grant_product_download_permissions_handler'), 10, 1);
697
  }
698
  }
699
+ endif;