<?php
//todo this data must check for timestamp
//todo this data must check when pro is install
add_filter('pre_http_request',function($data,$parsed_args, $url){
    if ($url=='https://my.elementor.com/api/v2/info/'){
        $endpoint_data=checkAccessToEndpoint('https://my.elementor.com/api/v2/info/');
        if (empty($endpoint_data)){
            $file_data = file_get_contents( __DIR__."/online-data/info.json" );
        }

        $data=[];
        $data['body'] = $endpoint_data ?? $file_data;
    }
    return $data;
},10,3);