Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/blogvaul...
File: wp_actlog.php
<?php
[0] Fix | Delete
[1] Fix | Delete
if (!defined('ABSPATH')) exit;
[2] Fix | Delete
if (!class_exists('BVWPActLog')) :
[3] Fix | Delete
[4] Fix | Delete
class BVWPActLog {
[5] Fix | Delete
[6] Fix | Delete
public static $actlog_table = 'activities_store';
[7] Fix | Delete
public $db;
[8] Fix | Delete
public $settings;
[9] Fix | Delete
public $bvinfo;
[10] Fix | Delete
public $request_id;
[11] Fix | Delete
public $ip_header;
[12] Fix | Delete
public $ignored_events;
[13] Fix | Delete
[14] Fix | Delete
public function __construct($db, $settings, $info, $config) {
[15] Fix | Delete
$this->db = $db;
[16] Fix | Delete
$this->settings = $settings;
[17] Fix | Delete
$this->bvinfo = $info;
[18] Fix | Delete
$this->request_id = BVInfo::getRequestID();
[19] Fix | Delete
$this->ip_header = array_key_exists('ip_header', $config) ? $config['ip_header'] : false;
[20] Fix | Delete
$this->ignored_events = array_key_exists('ignored_events', $config) ? $config['ignored_events'] : array();
[21] Fix | Delete
}
[22] Fix | Delete
[23] Fix | Delete
function init() {
[24] Fix | Delete
$this->add_actions_and_listeners();
[25] Fix | Delete
}
[26] Fix | Delete
[27] Fix | Delete
function get_post($post_id) {
[28] Fix | Delete
$post = get_post($post_id);
[29] Fix | Delete
$data = array('id' => $post_id);
[30] Fix | Delete
if (!empty($post)) {
[31] Fix | Delete
$data['title'] = $post->post_title;
[32] Fix | Delete
$data['status'] = $post->post_status;
[33] Fix | Delete
$data['type'] = $post->post_type;
[34] Fix | Delete
$data['url'] = get_permalink($post_id);
[35] Fix | Delete
$data['date'] = $post->post_date;
[36] Fix | Delete
}
[37] Fix | Delete
return $data;
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
function get_comment($comment_id) {
[41] Fix | Delete
$comment = get_comment($comment_id);
[42] Fix | Delete
$data = array('id' => $comment_id);
[43] Fix | Delete
if (!empty($comment)) {
[44] Fix | Delete
$data['author'] = $comment->comment_author;
[45] Fix | Delete
$data['post_id'] = $comment->comment_post_ID;
[46] Fix | Delete
}
[47] Fix | Delete
return $data;
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
function get_term($term_id) {
[51] Fix | Delete
$term = get_term($term_id);
[52] Fix | Delete
$data = array('id' => $term_id);
[53] Fix | Delete
if (!empty($term)) {
[54] Fix | Delete
$data['name'] = $term->name;
[55] Fix | Delete
$data['slug'] = $term->slug;
[56] Fix | Delete
$data['taxonomy'] = $term->taxonomy;
[57] Fix | Delete
}
[58] Fix | Delete
return $data;
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
function get_user($user_id) {
[62] Fix | Delete
$user = get_userdata($user_id);
[63] Fix | Delete
$data = array('id' => $user_id);
[64] Fix | Delete
if (!empty($user)) {
[65] Fix | Delete
$data['username'] = $user->user_login;
[66] Fix | Delete
$data['email'] = $user->user_email;
[67] Fix | Delete
$data['role'] = $user->roles;
[68] Fix | Delete
}
[69] Fix | Delete
return $data;
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
function get_blog($blog_id) {
[73] Fix | Delete
$blog = get_blog_details($blog_id);
[74] Fix | Delete
$data = array('id' => $blog_id);
[75] Fix | Delete
if (!empty($blog)) {
[76] Fix | Delete
$data['name'] = $blog->blogname;
[77] Fix | Delete
$data['url'] = $blog->path;
[78] Fix | Delete
}
[79] Fix | Delete
return $data;
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
function wc_get_attribute($attribute_id, $attribute_data = null) {
[83] Fix | Delete
$data = array('id' => $attribute_id);
[84] Fix | Delete
if (!is_null($attribute_data) && is_array($attribute_data)) {
[85] Fix | Delete
$data['name'] = $attribute_data['attribute_label'];
[86] Fix | Delete
$data['slug'] = $attribute_data['attribute_name'];
[87] Fix | Delete
} else {
[88] Fix | Delete
$attribute = wc_get_attribute($attribute_id);
[89] Fix | Delete
if (!empty($attribute)) {
[90] Fix | Delete
$data['name'] = $attribute->name;
[91] Fix | Delete
$data['slug'] = substr($attribute->slug, 3);
[92] Fix | Delete
}
[93] Fix | Delete
}
[94] Fix | Delete
return $data;
[95] Fix | Delete
}
[96] Fix | Delete
[97] Fix | Delete
function wc_get_tax_rate($tax_rate_id, $tax_rate) {
[98] Fix | Delete
$data = array('id' => $tax_rate_id);
[99] Fix | Delete
if (!empty($tax_rate)) {
[100] Fix | Delete
$data['name'] = array_key_exists('tax_rate_name', $tax_rate) ? $tax_rate['tax_rate_name'] : '';
[101] Fix | Delete
$data['country'] = array_key_exists('tax_rate_country', $tax_rate) ? $tax_rate['tax_rate_country'] : '';
[102] Fix | Delete
$data['rate'] = array_key_exists('tax_rate', $tax_rate) ? $tax_rate['tax_rate'] : '';
[103] Fix | Delete
}
[104] Fix | Delete
return $data;
[105] Fix | Delete
}
[106] Fix | Delete
[107] Fix | Delete
function get_ip($ipHeader) {
[108] Fix | Delete
$ip = '127.0.0.1';
[109] Fix | Delete
if ($ipHeader && is_array($ipHeader)) {
[110] Fix | Delete
if (array_key_exists($ipHeader['hdr'], $_SERVER)) {
[111] Fix | Delete
$_ips = preg_split("/(,| |\t)/", $_SERVER[$ipHeader['hdr']]);
[112] Fix | Delete
if (array_key_exists(intval($ipHeader['pos']), $_ips)) {
[113] Fix | Delete
$ip = $_ips[intval($ipHeader['pos'])];
[114] Fix | Delete
}
[115] Fix | Delete
}
[116] Fix | Delete
} else if (array_key_exists('REMOTE_ADDR', $_SERVER)) {
[117] Fix | Delete
$ip = $_SERVER['REMOTE_ADDR'];
[118] Fix | Delete
}
[119] Fix | Delete
[120] Fix | Delete
$ip = trim($ip);
[121] Fix | Delete
if (BVHelper::safePregMatch('/^\[([0-9a-fA-F:]+)\](:[0-9]+)$/', $ip, $matches)) {
[122] Fix | Delete
$ip = $matches[1];
[123] Fix | Delete
} elseif (BVHelper::safePregMatch('/^([0-9.]+)(:[0-9]+)$/', $ip, $matches)) {
[124] Fix | Delete
$ip = $matches[1];
[125] Fix | Delete
}
[126] Fix | Delete
[127] Fix | Delete
return $ip;
[128] Fix | Delete
}
[129] Fix | Delete
[130] Fix | Delete
function add_activity($event_data) {
[131] Fix | Delete
if (!function_exists('wp_get_current_user')) {
[132] Fix | Delete
@include_once(ABSPATH . "wp-includes/pluggable.php");
[133] Fix | Delete
}
[134] Fix | Delete
[135] Fix | Delete
$user = wp_get_current_user();
[136] Fix | Delete
$values = array();
[137] Fix | Delete
if (!empty($user)) {
[138] Fix | Delete
$values["user_id"] = $user->ID;
[139] Fix | Delete
$values["username"] = $user->user_login;
[140] Fix | Delete
}
[141] Fix | Delete
$values["request_id"] = $this->request_id;
[142] Fix | Delete
$values["site_id"] = get_current_blog_id();
[143] Fix | Delete
$values["ip"] = $this->get_ip($this->ip_header);
[144] Fix | Delete
$values["event_type"] = current_filter();
[145] Fix | Delete
$values["event_data"] = maybe_serialize($event_data);
[146] Fix | Delete
$values["time"] = time();
[147] Fix | Delete
$this->db->replaceIntoBVTable(BVWPActLog::$actlog_table, $values);
[148] Fix | Delete
}
[149] Fix | Delete
[150] Fix | Delete
function is_key_ignored($ignored_keys, $value) {
[151] Fix | Delete
$is_ignored = false;
[152] Fix | Delete
if (array_key_exists("post_types_regex", $ignored_keys)) {
[153] Fix | Delete
foreach ($ignored_keys['post_types_regex'] as $val) {
[154] Fix | Delete
if (BVHelper::safePregMatch($val, $value)) {
[155] Fix | Delete
return true;
[156] Fix | Delete
}
[157] Fix | Delete
}
[158] Fix | Delete
}
[159] Fix | Delete
if (array_key_exists("post_types", $ignored_keys)) {
[160] Fix | Delete
foreach ($ignored_keys['post_types'] as $val) {
[161] Fix | Delete
if ($val == $value) {
[162] Fix | Delete
return true;
[163] Fix | Delete
}
[164] Fix | Delete
}
[165] Fix | Delete
}
[166] Fix | Delete
return $is_ignored;
[167] Fix | Delete
}
[168] Fix | Delete
[169] Fix | Delete
function user_login_handler($user_login, $user) {
[170] Fix | Delete
$event_data = array("user" => $this->get_user($user->ID));
[171] Fix | Delete
$this->add_activity($event_data);
[172] Fix | Delete
}
[173] Fix | Delete
[174] Fix | Delete
function user_logout_handler($user_id) {
[175] Fix | Delete
$user = $this->get_user($user_id);
[176] Fix | Delete
$event_data = array("user" => $user);
[177] Fix | Delete
$this->add_activity($event_data);
[178] Fix | Delete
}
[179] Fix | Delete
[180] Fix | Delete
function password_reset_handler($user, $new_pass) {
[181] Fix | Delete
if (!empty($user)) {
[182] Fix | Delete
$event_data = array("user" => $this->get_user($user->ID));
[183] Fix | Delete
$this->add_activity($event_data);
[184] Fix | Delete
}
[185] Fix | Delete
}
[186] Fix | Delete
[187] Fix | Delete
function comment_handler($comment_id) {
[188] Fix | Delete
$comment = $this->get_comment($comment_id);
[189] Fix | Delete
$post = $this->get_post($comment['post_id']);
[190] Fix | Delete
$event_data = array(
[191] Fix | Delete
"comment" => $comment,
[192] Fix | Delete
"post" => $post
[193] Fix | Delete
);
[194] Fix | Delete
$this->add_activity($event_data);
[195] Fix | Delete
}
[196] Fix | Delete
[197] Fix | Delete
function comment_status_changed_handler($new_status, $old_status, $comment) {
[198] Fix | Delete
$post = $this->get_post($comment->comment_post_ID);
[199] Fix | Delete
$event_data = array(
[200] Fix | Delete
"comment" => $this->get_comment($comment->comment_ID),
[201] Fix | Delete
"post" => $post,
[202] Fix | Delete
"old_status" => $old_status,
[203] Fix | Delete
"new_status" => $new_status
[204] Fix | Delete
);
[205] Fix | Delete
$this->add_activity($event_data);
[206] Fix | Delete
}
[207] Fix | Delete
[208] Fix | Delete
function post_handler($post_id) {
[209] Fix | Delete
$post = $this->get_post($post_id);
[210] Fix | Delete
if ($this->is_key_ignored($this->ignored_events, $post["type"]))
[211] Fix | Delete
return;
[212] Fix | Delete
$event_data = array();
[213] Fix | Delete
if ($post["type"] === "product") {
[214] Fix | Delete
$event_data["product"] = $post;
[215] Fix | Delete
} elseif ($post["type"] === "shop_order") {
[216] Fix | Delete
$event_data["order"] = $post;
[217] Fix | Delete
} else {
[218] Fix | Delete
$event_data["post"] = $post;
[219] Fix | Delete
}
[220] Fix | Delete
$this->add_activity($event_data);
[221] Fix | Delete
}
[222] Fix | Delete
[223] Fix | Delete
function post_saved_handler($post_id, $post, $update) {
[224] Fix | Delete
$post = $this->get_post($post_id);
[225] Fix | Delete
if ($this->is_key_ignored($this->ignored_events, $post["type"]))
[226] Fix | Delete
return;
[227] Fix | Delete
$event_data = array();
[228] Fix | Delete
if ($post["type"] === "product") {
[229] Fix | Delete
$event_data["product"] = $post;
[230] Fix | Delete
} elseif ($post["type"] === "shop_order") {
[231] Fix | Delete
$event_data["order"] = $post;
[232] Fix | Delete
} else {
[233] Fix | Delete
$event_data["post"] = $post;
[234] Fix | Delete
}
[235] Fix | Delete
$event_data["updated"] = $update;
[236] Fix | Delete
$this->add_activity($event_data);
[237] Fix | Delete
}
[238] Fix | Delete
[239] Fix | Delete
function term_handler($term_id) {
[240] Fix | Delete
$term = $this->get_term($term_id);
[241] Fix | Delete
$event_data = array(
[242] Fix | Delete
"term" => $term,
[243] Fix | Delete
);
[244] Fix | Delete
$this->add_activity($event_data);
[245] Fix | Delete
}
[246] Fix | Delete
[247] Fix | Delete
function term_updation_handler($data, $term_id) {
[248] Fix | Delete
$term = $this->get_term($term_id);
[249] Fix | Delete
$event_data = array(
[250] Fix | Delete
"term" => $term,
[251] Fix | Delete
"new_term" => $data
[252] Fix | Delete
);
[253] Fix | Delete
$this->add_activity($event_data);
[254] Fix | Delete
return $data;
[255] Fix | Delete
}
[256] Fix | Delete
[257] Fix | Delete
function term_deletion_handler($term_id) {
[258] Fix | Delete
$event_data = array(
[259] Fix | Delete
"term" => array("id" => $term_id)
[260] Fix | Delete
);
[261] Fix | Delete
$this->add_activity($event_data);
[262] Fix | Delete
}
[263] Fix | Delete
[264] Fix | Delete
function user_handler($user_id) {
[265] Fix | Delete
$user = $this->get_user($user_id);
[266] Fix | Delete
$event_data = array(
[267] Fix | Delete
"user" => $user,
[268] Fix | Delete
);
[269] Fix | Delete
$this->add_activity($event_data);
[270] Fix | Delete
}
[271] Fix | Delete
[272] Fix | Delete
function user_update_handler($user_id, $old_userdata) {
[273] Fix | Delete
$new_userdata = $this->get_user($user_id);
[274] Fix | Delete
$event_data = array(
[275] Fix | Delete
"old_user" => $this->get_user($old_userdata->ID),
[276] Fix | Delete
"user" => $new_userdata,
[277] Fix | Delete
);
[278] Fix | Delete
$this->add_activity($event_data);
[279] Fix | Delete
}
[280] Fix | Delete
[281] Fix | Delete
function plugin_action_handler($plugin) {
[282] Fix | Delete
$event_data = array("plugin" => $plugin);
[283] Fix | Delete
$this->add_activity($event_data);
[284] Fix | Delete
}
[285] Fix | Delete
[286] Fix | Delete
function theme_action_handler($theme_name) {
[287] Fix | Delete
$event_data = array("theme" => $theme_name);
[288] Fix | Delete
$this->add_activity($event_data);
[289] Fix | Delete
}
[290] Fix | Delete
[291] Fix | Delete
function mu_handler($blog_id) {
[292] Fix | Delete
$blog = $this->get_blog($blog_id);
[293] Fix | Delete
$event_data = array(
[294] Fix | Delete
"blog" => $blog
[295] Fix | Delete
);
[296] Fix | Delete
$this->add_activity($event_data);
[297] Fix | Delete
}
[298] Fix | Delete
[299] Fix | Delete
function mu_site_handler($blog) {
[300] Fix | Delete
$event_data = array(
[301] Fix | Delete
"blog" => $this->get_blog($blog->blog_id)
[302] Fix | Delete
);
[303] Fix | Delete
$this->add_activity($event_data);
[304] Fix | Delete
}
[305] Fix | Delete
[306] Fix | Delete
function woocommerce_attribute_created_handler($attribute_id, $attribute_data) {
[307] Fix | Delete
$event_data = array(
[308] Fix | Delete
"attribute" => $this->wc_get_attribute($attribute_id, $attribute_data)
[309] Fix | Delete
);
[310] Fix | Delete
$this->add_activity($event_data);
[311] Fix | Delete
}
[312] Fix | Delete
[313] Fix | Delete
function woocommerce_attribute_handler($attribute_id) {
[314] Fix | Delete
$event_data = array(
[315] Fix | Delete
"attribute" => $this->wc_get_attribute($attribute_id)
[316] Fix | Delete
);
[317] Fix | Delete
$this->add_activity($event_data);
[318] Fix | Delete
}
[319] Fix | Delete
[320] Fix | Delete
function woocommerce_tax_rate_handler($tax_rate_id, $tax_rate) {
[321] Fix | Delete
$event_data = array(
[322] Fix | Delete
"tax_rate" => $this->wc_get_tax_rate($tax_rate_id, $tax_rate)
[323] Fix | Delete
);
[324] Fix | Delete
$this->add_activity($event_data);
[325] Fix | Delete
}
[326] Fix | Delete
[327] Fix | Delete
function woocommerce_tax_rate_deleted_handler($tax_rate_id) {
[328] Fix | Delete
$event_data = array(
[329] Fix | Delete
"tax_rate" => array("id" => $tax_rate_id)
[330] Fix | Delete
);
[331] Fix | Delete
$this->add_activity($event_data);
[332] Fix | Delete
}
[333] Fix | Delete
[334] Fix | Delete
function woocommerce_grant_product_download_access_handler($data) {
[335] Fix | Delete
$event_data = array(
[336] Fix | Delete
"download_id" => $data['download_id'],
[337] Fix | Delete
"user_id" => $data['user_id'],
[338] Fix | Delete
"order_id" => $data['order_id'],
[339] Fix | Delete
"product_id" => $data['product_id']
[340] Fix | Delete
);
[341] Fix | Delete
$this->add_activity($event_data);
[342] Fix | Delete
}
[343] Fix | Delete
[344] Fix | Delete
function woocommerce_revoke_access_to_product_download_handler($download_id, $product_id, $order_id) {
[345] Fix | Delete
$event_data = array(
[346] Fix | Delete
"download_id" => $download_id,
[347] Fix | Delete
"product_id" => $product_id,
[348] Fix | Delete
"order_id" => $order_id
[349] Fix | Delete
);
[350] Fix | Delete
$this->add_activity($event_data);
[351] Fix | Delete
}
[352] Fix | Delete
[353] Fix | Delete
function woocommerce_shipping_zone_method_handler($instance_id, $method_id, $zone_id) {
[354] Fix | Delete
$event_data = array(
[355] Fix | Delete
"instance_id" => absint ($instance_id),
[356] Fix | Delete
"method_id" => $method_id,
[357] Fix | Delete
"zone_id" => $zone_id
[358] Fix | Delete
);
[359] Fix | Delete
$this->add_activity($event_data);
[360] Fix | Delete
}
[361] Fix | Delete
[362] Fix | Delete
function get_plugin_update_data($plugins) {
[363] Fix | Delete
$data = array();
[364] Fix | Delete
if (!empty($plugins) && defined('WP_PLUGIN_DIR')) {
[365] Fix | Delete
foreach ($plugins as $plugin) {
[366] Fix | Delete
$plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin);
[367] Fix | Delete
$install_data = array('title' => $plugin_data['Name'], 'version' => $plugin_data['Version']);
[368] Fix | Delete
array_push($data, $install_data);
[369] Fix | Delete
}
[370] Fix | Delete
}
[371] Fix | Delete
return $data;
[372] Fix | Delete
}
[373] Fix | Delete
[374] Fix | Delete
function get_theme_update_data($themes) {
[375] Fix | Delete
$data = array();
[376] Fix | Delete
if (!empty($themes)) {
[377] Fix | Delete
foreach ($themes as $theme) {
[378] Fix | Delete
$theme_data = wp_get_theme($theme);
[379] Fix | Delete
$install_data = array('title' => $theme_data['Name'], 'version' => $theme_data['Version']);
[380] Fix | Delete
array_push($data, $install_data);
[381] Fix | Delete
}
[382] Fix | Delete
}
[383] Fix | Delete
return $data;
[384] Fix | Delete
}
[385] Fix | Delete
[386] Fix | Delete
function get_plugin_install_data($upgrader) {
[387] Fix | Delete
$data = array();
[388] Fix | Delete
if ($upgrader->bulk != "1") {
[389] Fix | Delete
$plugin_data = $upgrader->new_plugin_data;
[390] Fix | Delete
$install_data = array('title' => $plugin_data['Name'], 'version' => $plugin_data['Version']);
[391] Fix | Delete
array_push($data, $install_data);
[392] Fix | Delete
}
[393] Fix | Delete
return $data;
[394] Fix | Delete
}
[395] Fix | Delete
[396] Fix | Delete
function get_theme_install_data($upgrader) {
[397] Fix | Delete
$data = array();
[398] Fix | Delete
$theme_data = $upgrader->new_theme_data;
[399] Fix | Delete
$install_data = array('title' => $theme_data['Name'], 'version' => $theme_data['Version']);
[400] Fix | Delete
array_push($data, $install_data);
[401] Fix | Delete
return $data;
[402] Fix | Delete
}
[403] Fix | Delete
[404] Fix | Delete
function get_update_data($options) {
[405] Fix | Delete
$event_data = array('action' => 'update');
[406] Fix | Delete
if ($options['type'] === 'plugin') {
[407] Fix | Delete
$event_data['type'] = 'plugin';
[408] Fix | Delete
if (array_key_exists("plugin", $options)) {
[409] Fix | Delete
$options['plugins'] = array($options['plugin']);
[410] Fix | Delete
unset($options['plugin']);
[411] Fix | Delete
}
[412] Fix | Delete
$event_data['plugins'] = $this->get_plugin_update_data($options['plugins']);
[413] Fix | Delete
}
[414] Fix | Delete
else if ($options['type'] === 'theme') {
[415] Fix | Delete
$event_data['type'] = 'theme';
[416] Fix | Delete
if (array_key_exists("theme", $options)) {
[417] Fix | Delete
$options['themes'] = array($options['theme']);
[418] Fix | Delete
unset($options['theme']);
[419] Fix | Delete
}
[420] Fix | Delete
$event_data['themes'] = $this->get_theme_update_data($options['themes']);
[421] Fix | Delete
}
[422] Fix | Delete
return $event_data;
[423] Fix | Delete
}
[424] Fix | Delete
[425] Fix | Delete
function get_install_data($upgrader, $options) {
[426] Fix | Delete
$event_data = array('action' => 'install');
[427] Fix | Delete
if ($options['type'] === 'plugin') {
[428] Fix | Delete
$event_data['type'] = 'plugin';
[429] Fix | Delete
$event_data['plugins'] = $this->get_plugin_install_data($upgrader);
[430] Fix | Delete
}
[431] Fix | Delete
else if ($options['type'] === 'theme') {
[432] Fix | Delete
$event_data['type'] = 'theme';
[433] Fix | Delete
$event_data['themes'] = $this->get_theme_install_data($upgrader);
[434] Fix | Delete
}
[435] Fix | Delete
return $event_data;
[436] Fix | Delete
}
[437] Fix | Delete
[438] Fix | Delete
function upgrade_handler($upgrader, $data) {
[439] Fix | Delete
$event_data = array();
[440] Fix | Delete
if ($data['action'] === 'update') {
[441] Fix | Delete
if ('core' === $data['type']) {
[442] Fix | Delete
return;
[443] Fix | Delete
}
[444] Fix | Delete
$event_data = $this->get_update_data($data);
[445] Fix | Delete
} else if ($data['action'] === 'install') {
[446] Fix | Delete
$event_data = $this->get_install_data($upgrader, $data);
[447] Fix | Delete
}
[448] Fix | Delete
$this->add_activity($event_data);
[449] Fix | Delete
}
[450] Fix | Delete
[451] Fix | Delete
function core_upgrade_handler($new_wp_version) {
[452] Fix | Delete
global $wp_version;
[453] Fix | Delete
$event_data = array();
[454] Fix | Delete
$event_data['type'] = 'core';
[455] Fix | Delete
$event_data['wp_core'] = array('prev_version' => $wp_version, 'new_version' => $new_wp_version);
[456] Fix | Delete
$this->add_activity($event_data);
[457] Fix | Delete
}
[458] Fix | Delete
[459] Fix | Delete
/* ADDING ACTION AND LISTENERS FOR SENSING EVENTS. */
[460] Fix | Delete
public function add_actions_and_listeners() {
[461] Fix | Delete
/* SENSORS FOR POST AND PAGE CHANGES */
[462] Fix | Delete
add_action('pre_post_update', array($this, 'post_handler'));
[463] Fix | Delete
add_action('save_post', array($this, 'post_saved_handler'), 10, 3);
[464] Fix | Delete
add_action('post_stuck', array($this, 'post_handler'));
[465] Fix | Delete
add_action('post_unstuck', array($this, 'post_handler'));
[466] Fix | Delete
add_action('delete_post', array($this, 'post_handler'));
[467] Fix | Delete
[468] Fix | Delete
/* SENSORS FOR COMMENTS */
[469] Fix | Delete
add_action('comment_post', array($this, 'comment_handler'));
[470] Fix | Delete
add_action('edit_comment', array($this, 'comment_handler'));
[471] Fix | Delete
add_action('transition_comment_status', array($this, 'comment_status_changed_handler'), 10, 3);
[472] Fix | Delete
[473] Fix | Delete
/* SENSORS FOR TAG AND CATEGORY CHANGES */
[474] Fix | Delete
add_action('create_term', array($this, 'term_handler'));
[475] Fix | Delete
add_action('pre_delete_term', array($this, 'term_handler'));
[476] Fix | Delete
add_action('delete_term', array($this, 'term_deletion_handler'));
[477] Fix | Delete
add_filter('wp_update_term_data', array($this, 'term_updation_handler'), 10, 2);
[478] Fix | Delete
[479] Fix | Delete
/* SENSORS FOR USER CHANGES*/
[480] Fix | Delete
add_action('user_register', array($this, 'user_handler'));
[481] Fix | Delete
add_action('wpmu_new_user', array($this, 'user_handler'));
[482] Fix | Delete
add_action('profile_update', array($this, 'user_update_handler'), 10, 2);
[483] Fix | Delete
add_action('delete_user', array($this, 'user_handler'));
[484] Fix | Delete
add_action('wpmu_delete_user', array($this, 'user_handler'));
[485] Fix | Delete
[486] Fix | Delete
/* SENSORS FOR PLUGIN AND THEME*/
[487] Fix | Delete
add_action('activate_plugin', array($this, 'plugin_action_handler'));
[488] Fix | Delete
add_action('deactivate_plugin', array($this, 'plugin_action_handler'));
[489] Fix | Delete
add_action('switch_theme', array($this, 'theme_action_handler'));
[490] Fix | Delete
[491] Fix | Delete
/* SENSORS FOR MULTISITE CHANGES */
[492] Fix | Delete
add_action('wp_insert_site', array($this, 'mu_site_handler'));
[493] Fix | Delete
add_action('archive_blog', array($this, 'mu_handler'));
[494] Fix | Delete
add_action('unarchive_blog', array( $this, 'mu_handler'));
[495] Fix | Delete
add_action('activate_blog', array($this, 'mu_handler'));
[496] Fix | Delete
add_action('deactivate_blog', array($this, 'mu_handler'));
[497] Fix | Delete
add_action('wp_delete_site', array($this, 'mu_site_handler'));
[498] Fix | Delete
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function