Questions tagged [wp-remote-request]
The wp-remote-request tag has no usage guidance.
33
questions
0
votes
1
answer
65
views
WordPress getting data from external API
I am trying to create a Plugin that does the following jobs:
Authenticate the user to get Bearer token 'access_token'
Get data from API and store in Database
I have checked all the APIs and ...
0
votes
0
answers
41
views
Send PUT remote request with BuddyPress checkbox
I am trying to create a code that when a BuddyPress user set active a Xprofile field checkbox a PUT remote request will trigger and update a single property of json endpoint, but i am not able to get ...
1
vote
1
answer
194
views
Why is this specific API request failing when sending via wp_remote_post?
I'm pulling my hair out trying to make a POST request to an API endpoint using wp_remote_post.
The API needs a request with content-type multipart/mixed but WordPress doesn't seem to play nicely with ...
2
votes
1
answer
1k
views
Wordpress wp_remote_post vs wp_remote_request
I'm somehow new to Wordpress and its API and while writing an simple Rest Service to an remote Server i have been asked to use the native wp_remote_X functions.
Right now i have some trouble to ...
1
vote
1
answer
916
views
WP_REMOTE_POST Requests are being blocked by API provider [closed]
I'm trying to make some API POST requests via WordPress' own method i.e. wp_remote_post()
Here is the sample code I'm using:
$args = array (
'sslverify' => false,
'headers' => [
'...
2
votes
0
answers
51
views
What would be the best way to implement Magic Link logins in WordPress?
On the internet I saw several plugins/services offering a kind of a 'magic login' link functionality. This allows users to sign in without a password but with a magic link.
That made me wondering: If ...
0
votes
1
answer
1k
views
wp_remote_post sends empty body
I made an api with nodejs and i'm trying to make some calls to it throught wordpress, all the requests works correctly but when i add a request body it is sent empty, i tried to search what was the ...
0
votes
0
answers
96
views
Can I call a functions.php file from a different URL?
I have several(5+) sites that are very similar in functionality. With that I have the same amount of functions.php files and child themes.
What I'd like to do is have one common functions file and ...
0
votes
1
answer
412
views
Using webhook sending message to telegram from wordpress?
I want send a message to telegram whenever a form submitted. i am using gravity form plugin form. and it has the hook
add_action( 'gform_after_submission', 'post_to_third_party', 10, 2 );
which will ...
1
vote
3
answers
1k
views
is_admin() returns false in save_post hook with Gutenberg editor
I have a plugin that implements a REST API that needs to be notified when an admin adds one of my supported shortcodes to a page or post. I hook save_post with my function like this.
...
4
votes
2
answers
2k
views
Custom routes for custom post type?
I have a custom post type called 'event'. An event has multiple subpages like registration, speakers, contact us, etc. Currently the content is saved as one or more custom fields.
I would like to ...
1
vote
0
answers
2k
views
how to avoid timeouts with remote API requests?
I'm developing a plugin, WP SoundSystem, that makes Wordpress rest requests to my remote API api.spiff-radio.org.
That API is scraping content on the web.
Which means that it might be slow to get the ...
0
votes
1
answer
277
views
wp_remote_request to url with port 8001 not woorking
I try to send a request with the function wp_remote_request and it is not accepted
(Note the port at URL)
When I download the port it is accepted
Where's the problem?
tish is the code:
$args = ...
1
vote
0
answers
1k
views
wp_remote_request header error even though working properly with cURL
I'm trying to make calls to a JSON API inside my wordpress theme.
I tried with the cURL option, making a custom function and things works as it should but I wanted to use the built-in wordpress ...
0
votes
1
answer
614
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
0
answers
1k
views
view counter update in WordPress REST api HTTP get
I use WordPress rest API for app communication with my site in need update post view counter when HTTP get API.
I search a lot but nothing found about it, in a tutorial "Find popular posts with the ...
0
votes
2
answers
960
views
How to debug new shortcode? And how to get string from shortcode into code?
I am trying to write a simple plugin that fetches some data from an API endpoint. I am planning to read the api key from a shortcode, but didn't get that far yet.
I wrote the following piece of code. ...
2
votes
0
answers
278
views
Proxy not working with Requests::request_multiple()?
I try to send async multiple requests with proxy option by built-in WP Class Requests, but it's not working.
$options = array(
'proxy' => $proxy
);
Single Request, it's working, so the proxy ...
-2
votes
1
answer
2k
views
How can I interact with a third party service that sends POST requests to me in response to the order information that I send them?
I'm developing a payment gateway for Wordpress. I should send the data to a third party and get the confirmation code (and other info) from them. The problem is that they don't return this ...
0
votes
1
answer
485
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 ...
3
votes
2
answers
794
views
Is curl required?
My admin panel is very slow I've tried to debug the issue. I nailed it to the function wp_remote_post and an internal error message thrown by curl on this line
return new WP_Error( '...
1
vote
0
answers
232
views
wp cron job fires at every second or so, if callback is wrapped with DOING_CRON check it never fires at all
I am a bit lost while dealing with a open source plugin implementing wp cron.
You can read about the problem on github https://github.com/nekojira/wp-currencies/issues/6#issuecomment-116735909 - I ...
26
votes
3
answers
23k
views
Is it safe to use sslverify => true for with wp_remote_get/wp_remote_post
I normally use this argument to prevent errors with wp_remote_get and wp_remote_post
array(
'sslverify' => false
)
For security reasons I would like to set it to true (or remove it since the ...
0
votes
2
answers
1k
views
How can I call specific function if requested URL is not found?
My website is fully API based and builds pages/posts from API data.
I was thinking to create something like PHP magic function __call to call specific function when requested URL would return 404, but ...
0
votes
0
answers
126
views
Submit form stored in one plugin from another plugin?
I have two plugins pluginA and pluginB. PluginA contains a form with a single button which when pressed will do some calculations.
PluginA works fine, however, I want to be able to submit this form ...
0
votes
1
answer
603
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:
...
1
vote
1
answer
2k
views
How to run a function on plugin's options page?
I am writing a plugin that syncs data from a third party service to custom post types in wordpress via HTTP/SOAP. There will be the option to run it on an interval (using wP_cron functions) but I also ...
8
votes
1
answer
11k
views
How to use the HTTP API with a Proxy?
If I want to route a HTTP request through a local (alias: on the current server) Proxy, how would I go around this?
The allowed Proxy settings for the wp-config.php are the following:
# HTTP Proxies
...
4
votes
2
answers
815
views
WP_Http_Cookie destroys cookie value through urldecode()
Background: Working on a Widget that uses a remote API using wp_remote_post to log into the service, once logged in storing the cookies received for the second request to query data with wp_remote_get....
3
votes
2
answers
2k
views
Facebook OAuth, WP_Http::request() vs wp_remote_request()
Running WordPress 3.3.2 and PHP Version 5.2.17
I'm trying to get the access_token from Facebook using wp_remote_request() and Facebook OAuth API (btw, working example at the end of this entry).
Is ...
1
vote
1
answer
270
views
how to remotely check a username / password from within a plugin
people need a user account on my site to be able to download a plugin. I want to add an activation function in the plugin so a user must supply their username and password the first time they use the ...
0
votes
1
answer
3k
views
Wp Remote get with manual redirect
I set
add_filter( 'http_request_redirection_count', array($instance,'SetDirectionCount'));
to 0
I try to get 'http://boards.ign.com/The_Vestibule/b5296/' or 'http://www.informationweek.com/story/'...
1
vote
1
answer
792
views
Using wp-cron in backpress - problems with wp_remote_post, fsockopen error
I'm working on a BackPress project where I need to schedule cron tasks. The cron_uri for BP is stored in options, rather than hardcoded as it is in WP core. I've tried setting the option to mysite.com/...