Questions tagged [curl]

The tag has no usage guidance.

29 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
1answer
1k views

Creating a post with the REST API, curl and oauth returning 401 error

I'm trying to create a WordPress post using the REST API, OAuth, and cURL. However, I'm running into some trouble. I'm able to create a blank post (no title, slug, etc) using the following code: $...
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 ...
2
votes
0answers
128 views

Login WordPress website using wp-rest api

I am using WordPress 4.8 and i am new to rest api . I have 2 websites , one is www.example.com and second is www.example.com/site2. That is second website is installed inside the first . In example....
1
vote
0answers
29 views

PHP to Handle API Return instead of print

My API End point has return statement instead of print or echo : e.g. return json_encode($data); instead of print json_encode($data); I have a curl caller to consume my API. When I try to display ...
1
vote
0answers
248 views

Curl requests sent two times

i've an issue with my curl request and i think it's coming from wordpress, i'm using wordpress to push data using curl & an API here is an example of curl method : public function pushtest() { ...
1
vote
0answers
914 views

wp_remote_get() to get AJAX url /wp-admin/admin-ajax.php

Regarding to this post I started to create an AJAX handler with the default WordPress AJAX API. I want to call a non-blocking call to another AJAX handler, in the same WordPress site. Order of ...
1
vote
0answers
842 views

WP OAuth Server “The grant type was not specified in the request”

I've installed WP OAuth Server to make an SSO thing with my Wordpress, but I can't get it to work proper. I followed this example on how to set up Single Sign On. I'm stuck at Step 3. I get this error:...
1
vote
0answers
322 views

get post content of particular post by url

I want to get the post content of particular post using Curl or any other methods from third party website is it possible? As the structure remains the same <entry-content> i guess there ...
1
vote
0answers
2k views

Why is json_decode failing?

I'm trying to determine if this is related to my having the latest version of PHP on my server while using the latest version of Wordpress. Or if I'm just doing it wrong: Here's my function that is ...
1
vote
2answers
751 views

Wordpress from url get external source title

Hi I am building a news website. I am trying to automate it. News url (metabox) Title Content area Image (featured image option on wordpress) When paste the site url I would like the other metabox ...
0
votes
0answers
24 views

What is causing REST API issues in the plugin/script for logons?

I am not really sure when the problem started but we have a long-standing and still very functional SSO script that was made in-house for automatic WP sign-in based on SSO handshake. The script is ...
0
votes
0answers
29 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
0answers
36 views

403 why this? what i´m i doing wrong

I'm trying to make a simple API request but I get the 403 code why? <?php $g2aEmail = 'xxx'; // customer email $apiHash = 'xxx'; // customer API hash $apiSecret = 'xxx'; // ...
0
votes
0answers
12 views

Change the product page 3rd party API

I´m trying to change product page inside a plugin that I´m developing but I have no idea what I´m doing wrong? I have tried to make a new curl request but from what I herd curl is not a thing in WP. ...
0
votes
0answers
56 views

WP-CRON is not working

my website is running on a ubuntu 18.04 vps and im using nginx i recently noticed that wp-cron is not getting excecuted properly so i installed WP-Cron Status Checker plugin and it shows cURL error ...
0
votes
0answers
161 views

Contactform7: display results from CURL

I am stuck into a problem. I sent contact form data through curl and I get a response from an API. How is it possible to display there results on my page? Ideally through AJAX and in my own custom ...
0
votes
0answers
471 views

Post to WordPress API using cURL and login cookies

I want to post from one WordPress install [SiteA] to another [SiteB] using the http API and cURL. I have found plenty of JS examples where the auth cookie is loaded into the browser, and then an AJAX ...
0
votes
0answers
116 views

Create a Wordpress post using curl comand from Linux console?

Is it possible to create a Wordpress page or post with a curl command from Linux console? I tried using the available REST API, but for some reason can't figure it out. If you could give me an ...
0
votes
0answers
140 views

Update products with curl (bash)

So i have a plugin that dose half the work, so i told my self why not make a bash file that can do that for me? with cronjob BUT the problem is that the Update part of my bash "script" is doing ...
0
votes
1answer
3k views

REST API works in browser and via AJAX but fails via cURL

I'm using a WordPress REST API to get contents of a page. The URL I'm using is: https://sitename.org/wp-json/wp/v2/pages/4322 When I open that URL in browser, I'm getting back valid response. ...
0
votes
1answer
384 views

Installation problem with wordpress xampp

I have installed wordpress in my xampp server. everything looks great. I am using proxy so i have added below snippet in wp_config.php to use proxies. /* Configure proxy Server */ define('...
0
votes
0answers
683 views

Set wordpress auth cookie from external site?

Im trying to setup a wordpress 1 click login to our companies wordpress sites, we have many. Ive been asked to create one and not use a third party. Ive managed to use PHP cURL to send a login ...
0
votes
0answers
623 views

Does wp_remote_post() require curl?

Does the following code require curl? $response = wp_remote_post( $url, [ 'body' => json_encode( $data ) ] );
0
votes
2answers
464 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( '...
0
votes
1answer
204 views

Sending WordPress database information to cross domain the safe way?

I want to send my options and WP_user database information to my AWS server from my WP site's database. I heard using PHP'cURL is not recommended. I want a safe solution so please aid me in the right ...
0
votes
1answer
60 views

Run Wordpress Plugin in the Specified time

I write the wordpress plugin . That Contains curl code... When I open wordpress site Ex(http://localhost/wordpress or http://localhost/wordpress/wp-admin ,...) this plugin running. But I Want Run ...
0
votes
0answers
46 views

wordpress database error

I write code to extract peice from website with curl. this should be refresh page to get price. I want store data in the wordpress database with foreach. when I refreshing page but give this error....
0
votes
0answers
149 views

Get full page HTML for a non-public Wordpress page

How can I write a function that will return the full rendered HTML of a non-public URL on my Wordpress site—a URL that you must be logged in to see, such as a draft? Not just the post content, but the ...
0
votes
0answers
85 views

Is it possible to make Wordpress as a RESTful app?

I'm planning to create a Wordpress plugin that accepts data via cURL and sends a JSON reply. The plugin will save the data in the database upon receive so there has to be some authentication and will ...