PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 4.0.2
Visualizer – Tables & Charts Manager with Built-in AI Generator v4.0.2
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | classes/Visualizer/Render/Layout.php +7 -12 4.0.84.0.2 View file →
@@ -187,15 +187,10 @@
187 187 $headers['method'] = 'get';
188 188 }
189 189 $methods = apply_filters( 'visualizer_json_request_methods', array( 'GET', 'POST' ) );
190 190
191 - $auth = isset( $headers['auth'] ) ? $headers['auth'] : '';
192 - $auth_username = is_array( $auth ) && isset( $auth['username'] ) ? $auth['username'] : '';
193 - $auth_password = is_array( $auth ) && isset( $auth['password'] ) ? $auth['password'] : '';
194 - $auth_string = is_string( $auth ) ? $auth : '';
195 -
196 191 // open the headers by default?
197 - $headers_open = ! empty( $auth_username ) || ! empty( $auth_string );
192 + $headers_open = $headers && array_key_exists( 'auth', $headers ) && ( array_key_exists( 'username', $headers['auth'] ) && ! empty( $headers['auth']['username'] ) ) || ( ! empty( $headers['auth'] ) && is_string( $headers['auth'] ) );
198 193 ?>
199 194 <div id="visualizer-json-screen" style="display: none">
200 195 <div class="visualizer-json-form">
201 196 <h3 class="viz-step step1"><?php _e( 'STEP 1: Specify the JSON endpoint/URL', 'visualizer' ); ?></h3>
@@ -246,9 +241,9 @@
246 241 <input
247 242 type="text"
248 243 id="vz-import-json-username"
249 244 name="username"
250 - value="<?php echo esc_attr( $auth_username ); ?>"
245 + value="<?php echo ( array_key_exists( 'auth', $headers ) && array_key_exists( 'username', $headers['auth'] ) ? $headers['auth']['username'] : '' ); ?>"
251 246 placeholder="<?php esc_html_e( 'Username/Access Key', 'visualizer' ); ?>"
252 247 class="json-form-element">
253 248 &
254 249 <input
@@ -254,9 +249,9 @@
254 249 <input
255 250 type="password"
256 251 id="vz-import-json-password"
257 252 name="password"
258 - value="<?php echo esc_attr( $auth_password ); ?>"
253 + value="<?php echo ( array_key_exists( 'auth', $headers ) && array_key_exists( 'password', $headers['auth'] ) ? $headers['auth']['password'] : '' ); ?>"
259 254 placeholder="<?php esc_html_e( 'Password/Secret Key', 'visualizer' ); ?>"
260 255 class="json-form-element">
261 256 </div>
262 257 </div>
@@ -270,9 +265,9 @@
270 265 <input
271 266 type="text"
272 267 id="vz-import-json-auth"
273 268 name="auth"
274 - value="<?php echo esc_attr( $auth_string ); ?>"
269 + value="<?php echo ( array_key_exists( 'auth', $headers ) && is_string( $headers['auth'] ) ? $headers['auth'] : '' ); ?>"
275 270 placeholder="<?php esc_html_e( 'e.g. SharedKey <AccountName>:<Signature>', 'visualizer' ); ?>"
276 271 class="visualizer-input json-form-element">
277 272 </div>
278 273 </div>
@@ -278,9 +273,9 @@
278 273 </div>
279 274 <div class="json-wizard-header">
280 275 <div class="field-title"><?php esc_html_e( 'Additional headers', 'visualizer' ); ?></div>
281 276 <div>
282 - <textarea name="additional_headers" class="visualizer-input" placeholder="<?php esc_html_e( 'Key:Value, Key2:Value2,...', 'visualizer' ); ?>"><?php echo esc_textarea( isset( $headers['additional_headers'] ) ? $headers['additional_headers'] : '' ); ?></textarea>
277 + <textarea name="additional_headers" class="visualizer-input" placeholder="<?php esc_html_e( 'Key:Value, Key2:Value2,...', 'visualizer' ); ?>"><?php echo isset( $headers['additional_headers'] ) ? $headers['additional_headers'] : ''; ?></textarea>
283 278 </div>
284 279 </div>
285 280 </div>
286 281 </div>
@@ -293,9 +288,9 @@
293 288 <select name="root" id="vz-import-json-root" class="json-form-element">
294 289 <?php
295 290 if ( ! empty( $root ) ) {
296 291 ?>
297 - <option value="<?php echo esc_attr( $root ); ?>"><?php echo esc_html( str_replace( Visualizer_Source_Json::TAG_SEPARATOR, Visualizer_Source_Json::TAG_SEPARATOR_VIEW, $root ) ); ?></option>
292 + <option value="<?php echo esc_attr( $root ); ?>"><?php echo str_replace( Visualizer_Source_Json::TAG_SEPARATOR, Visualizer_Source_Json::TAG_SEPARATOR_VIEW, $root ); ?></option>
298 293 <?php
299 294 }
300 295 ?>
301 296 </select>
@@ -311,9 +306,9 @@
311 306 <option value="0" class="static"><?php _e( 'Get results from the first page only', 'visualizer' ); ?></option>
312 307 <?php
313 308 if ( ! empty( $paging ) ) {
314 309 ?>
315 - <option value="<?php echo esc_attr( $paging ); ?>"><?php echo esc_html( sprintf( 'Get results from the first %d pages using %s', apply_filters( 'visualizer_json_fetch_pages', 5, $url ), str_replace( Visualizer_Source_Json::TAG_SEPARATOR, Visualizer_Source_Json::TAG_SEPARATOR_VIEW, $paging ) ) ); ?></option>
310 + <option value="<?php echo esc_attr( $paging ); ?>"><?php echo sprintf( 'Get results from the first %d pages using %s', apply_filters( 'visualizer_json_fetch_pages', 5, $url ), str_replace( Visualizer_Source_Json::TAG_SEPARATOR, Visualizer_Source_Json::TAG_SEPARATOR_VIEW, $paging ) ); ?></option>
316 311 <?php
317 312 }
318 313 ?>
319 314 </select>