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R",'ST'=>"STP",'SA'=>"SAU",'SN'=>"SEN",'RS'=>"SRB",'SC'=>"SYC",'SL'=>"SLE",'SG'=>"SGP",'SX'=>"SXM",'SK'=>"SVK",'SI'=>"SVN",'SB'=>"SLB",'SO'=>"SOM",'ZA'=>"ZAF",'KR'=>"KOR",'SS'=>"SSD",'ES'=>"ESP",'LK'=>"LKA",'SD'=>"SDN",'SR'=>"SUR",'SJ'=>"SJM",'SZ'=>"SWZ",'SE'=>"SWE",'CH'=>"CHE",'SY'=>"SYR",'TW'=>"TWN",'TJ'=>"TJK",'TZ'=>"TZA",'TH'=>"THA",'TG'=>"TGO",'TK'=>"TKL",'TO'=>"TON",'TT'=>"TTO",'TN'=>"TUN",'TR'=>"TUR",'TM'=>"TKM",'TC'=>"TCA",'TV'=>"TUV",'VI'=>"VIR",'UG'=>"UGA",'UA'=>"UKR",'AE'=>"ARE",'GB'=>"GB",'US'=>"US",'UY'=>"URY",'UZ'=>"UZB",'VU'=>"VUT",'VA'=>"VAT",'VE'=>"VEN",'VN'=>"VNM",'WF'=>"WLF",'EH'=>"ESH",'YE'=>"YEM",'ZM'=>"ZMB",'ZW'=>"ZWE"); return isset($country_codes[$code])?$country_codes[$code]:$code; } public function adsforwp_visitor_condition_add_meta_box() { global $post; $in_group = array(); if ( is_object( $post ) ) { $common_function_obj = new Adsforwp_Admin_Common_Functions(); $in_group = $common_function_obj->adsforwp_check_ads_in_group( $post->ID ); } if ( empty( $in_group ) ) { add_meta_box( 'adsforwp_visitor_condition_metabox', esc_html__( 'User Targeting', 'ads-for-wp' ), array( $this, 'adsforwp_visitor_condition_callback' ), array( 'adsforwp', 'adsforwp-groups' ), 'normal', 'low' ); } } public function adsforwp_visitor_condition_callback( $post ) { $visitor_condition_enable = get_post_meta( $post->ID, $key = 'adsforwp_v_condition_enable', true ); $visitor_conditions_array = get_post_meta( $post->ID, 'visitor_conditions_array', true ) ; $visitor_conditions_array = is_array( $visitor_conditions_array ) ? array_values( $visitor_conditions_array ) : array(); if ( empty( $visitor_conditions_array ) ) { $visitor_conditions_array[0] = array( 'visitor_conditions' => array( array( 'key_1' => 'device', 'key_2' => 'equal', 'key_3' => 'desktop', ), ), ); } // security check wp_nonce_field( 'adsforwp_visitor_condition_action_nonce', 'adsforwp_visitor_condition_name_nonce' ); // Type Select $choices = array( esc_html__( 'Basic', 'ads-for-wp' ) => array( 'device' => esc_html__( 'Device Type', 'ads-for-wp' ), 'browser_language' => esc_html__( 'Language Of The Browser', 'ads-for-wp' ), 'logged_in_visitor' => esc_html__( 'Logged In', 'ads-for-wp' ), 'user_agent' => esc_html__( 'User Agent', 'ads-for-wp' ), 'user_type' => esc_html__( 'User Permission', 'ads-for-wp' ), 'referrer_url' => esc_html__( 'Referring URL', 'ads-for-wp' ), 'url_parameter' => esc_html__( 'URL Parameter', 'ads-for-wp' ), 'geo_location' => esc_html__( 'Country', 'ads-for-wp' ), 'cookie' => esc_html__( 'Cookie', 'ads-for-wp' ), 'browser_width' => esc_html__( 'Browser Width', 'ads-for-wp' ), ), ); if ( defined( 'PMPRO_BASE_FILE' ) ) { $choices['Basic']['membership_level'] = esc_html__( 'Membership Level', 'ads-for-wp' ); } $comparison = array( 'equal' => esc_html__( 'Equal to', 'ads-for-wp' ), 'not_equal' => esc_html__( 'Not Equal to', 'ads-for-wp' ), ); $total_group_fields = count( $visitor_conditions_array ); ?>
'; } else { echo '
' . esc_html__( 'User Targeting', 'ads-for-wp' ) . ''; echo '

' . esc_html__( 'User Targeting conditions to limit the number of users who can see your ad.', 'ads-for-wp' ) . '

'; echo '
'; } ?>
0 ) { echo 'Or'; } ?>
adsforwp_comparision_condition_type_values( $selected_val_key_1, $selected_val_key_2, $selected_val_key_4, $selected_val_key_5, $i, $j ); ?>
adsforwp_visitor_condition_type_values( $selected_val_key_1, $selected_val_key_3, $selected_val_key_4, $selected_val_key_5, $i, $j ); ?>
ID, 'visitor_conditions_array', true ); if ( is_array( $visitor_conditions_array ) && ! empty( $visitor_conditions_array ) ) { foreach ( $visitor_conditions_array as $key => $value ) { foreach ( $value as $gkey => $gvalue ) { foreach ( $gvalue as $hkey => $hvalue ) { if ( $hvalue['key_1'] == 'device' ) { $user_target_type = 1; break; } } } } } $message = ''; if ( function_exists( 'wpsc_init' ) ) { global $wp_cache_mobile_enabled; if ( ! $wp_cache_mobile_enabled ) { $afwp_cache_mobile_support = 1; $message = "You are using WP Super Cache plugin, if you want User Targeting for 'Device Type' to work perfectly we recommend you to enable Mobile Support of your cache plugin."; } } elseif ( defined( 'WP_ROCKET_FILE' ) ) { $wp_rocket_option = get_option( 'wp_rocket_settings' ); if ( ! $wp_rocket_option['cache_mobile'] || ! $wp_rocket_option['do_caching_mobile_files'] ) { $afwp_cache_mobile_support = 1; $message = "You are using WP Rocket Cache plugin, if you want User Targeting for 'Device Type' to work perfectly we recommend you to enable Mobile Support of your cache plugin."; } } elseif ( defined( 'W3TC_FILE' ) ) { $afwp_cache_mobile_support = 1; $message = "You are using WP3 Total Cache plugin, if you want User Targeting for 'Device Type' to work perfectly we recommend you to enable Mobile Support of your cache plugin."; } $visitor_condition_enable = get_post_meta( $post->ID, $key = 'adsforwp_v_condition_enable', true ); if ( isset( $visitor_condition_enable ) && $visitor_condition_enable == 'enable' ) { if ( $user_target_type == 1 && $afwp_cache_mobile_support == 1 ) { ?>

Warning:

adsforwp_get_client_ip(); $ipdat = wp_remote_get( 'http://www.geoplugin.net/json.gp?ip=' . $ip ); if ( ! is_wp_error( $ipdat ) && wp_remote_retrieve_response_code( $ipdat ) === 200 ) { $body = wp_remote_retrieve_body( $ipdat ); $ipdat = json_decode( $body ); if ( $ipdat !== null ) { $country_code = $ipdat->geoplugin_countryCode; $country_code = $this->adsforwp_get_three_letter_country_code_using_two($country_code); } } return $country_code; } public function adsforwp_visitor_condition_logic_checker( $input ) { global $post; $type = $comparison = $data = $result = ''; if ( is_array( $input ) ) { $type = array_key_exists( 'key_1', $input ) ? $input['key_1'] : ''; $comparison = array_key_exists( 'key_2', $input ) ? $input['key_2'] : ''; $data = array_key_exists( 'key_3', $input ) ? $input['key_3'] : ''; } // Get all the users registered $user = wp_get_current_user(); switch ( $type ) { case 'device': require_once ADSFORWP_PLUGIN_DIR . '/vendor/class-adsforwp-mobile-detect.php'; $mobile_detect = $isTablet = ''; // instantiate the Mobile detect class $mobile_detect = new Adsforwp_Mobile_Detect(); $isMobile = $mobile_detect->isMobile(); $isTablet = $mobile_detect->isTablet(); $device_name = 'desktop'; if ( $isMobile && $isTablet ) { // Only For tablet $device_name = 'mobile'; } elseif ( $isMobile && ! $isTablet ) { // Only for mobile $device_name = 'mobile'; } if ( $comparison == 'equal' ) { if ( $device_name == $data ) { $result = true; } } if ( $comparison == 'not_equal' ) { if ( $device_name != $data ) { $result = true; } } break; case 'referrer_url': // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized --Reason Using it for condition check $referrer_url = isset( $_SERVER['HTTP_REFERER'] ) ? sanitize_url( $_SERVER['HTTP_REFERER'] ) : ''; if ( isset( $input['key_4'] ) && $input['key_3'] == 'url_custom' ) { $data = $input['key_4']; } if ( $comparison == 'equal' ) { if ( $referrer_url == $data ) { $result = true; } } if ( $comparison == 'not_equal' ) { if ( $referrer_url != $data ) { $result = true; } } break; case 'browser_width': $result = true; break; case 'browser_language': // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized --Reason Using it for condition check $browser_language = isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ? substr( $_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2 ) : ''; if ( $comparison == 'equal' ) { if ( $browser_language == $data ) { $result = true; } } if ( $comparison == 'not_equal' ) { if ( $browser_language != $data ) { $result = true; } } break; case 'geo_location': $country_code = ''; $saved_ip = ''; $user_ip = $this->adsforwp_get_client_ip(); $saved_ip_list = array(); if ( isset( $_COOKIE['adsforwp-user-info'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized --Reason Using it for condition check $saved_ip_list = $_COOKIE['adsforwp-user-info']; $saved_ip = trim( base64_decode( $saved_ip_list[0] ) ); } if ( ! empty( $saved_ip_list ) && $saved_ip == $user_ip ) { if ( isset( $saved_ip_list[1] ) ) { $country_code = trim( base64_decode( $saved_ip_list[1] ) ); } } if ( $comparison == 'equal' ) { if($country_code!=""){ if ( $country_code == $data ) { $result = true; } }else{ $country_code = $this->adsfrowp_check_country_code($country_code); if ( $country_code == $data ) { $result = true; } } } if ( $comparison == 'not_equal' ) { if($country_code!=""){ if ( $country_code != $data ) { $result = true; } }else{ $country_code = $this->adsfrowp_check_country_code($country_code); if ( $country_code != $data ) { $result = true; } } } break; case 'url_parameter': // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash --Reason Using it for condition check $url = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_url( $_SERVER['REQUEST_URI'] ) : ''; if ( $comparison == 'equal' ) { if ( strpos( $url, $data ) !== false ) { $result = true; } } if ( $comparison == 'not_equal' ) { if ( strpos( $url, $data ) == false ) { $result = true; } } break; case 'cookie': $cookie_arr = $_COOKIE; if ( $data == '' ) { if ( $comparison == 'equal' ) { if ( isset( $cookie_arr ) ) { $result = true; } } if ( $comparison == 'not_equal' ) { if ( ! isset( $cookie_arr ) ) { $result = true; } } } else { if ( $comparison == 'equal' ) { if ( $cookie_arr ) { foreach ( $cookie_arr as $arr ) { if ( $arr == $data ) { $result = true; break; } } } } if ( $comparison == 'not_equal' ) { if ( isset( $cookie_arr ) ) { foreach ( $cookie_arr as $arr ) { if ( $arr != $data ) { $result = true; break; } } } } } break; case 'logged_in_visitor': if ( is_user_logged_in() ) { $status = 'true'; } else { $status = 'false'; } if ( $comparison == 'equal' ) { if ( $status == $data ) { $result = true; } } if ( $comparison == 'not_equal' ) { if ( $status != $data ) { $result = true; } } break; case 'user_agent': $user_agent_name = $this->adsforwp_detect_user_agent(); if ( isset( $input['key_5'] ) && $input['key_3'] == 'user_agent_custom' ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason Using it for condition check if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && stripos( $_SERVER['HTTP_USER_AGENT'], $input['key_5'] ) ) { $user_agent_name = $input['key_5']; } $data = $input['key_5']; } if ( $comparison == 'equal' ) { if ( $user_agent_name == $data ) { $result = true; } } if ( $comparison == 'not_equal' ) { if ( $user_agent_name != $data ) { $result = true; } } break; case 'user_type': if ( $comparison == 'equal' ) { if ( in_array( $data, (array) $user->roles ) ) { $result = true; } } if ( $comparison == 'not_equal' ) { require_once ABSPATH . 'wp-admin/includes/user.php'; // Get all the registered user roles $roles = get_editable_roles(); $all_user_types = array(); foreach ( $roles as $key => $value ) { $all_user_types[] = $key; } // Flip the array so we can remove the user that is selected from the dropdown $all_user_types = array_flip( $all_user_types ); // User Removed unset( $all_user_types[ $data ] ); // Check and make the result true that user is not found if ( in_array( $data, (array) $all_user_types ) ) { $result = true; } } break; case 'membership_level': if ( $comparison == 'equal' ) { if ( isset( $user->membership_level ) && function_exists( 'pmpro_getAllLevels' ) ) { if ( in_array( $data, (array) $user->membership_level->id ) ) { $result = true; } } } if ( $comparison == 'not_equal' ) { require_once ABSPATH . 'wp-admin/includes/user.php'; // Get all the registered user roles if ( function_exists( 'pmpro_getAllLevels' ) ) { $all_pmpro_levels = pmpro_getAllLevels( false, true ); $all_level_types = array(); foreach ( $all_pmpro_levels as $key => $value ) { $all_level_types[] = $value->id; } // Flip the array so we can remove the user that is selected from the dropdown $all_level_types = array_flip( $all_level_types ); // User Removed unset( $all_level_types[ $data ] ); // Check and make the result true that user is not found if ( in_array( $data, (array) $all_level_types ) ) { $result = true; } } } break; default: $result = false; break; } return $result; } public function adsforwp_detect_user_agent() { $user_agent_name = 'others'; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason Using it for condition check $server_user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : ''; if ( strpos( $server_user_agent, 'Opera' ) || strpos( $user_agent, 'OPR/' ) ) { $user_agent_name = 'opera'; } elseif ( strpos( $server_user_agent, 'Edge' ) ) { $user_agent_name = 'edge'; } elseif ( strpos( $server_user_agent, 'Firefox' ) ) { $user_agent_name = 'firefox'; } elseif ( strpos( $server_user_agent, 'MSIE' ) || strpos( $user_agent, 'Trident/7' ) ) { $user_agent_name = 'internet_explorer'; } elseif ( stripos( $server_user_agent, 'iPod' ) ) { $user_agent_name = 'ipod'; } elseif ( stripos( $server_user_agent, 'iPhone' ) ) { $user_agent_name = 'iphone'; } elseif ( stripos( $server_user_agent, 'iPad' ) ) { $user_agent_name = 'ipad'; } elseif ( stripos( $server_user_agent, 'Android' ) ) { $user_agent_name = 'android'; } elseif ( stripos( $server_user_agent, 'webOS' ) ) { $user_agent_name = 'webos'; } elseif ( strpos( $server_user_agent, 'Chrome' ) ) { $user_agent_name = 'chrome'; } elseif ( strpos( $server_user_agent, 'Safari' ) ) { $user_agent_name = 'safari'; } return $user_agent_name; } public function adsforwp_visitor_condition_field_data( $post_id ) { $visitor_conditions_array = get_post_meta( $post_id, 'visitor_conditions_array', true ); $output = array(); if ( $visitor_conditions_array ) { foreach ( $visitor_conditions_array as $gropu ) { $output[] = array_map( array( $this, 'adsforwp_visitor_condition_logic_checker' ), $gropu['visitor_conditions'] ); } } return $output; } public function adsforwp_visitor_conditions_status( $post_id ) { $unique_checker = ''; $visitor_condition_enable = get_post_meta( $post_id, $key = 'adsforwp_v_condition_enable', true ); if ( isset( $visitor_condition_enable ) && $visitor_condition_enable == 'enable' ) { $resultset = $this->adsforwp_visitor_condition_field_data( $post_id ); if ( $resultset ) { $condition_array = array(); foreach ( $resultset as $result ) { $data = array_filter( $result ); $number_of_fields = count( $data ); $checker = 0; if ( $number_of_fields > 0 ) { $checker = count( array_unique( $data ) ); $array_is_false = in_array( false, $result ); if ( $array_is_false ) { $checker = 0; } } $condition_array[] = $checker; } $array_is_true = in_array( true, $condition_array ); if ( $array_is_true ) { $unique_checker = 1; } } else { $unique_checker = 'notset'; } } else { $unique_checker = 1; } return $unique_checker; } // Function to get the client IP address public function adsforwp_get_client_ip() { $ipaddress = ''; if ( isset( $_SERVER['HTTP_CLIENT_IP'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason Just using it for condition check $ipaddress = $_SERVER['HTTP_CLIENT_IP']; } elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason Just using it for condition check $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']; } elseif ( isset( $_SERVER['HTTP_X_FORWARDED'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason Just using it for condition check $ipaddress = $_SERVER['HTTP_X_FORWARDED']; } elseif ( isset( $_SERVER['HTTP_FORWARDED_FOR'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason Just using it for condition check $ipaddress = $_SERVER['HTTP_FORWARDED_FOR']; } elseif ( isset( $_SERVER['HTTP_FORWARDED'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason Just using it for condition check $ipaddress = $_SERVER['HTTP_FORWARDED']; } elseif ( isset( $_SERVER['REMOTE_ADDR'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason Just using it for condition check $ipaddress = $_SERVER['REMOTE_ADDR']; } else { $ipaddress = 'UNKNOWN'; } return $ipaddress; } } if ( class_exists( 'Adsforwp_View_Visitor_Condition' ) ) { new Adsforwp_View_Visitor_Condition(); }