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/wp-conte.../plugins/wp-smush.../vendor/mixpanel/mixpanel.../lib/Producer...
File: MixpanelGroups.php
<?php
[0] Fix | Delete
require_once(dirname(__FILE__) . "/MixpanelBaseProducer.php");
[1] Fix | Delete
[2] Fix | Delete
/**
[3] Fix | Delete
* Provides an API to create/update group profiles on Mixpanel
[4] Fix | Delete
*/
[5] Fix | Delete
class Producers_MixpanelGroups extends Producers_MixpanelBaseProducer {
[6] Fix | Delete
[7] Fix | Delete
/**
[8] Fix | Delete
* Internal method to prepare a message given the message data
[9] Fix | Delete
* @param $group_key
[10] Fix | Delete
* @param $group_id
[11] Fix | Delete
* @param $operation
[12] Fix | Delete
* @param $value
[13] Fix | Delete
* @param boolean $ignore_time If the $ignore_time property is true, Mixpanel will not automatically update the "Last Seen" property of the group Profile. Otherwise, Mixpanel will add a "Last Seen" property associated with the current time
[14] Fix | Delete
* @return array
[15] Fix | Delete
*/
[16] Fix | Delete
private function _constructPayload($group_key, $group_id, $operation, $value, $ignore_time = false) {
[17] Fix | Delete
$payload = array(
[18] Fix | Delete
'$token' => $this->_token,
[19] Fix | Delete
'$group_key' => $group_key,
[20] Fix | Delete
'$group_id' => $group_id,
[21] Fix | Delete
'$time' => microtime(true),
[22] Fix | Delete
$operation => $value
[23] Fix | Delete
);
[24] Fix | Delete
if ($ignore_time === true) $payload['$ignore_time'] = true;
[25] Fix | Delete
return $payload;
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
/**
[29] Fix | Delete
* Set properties on a group profile. If the group profile does not exist, it creates it with these properties.
[30] Fix | Delete
* If it does exist, it sets the properties to these values, overwriting existing values.
[31] Fix | Delete
* @param string|int $group_key the group_key used for groups in Project Settings
[32] Fix | Delete
* @param string|int $group_id the group id used for the group profile
[33] Fix | Delete
* @param array $props associative array of properties to set on the group profile
[34] Fix | Delete
* @param boolean $ignore_time If the $ignore_time property is true, Mixpanel will not automatically update the "Last Seen" property of the group profile. Otherwise, Mixpanel will add a "Last Seen" property associated with the current time
[35] Fix | Delete
*/
[36] Fix | Delete
public function set($group_key, $group_id, $props, $ignore_time = false) {
[37] Fix | Delete
$payload = $this->_constructPayload($group_key, $group_id, '$set', $props, $ignore_time);
[38] Fix | Delete
$this->enqueue($payload);
[39] Fix | Delete
}
[40] Fix | Delete
[41] Fix | Delete
/**
[42] Fix | Delete
* Set properties on a group profile. If the Group profile does not exist, it creates it with these properties.
[43] Fix | Delete
* If it does exist, it sets the properties to these values but WILL NOT overwrite existing values.
[44] Fix | Delete
* @param string|int $group_key the group_key used for groups in Project Settings
[45] Fix | Delete
* @param string|int $group_id the group id used for the group profile
[46] Fix | Delete
* @param array $props associative array of properties to set on the group profile
[47] Fix | Delete
* @param boolean $ignore_time If the $ignore_time property is true, Mixpanel will not automatically update the "Last Seen" property of the group profile. Otherwise, Mixpanel will add a "Last Seen" property associated with the current time
[48] Fix | Delete
*/
[49] Fix | Delete
public function setOnce($group_key, $group_id, $props, $ignore_time = false) {
[50] Fix | Delete
$payload = $this->_constructPayload($group_key, $group_id, '$set_once', $props, $ignore_time);
[51] Fix | Delete
$this->enqueue($payload);
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
/**
[55] Fix | Delete
* Unset properties on a group profile. If the group does not exist, it creates it with no properties.
[56] Fix | Delete
* If it does exist, it unsets these properties. NOTE: In other libraries we use 'unset' which is
[57] Fix | Delete
* a reserved word in PHP.
[58] Fix | Delete
* @param string|int $group_key the group_key used for groups in Project Settings
[59] Fix | Delete
* @param string|int $group_id the group id used for the group profile
[60] Fix | Delete
* @param array $props associative array of properties to unset on the group profile
[61] Fix | Delete
* @param boolean $ignore_time If the $ignore_time property is true, Mixpanel will not automatically update the "Last Seen" property of the group profile. Otherwise, Mixpanel will add a "Last Seen" property associated with the current time
[62] Fix | Delete
*/
[63] Fix | Delete
public function remove($group_key, $group_id, $props, $ignore_time = false) {
[64] Fix | Delete
$payload = $this->_constructPayload($group_key, $group_id, '$remove', $props, $ignore_time);
[65] Fix | Delete
$this->enqueue($payload);
[66] Fix | Delete
}
[67] Fix | Delete
[68] Fix | Delete
/**
[69] Fix | Delete
* Adds $val to a list located at $prop. If the property does not exist, it will be created. If $val is a string
[70] Fix | Delete
* and the list is empty or does not exist, a new list with one value will be created.
[71] Fix | Delete
* @param string|int $group_key the group_key used for groups in Project Settings
[72] Fix | Delete
* @param string|int $group_id the group id used for the group profile
[73] Fix | Delete
* @param string $prop the property that holds the list
[74] Fix | Delete
* @param string|array $val items to add to the list
[75] Fix | Delete
* @param boolean $ignore_time If the $ignore_time property is true, Mixpanel will not automatically update the "Last Seen" property of the group profile. Otherwise, Mixpanel will add a "Last Seen" property associated with the current time
[76] Fix | Delete
*/
[77] Fix | Delete
public function union($group_key, $group_id, $prop, $val, $ignore_time = false) {
[78] Fix | Delete
$payload = $this->_constructPayload($group_key, $group_id, '$union', array("$prop" => $val), $ignore_time);
[79] Fix | Delete
$this->enqueue($payload);
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
/**
[83] Fix | Delete
* Delete this group profile from Mixpanel
[84] Fix | Delete
* @param string|int $group_key the group_key used for groups in Project Settings
[85] Fix | Delete
* @param string|int $group_id the group id used for the group profile
[86] Fix | Delete
* @param boolean $ignore_time If the $ignore_time property is true, Mixpanel will not automatically update the "Last Seen" property of the profile. Otherwise, Mixpanel will add a "Last Seen" property associated with the current time
[87] Fix | Delete
*/
[88] Fix | Delete
public function deleteGroup($group_key, $group_id, $ignore_time = false) {
[89] Fix | Delete
$payload = $this->_constructPayload($group_key, $group_id, '$delete', "", $ignore_time);
[90] Fix | Delete
$this->enqueue($payload);
[91] Fix | Delete
}
[92] Fix | Delete
[93] Fix | Delete
/**
[94] Fix | Delete
* Returns the "groups" endpoint
[95] Fix | Delete
* @return string
[96] Fix | Delete
*/
[97] Fix | Delete
function _getEndpoint() {
[98] Fix | Delete
return $this->_options['groups_endpoint'];
[99] Fix | Delete
}
[100] Fix | Delete
[101] Fix | Delete
}
[102] Fix | Delete
[103] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function