PluginProbe
WPGet API – Connect to any external REST API / 1.9.0
WPGet API – Connect to any external REST API v1.9.0
1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.3 2.1.4 2.1.5 2.2.0 2.2.1 2.2.10 2.2.2 2.2.3 All 97 releases
← All changes | includes/class-admin-options.php +46 -57 1.9.41.9.0 View file →
@@ -203,9 +203,9 @@
203 203 'sortable' => true, // beta
204 204 ),
205 205 'fields' => array(
206 206 array(
207 - 'name' => __( 'API Name', 'wpgetapi' ) . '<span class="dashicons dashicons-editor-help" data-tip="' . __( 'The name of this API. Call it whatever you like.', 'wpgetapi' ) . '"></span>',
207 + 'name' => __( 'API Name', 'wpgetapi' ),
208 208 'id' => 'name',
209 209 'type' => 'text',
210 210 'attributes' => array(
211 211 'required' => true,
@@ -210,12 +210,12 @@
210 210 'attributes' => array(
211 211 'required' => true,
212 212 'placeholder' => 'Google Maps',
213 213 ),
214 - 'desc' => '',
214 + 'desc' => __( 'The name of the API you are connecting to.', 'wpgetapi' ),
215 215 ),
216 216 array(
217 - 'name' => __( 'Unique ID', 'wpgetapi' ) . '<span class="dashicons dashicons-editor-help" data-tip="' . __( 'Choose your own unique ID for this API. Use lowercase letters and underscores only!', 'wpgetapi' ) . '"></span>',
217 + 'name' => __( 'Unique ID', 'wpgetapi' ),
218 218 'id' => 'id',
219 219 'type' => 'text',
220 220 'attributes' => array(
221 221 'required' => true,
@@ -220,12 +220,12 @@
220 220 'attributes' => array(
221 221 'required' => true,
222 222 'placeholder' => 'google_maps',
223 223 ),
224 - 'desc' => '',
224 + 'desc' => __( 'A unique ID for your API. Lowercase letters and underscores only.', 'wpgetapi' ),
225 225 ),
226 226 array(
227 - 'name' => __( 'Base URL', 'wpgetapi' ) . '<span class="dashicons dashicons-editor-help" data-tip="' . __( 'The base URL of the API you are connecting to.', 'wpgetapi' ) . '"></span>',
227 + 'name' => __( 'Base URL', 'wpgetapi' ),
228 228 'id' => 'base_url',
229 229 'type' => 'text',
230 230 'attributes' => array(
231 231 'required' => true,
@@ -230,9 +230,9 @@
230 230 'attributes' => array(
231 231 'required' => true,
232 232 'placeholder' => 'https://maps.googleapis.com/maps/api',
233 233 ),
234 - 'desc' => '',
234 + 'desc' => __( 'The base URL of the API you are connecting to.', 'wpgetapi' ),
235 235 ),
236 236
237 237 )
238 238 );
@@ -251,13 +251,13 @@
251 251
252 252 $fields = array();
253 253
254 254 $cache_disabled = $this->pro_plugin ? '' : 'disabled';
255 - $cache_url = $this->pro_plugin ? '<a target="_blank" href="https://wpgetapi.com/docs/caching-api-calls/">Caching Help</a>' : '<a target="_blank" href="https://wpgetapi.com/downloads/pro-plugin/?utm_campaign=Cache Pro Plugin&utm_medium=Admin&utm_source=User">PRO Feature<span class="dashicons dashicons-external"></span></a>';
255 + $cache_url = $this->pro_plugin ? '<a target="_blank" href="https://wpgetapi.com/docs/caching-api-calls/">Help <span class="dashicons dashicons-external"></span></a>' : '<a target="_blank" href="https://wpgetapi.com/downloads/pro-plugin/?utm_campaign=Cache Pro Plugin&utm_medium=Admin&utm_source=User">PRO Plugin<span class="dashicons dashicons-external"></span></a>';
256 256
257 257 $endpoint_fields = apply_filters( 'wpgetapi_fields_endpoints', array(
258 258 array(
259 - 'name' => __( 'Unique ID', 'wpgetapi' ) . '<span class="dashicons dashicons-editor-help" data-tip="' . __( 'Choose your own unique ID for this endpoint. Use lowercase letters and underscores only!', 'wpgetapi' ) . '"></span>',
259 + 'name' => __( 'Unique ID', 'wpgetapi' ),
260 260 'id' => 'id',
261 261 'type' => 'text',
262 262 'classes' => 'field-id',
263 263 'attributes' => array(
@@ -263,15 +263,15 @@
263 263 'attributes' => array(
264 264 'required' => true,
265 265 'placeholder' => 'new_endpoint',
266 266 ),
267 - 'desc' => '',
267 + 'desc' => __( 'A unique ID for this endpoint. Lowercase letters and underscores only.', 'wpgetapi' ),
268 268 'before_row' => "wpgetapi_output_top_of_endpoint",
269 269 'api_id' => $api_id,
270 270
271 271 ),
272 272 array(
273 - 'name' => __( 'Endpoint', 'wpgetapi' ) . '<span class="dashicons dashicons-editor-help" data-tip="' . __( 'This Endpoint will be appended to the Base URL to create the full URL that will be called.', 'wpgetapi' ) . '"></span>',
273 + 'name' => __( 'Endpoint', 'wpgetapi' ),
274 274 'id' => 'endpoint',
275 275 'type' => 'text',
276 276 'classes' => 'field-endpoint',
277 277 'attributes' => array(
@@ -277,12 +277,12 @@
277 277 'attributes' => array(
278 278 'required' => true,
279 279 'placeholder' => '/newendpoint',
280 280 ),
281 - 'desc' => '',
281 + 'desc' => __( 'The endpoint that will be appended to the base URL.', 'wpgetapi' ),
282 282 ),
283 283 array(
284 - 'name' => __( 'Method', 'wpgetapi' ) . '<span class="dashicons dashicons-editor-help" data-tip="' . __( 'The Request Method for this endpoint. If you are displaying data from the API, it will usually be GET. If you are sending to the API, it will usually be POST.', 'wpgetapi' ) . '"></span>',
284 + 'name' => __( 'Method', 'wpgetapi' ),
285 285 'id' => 'method',
286 286 'type' => 'select',
287 287 'classes' => 'field-method',
288 288 'attributes' => array(
@@ -293,19 +293,13 @@
293 293 'POST' => 'POST',
294 294 'PUT' => 'PUT',
295 295 'DELETE' => 'DELETE',
296 296 ),
297 - 'desc' => '',
297 + 'desc' => __( 'The request method for this endpoint.', 'wpgetapi' ),
298 298 ),
299 299
300 300 array(
301 - 'name' => __( 'Results Format', 'wpgetapi' ) .
302 - '<span class="dashicons dashicons-editor-help" data-tip="' .
303 - sprintf(
304 - __( 'The format that the API data will be returned in. To format the data as HTML, click the link below to learn how. %1s', 'wpgetapi' ),
305 - htmlentities( '<br><a target="_blank" href="https://wpgetapi.com/docs/formatting-json-data/?utm_campaign=Shortcode JSON&utm_medium=Admin&utm_source=User">Format as HTML</a>' )
306 - ) .
307 - '"></span>',
301 + 'name' => __( 'Results Format', 'wpgetapi' ),
308 302 'id' => 'results_format',
309 303 'type' => 'select',
310 304 'classes' => 'field-results-format',
311 305 'attributes' => array(
@@ -311,73 +305,64 @@
311 305 'attributes' => array(
312 306 'required' => true,
313 307 ),
314 308 'options_cb' => 'wpgetapi_results_format_options',
315 - 'desc' => ''
309 + 'desc' => sprintf(
310 + __( 'The format of the results. %1s', 'wpgetapi' ),
311 + '<a target="_blank" href="https://wpgetapi.com/docs/format-api-data-as-html/?utm_campaign=Shortcode JSON&utm_medium=Admin&utm_source=User">More options <span class="dashicons dashicons-external"></span></a>'
312 + )
316 313 ),
317 314
318 315 array(
319 - 'name' => __( 'Cache Time', 'wpgetapi' ) .
320 - '<span class="dashicons dashicons-editor-help" data-tip="' .
321 - sprintf(
322 - __( 'The time in seconds to cache this request for. %1s', 'wpgetapi' ),
323 - htmlentities( '<br>' . $cache_url )
324 - ) .
325 - '"></span>',
316 + 'name' => __( 'Cache Time', 'wpgetapi' ),
326 317 'id' => 'cache_time',
327 318 'type' => 'text',
328 319 'classes' => 'field-cache-time',
329 320 'attributes' => array(
330 - 'placeholder' => '3600',
321 + 'placeholder' => '',
331 322 $cache_disabled => $cache_disabled,
332 323 ),
333 - 'desc' => ''
324 + 'desc' => sprintf(
325 + __( 'The time in seconds to cache this request for. %1s', 'wpgetapi' ),
326 + $cache_url
327 + )
334 328 ),
335 329
336 330 array(
337 - 'name' => __( 'Query String', 'wpgetapi' ) .
338 - '<span class="dashicons dashicons-editor-help" data-tip="' .
339 - sprintf(
340 - __( 'Parameters as name/value pairs that will be appended to the URL. The query string is the part of the URL after the question mark, like so: https://yoururl.com<b>?key=value&key3=value3</b> %1s', 'wpgetapi' ),
341 - htmlentities( '<br><a target="_blank" href="https://wpgetapi.com/docs/adding-query-string-parameters/?utm_campaign=Query String&utm_medium=Admin&utm_source=User">More Info</a>' )
342 - ) .
343 - '"></span>',
331 + 'name' => __( 'Query String', 'wpgetapi' ),
344 332 'id' => 'query_parameters',
345 333 'type' => 'parameter',
346 334 'classes' => 'field-query-parameters',
347 335 'repeatable' => true,
348 - 'desc' => ''
336 + 'desc' => sprintf(
337 + __( 'Parameters as name/value pairs that will be appended to the URL. %1s', 'wpgetapi' ),
338 + '<a target="_blank" href="https://wpgetapi.com/docs/adding-query-string-parameters/?utm_campaign=Query String&utm_medium=Admin&utm_source=User">Help <span class="dashicons dashicons-external"></span></a>'
339 + )
349 340 ),
350 341 array(
351 - 'name' => __( 'Headers', 'wpgetapi' ) .
352 - '<span class="dashicons dashicons-editor-help" data-tip="' .
353 - sprintf(
354 - __( 'Parameters as name/value pairs, sent in the Headers. %1s', 'wpgetapi' ),
355 - htmlentities( '<br><a target="_blank" href="https://wpgetapi.com/docs/sending-headers-in-request/?utm_campaign=Headers&utm_medium=Admin&utm_source=User">More Info</a>' )
356 - ) .
357 - '"></span>',
342 + 'name' => __( 'Headers', 'wpgetapi' ),
358 343 'id' => 'header_parameters',
359 344 'type' => 'parameter',
360 345 'classes' => 'field-header-parameters',
361 346 'repeatable' => true,
362 - 'desc' => ''
347 + 'desc' => sprintf(
348 + __( 'Parameters as name/value pairs, sent in the headers. %1s', 'wpgetapi' ),
349 + '<a target="_blank" href="https://wpgetapi.com/docs/sending-headers-in-request/?utm_campaign=Headers&utm_medium=Admin&utm_source=User">Help <span class="dashicons dashicons-external"></span></a>'
350 + )
363 351 ),
364 352 array(
365 - 'name' => __( 'Body POST Fields', 'wpgetapi' ) .
366 - '<span class="dashicons dashicons-editor-help" data-tip="' .
367 - sprintf(
368 - __( 'Parameters as name/value pairs, sent in the Body as POST fields. %1s', 'wpgetapi' ),
369 - htmlentities( '<br><a target="_blank" href="https://wpgetapi.com/docs/sending-post-fields-in-request/?utm_campaign=Body&utm_medium=Admin&utm_source=User">More Info</a>' )
370 - ) .
371 - '"></span>',
353 + 'name' => __( 'Body POST Fields', 'wpgetapi' ),
372 354 'id' => 'body_parameters',
373 355 'type' => 'parameter',
374 356 'classes' => 'field-body-parameters',
375 357 'repeatable' => true,
376 - 'desc' => ''
358 + 'desc' => sprintf(
359 + __( 'Parameters as name/value pairs, sent in the body as POST fields. %1s', 'wpgetapi' ),
360 + '<a target="_blank" href="https://wpgetapi.com/docs/sending-post-fields-in-request/?utm_campaign=Body&utm_medium=Admin&utm_source=User">Help <span class="dashicons dashicons-external"></span></a>'
361 + )
377 362 ),
378 363 array(
379 - 'name' => __( 'Encode Body', 'wpgetapi' ) . '<span class="dashicons dashicons-editor-help" data-tip="' . __( 'Encoding of the above Body parameters.', 'wpgetapi' ) . '"></span>',
364 + 'name' => __( 'Encode Body', 'wpgetapi' ),
380 365 'id' => 'body_json_encode',
381 366 'type' => 'select',
382 367 'classes' => 'field-body-json-encode',
383 368 'options' => array(
@@ -385,9 +370,9 @@
385 370 'true' => __( 'JSON encode', 'wpgetapi' ),
386 371 'url' => __( 'URL encode (x-www-form-urlencoded)', 'wpgetapi' ),
387 372 'xml' => __( 'XML format (available in PRO only)', 'wpgetapi' ),
388 373 ),
389 - 'desc' => '',
374 + 'desc' => __( 'Encoding of the above Body parameters. ', 'wpgetapi' ),
390 375 ),
391 376 ) );
392 377
393 378
@@ -549,9 +534,13 @@
549 534 var output = JSON.parse( response );
550 535
551 536 jQuery( '.wpgetapi-test-area[data-endpoint="' + output.endpoint_id + '"] .handle' ).show();
552 537
553 - jQuery( '.wpgetapi-test-area[data-endpoint="' + output.endpoint_id + '"] .wpgetapi-result' ).html( output.data);
538 + jQuery( '.wpgetapi-test-area[data-endpoint="' + output.endpoint_id + '"] .wpgetapi-result' ).html(
539 + '<div class="side-notice"><p>These results contain the raw output of your API call as well as extra debugging information for testing purposes. <br>' +
540 + 'Using the shortcode or the template tag on the front end will display the Data Output section as shown below. The data can be formatted any way you like, depending on your requirements.</p></div>' +
541 + output.data
542 + );
554 543
555 544 // enable button
556 545 $( '.wpgetapi-test-area[data-endpoint="' + output.endpoint_id + '"] .test-button' ).attr( 'disabled', false );
557 546