Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

The tag has no usage guidance.

0
votes
1answer
44 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
38 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
29 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
0answers
18 views

wp_remote_get is stripping out Link header values

Using this code: $get_webinars = wp_remote_get('https://link.com/api/v1/accounts/6/courses?per_page=250&include[]=syllabus_body', array( 'headers' => array( 'Authorization' => '...
0
votes
1answer
182 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
76 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 ...
1
vote
0answers
65 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
73 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 = ...
1
vote
1answer
60 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
59 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 ...
0
votes
0answers
96 views

wp_remote_request does not return a response from from server when ran as Cron

Problem: wp_remote_get/wp_remote_request of a specific https target fails to return a response unless ran via WP_CLI function. $wp_remote_args => array( 'timeout' => 5, 'sslverify' =>...
2
votes
1answer
2k 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
154 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($...
0
votes
1answer
296 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 ...
0
votes
2answers
4k 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
90 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
1k 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
198 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
528 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
574 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 ...
3
votes
2answers
578 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
94 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' =&...
1
vote
1answer
3k 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
228 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 ...
0
votes
2answers
184 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
204 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
906 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
3k 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 ...
5
votes
2answers
2k 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
206 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
278 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
586 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
57 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
1k 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
281 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
72 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 ...
5
votes
3answers
18k views

using wp_remote_get instead of file_get_contents [duplicate]

have run my theme through the Theme checker plugin and it seems upset about use of 'file_get_contents' to get a json url. I've found posts saying i should use wp_remote_get. I'm currently decoding the ...
1
vote
1answer
1k views

Use wp_remote_get to add image to media library

I'm using Embedly to make it easy for a client to add news to their website - basically, they just input a URL, and Embedly grabs the link's information, and I add it all to post meta for displaying ...
0
votes
0answers
2k views

How to use wp_remote_get in place of file_get_contents?

I am trying to implement this plugin( http://wp.tutsplus.com/tutorials/creative-coding/creating-a-simple-backuprestore-settings-feature/ ) with my theme. Everything's working great. but the problem is ...
3
votes
4answers
3k views

rewrite script to use wp_remote_get instead of file_get_contents_curl

I have a script that pulls the facebook likes via facebook graph and writes them in my DB. However it uses file_get_contents_curl for the request and this is causing problems, so I'd like to use the ...
3
votes
1answer
3k views

wp_remote_get returns an error for valid URL

I currently have the following snippet of php to fetch some HTML and render it in my theme(squash theme). <?php $response = wp_remote_get( 'http://www.toucan-it.co.uk/wp-content/themes/squash/...
0
votes
2answers
388 views

how get number of twitter followers in wordpress

I used function to get twitter followers function twitter_count($twitter_user){ $count = get_transient('twitter_count'); if ($count !== false) return $count; $count = 0; ...
0
votes
1answer
1k views

@file_get_contents and wp_remote_get

$content = json_decode(@file_get_contents($query)); what correctly replacement for @file_get_contents in this string? if i just replace @file_get_contents for @wp_remote_get i get error Warning: ...
0
votes
1answer
819 views

calling admin-ajax.php from admin-ajax.php

I'm writing a plugin that calls the output of another plugin's ajax, which is set-up at wp_ajax_ I would have called the functions directly, but limitations in the plugin make that a non-option. To ...
3
votes
1answer
3k views

wp_remote_get vs. file_get_contents vs. cURL?

I need to fetch the contents of a remote file. Which is better for performance - wp_remote_get, file_get_contents, or cURL? How exactly does wp_remote_get work? Can you suppress errors, ex. @...
0
votes
1answer
2k views

wp_remote_get with Google Books API

Trying my hand at pulling some info from Google API, and having a bit of trouble. My code: $body = array( 'intitle' => 'Test', //Returns results where the text following this keyword is found ...
0
votes
2answers
1k views

AJAX request not routing through proxy

I've built a plugin that uses AJAX to post a URL to the URL2PNG API and bring back a screenshot into WordPress via wp_remote_get. It works beautifully in my development environment. In production, ...
1
vote
1answer
467 views

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

I m trying to share my web site contents for other web sites using by external loop file or rss file. when i asked some questions about wp_remote_get function ; @Serkan suggest to me , using ...
0
votes
2answers
1k views

Issues with downloading a file with wp_remote_get()

I'm using wp_remote_get() to download a remote file with the following URL: http://feeds.paidonresults.net/1.0?affiliateid=34069&feedid=M742&template=CSV&CSVSeperator=comma&...
1
vote
1answer
741 views

On Plugin Activation, How Do I Check for Proper Transport Mechanism?

For a plugin that communicates with somewhere else, I hear we're supposed to use wp_remote_post and wp_remote_get instead of PHP's Curl library. Okay, but is there a fast and proper way on plugin ...