addons-settings-page.php
6 years ago
advanced-settings-page.php
6 years ago
error-manager-page.php
6 years ago
language-switcher-shortcode.php
6 years ago
license-settings-page.php
6 years ago
machine-translation-settings-page.php
6 years ago
main-settings-language-selector.php
6 years ago
main-settings-page.php
6 years ago
settings-navigation-tabs.php
6 years ago
test-api-settings-page.php
6 years ago
translation-manager.php
6 years ago
trp-remove-duplicate-rows.php
6 years ago
trp-update-database.php
6 years ago
test-api-settings-page.php
41 lines
| 1 | <?php |
| 2 | |
| 3 | $trp = TRP_Translate_Press::get_trp_instance(); |
| 4 | $machine_translator = $trp->get_component( 'machine_translator' ); |
| 5 | $response = $machine_translator->test_request(); |
| 6 | $api_key = $machine_translator->get_api_key(); |
| 7 | ?> |
| 8 | |
| 9 | <div id="trp-addons-page" class="wrap"> |
| 10 | |
| 11 | <h1> <?php esc_html_e( 'TranslatePress Settings', 'translatepress-multilingual' );?></h1> |
| 12 | <?php do_action ( 'trp_settings_navigation_tabs' ); ?> |
| 13 | |
| 14 | <div class="grid feat-header"> |
| 15 | <div class="grid-cell"> |
| 16 | <?php if( $api_key != false ) : ?> |
| 17 | <h2><?php esc_html_e('API Key from settings page:', 'translatepress-multilingual');?> <span style="font-family:monospace"><?php echo $api_key; ?></span></h2> |
| 18 | <?php endif; ?> |
| 19 | |
| 20 | <h2><?php esc_html_e('HTTP Referrer:', 'translatepress-multilingual');?> <span style="font-family:monospace"><?php echo esc_url( $machine_translator->get_referer() ); ?></span></h2> |
| 21 | <p><?php esc_html_e('Use this HTTP Referrer if the API lets you restrict key usage from its Dashboard.', 'translatepress-multilingual'); ?></p> |
| 22 | |
| 23 | <h3><?php esc_html_e('Response:', 'translatepress-multilingual');?></h3> |
| 24 | <pre> |
| 25 | <?php print_r( $response["response"] ); ?> |
| 26 | </pre> |
| 27 | <h3><?php esc_html_e('Response Body:', 'translatepress-multilingual');?></h3> |
| 28 | <pre> |
| 29 | <?php print_r( esc_html( $response["body"] ) ); ?> |
| 30 | </pre> |
| 31 | |
| 32 | <h3><?php esc_html_e('Entire Response From wp_remote_get():', 'translatepress-multilingual');?></h3> |
| 33 | <pre> |
| 34 | <?php print_r( $response ); ?> |
| 35 | </pre> |
| 36 | </div> |
| 37 | </div> |
| 38 | |
| 39 | |
| 40 | </div> |
| 41 |