"kindly suggest corrections" - although SO isn't a code review site I'll throw my two cents in. Almost every single one of your comments is followed by a very obvious single command. For instance,
// Execute cURL request
is followed by
$response = curl_exec($ch);
Although this isn't wrong, many people find this style to be harder to read because they are effectively reading things twice. Further, debugging can be harder because you might mentally assume the comment aligns with the code. Generally speaking, I would recommend commenting only when something isn't directly obvious or expected. —
Chris Haas 1 min ago