Questions tagged [wp-remote-get]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
23 views

Use wp_remote_get() with a private or password protected page?

Is there any way to use the wp_remote_get() function to access a WordPress page that is either set to Private -OR- password protected (using the native password option in the post visibility settings)?...
1
vote
1answer
227 views

Use wp_remote_get to get JSON instagram feed from public profile

I'm using the curl php library to get the instagram json feed from a given public profile. I want to use wp_remote_get() because on the host I'm using for this project, I don't have the ability to use ...
0
votes
0answers
60 views

Spektrix API v3 Authentication wp_remote_get()

I have a need to authenticate a GET request to Spektrix. The API requests that require authentication need an API Login Name and a API Secret Key. The API Secret Key needs to be base-64 encoded, and ...
0
votes
0answers
24 views

API call returning wrong data

My question/issue is that wp_remote_get() is pulling in the wrong page/data on one site, and I'm stumped. I have 3 WP sites. Site 1 has a page with content that is used across all three sites. The ...
0
votes
1answer
56 views

How to import the data to the post from an external URL?

I want to show the special data (a number) inside a WordPress page. This data is generated by an external API and changes from time to time. I don't have any clue how to manage this. The data I need ...
0
votes
1answer
76 views

Wordpress HTTP API NTLM Authentication

I was wondering if anyone has had to use NTLM authentication when using wp_remote_get? Trying to authenticate using Basic but that is returning the proxy error. When I use other authenticators for ...
0
votes
0answers
15 views

cUrl result: Tell if the result is a single post or a blog roll of latest posts?

If I cUrl a remote WordPress site, and I'm looking at the HTML response... What is the canonical method to determine if I'm looking at a blog roll, or a single post? My guess: I don't think there is ...
1
vote
1answer
339 views

How to convert this cURL to wp_remote_*?

My function below includes a cURL call which throws a text string at a Google Cloud text analysis API, returning a response object, which we then parse to get a specific piece. It has been ...
0
votes
0answers
62 views

wp_remote_get, how to update dynamically

please i want the ETHBTC price to be updating dynamically without refreshing the page,, if i use (meta http-equiv="refresh" content="5") it refresh the site. i want only the ETHBTC price to be ...
0
votes
1answer
453 views

wp_remote_get - cURL error 28 - only on same domain

On my website I use wp_remote_get to fetch data from mydomain.com/wp-json/wp/v2/pages/75 When I run it on my localhost it works fine, but after sending to production server (mydomain.com) suddenly I’...
0
votes
2answers
360 views

Cannot parse results from wp_remote_get

I'm calling an api with wp_remote_get and I can't seem to parse the results. Here is how I call the api: $url = 'https://blah/api/data/'; $args = array( 'headers' => array( ...
0
votes
0answers
338 views

pulling in external JSON search results into WordPress

I want to retrieve search results from a search appliance that gives results in JSON format. Interacting with the form below takes the user to a page of JSON data. Instead, I want to take the search....
0
votes
1answer
303 views

Passing cookies when using wp_remote_get

I'm working on a plugin that fetches remote RSS feeds using wp_remote_get. The problem is that Tumblr requires a cookie for GDPR compliance. This includes RSS feeds. Which means all Tumblr feeds are ...
1
vote
2answers
880 views

Remove caching from wp_remote_get calls from custom plugin

I wrote a plugin to hit an API and display results on a page. When I was testing, every time I hit "preview", the plugin would hit the API and retrieve the most recent data. Now that the plugin is ...
2
votes
1answer
2k views

How to wp_upload_bits() to a sub-folder?

I am using wp_upload_bits() to copy an obtained remote image... $upload = wp_upload_bits($file, '', wp_remote_retrieve_body( $get )); Image source example: https://logo.clearbit.com/starcomww.com ...
0
votes
1answer
704 views

Where would I put my call to wp_remote_get?

I have a sidebar is supposed to loop through a bunch of job postings that are fetched from a GET request. The resulting HTML should look like this: <div> <h4 class="myapp-sidebar-heaader"&...
0
votes
1answer
154 views

Install plugin on remote wordpress

I want to install a plugin using wp-cli (or anything else) on a WordPress based website. I have URL, admin-user, admin-pass only. (no FTP/ssh). I want to do it programmatically, without going into the ...
0
votes
0answers
471 views

wp_remote_get - curl error 28 connection timed out - using SANS in URL

I have WAMP installed and everything works fine locally with this wordpress code, but as soon as I upload this to our hosting company: goDaddy, I get a connection time out error. I'm not really ...
0
votes
1answer
170 views

wp_remote_get adding backslashes

I am having this issue where wp_remote_get appears to be adding backslashes "\" to my string. It also adds things in like body and headers. {"headers":{}, "body":" {\"page\":1,\"total_results\":44,\"...
0
votes
1answer
730 views

Daily automatic update of stock quotes via REST API and Cronjob. Or is there a more sophisticated way?

I'm building a stock database with WordPress. There is a custom Post Type stocks with the fields last_price and ytd_return (ACF). The database will hold around 2000 stocks. For the stock quotes I ...
0
votes
1answer
289 views

add pagination to wp_remote_get

I'm building a plugin for a client and it requires me to use wp_remote_get to retrieve records from their server. I have everything working but I can't seem to find any good examples of how you add ...
3
votes
0answers
137 views

How do I execute a wp_remote_get call using NTLM authentication?

I need to use ntlm authentication for a remote call, and I'm not sure how to configure the wp_remote_get call to do so. I have used wp_remote_get successfully in other situations without NTLM by ...
1
vote
1answer
445 views

Most performant way of fetching remote API data?

I am currently trying to speed optimise the fetching of the data via the remote API. I am using it in this way: $response = wp_remote_get('https://some-api.com/endpoint'); $response_body = ...
3
votes
1answer
510 views

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

I am developing a WordPress plugin and wants to run a background task that calls an API and updates database table. Now, the API can only give results for 5 DB entries in one go and for 500 entries in ...
1
vote
0answers
172 views

wp_remote_get times out on api request but jquery GET and postman work?

I'm working on a project with two themes. Theme 1 contains a custom WP REST endpoint I made. Theme 2 needs to make a GET request to the endpoint. Both projects are hosted locally. When I make a ...
2
votes
1answer
5k views

Trying to get an api request getting error 404

I'm trying to get a list of locations from a website called weedmaps. This is the code that I'm using: function call_for_api() { $url='https://api-v2.weedmaps.com/api/v2/listings'; $...
0
votes
1answer
340 views

Fetching data from another website results in a slow website?

I am fetching data from another website with the following code: <?php // IOCS logos $logos_url = 'https://www.someurl'; $logos_request = wp_remote_get( $logos_url ); if(is_wp_error($...
3
votes
3answers
2k views

How to get the generated query string of wp_remote_get?

I have some very basic data that I am posting to a proprietary lead capturing system. Whenever I submit my form data to their system the body of the request is an error 500 page. I am trying to debug ...
1
vote
2answers
11k views

WP_Remote_Get Not working

I have a plugin which uses wp_remote_get() and it's not working on my nginx server so I decided to test this. I created a file called test.php and inserted: <?php $response = wp_remote_get( '...
0
votes
1answer
103 views

GET web api method from a Wordpress PHP script

I'm working on relaying the information that the formcraft plugin dumps into a GET web api method. The information from the formcraft plugin is saved into the variable $_REQUEST. Formcraft calls the ...
3
votes
1answer
2k views

How to consume and display external data in WordPress from another website

I am trying to access data from another website to display on a WordPress Website I am developing. So far I have the following: <?php /* Template Name: Testing remote data */ ...
1
vote
0answers
342 views

How to create a WP Cron hooks based on schedules from Advanced cron manager plugin?

I need to run the following script once per 24 hours: (1) http:domain.com/wp-cron.php?import_key=Iq_GCn7v0&import_id=36&action=trigger the following one to run after the above, once or twice ...
0
votes
1answer
849 views

Errors on a single host using wp_remote_get() unless sslverify is set to false

I'm testing a plugin on HostGator, GoDaddy, DreamHost and DigitalOcean, developing locally with VVV. I'm running WordPress 4.4.2 across the board. I'm using wp_remote_get() to retrieve weather data ...
3
votes
1answer
915 views

wp_remote_get() not retrieving pages properly

I am using wp_remote_get() to retrieve different pages from the web. It is a news site. Most of the time, this works successfully. However, sometimes, the request returns success (code 200), but the ...
2
votes
2answers
1k views

What's a simple but secure method to get file contents into WordPress?

The scenario I'm developing a plugin, and part of it requires lots of text content (help descriptions) that I would prefer to keep as separate text files (in a subdirectory within the plugin) for ...
1
vote
1answer
164 views

Strange Situation When Try To Retrieve Github Gist Using wp_remote_get

I have fall in a strange situation. Take a look at below code: <?php $args = array( 'headers' => array( 'Accept' => 'application/vnd.github.v3+json', 'Authorization' =&...
5
votes
1answer
8k views

How to add Request header in WordPress remote api calls

Hey am new to WP development, can any one tell me how to add request headers in wp_remote_get() or wp_remote_post() remote api calls. I tried the following but didnt work $response = ...
1
vote
3answers
245 views

How to Download and install plugin database remotely

I have the following problem. I got a plugin that is huge due to all the data needed. The data is all the countries and cities in the world and also a maxmind.mmdb database. 1 - Issue Currently I got ...
0
votes
3answers
252 views

Remotely get WordPress theme version

I'm using wp_remove_get to get the WordPress theme style content (style.css) and then get the theme version number. However I don't know exactly what regex I should use to get the version code: <?...
0
votes
1answer
320 views

wp_remote instead of file_get_contents on non json

I have searched this website and although there are a lot of threads regarding the wp_remote functions but none are what I am asking and would like to know if its possible. I am wanting to scrape a ...
0
votes
1answer
2k views

Wrapping add_query_arg with esc_url not working

I know about the XSS issue related to add_query_arg()function. That is why I am wrapping it with esc_url(). Problem is...this is not working with wp_remote_get(). If I go: $url = add_query_arg( ...
4
votes
1answer
4k views

HTTP request on localhost failing

I have a Wordpress instance on my development box with the WP REST API plugin installed. I am attempting to create my own plugin to use wp_remote_get() to communicate with my own custom PHP ...
6
votes
2answers
3k views

HTTP digest authentication using wp_remote_get

I am able to implement http basic auth in wp_remote_get using the following code $args = array( 'headers' => array( 'Authorization' => 'Basic ' . base64_encode( $username . ':' . $...
1
vote
0answers
243 views

wp_remote_get sslv3 alert handshake failure

I'm attempting to retrieve remote content with wp_remote_get but I'm getting the following error returned : 'sslv3 alert handshake failure'. I've tried using 'sslverify' => false in the args array,...
0
votes
0answers
322 views

Is it possible to load an admin page inside a thickbox?

I'm currently trying to load a custom made admin page inside a thickbox. It's for creating new users with loads of extra custom data and none of the stuff I don't care about. Administrators can ...
1
vote
1answer
756 views

wp_remote_get() and javascript/noscript situation

I am using wp_remote_get() to get access to certain pages on the net. However, when I make a call using wp_remote_get(), the response I recieve is a webpage that contains the following lines of code: ...
0
votes
0answers
63 views

Should I use transients for these API call results?

I am consuming an API that gives me a list of people and their profiles. My initial idea was working perfectly fine when it's just the list of people because I was just saving the ids and names using ...
0
votes
0answers
2k views

wp_remote_get() never fires

I am quite familiar with the wp_remote_get() function. However, this one is blowing my mind. Here is my code to call the url: // data to send in our API request $api_params = array( ...
0
votes
1answer
409 views

http_response_timeout filter not working

I am writing a Wordpress plugin that makes calls to external sites. I want to raise the timeout for all wp_remote_* calls, so I added the following to the __construct function of my plugin: ...
0
votes
0answers
83 views

saving file to external server vip

I have a handwritten script that writes a text file locally in one of my Wordpress pages, but now I need it to read and write to a remote server that is password protected and accessible only through ...