Trying to get an api request getting error 404

Try using a GET request instead of a POST request. The headers indicate they only allow origin from weedmaps.com in the POST request. The method in WordPress is wp_remote_get(). function call_for_api() { $url=”https://api-v2.weedmaps.com/api/v2/listings”; $response = wp_remote_get( $url, array( ‘timeout’ => 45, ‘redirection’ => 5, ‘httpversion’ => ‘1.0’, ‘blocking’ => true, ‘headers’ => array( ‘accept’ => … Read more

Is there any background process that I can run from plugin without depending on page hits on a website without affecting page-load speed?

There is no reason for your design, but the core of your problem is that (I assume) people are trying to use a free tier of the API instead of properly paying for its use and removing the ridiculous restrictions. Anyway, the solution is fairly simple, run your cron every half an hour, allocate to … Read more

wp_remote_get vs. fetch_feed ? which is the better for performance?

Neither are high performance, and they do different things. fetch_feed is for grabbing feeds RSS feeds etc, wp_remote_get is for grabbing arbitrary items. Neither are fast, and the performance difference between each is negligible or irrelevant, but technically fetch_feed is slower than wp_remote_get, not because it’s faster or slower at grabbing over the network, but … Read more

wp_remote_get() not retrieving pages properly

The HTTP request sent by wp_remote_get() is different from the one that a browser sends. E.g the user-agent is different (see documentation). Some websites respond differently based on this. The second argument of wp_remote_get() allows one to alter the request. Websites might also respond differently depending on the IP or the number of requests received … Read more

wp_remote_get – cURL error 28 – only on same domain

By default, WordPress set the timeout value for cURL in wp-includes/class-wp-http-curl.php to 5 seconds and the same value is also set to HTTP requests in wp-includes/class-http.php that is a newer class for making HTTP requests that can use also cURL if it’s present in the server. In your case, 5 seconds was not enough to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)