Please save this code as php file and upload it to your plugins folder.
activate the plugin “Elementor Page Builder Template Library Testing”, Go to “Elementor TL Testing” menu and press the button.
paste the result here.
the code:
<?php
/*
Plugin Name: Elementor Page Builder Template Library Testing
Version: 1.0
License: GPL2
*/
define( 'ELEMENTOR_API_INFO_URL', 'https://my.elementor.com/api/v1/info/' );
add_action( 'admin_menu', 'etl_admin_menu' );
function etl_admin_menu() {
add_menu_page( 'Elementor TL Testing', 'Elementor TL Testing', 'manage_options', 'etl', 'etl_render_menu' );
}
function etl_render_menu() {
if ( isset( $_POST['etl_submit'] ) ) {
$response = wp_remote_post( ELEMENTOR_API_INFO_URL, [
'timeout' => 25,
'body' => [
// Which API version is used
'api_version' => ELEMENTOR_VERSION,
// Which language to return
'site_lang' => get_bloginfo( 'language' ),
],
] );
$httpcode = (int) wp_remote_retrieve_response_code( $response );
?>
<h2>Connection Errors</h2>
<?php
$errors = array();
if ( 200 !== $httpcode ) {
$errors[] = 'Fetching template libray failed with http code: ' . $httpcode;
}
if ( is_wp_error( $response ) ) {
$errors[] = 'Fetching template libray failed with error: ' . $response->get_error_message();
}
if ( ! empty( $errors ) ) {
foreach ($errors as $error ) {
echo $error . '<br>';
}
} else {
echo 'Check is ok.';
}
$info_data = json_decode( wp_remote_retrieve_body( $response ), true );
$templates = get_option( 'elementor_remote_info_templates_data' );
?>
<h2>Template Library Remote Response</h2>
<?php
if ( isset( $info_data['templates'] ) && ! empty( $info_data['templates'] ) ) {
echo 'Check is ok.';
} else {
echo 'Empty Value.';
}
?>
<h2>Template Library Saved Option</h2>
<?php
if ( ! empty( $templates ) ) {
echo 'Check is ok.';
} else {
echo 'Empty Value.';
}
}
?>
<div class="wrapper">
<h2>Elementor Page Builder Template Library Testing</h2>
<form action="<?php echo admin_url( 'admin.php?page=etl' ); ?>" method="post">
<label>Click to get debug info for elementor template library</label>
<button class="button button-primary" type="submit" name="etl_submit">Start The Test</button>
</form>
</div>
<?php
}