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-api.php +30 -240 2.1.51.9.0 View file →
@@ -28,9 +28,8 @@
28 28 public $header_parameters = ''; // the header paramaters
29 29 public $body_parameters = ''; // the body paramaters
30 30 public $body_json_encode = ''; // body_json_encode body
31 31 public $body_url_encode = ''; // urlencode body
32 - public $body_base64_encode = ''; // base64 encode body
33 32 public $body_xml_format = ''; // xml format body
34 33 public $xml_root_node = 'root'; // root node for xml
35 34
36 35 public $response = ''; // the returned response
@@ -39,15 +38,11 @@
39 38 public $final_request_args = array(); // final request_args
40 39
41 40 public $results_format = 'json_string'; // results format
42 41
43 - public $response_code = ''; // the response code from the call
44 -
45 42 public $timeout = 10; // the timeout
46 - public $sslverify = 1; // ssl verify
43 + public $sslverify = 1; // the paramaters
47 44 public $debug = false;
48 -
49 - public $pro_plugin = false;
50 45
51 46
52 47 /**
53 48 * Main constructor
@@ -75,13 +70,11 @@
75 70 * Init our api data
76 71 */
77 72 public function init() {
78 73
79 - $this->pro_plugin = is_plugin_active( 'wpgetapi-extras/wpgetapi-extras.php' ) ? true : false;
80 -
81 74 // if we are doing importer plugin,
82 75 // we need to intercept and modify most of our methods values
83 - if( $this->api_id === 'wpgetapi_importer' ) {
76 + if( $this->api_id == 'wpgetapi_importer' ) {
84 77
85 78 $data = apply_filters( 'wpgetapi_api_importer_init', $this );
86 79
87 80 if( $data ) {
@@ -129,14 +122,11 @@
129 122 $this->header_parameters = isset( $endpoint['header_parameters'] ) && ! empty( $endpoint['header_parameters'] ) ? $this->do_parameters( $endpoint['header_parameters'] ) : array();
130 123
131 124 $this->body_parameters = isset( $endpoint['body_parameters'] ) && ! empty( $endpoint['body_parameters'] ) ? $this->do_parameters( $endpoint['body_parameters'] ) : array();
132 125
133 - // how to encode the body
134 126 $this->body_json_encode = isset( $endpoint['body_json_encode'] ) && $endpoint['body_json_encode'] == 'true' ? true : false;
135 127 $this->body_url_encode = isset( $endpoint['body_json_encode'] ) && $endpoint['body_json_encode'] == 'url' ? true : false;
136 - $this->body_base64_encode = isset( $endpoint['body_json_encode'] ) && $endpoint['body_json_encode'] == 'base64' ? true : false;
137 128 $this->body_xml_format = isset( $endpoint['body_json_encode'] ) && $endpoint['body_json_encode'] == 'xml' ? true : false;
138 -
139 129 $this->xml_root_node = isset( $endpoint['xml_root'] ) && ! empty( $endpoint['xml_root'] ) ? $endpoint['xml_root'] : $this->xml_root_node;
140 130
141 131 $this->results_format = isset( $endpoint['results_format'] ) ? sanitize_text_field( $endpoint['results_format'] ) : $this->results_format;
142 132
@@ -142,9 +132,9 @@
142 132
143 133
144 134 if(
145 135 // set the format to php array data if html format is set
146 - ( isset( $this->args['format'] ) && $this->args['format'] == 'html' && $this->results_format != 'xml_array' ) ||
136 + ( isset( $this->args['format'] ) && $this->args['format'] == 'html' ) ||
147 137 // set the format to php array data if it is set in the args (coming from the importer)
148 138 ( isset( $this->args['results_format'] ) && $this->args['results_format'] == 'json_decoded' )
149 139 ) {
150 140 $this->results_format = 'json_decoded';
@@ -149,18 +139,8 @@
149 139 ) {
150 140 $this->results_format = 'json_decoded';
151 141 }
152 142
153 - // set the format to JSON string if it is set in the args (coming from the wpdatatables integration)
154 - if( isset( $this->args['results_format'] ) && $this->args['results_format'] == 'json_string' ) {
155 - $this->results_format = 'json_string';
156 - }
157 -
158 - // set the format to JSON string if it is set in the args (coming from the wpdatatables integration)
159 - if( isset( $this->args['results_format'] ) && $this->args['results_format'] == 'json_decoded' ) {
160 - $this->results_format = 'json_decoded';
161 - }
162 -
163 143 }
164 144
165 145 }
166 146
@@ -213,12 +193,8 @@
213 193 // PUT request
214 194 if( $this->method == 'PUT' )
215 195 $this->response = $this->PUT_request();
216 196
217 - // PATCH request
218 - if( $this->method == 'PATCH' )
219 - $this->response = $this->PATCH_request();
220 -
221 197 // GET request
222 198 if( $this->method == 'GET' )
223 199 $this->response = $this->GET_request();
224 200
@@ -231,12 +207,12 @@
231 207 return apply_filters( 'wpgetapi_raw_error_data', json_encode( $this->response ), $this );
232 208 }
233 209
234 210 // get response_code
235 - $this->response_code = wp_remote_retrieve_response_code( $this->response );
211 + $response_code = wp_remote_retrieve_response_code( $this->response );
236 212
237 213 // action to intercept call depending on response_code
238 - $this->response = apply_filters( 'wpgetapi_before_retrieve_body', $this->response, $this->response_code, $this );
214 + $this->response = apply_filters( 'wpgetapi_before_retrieve_body', $this->response, $response_code, $this );
239 215
240 216 // get body
241 217 // modified in version 1.6.1 to allow for OAuth 2.0 plugin returning body already
242 218 $data = isset( $this->response['body'] ) ? $this->response['body'] : $this->response;
@@ -261,14 +237,8 @@
261 237 // first make sure our endpoint starts with a slash
262 238 if ( substr( $this->endpoint, 0, 1 ) != '/' )
263 239 $this->endpoint = '/' . $this->endpoint;
264 240
265 - // if we have item_key from api to posts plugin
266 - // replace our keyword with the actual item_key value
267 - if ( isset( $this->args['item_key'] ) && strpos( $this->endpoint, '(importer:item_key)' ) !== false ) {
268 - $this->endpoint = str_replace( '(importer:item_key)', $this->args['item_key'], $this->endpoint );
269 - }
270 -
271 241 $this->endpoint = apply_filters( 'wpgetapi_endpoint', $this->endpoint, $this );
272 242
273 243 $url = untrailingslashit( $this->base_url ) . $this->endpoint;
274 244
@@ -282,12 +252,10 @@
282 252
283 253 // add empty array - was getting errors if it was just null or false
284 254 $params = empty( $params ) ? array(''=>'') : $params;
285 255
286 - $result = add_query_arg( $params, $url );
256 + return add_query_arg( $params, $url );
287 257
288 - return $result;
289 -
290 258 }
291 259
292 260
293 261 /**
@@ -301,13 +269,13 @@
301 269 ), $this );
302 270
303 271
304 272 // if doing POST request, include body paramters
305 - if( $this->method == 'POST' || $this->method == 'PUT' || $this->method == 'DELETE' || $this->method == 'PATCH' ) {
273 + if( $this->method == 'POST' || $this->method == 'PUT' || $this->method == 'DELETE' ) {
306 274
307 275 // tokens are sent through here
308 276 $this->body_parameters = apply_filters( 'wpgetapi_body_parameters', $this->body_parameters, $this );
309 -
277 +
310 278 // do we json_encode the entire body
311 279 if( $this->body_json_encode == true ) {
312 280 $this->body_parameters = json_encode( $this->body_parameters );
313 281 }
@@ -312,9 +280,9 @@
312 280 $this->body_parameters = json_encode( $this->body_parameters );
313 281 }
314 282
315 283 // do we urlencode the entire body
316 - if( $this->body_parameters && $this->body_url_encode == true ) {
284 + if( $this->body_url_encode == true ) {
317 285
318 286 // checking if the parameters have a json string (raw)
319 287 if (
320 288 ( ! is_array( $this->body_parameters ) ) &&
@@ -327,15 +295,11 @@
327 295
328 296 }
329 297
330 298 // do we xml the entire body
331 - if( $this->body_parameters && $this->body_xml_format == true ) {
332 -
333 - $root_node = $this->xml_root_node != '' ? '<' . $this->xml_root_node . '/>' : '';
299 + if( $this->body_xml_format == true ) {
334 300
335 - $xml_element = apply_filters( 'wpgetapi_xml_element', '<?xml version="1.0" encoding="UTF-8"?>' . $root_node );
336 -
337 - $xml = new SimpleXmlElement( $xml_element );
301 + $xml = new SimpleXmlElement( '<' . $this->xml_root_node . '/>' );
338 302
339 303 foreach( $this->body_parameters as $key => $value) {
340 304 $xml->addChild( $key, $value );
341 305 }
@@ -343,18 +307,8 @@
343 307 $this->body_parameters = $xml->asXML();
344 308
345 309 }
346 310
347 - // do we base64 encode the entire body
348 - if( $this->body_parameters && $this->body_base64_encode == true ) {
349 -
350 - $this->body_parameters = is_array( $this->body_parameters ) ? json_encode( $this->body_parameters ) : $this->body_parameters;
351 - $this->body_parameters = base64_encode( $this->body_parameters );
352 -
353 - }
354 -
355 - $this->body_parameters = apply_filters( 'wpgetapi_modify_formatted_body_parameters', $this->body_parameters, $this );
356 -
357 311 // add our body parameters
358 312 if( $this->body_parameters && ! empty( $this->body_parameters ) )
359 313 $headers['body'] = $this->body_parameters;
360 314
@@ -359,12 +313,8 @@
359 313 $headers['body'] = $this->body_parameters;
360 314
361 315 }
362 316
363 - // get our body paramters as they are formatted
364 - // this won't change anything, it just allows us to get the parameters
365 - $this->body_parameters = apply_filters( 'wpgetapi_final_body_parameters', $this->body_parameters, $this );
366 -
367 317 // add headers to our final request args
368 318 $this->final_request_args = wp_parse_args( $headers, $this->final_request_args );
369 319
370 320 // build the args taht are sent to the request
@@ -386,9 +336,8 @@
386 336 /**
387 337 * Do a GET request
388 338 */
389 339 public function GET_request() {
390 -
391 340 $response = '';
392 341 // so we can so something before the remote_get (caching)
393 342 $response = apply_filters( 'wpgetapi_before_get_request', $response, $this );
394 343
@@ -393,11 +342,9 @@
393 342 $response = apply_filters( 'wpgetapi_before_get_request', $response, $this );
394 343
395 344 if( empty( $response ) )
396 345 $response = wp_remote_get( $this->final_url, $this->final_request_args );
397 -
398 346 return $response;
399 -
400 347 }
401 348
402 349 /**
403 350 * Do a POST request
@@ -402,18 +349,10 @@
402 349 /**
403 350 * Do a POST request
404 351 */
405 352 public function POST_request() {
406 -
407 - $response = '';
408 - // so we can so something before the remote_post (caching)
409 - $response = apply_filters( 'wpgetapi_before_post_request', $response, $this );
410 -
411 - //$this->final_request_args['method'] = 'POST';
412 -
413 - if( empty( $response ) )
414 - $response = wp_remote_post( $this->final_url, $this->final_request_args );
415 -
353 + $this->final_request_args['method'] = 'POST';
354 + $response = wp_remote_post( $this->final_url, $this->final_request_args );
416 355 return $response;
417 356 }
418 357
419 358 /**
@@ -425,17 +364,8 @@
425 364 return $response;
426 365 }
427 366
428 367 /**
429 - * Do a PATCH request
430 - */
431 - public function PATCH_request() {
432 - $this->final_request_args['method'] = 'PATCH';
433 - $response = wp_remote_request( $this->final_url, $this->final_request_args );
434 - return $response;
435 - }
436 -
437 - /**
438 368 * Do a DELETE request
439 369 */
440 370 public function DELETE_request() {
441 371 $this->final_request_args['method'] = 'DELETE';
@@ -449,9 +379,9 @@
449 379 */
450 380 public function return_data( $data ) {
451 381
452 382 $data = apply_filters( 'wpgetapi_json_response_body_before_decode', $data, $this->keys );
453 -
383 +
454 384 // converts all data to arrays, removing objects
455 385 if( is_string( $data ) ) {
456 386 $decode = json_decode( $data, true );
457 387 if( json_last_error() ) {
@@ -459,13 +389,13 @@
459 389 } else {
460 390 $data = $decode;
461 391 }
462 392 }
463 -
393 +
464 394 $data = apply_filters( 'wpgetapi_json_response_body', $data, $this->keys );
465 395
466 396 if( $this->results_format == 'json_string' )
467 - return trim( json_encode( $data, JSON_PRETTY_PRINT ),'"');
397 + return trim( json_encode( $data ),'"');
468 398
469 399 if( $this->results_format == 'json_decoded' )
470 400 return $data;
471 401
@@ -474,9 +404,9 @@
474 404 /**
475 405 * Sort out the parameters if they exist
476 406 */
477 407 public function do_parameters( $parameters ) {
478 -
408 +
479 409 $new_array = array();
480 410 $raw = '';
481 411 $parameters = $this->decrypt( $parameters );
482 412
@@ -492,14 +422,8 @@
492 422 unset( $parameters[ $key ] );
493 423 continue;
494 424 }
495 425
496 - // if we have item_key from api to posts plugin
497 - // replace our keyword with the actual item_key value
498 - if ( isset( $this->args['item_key'] ) && strpos( $parameter['value'], '(importer:item_key)' ) !== false ) {
499 - $parameter['value'] = str_replace( '(importer:item_key)', $this->args['item_key'], $parameter['value'] );
500 - }
501 -
502 426 $new_array[ sanitize_text_field( $parameter['name'] ) ] = $parameter['value'];
503 427
504 428 // if we are sending raw body
505 429 } else if( empty( $parameter['name'] ) && ! empty( $parameter['value'] ) ) {
@@ -510,20 +434,17 @@
510 434
511 435 }
512 436 }
513 437
514 - // now look for array or json string and sort these out - for using such things in shortcode
438 + // look for array or json string and sort these out - for using such things in shortcode
515 439 if( ! empty( $new_array ) ) {
516 440
517 441 foreach ( $new_array as $key => $value ) {
518 442
519 443 // checking if the parameters have a json string
520 - if ( strpos( $value, '{"' ) !== false && strpos( $value, '}' ) !== false ) {
521 -
522 - $tmp_val = $value;
523 - $tmp_val = json_decode( $tmp_val, true );
524 - $new_array[ $key ] = $tmp_val ? $tmp_val : $value;
525 -
444 + if ( strpos( $value, '{' ) !== false && strpos( $value, '}' ) !== false ) {
445 + //if ( substr( $value, 0, 1 ) === '{' && substr( $value, -1 ) === '}' ) {
446 + $new_array[ $key ] = json_decode( $value, true );
526 447 } else
527 448
528 449 // checking if the parameters have an array within the string
529 450 // if they do, create them as an actual array
@@ -533,38 +454,17 @@
533 454 }
534 455
535 456 // set value as integer
536 457 if ( strpos( $value, 'integer(' ) !== false && substr( $value, -1 ) === ')' ) {
537 -
538 458 preg_match("/\(([^\)]*)\)/", $value, $match );
539 - $result = trim( $match[1] );
540 -
541 - // checking if we have additional token within
542 - // and we need to send this directly to PRO plugin from here
543 - if( strpos( $value, '(' ) !== false && strpos( $value, ':' ) !== false && $this->pro_plugin ) {
544 - $result = $this->replace_tokens( $result );
545 - } else {
546 - $result = $result;
547 - }
548 -
459 + $result = $match[1];
549 460 $new_array[ $key ] = absint( $result );
550 -
551 461 }
552 462
553 463 // set value as float
554 464 if ( strpos( $value, 'float(' ) !== false && substr( $value, -1 ) === ')' ) {
555 -
556 465 preg_match("/\(([^\)]*)\)/", $value, $match );
557 - $result = trim( $match[1] );
558 - if ( substr( $result, 0, 1 ) === '"' && substr( $result, -1 ) === '"' )
559 - $result = trim( $result,'""' );
560 -
561 - // checking if we have additional token within
562 - // and we need to send this directly to PRO plugin from here
563 - if( strpos( $value, '(' ) !== false && strpos( $value, ':' ) !== false && $this->pro_plugin ) {
564 - $result = $this->replace_tokens( $result );
565 - }
566 -
466 + $result = $match[1];
567 467 $new_array[ $key ] = (float) $result;
568 468
569 469 }
570 470
@@ -571,19 +471,9 @@
571 471 // set value as boolean
572 472 if ( strpos( $value, 'boolean(' ) !== false && substr( $value, -1 ) === ')' ) {
573 473 preg_match("/\(([^\)]*)\)/", $value, $match );
574 474 $result = $match[1];
575 -
576 - // checking if we have additional token within
577 - // and we need to send this directly to PRO plugin from here
578 - if( strpos( $value, '(' ) !== false && strpos( $value, ':' ) !== false && $this->pro_plugin ) {
579 - $result = $this->replace_tokens( $result );
580 - } else {
581 - $result = $result;
582 - }
583 -
584 475 $result = filter_var( $result, FILTER_VALIDATE_BOOLEAN );
585 -
586 476 $new_array[ $key ] = $result;
587 477
588 478 }
589 479
@@ -589,9 +479,9 @@
589 479
590 480 }
591 481
592 482 }
593 -
483 +
594 484 return $raw ? $raw : $new_array;
595 485
596 486 }
597 487
@@ -596,20 +486,8 @@
596 486 }
597 487
598 488
599 489 /**
600 - * Do a direct token replacement if PRO plugin installed and is required.
601 - */
602 - public function replace_tokens( $value ) {
603 - $tokens = new WpGetApi_Extras_Tokens();
604 - $action_args = isset( $this->args['action_args'] ) ? $this->args['action_args'] : null;
605 - $value = ( substr( $value, -1 ) !== ')' ? $value . ')' : $value );
606 - $result = $tokens->replace_tokens( $value, $action_args );
607 - return $result;
608 - }
609 -
610 -
611 - /**
612 490 * decrypt our parameters from the DB
613 491 */
614 492 public function decrypt( $array_or_string ) {
615 493
@@ -643,69 +521,10 @@
643 521 ) {
644 522
645 523 $this->debug = true;
646 524
647 - // admin test endpoint button
648 525 $testing = isset( $this->args['test_endpoint'] ) && ( $this->args['test_endpoint'] === true ) ? true : false;
649 526
650 - // get api status from response code
651 - $status = array(
652 - 'title' => 'Error in API response.',
653 - 'desc' => 'Check all details within your endpoint. Something is misconfigured.',
654 - 'type' => '<span class="dashicons dashicons-dismiss"></span>'
655 - );
656 -
657 - if( $this->response_code >= 200 && $this->response_code <= 299 ) {
658 - $status = array(
659 - 'title' => 'Success!',
660 - 'desc' => 'Your API is returning a success message and is returning the data as shown in the Data Output section below. You can modify this by changing the Results Format option or see <a href="https://wpgetapi.com/docs/format-api-data-as-html/">here</a> for info on formatting this data.',
661 - 'type' => '<span class="dashicons dashicons-yes-alt"></span>'
662 - );
663 - }
664 - if( $this->response_code >= 400 && $this->response_code <= 499 ) {
665 - $status = array(
666 - 'title' => 'Bad Request',
667 - 'desc' => 'This could indicate that the URL you are calling is incorrect or that some other data is missing or incorrect. Please check your Base URL and Endpoint are correct as well as the Request Method.',
668 - 'type' => '<span class="dashicons dashicons-dismiss"></span>'
669 - );
670 - }
671 - if( $this->response_code == 401 ) {
672 - $status = array(
673 - 'title' => 'Unauthorised',
674 - 'desc' => 'You are successfully connecting to your API. But your API key, login or API credentials are incorrect. See <a href="https://wpgetapi.com/docs/authentication-authorization/">here</a> for info on correctly authorizing your API requests.',
675 - 'type' => '<span class="dashicons dashicons-warning"></span>'
676 - );
677 - }
678 - if( $this->response_code == 403 ) {
679 - $status = array(
680 - 'title' => 'Forbidden',
681 - 'desc' => 'This could indicate that you may need to get your IP address whitelisted with your API provider or that you do not have access to this API.',
682 - 'type' => '<span class="dashicons dashicons-dismiss"></span>'
683 - );
684 - }
685 - if( $this->response_code == 405 ) {
686 - $status = array(
687 - 'title' => 'Method Not Allowed',
688 - 'desc' => 'Try changing the Request Method within the endpoint settings.',
689 - 'type' => '<span class="dashicons dashicons-dismiss"></span>'
690 - );
691 - }
692 - if( $this->response_code == 415 ) {
693 - $status = array(
694 - 'title' => 'Unsupported Media Type',
695 - 'desc' => 'Try adding "Content-type" to the Headers with the Value of "json/application" as shown <a href="https://wpgetapi.com/docs/troubleshooting/">here</a>.',
696 - 'type' => '<span class="dashicons dashicons-dismiss"></span>'
697 - );
698 - }
699 - if( $this->response_code >= 500 && $this->response_code <= 599 ) {
700 - $status = array(
701 - 'title' => 'Internal Server Error',
702 - 'desc' => 'This indicates an issue with the API server. Contact your API provider.',
703 - 'type' => '<span class="dashicons dashicons-dismiss"></span>'
704 - );
705 - }
706 -
707 -
708 527 ob_start(); ?>
709 528
710 529 <style>
711 530
@@ -742,11 +561,10 @@
742 561 background: #fff;
743 562 padding: 15px 20px;
744 563 display: inline-block !important;
745 564 width: 100% !important;
746 - box-shadow: 0 4px 4px -2px rgb(0 0 0 / 9%);
747 - border: 1px solid #eee;
748 - margin-bottom: 20px !important;
565 + box-shadow: 3px 3px 0 rgb(0 0 0 / 8%);
566 + border: 1px solid #efefef;
749 567 }
750 568 .wpgetapi-debug .debug-item h6 {
751 569 font-weight: bold;
752 570 font-size: 14px;
@@ -758,14 +576,15 @@
758 576 font-family: monospace !important;
759 577 font-size: 13px !important;
760 578 margin: 0 !important;
761 579 padding: 8px 12px;
762 - background: #f4f7f9;
580 + background: #f8f8f8;
763 581 }
764 582 .wpgetapi-debug .debug-item .debug-result pre {
765 583 border: none;
766 584 padding: 5px
767 585 }
586 +
768 587 .wpgetapi-debug.testing {
769 588 background: transparent;
770 589 padding: 0;
771 590 box-shadow: none;
@@ -772,32 +591,8 @@
772 591 }
773 592 .wpgetapi-debug.testing .debug-item {
774 593 margin: 5px 0;
775 594 }
776 -.wpgetapi-debug.testing .debug-item.status {
777 - border: none;
778 - box-shadow: none;
779 - margin-bottom: 15px;
780 -}
781 -.wpgetapi-debug .debug-item.status h5 {
782 - font-size: 15px;
783 -}
784 -.wpgetapi-debug .status .dashicons {
785 - margin: 0 5px 3px 0;
786 -}
787 -.wpgetapi-debug .status .dashicons-yes-alt {
788 - color: #5e9929;
789 -}
790 -.wpgetapi-debug .status .dashicons-dismiss {
791 - color: #cc4646;
792 -}
793 -.wpgetapi-debug .status .dashicons-warning {
794 - color: #dfa12e;
795 -}
796 -.wpgetapi-debug .status .desc {
797 - font-size: 14px;
798 - font-weight: 400 !important;
799 -}
800 595 </style>
801 596
802 597 <div class="wpgetapi-debug <?php echo $testing ? 'testing' : ''; ?>">
803 598
@@ -802,15 +597,9 @@
802 597 <div class="wpgetapi-debug <?php echo $testing ? 'testing' : ''; ?>">
803 598
804 599 <?php if( $testing ) { ?>
805 600
806 - <div class="debug-item status">
807 - <div class="">
808 - <h5><?php _e( $status['type'] ); ?> <?php esc_html_e( $status['title'] ); ?></h5>
809 - <span class="desc"><?php _e( $status['desc'] ); ?></span>
810 - </div>
811 - </div>
812 - <div class="debug-item">
601 + <div class="debug-item">
813 602 <h6><?php esc_html_e( 'Full URL', 'wpgetapi' ); ?></h6>
814 603 <p class="small"><?php esc_html_e( 'The full URL that is being called.', 'wpgetapi' ); ?></p>
815 604 <div class="debug-result"><?php esc_html_e( $this->final_url ); ?></div>
816 605 </div>
@@ -817,8 +606,9 @@
817 606
818 607 <div class="debug-item">
819 608 <h6><?php esc_html_e( 'Data Output', 'wpgetapi' ); ?></h6>
820 609 <p class="small"><?php esc_html_e( 'The output that has been returned from the API. This is what the shortcode or template tag will display and can be formatted however you like.', 'wpgetapi' ); ?></p>
610 + <p class="small"><?php esc_html_e( 'See the ', 'wpgetapi' ); ?> <a target="_blank" href="https://wpgetapi.com/docs/?utm_campaign=Test Endpoint&utm_medium=Admin&utm_source=User"><?php esc_html_e( 'documentation', 'wpgetapi' ); ?></a> <?php esc_html_e( ' for help in formatting.', 'wpgetapi' ); ?></p>
821 611 <div class="debug-result"><?php wpgetapi_pp( $data ); ?></div>
822 612 </div>
823 613
824 614 <div class="debug-item">