← All changes
|
includes/admin/views/html-admin-matching-properties.php
+93
-30
2.2.4
→
2.3.1
View file →
| @@ -12,18 +12,24 @@ | ||
| 12 | 12 | |
| 13 | 13 | <div id="poststuff"> |
| 14 | 14 | |
| 15 | 15 | <?php |
| 16 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 16 | 17 | $percentage_lower = get_option( 'propertyhive_applicant_match_price_range_percentage_lower', '' ); |
| 18 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 17 | 19 | $percentage_higher = get_option( 'propertyhive_applicant_match_price_range_percentage_higher', '' ); |
| 18 | 20 | |
| 21 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 19 | 22 | $currency = '£'; |
| 20 | 23 | if ( isset($applicant_profile['currency']) && !empty($applicant_profile['currency']) ) |
| 21 | 24 | { |
| 25 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 22 | 26 | $PH_Countries = new PH_Countries(); |
| 27 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 23 | 28 | $selected_currency = $PH_Countries->get_currency($applicant_profile['currency']); |
| 24 | 29 | if ( $selected_currency !== false ) |
| 25 | 30 | { |
| 31 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 26 | 32 | $currency = $selected_currency['currency_symbol']; |
| 27 | 33 | } |
| 28 | 34 | } |
| 29 | 35 | |
| @@ -30,8 +36,9 @@ | ||
| 30 | 36 | echo '<div style="background:#F3F3F3; border:1px solid #DDD; padding:20px;"> |
| 31 | 37 | |
| 32 | 38 | <h3 style="padding-top:0; margin-top:0;">' . esc_html( __('Applicant Requirements', 'propertyhive') ) . '</h3>'; |
| 33 | 39 | |
| 40 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 34 | 41 | $requirements = array(); |
| 35 | 42 | |
| 36 | 43 | if ( |
| 37 | 44 | isset($applicant_profile['department']) && |
| @@ -40,11 +47,12 @@ | ||
| 40 | 47 | $applicant_profile['max_price_actual'] != '' && |
| 41 | 48 | $applicant_profile['max_price_actual'] != 0 |
| 42 | 49 | ) |
| 43 | 50 | { |
| 51 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 44 | 52 | $requirements[] = array( |
| 45 | 53 | 'label' => __( 'Maximum Price', 'propertyhive' ), |
| 46 | - 'value' => $currency . ph_display_price_field($applicant_profile['max_price']), | |
| 54 | + 'value' => $currency . esc_html( ph_display_price_field($applicant_profile['max_price']) ), | |
| 47 | 55 | ); |
| 48 | 56 | } |
| 49 | 57 | if ( |
| 50 | 58 | isset($applicant_profile['department']) && |
| @@ -53,9 +61,11 @@ | ||
| 53 | 61 | ) |
| 54 | 62 | { |
| 55 | 63 | if ( $percentage_lower != '' && $percentage_higher != '' ) |
| 56 | 64 | { |
| 65 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 57 | 66 | $match_price_range_lower = ''; |
| 67 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 58 | 68 | $match_price_range_lower_display = ''; |
| 59 | 69 | if ( |
| 60 | 70 | !isset($applicant_profile['match_price_range_lower_actual']) || |
| 61 | 71 | ( isset($applicant_profile['match_price_range_lower_actual']) && $applicant_profile['match_price_range_lower_actual'] == '' ) |
| @@ -62,16 +72,19 @@ | ||
| 62 | 72 | ) |
| 63 | 73 | { |
| 64 | 74 | if ( isset($applicant_profile['max_price']) && $applicant_profile['max_price'] != '' ) |
| 65 | 75 | { |
| 66 | - $match_price_range_lower = $applicant_profile['max_price'] - ( $applicant_profile['max_price'] * ( $percentage_lower / 100 ) ); | |
| 76 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 77 | + $match_price_range_lower = (float) $applicant_profile['max_price'] - ( (float) $applicant_profile['max_price'] * ( (float) $percentage_lower / 100 ) ); | |
| 67 | 78 | } |
| 68 | 79 | } |
| 69 | 80 | else |
| 70 | 81 | { |
| 82 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 71 | 83 | $match_price_range_lower = $applicant_profile['match_price_range_lower']; |
| 72 | 84 | } |
| 73 | 85 | |
| 86 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 74 | 87 | $match_price_range_higher = ''; |
| 75 | 88 | if ( |
| 76 | 89 | !isset($applicant_profile['match_price_range_higher_actual']) || |
| 77 | 90 | ( isset($applicant_profile['match_price_range_higher_actual']) && $applicant_profile['match_price_range_higher_actual'] == '' ) |
| @@ -78,13 +91,15 @@ | ||
| 78 | 91 | ) |
| 79 | 92 | { |
| 80 | 93 | if ( isset($applicant_profile['max_price']) && $applicant_profile['max_price'] != '' ) |
| 81 | 94 | { |
| 82 | - $match_price_range_higher = $applicant_profile['max_price'] + ( $applicant_profile['max_price'] * ( $percentage_higher / 100 ) ); | |
| 95 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 96 | + $match_price_range_higher = (float) $applicant_profile['max_price'] + ( (float) $applicant_profile['max_price'] * ( (float) $percentage_higher / 100 ) ); | |
| 83 | 97 | } |
| 84 | 98 | } |
| 85 | 99 | else |
| 86 | 100 | { |
| 101 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 87 | 102 | $match_price_range_higher = $applicant_profile['match_price_range_higher']; |
| 88 | 103 | } |
| 89 | 104 | |
| 90 | 105 | if ( |
| @@ -90,11 +105,12 @@ | ||
| 90 | 105 | if ( |
| 91 | 106 | $match_price_range_lower != '' && $match_price_range_higher != '' |
| 92 | 107 | ) |
| 93 | 108 | { |
| 109 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 94 | 110 | $requirements[] = array( |
| 95 | 111 | 'label' => __( 'Match Price Range', 'propertyhive' ), |
| 96 | - 'value' => $currency . ph_display_price_field($match_price_range_lower) . ' to ' . $currency . ph_display_price_field($match_price_range_higher), | |
| 112 | + 'value' => $currency . esc_html( ph_display_price_field($match_price_range_lower) ) . ' to ' . $currency . esc_html( ph_display_price_field($match_price_range_higher) ), | |
| 97 | 113 | ); |
| 98 | 114 | } |
| 99 | 115 | } |
| 100 | 116 | } |
| @@ -102,11 +118,12 @@ | ||
| 102 | 118 | isset($applicant_profile['department']) && ( $applicant_profile['department'] == 'residential-lettings' || ph_get_custom_department_based_on($applicant_profile['department']) == 'residential-lettings' ) && |
| 103 | 119 | isset($applicant_profile['max_price_actual']) && $applicant_profile['max_price_actual'] != '' && $applicant_profile['max_price_actual'] != 0 |
| 104 | 120 | ) |
| 105 | 121 | { |
| 122 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 106 | 123 | $requirements[] = array( |
| 107 | 124 | 'label' => __( 'Maximum Rent', 'propertyhive' ), |
| 108 | - 'value' => $currency . ph_display_price_field($applicant_profile['max_rent']) . ' ' . $applicant_profile['rent_frequency'], | |
| 125 | + 'value' => $currency . esc_html( ph_display_price_field($applicant_profile['max_rent']) ) . ' ' . esc_html( $applicant_profile['rent_frequency'] ), | |
| 109 | 126 | ); |
| 110 | 127 | } |
| 111 | 128 | if ( |
| 112 | 129 | isset($applicant_profile['department']) && |
| @@ -119,23 +136,27 @@ | ||
| 119 | 136 | ) |
| 120 | 137 | { |
| 121 | 138 | if ( isset($applicant_profile['min_beds']) && $applicant_profile['min_beds'] != '' && $applicant_profile['min_beds'] != 0 ) |
| 122 | 139 | { |
| 140 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 123 | 141 | $requirements[] = array( |
| 124 | 142 | 'label' => __( 'Minimum Beds', 'propertyhive' ), |
| 125 | - 'value' => $applicant_profile['min_beds'], | |
| 143 | + 'value' => esc_html( $applicant_profile['min_beds'] ), | |
| 126 | 144 | ); |
| 127 | 145 | } |
| 128 | 146 | if ( isset($applicant_profile['property_types']) && is_array($applicant_profile['property_types']) && !empty($applicant_profile['property_types']) ) |
| 129 | 147 | { |
| 130 | - $terms = get_terms('property_type', array('hide_empty' => false, 'fields' => 'names', 'include' => $applicant_profile['property_types'])); | |
| 148 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 149 | + $terms = get_terms( array_merge( wp_parse_args( array('hide_empty' => false, 'fields' => 'names', 'include' => $applicant_profile['property_types']) ), array( 'taxonomy' => 'property_type' ) ) ); | |
| 131 | 150 | if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) |
| 132 | 151 | { |
| 152 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 133 | 153 | $sliced_terms = array_slice( $terms, 0, 2 ); |
| 134 | 154 | |
| 155 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 135 | 156 | $requirements[] = array( |
| 136 | 157 | 'label' => __( 'Property Types', 'propertyhive' ), |
| 137 | - 'value' => implode(", ", $sliced_terms) . ( (count($terms) > 2) ? '<span title="' . addslashes( implode(", ", $terms) ) .'"> + ' . (count($terms) - 2) . ' more</span>' : '' ), | |
| 158 | + 'value' => esc_html( implode(", ", $sliced_terms) ) . ( (count($terms) > 2) ? '<span title="' . esc_attr( implode(", ", $terms) ) .'"> + ' . (count($terms) - 2) . ' more</span>' : '' ), | |
| 138 | 159 | ); |
| 139 | 160 | } |
| 140 | 161 | } |
| 141 | 162 | } |
| @@ -145,18 +166,22 @@ | ||
| 145 | 166 | ) |
| 146 | 167 | { |
| 147 | 168 | if ( isset($applicant_profile['available_as']) && is_array($applicant_profile['available_as']) && !empty($applicant_profile['available_as']) ) |
| 148 | 169 | { |
| 170 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 149 | 171 | $available_as = array(); |
| 150 | 172 | if ( in_array('sale', $applicant_profile['available_as']) ) |
| 151 | 173 | { |
| 174 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 152 | 175 | $available_as[] = 'For Sale'; |
| 153 | 176 | } |
| 154 | 177 | if ( in_array('rent', $applicant_profile['available_as']) ) |
| 155 | 178 | { |
| 179 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 156 | 180 | $available_as[] = 'To Rent'; |
| 157 | 181 | } |
| 158 | 182 | |
| 183 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 159 | 184 | $requirements[] = array( |
| 160 | 185 | 'label' => __( 'Available As', 'propertyhive' ), |
| 161 | 186 | 'value' => implode(", ", $available_as), |
| 162 | 187 | ); |
| @@ -167,33 +192,41 @@ | ||
| 167 | 192 | || |
| 168 | 193 | (isset($applicant_profile['max_floor_area_actual']) && $applicant_profile['max_floor_area_actual'] != '') |
| 169 | 194 | ) |
| 170 | 195 | { |
| 196 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 171 | 197 | $sizes = array('min' => '', 'max' => ''); |
| 198 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 172 | 199 | $value = ''; |
| 173 | 200 | if ( isset($applicant_profile['min_floor_area_actual']) && $applicant_profile['min_floor_area_actual'] != '' ) |
| 174 | 201 | { |
| 202 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 175 | 203 | $sizes['min'] = $applicant_profile['min_floor_area_actual']; |
| 176 | 204 | } |
| 177 | 205 | if ( isset($applicant_profile['max_floor_area_actual']) && $applicant_profile['max_floor_area_actual'] != '' ) |
| 178 | 206 | { |
| 207 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 179 | 208 | $sizes['max'] = $applicant_profile['max_floor_area_actual']; |
| 180 | 209 | } |
| 181 | 210 | if ( $sizes['min'] != '' && $sizes['max'] != '' ) |
| 182 | 211 | { |
| 183 | - $value = number_format($sizes['min']) . ' - ' . number_format($sizes['max']) . ' Sq Ft'; | |
| 212 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 213 | + $value = number_format( (float) $sizes['min'] ) . ' - ' . number_format( (float) $sizes['max'] ) . ' Sq Ft'; | |
| 184 | 214 | } |
| 185 | 215 | if ( $sizes['min'] != '' && $sizes['max'] == '' ) |
| 186 | 216 | { |
| 187 | - $value = 'From ' . number_format($sizes['min']) . ' Sq Ft'; | |
| 217 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 218 | + $value = 'From ' . number_format( (float) $sizes['min'] ) . ' Sq Ft'; | |
| 188 | 219 | } |
| 189 | 220 | if ( $sizes['min'] == '' && $sizes['max'] != '' ) |
| 190 | 221 | { |
| 191 | - $value = 'Up To ' . number_format($sizes['max']) . ' Sq Ft'; | |
| 222 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 223 | + $value = 'Up To ' . number_format( (float) $sizes['max'] ) . ' Sq Ft'; | |
| 192 | 224 | } |
| 193 | 225 | |
| 194 | 226 | if ( $value != '' ) |
| 195 | 227 | { |
| 228 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 196 | 229 | $requirements[] = array( |
| 197 | 230 | 'label' => __( 'Floor Area', 'propertyhive' ), |
| 198 | 231 | 'value' => $value, |
| 199 | 232 | ); |
| @@ -201,16 +234,19 @@ | ||
| 201 | 234 | } |
| 202 | 235 | |
| 203 | 236 | if ( isset($applicant_profile['commercial_property_types']) && is_array($applicant_profile['commercial_property_types']) && !empty($applicant_profile['commercial_property_types']) ) |
| 204 | 237 | { |
| 205 | - $terms = get_terms('commercial_property_type', array('hide_empty' => false, 'fields' => 'names', 'include' => $applicant_profile['commercial_property_types'])); | |
| 238 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 239 | + $terms = get_terms( array_merge( wp_parse_args( array('hide_empty' => false, 'fields' => 'names', 'include' => $applicant_profile['commercial_property_types']) ), array( 'taxonomy' => 'commercial_property_type' ) ) ); | |
| 206 | 240 | if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) |
| 207 | 241 | { |
| 242 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 208 | 243 | $sliced_terms = array_slice( $terms, 0, 2 ); |
| 209 | 244 | |
| 245 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 210 | 246 | $requirements[] = array( |
| 211 | 247 | 'label' => __( 'Property Types', 'propertyhive' ), |
| 212 | - 'value' => implode(", ", $sliced_terms) . ( (count($terms) > 2) ? '<span title="' . addslashes( implode(", ", $terms) ) .'"> + ' . (count($terms) - 2) . ' more</span>' : '' ), | |
| 248 | + 'value' => esc_html( implode(", ", $sliced_terms) ) . ( (count($terms) > 2) ? '<span title="' . esc_attr( implode(", ", $terms) ) .'"> + ' . (count($terms) - 2) . ' more</span>' : '' ), | |
| 213 | 249 | ); |
| 214 | 250 | } |
| 215 | 251 | } |
| 216 | 252 | } |
| @@ -217,16 +253,19 @@ | ||
| 217 | 253 | if ( get_option('propertyhive_applicant_locations_type') != 'text' ) |
| 218 | 254 | { |
| 219 | 255 | if ( isset($applicant_profile['locations']) && is_array($applicant_profile['locations']) && !empty($applicant_profile['locations']) ) |
| 220 | 256 | { |
| 221 | - $terms = get_terms('location', array('hide_empty' => false, 'fields' => 'names', 'include' => $applicant_profile['locations'])); | |
| 257 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 258 | + $terms = get_terms( array_merge( wp_parse_args( array('hide_empty' => false, 'fields' => 'names', 'include' => $applicant_profile['locations']) ), array( 'taxonomy' => 'location' ) ) ); | |
| 222 | 259 | if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) |
| 223 | 260 | { |
| 261 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 224 | 262 | $sliced_terms = array_slice( $terms, 0, 2 ); |
| 225 | 263 | |
| 264 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 226 | 265 | $requirements[] = array( |
| 227 | 266 | 'label' => __( 'Locations', 'propertyhive' ), |
| 228 | - 'value' => implode(", ", $sliced_terms) . ( (count($terms) > 2) ? ' <span title="' . addslashes( implode(", ", $terms) ) .'">+ ' . (count($terms) - 2) . ' more</span>' : '' ), | |
| 267 | + 'value' => esc_html( implode(", ", $sliced_terms) ) . ( (count($terms) > 2) ? ' <span title="' . esc_attr( implode(", ", $terms) ) .'">+ ' . (count($terms) - 2) . ' more</span>' : '' ), | |
| 229 | 268 | ); |
| 230 | 269 | } |
| 231 | 270 | } |
| 232 | 271 | } |
| @@ -233,32 +272,37 @@ | ||
| 233 | 272 | else |
| 234 | 273 | { |
| 235 | 274 | if ( isset($applicant_profile['location_text']) && trim($applicant_profile['location_text']) != '' ) |
| 236 | 275 | { |
| 276 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 237 | 277 | $location_value = trim($applicant_profile['location_text']); |
| 238 | 278 | |
| 239 | 279 | if ( isset($applicant_profile['location_radius']) && $applicant_profile['location_radius'] != '' ) |
| 240 | 280 | { |
| 281 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 241 | 282 | $location_value .= ' (Within '. $applicant_profile['location_radius'] .' Miles)'; |
| 242 | 283 | } |
| 243 | 284 | |
| 285 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 244 | 286 | $requirements[] = array( |
| 245 | 287 | 'label' => __( 'Location', 'propertyhive' ), |
| 246 | - 'value' => $location_value, | |
| 288 | + 'value' => esc_html( $location_value ), | |
| 247 | 289 | ); |
| 248 | 290 | } |
| 249 | 291 | } |
| 250 | 292 | |
| 293 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 251 | 294 | $requirements = apply_filters( 'propertyhive_applicant_requirements_display', $requirements, $contact_id, $applicant_profile ); |
| 252 | 295 | |
| 253 | 296 | if ( !empty($requirements) ) |
| 254 | 297 | { |
| 298 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 255 | 299 | foreach ( $requirements as $requirement ) |
| 256 | 300 | { |
| 257 | - echo '<div style="display:inline-block; width:23%; margin-right:2%; vertical-align:top"> | |
| 258 | - <strong>' . esc_html($requirement['label']) . ':</strong><br> | |
| 259 | - ' . $requirement['value'] . ' | |
| 260 | - </div>'; | |
| 301 | + echo '<div style="display:inline-block; width:23%; margin-right:2%; vertical-align:top"><strong>' . esc_html( $requirement['label'] ) . ':</strong><br>'; | |
| 302 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Core requirement values escape stored text/attributes above; preserve trusted HTML supplied by propertyhive_applicant_requirements_display and currency-symbol filters. | |
| 303 | + echo $requirement['value']; | |
| 304 | + echo '</div>'; | |
| 261 | 305 | } |
| 262 | 306 | } |
| 263 | 307 | |
| 264 | 308 | if ( isset($applicant_profile['notes']) && $applicant_profile['notes'] != '' ) |
| @@ -264,9 +308,9 @@ | ||
| 264 | 308 | if ( isset($applicant_profile['notes']) && $applicant_profile['notes'] != '' ) |
| 265 | 309 | { |
| 266 | 310 | echo '<div style="display:inline-block; width:100%; vertical-align:top; margin-top:15px;"> |
| 267 | 311 | <strong>Additional Requirement Notes:</strong><br> |
| 268 | - ' . nl2br( strip_tags( $applicant_profile['notes'] ) ) . ' | |
| 312 | + ' . nl2br( esc_html( wp_strip_all_tags( $applicant_profile['notes'] ) ) ) . ' | |
| 269 | 313 | </div>'; |
| 270 | 314 | } |
| 271 | 315 | |
| 272 | 316 | echo '</div>'; |
| @@ -274,17 +318,20 @@ | ||
| 274 | 318 | |
| 275 | 319 | <?php |
| 276 | 320 | if ( !empty($properties) ) |
| 277 | 321 | { |
| 322 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 278 | 323 | $select_all_actions = array( |
| 279 | 324 | 'email' => __( 'Email', 'propertyhive' ), |
| 280 | 325 | 'not_interested' => __( 'Not Suitable', 'propertyhive' ) |
| 281 | 326 | ); |
| 282 | 327 | |
| 328 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 283 | 329 | $select_all_actions = apply_filters( 'propertyhive_matching_select_all_actions', $select_all_actions ); |
| 284 | 330 | ?> |
| 285 | 331 | <div class="select-actions" style="padding-top:15px"> |
| 286 | 332 | <span style="display:inline-block; vertical-align:middle;"><?php echo esc_html(__( 'Select', 'propertyhive' )); ?>:</span> <?php |
| 333 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 287 | 334 | foreach ( $select_all_actions as $key => $value ) |
| 288 | 335 | { |
| 289 | 336 | echo '<a href="javascript:;" class="button" id="select_all_' . esc_attr(sanitize_title($key)) . '" style="display:inline-block; vertical-align:middle;">All - ' . esc_html($value) . '</a> '; |
| 290 | 337 | } |
| @@ -292,17 +339,22 @@ | ||
| 292 | 339 | <a href="javascript:;" class="button" id="select_none" style="display:inline-block; vertical-align:middle;">None</a> |
| 293 | 340 | </div> |
| 294 | 341 | |
| 295 | 342 | <?php |
| 343 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 296 | 344 | foreach ( $properties as $property ) |
| 297 | 345 | { |
| 346 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 298 | 347 | $previously_sent = array(); |
| 299 | 348 | if ( isset($applicant_profile_match_history[$property->id]) && is_array($applicant_profile_match_history[$property->id]) && !empty($applicant_profile_match_history[$property->id]) ) |
| 300 | 349 | { |
| 350 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 301 | 351 | $previously_sent = $applicant_profile_match_history[$property->id]; |
| 302 | 352 | } |
| 303 | 353 | |
| 354 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 304 | 355 | $on_market_change_date = $property->_on_market_change_date; |
| 356 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 305 | 357 | $price_change_date = $property->_price_change_date; |
| 306 | 358 | |
| 307 | 359 | echo '<div id="matching_applicant_' . (int)$contact_id . '_property_' . (int)$property->id . '" style="padding:20px 0; border-bottom:1px solid #CCC;">'; |
| 308 | 360 | |
| @@ -307,8 +359,9 @@ | ||
| 307 | 359 | echo '<div id="matching_applicant_' . (int)$contact_id . '_property_' . (int)$property->id . '" style="padding:20px 0; border-bottom:1px solid #CCC;">'; |
| 308 | 360 | |
| 309 | 361 | echo '<div style="float:left; width:18%;">'; |
| 310 | 362 | |
| 363 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 311 | 364 | $image_url = $property->get_main_photo_src(); |
| 312 | 365 | if ( $image_url !== FALSE ) |
| 313 | 366 | { |
| 314 | 367 | echo '<a href="' . esc_url(get_edit_post_link( $property->id )) . '" target="_blank"><img src="' . esc_url($image_url) . '" style="max-width:100%; margin:0 auto; display:block;" alt="' . esc_attr($property->get_formatted_summary_address()) . '"></a>'; |
| @@ -319,23 +372,27 @@ | ||
| 319 | 372 | echo '<div style="float:right; width:80%;">'; |
| 320 | 373 | |
| 321 | 374 | echo '<h3 style="margin:0; padding:0; margin-bottom:9px;"><a href="' . esc_url(get_edit_post_link( $property->id )) . '" target="_blank">' . esc_html($property->get_formatted_summary_address()) . '</a></h3>'; |
| 322 | 375 | |
| 323 | - echo '<div style="margin-bottom:7px; font-size:15px;"> | |
| 324 | - <strong>' . esc_html(( ($property->_department == 'residential-lettings') ? __('Rent', 'propertyhive') : __('Price', 'propertyhive') )) . ': ' . esc_html($property->price_qualifier) . ' ' . $property->get_formatted_price() . '</strong> | |
| 325 | - | '; | |
| 376 | + echo '<div style="margin-bottom:7px; font-size:15px;"><strong>' . esc_html( ( $property->_department == 'residential-lettings' ) ? __( 'Rent', 'propertyhive' ) : __( 'Price', 'propertyhive' ) ) . ': ' . esc_html( $property->price_qualifier ) . ' '; | |
| 377 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Price producers escape stored text before trusted currency/commercial/property price HTML filters. | |
| 378 | + echo $property->get_formatted_price(); | |
| 379 | + echo '</strong> | '; | |
| 326 | 380 | if ($property->department != 'commercial' || ph_get_custom_department_based_on($property->department) == 'commercial') |
| 327 | 381 | { |
| 328 | - echo $property->bedrooms . ' bed | '; | |
| 382 | + echo esc_html( $property->bedrooms ) . ' bed | '; | |
| 329 | 383 | } |
| 330 | 384 | else |
| 331 | 385 | { |
| 386 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 332 | 387 | $floor_area = $property->get_formatted_floor_area(); |
| 333 | 388 | if ( $floor_area != '' ) |
| 334 | 389 | { |
| 390 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Floor-area producer escapes base text before the trusted propertyhive_floor_area_output HTML filter. | |
| 335 | 391 | echo $floor_area . ' | '; |
| 336 | 392 | } |
| 337 | 393 | } |
| 394 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 338 | 395 | $property_type = $property->get_property_type(); |
| 339 | 396 | if ( $property_type != '' ) |
| 340 | 397 | { |
| 341 | 398 | echo esc_html($property_type) . ' | '; |
| @@ -342,23 +399,26 @@ | ||
| 342 | 399 | } |
| 343 | 400 | echo ' ' . esc_html($property->get_availability()) . ' |
| 344 | 401 | </div>'; |
| 345 | 402 | |
| 346 | - echo '<div style="margin-bottom:7px;">' . esc_html(strip_tags(get_the_excerpt($property->id))) . '</div>'; | |
| 403 | + echo '<div style="margin-bottom:7px;">' . esc_html(wp_strip_all_tags(get_the_excerpt($property->id))) . '</div>'; | |
| 347 | 404 | |
| 348 | 405 | echo '<div style="background:#F8F8F8; padding:12px 11px; line-height:1.7em; border:1px solid #DDD; font-weight:700"> |
| 349 | 406 | |
| 350 | 407 | <label><input type="checkbox" name="email_property_id[]" value="' . (int)$property->id . '" '; |
| 351 | 408 | |
| 409 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 352 | 410 | $post_tip = ''; |
| 353 | 411 | if ( strpos($email_address, '@') === FALSE ) |
| 354 | 412 | { |
| 355 | 413 | echo ' disabled title="Invalid email address: ' . esc_attr($email_address) . '"'; |
| 414 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 356 | 415 | $post_tip = 'Invalid email address: ' . $email_address; |
| 357 | 416 | } |
| 358 | 417 | elseif ( $do_not_email ) |
| 359 | 418 | { |
| 360 | 419 | echo ' disabled title="Contact via email not permitted - Set under contact details"'; |
| 420 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 361 | 421 | $post_tip = 'Contact via email not permitted - Set under contact details'; |
| 362 | 422 | } |
| 363 | 423 | else |
| 364 | 424 | { |
| @@ -363,9 +423,10 @@ | ||
| 363 | 423 | else |
| 364 | 424 | { |
| 365 | 425 | if ( !empty($previously_sent) ) |
| 366 | 426 | { |
| 367 | - $post_tip = 'Sent previously via ' . $previously_sent[count($previously_sent) - 1]['method'] . ' on ' . date("jS F Y", strtotime($previously_sent[count($previously_sent) - 1]['date'])); | |
| 427 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 428 | + $post_tip = 'Sent previously via ' . $previously_sent[count($previously_sent) - 1]['method'] . ' on ' . gmdate("jS F Y", strtotime($previously_sent[count($previously_sent) - 1]['date'])); | |
| 368 | 429 | |
| 369 | 430 | if ( |
| 370 | 431 | $on_market_change_date > $previously_sent[count($previously_sent) - 1]['date'] || |
| 371 | 432 | $price_change_date > $previously_sent[count($previously_sent) - 1]['date'] |
| @@ -372,13 +433,15 @@ | ||
| 372 | 433 | ) |
| 373 | 434 | { |
| 374 | 435 | if ( $price_change_date > $previously_sent[count($previously_sent) - 1]['date'] ) |
| 375 | 436 | { |
| 376 | - $post_tip .= ', however a price change occurred on ' . date("jS F Y", strtotime($price_change_date)); | |
| 437 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 438 | + $post_tip .= ', however a price change occurred on ' . gmdate("jS F Y", strtotime($price_change_date)); | |
| 377 | 439 | } |
| 378 | 440 | elseif ( $on_market_change_date > $previously_sent[count($previously_sent) - 1]['date'] ) |
| 379 | 441 | { |
| 380 | - $post_tip .= ', however a change to the on market status occurred on ' . date("jS F Y", strtotime($on_market_change_date)); | |
| 442 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. | |
| 443 | + $post_tip .= ', however a change to the on market status occurred on ' . gmdate("jS F Y", strtotime($on_market_change_date)); | |
| 381 | 444 | } |
| 382 | 445 | echo ' checked'; |
| 383 | 446 | } |
| 384 | 447 | } |
| @@ -410,9 +473,9 @@ | ||
| 410 | 473 | <p class="submit"> |
| 411 | 474 | |
| 412 | 475 | <input name="save" class="button-primary" type="submit" value="<?php echo esc_html(__( 'Continue', 'propertyhive' )); ?>" /> |
| 413 | 476 | |
| 414 | - <a href="<?php echo esc_url(get_edit_post_link((int)$_GET['contact_id'])); ?>" class="button"><?php echo esc_html(__( 'Cancel', 'propertyhive' )); ?></a> | |
| 477 | + <a href="<?php echo esc_url(get_edit_post_link( (int) $contact_id )); ?>" class="button"><?php echo esc_html(__( 'Cancel', 'propertyhive' )); ?></a> | |
| 415 | 478 | |
| 416 | 479 | <input type="hidden" name="step" value="one" /> |
| 417 | 480 | <?php wp_nonce_field( 'propertyhive-matching-properties' ); ?> |
| 418 | 481 | |