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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/popup-bu.../com/classes
File: PopupChecker.php
}
[500] Fix | Delete
/**
[501] Fix | Delete
* Divide target data to Permissive and Forbidden
[502] Fix | Delete
*
[503] Fix | Delete
* @since 1.0.0
[504] Fix | Delete
*
[505] Fix | Delete
* @return array $popupTargetData
[506] Fix | Delete
*
[507] Fix | Delete
*/
[508] Fix | Delete
public function divideTargetData()
[509] Fix | Delete
{
[510] Fix | Delete
$popup = $this->getPopup();
[511] Fix | Delete
$targetData = $popup->getTarget();
[512] Fix | Delete
return $this->divideIntoPermissiveAndForbidden($targetData);
[513] Fix | Delete
}
[514] Fix | Delete
[515] Fix | Delete
/**
[516] Fix | Delete
* Divide the Popup target data into Permissive And Forbidden assoc array
[517] Fix | Delete
*
[518] Fix | Delete
* @since 1.0.0
[519] Fix | Delete
*
[520] Fix | Delete
* @param array $postMetaData popup saved target data
[521] Fix | Delete
*
[522] Fix | Delete
* @return array $postMetaDivideData
[523] Fix | Delete
*
[524] Fix | Delete
*/
[525] Fix | Delete
public function divideIntoPermissiveAndForbidden($targetData)
[526] Fix | Delete
{
[527] Fix | Delete
$permissive = array();
[528] Fix | Delete
$forbidden = array();
[529] Fix | Delete
$permissiveOperators = array('==');
[530] Fix | Delete
$forbiddenOperators = array('!=');
[531] Fix | Delete
$permissiveOperators = apply_filters('sgpbAdditionalPermissiveOperators', $permissiveOperators);
[532] Fix | Delete
$forbiddenOperators = apply_filters('sgpbAdditionalForbiddenOperators', $forbiddenOperators);
[533] Fix | Delete
if (!empty($targetData)) {
[534] Fix | Delete
foreach ($targetData as $data) {
[535] Fix | Delete
if (empty($data['operator']) && $data['param'] != 'everywhere' && !strpos($data['param'], '_all') && $data['param'] != 'post_tags') {
[536] Fix | Delete
break;
[537] Fix | Delete
}
[538] Fix | Delete
// set by default '==' (is) value for all not specific conditions like all pages/posts/other_custom_post_types for future correct detection
[539] Fix | Delete
if ($data['param'] == 'everywhere' || strpos($data['param'], '_all') || $data['param'] == 'post_tags') {
[540] Fix | Delete
$data['operator'] = '==';
[541] Fix | Delete
}
[542] Fix | Delete
if ((isset($data['operator']) && in_array($data['operator'], $permissiveOperators))) {
[543] Fix | Delete
$permissive[] = $data;
[544] Fix | Delete
}
[545] Fix | Delete
else if (in_array($data['operator'], $forbiddenOperators)) {
[546] Fix | Delete
$forbidden[] = $data;
[547] Fix | Delete
}
[548] Fix | Delete
}
[549] Fix | Delete
}
[550] Fix | Delete
[551] Fix | Delete
$postMetaDivideData = array(
[552] Fix | Delete
'permissive' => $permissive,
[553] Fix | Delete
'forbidden' => $forbidden
[554] Fix | Delete
);
[555] Fix | Delete
[556] Fix | Delete
return $postMetaDivideData;
[557] Fix | Delete
}
[558] Fix | Delete
[559] Fix | Delete
/**
[560] Fix | Delete
* Get custom inserted data
[561] Fix | Delete
*
[562] Fix | Delete
* @since 1.0.0
[563] Fix | Delete
*
[564] Fix | Delete
* @return array $insertedData
[565] Fix | Delete
*/
[566] Fix | Delete
public function getCustomInsertedData()
[567] Fix | Delete
{
[568] Fix | Delete
$post = $this->getPost();
[569] Fix | Delete
$insertedData = array();
[570] Fix | Delete
[571] Fix | Delete
if (isset($post)) {
[572] Fix | Delete
$insertedData = SGPopup::getCustomInsertedDataByPostId($this->getPost()->ID);
[573] Fix | Delete
}
[574] Fix | Delete
[575] Fix | Delete
return $insertedData;
[576] Fix | Delete
}
[577] Fix | Delete
[578] Fix | Delete
/**
[579] Fix | Delete
* Check Popup conditions
[580] Fix | Delete
*
[581] Fix | Delete
* @since 1.0.0
[582] Fix | Delete
*
[583] Fix | Delete
* @return array
[584] Fix | Delete
*
[585] Fix | Delete
*/
[586] Fix | Delete
private function isSatisfyForOtherConditions()
[587] Fix | Delete
{
[588] Fix | Delete
$popup = $this->getPopup();
[589] Fix | Delete
$popupOptions = $popup->getOptions();
[590] Fix | Delete
$popupId = $popup->getId();
[591] Fix | Delete
[592] Fix | Delete
$dontAlowOpenPopup = apply_filters('sgpbOtherConditions', array('id' => $popupId, 'popupOptions' => $popupOptions, 'popupObj' => $popup));
[593] Fix | Delete
[594] Fix | Delete
return $dontAlowOpenPopup['status'];
[595] Fix | Delete
}
[596] Fix | Delete
[597] Fix | Delete
public static function checkUserStatus($savedStatus)
[598] Fix | Delete
{
[599] Fix | Delete
$equalStatus = true;
[600] Fix | Delete
[601] Fix | Delete
/*When current user status and saved options does not matched popup must not open*/
[602] Fix | Delete
if (is_user_logged_in() != (int)$savedStatus) {
[603] Fix | Delete
$equalStatus = false;
[604] Fix | Delete
}
[605] Fix | Delete
[606] Fix | Delete
return $equalStatus;
[607] Fix | Delete
}
[608] Fix | Delete
[609] Fix | Delete
public static function checkLanguage($popupLanguage = '')
[610] Fix | Delete
{
[611] Fix | Delete
global $post;
[612] Fix | Delete
[613] Fix | Delete
$postId = $post->ID;
[614] Fix | Delete
if (!function_exists('wpml_get_language_information')) {
[615] Fix | Delete
return true;
[616] Fix | Delete
}
[617] Fix | Delete
$postLanguage = wpml_get_language_information($postId);
[618] Fix | Delete
if (is_wp_error($postLanguage)) {
[619] Fix | Delete
return true;
[620] Fix | Delete
}
[621] Fix | Delete
if (!empty($_GET['lang']) && (sanitize_text_field($_GET['lang']) == $popupLanguage)) {
[622] Fix | Delete
return true;
[623] Fix | Delete
}
[624] Fix | Delete
if ($postLanguage['language_code'] != $popupLanguage) {
[625] Fix | Delete
return false;
[626] Fix | Delete
}
[627] Fix | Delete
[628] Fix | Delete
return true;
[629] Fix | Delete
}
[630] Fix | Delete
[631] Fix | Delete
public static function checkOtherConditionsActions($args)
[632] Fix | Delete
{
[633] Fix | Delete
if (empty($args['id']) || empty($args['popupOptions'])) {
[634] Fix | Delete
return false;
[635] Fix | Delete
}
[636] Fix | Delete
[637] Fix | Delete
$popupOptions = $args['popupOptions'];
[638] Fix | Delete
[639] Fix | Delete
if (!empty($popupOptions['sgpb-icl_post_language'])) {
[640] Fix | Delete
$languageCompatibilty = PopupChecker::checkLanguage($popupOptions['sgpb-icl_post_language']);
[641] Fix | Delete
[642] Fix | Delete
if ($languageCompatibilty === false) {
[643] Fix | Delete
return $languageCompatibilty;
[644] Fix | Delete
}
[645] Fix | Delete
}
[646] Fix | Delete
[647] Fix | Delete
[648] Fix | Delete
// proStartSilver
[649] Fix | Delete
//User status check
[650] Fix | Delete
if (!empty($popupOptions['sgpb-user-status'])) {
[651] Fix | Delete
$restrictUserStatus = PopupChecker::checkUserStatus($popupOptions['sgpb-loggedin-user']);
[652] Fix | Delete
[653] Fix | Delete
if ($restrictUserStatus === false) {
[654] Fix | Delete
return $restrictUserStatus;
[655] Fix | Delete
}
[656] Fix | Delete
}
[657] Fix | Delete
[658] Fix | Delete
// proEndSilver
[659] Fix | Delete
[660] Fix | Delete
// proStartPlatinum
[661] Fix | Delete
// proEndPlatinum
[662] Fix | Delete
[663] Fix | Delete
// checking by popup type
[664] Fix | Delete
if (!empty($popupOptions['sgpb-type'])) {
[665] Fix | Delete
$popupClassName = SGPopup::getPopupClassNameFormType($popupOptions['sgpb-type']);
[666] Fix | Delete
$popupClassName = __NAMESPACE__.'\\'.$popupClassName;
[667] Fix | Delete
[668] Fix | Delete
if (method_exists($popupClassName, 'allowToOpen')) {
[669] Fix | Delete
$allowToOpen = $popupClassName::allowToOpen($popupOptions, $args);
[670] Fix | Delete
return $allowToOpen;
[671] Fix | Delete
}
[672] Fix | Delete
}
[673] Fix | Delete
[674] Fix | Delete
return apply_filters('checkOtherConditions', true);
[675] Fix | Delete
}
[676] Fix | Delete
}
[677] Fix | Delete
[678] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function