Questions tagged [curl]

The tag has no usage guidance.

45 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
1answer
2k 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
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 ...
2
votes
0answers
9 views

How to automate filing a form as a user

Sincere apologies if this has been asked and answered. I'm a software developer with almost 0% experience in web. I write C/C++ engineering applications. I want to automate filling in a form on a ...
2
votes
0answers
121 views

Wordpress API returns empty page when page is less than X-WP-TotalPages

I am querying in the Wordpress API for all pages of media attachments. I am going page by page. I have about 5800 pages and when I hit pages 50-53 they return a blank or more of a [] but it is a ...
2
votes
0answers
597 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 ...
2
votes
0answers
135 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....
2
votes
2answers
596 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
1answer
18 views

Programmatic Login from 3rd Party site

I'm trying to do a sort of SSO/programmatic login solution for our wordpress site from our separate web application. I don't have a lot of experience with wordpress so I assume there's something I'm ...
1
vote
1answer
342 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 ...
1
vote
0answers
30 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
493 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
1k 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
921 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
330 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
1answer
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
838 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
14 views

Adding data to Yoast Meta Title/Description through Wordpress Rest API

I have been trying to add data via WordPress Rest API to the Yoast fields of meta title/ description but it doesn't seem to update it. I have used the following code where I have passed the meta ...
0
votes
0answers
18 views

WP Refused to display 'URL' in a frame because it set 'X-Frame-Options' to 'sameorigin'

I'm a beginner to WP development, I'm editing a plugin to add third-party payment gateway when i did the same code in normal php files i didn't had any error and it worked yet in WP cURL didn't follow ...
0
votes
0answers
12 views

CF7 bitrix24 webhook don't sent files

I use standard webhook template for integrate CF7 to bitrix24. All works fine exclude files. I see nothing in CRM. add_action( 'wpcf7_mail_sent', 'your_wpcf7_mail_sent_function' ); function ...
0
votes
0answers
45 views

cURL RETURNTRANSFER function in wp_remote_post

I have this cURL code below which is running on PHP, yet when I did it with WordPress it didn't work. I tried using WP_REMOTE_POST I couldn't do the return transfer function of cURL, what can be a ...
0
votes
0answers
8 views

Remotely access WP Admin menus / functionalities

I am building an app which manages WP sites remotely. All that is managed via the WP RestAPI poses no problem, but for such things as upgrading\ Updating / Uninstalling plugins, and other similar ...
0
votes
0answers
21 views

Retrieving X-WP-Total header using cURL

I am accessing a WP site from an outside app and using the restAPI routes / endpoints to work with posts, pages, comments, users, etc... I am wondering how I can change / use the below cURL to ...
0
votes
0answers
26 views

Installation failed: <!DOCTYPE html> 504 - Gateway Timeout

When installing the big plugins I am getting this error - WooCommerce. This problem does not happens with small plugins. It takes long time to install the plugin. Installation failed: <!DOCTYPE ...
0
votes
0answers
359 views

cURL error 60: SSL certificate problem: unable to get local issuer certificate

I've been researching for hours, but I don't seem to find a solution. I've tried every single solution I've found. We're running Wordpress 5.4 with PHP v7.4 in a Windows 2019 server that's behind an ...
0
votes
0answers
80 views

Download failed. cURL error 6: name lookup timed out

The problem is that I get Download failed. cURL error 6: name lookup timed out when getting a parent theme on wordpress.
0
votes
0answers
42 views

Hide response returned from WordPress REST API call

I have created this simple WordPress REST API where users can perform:   Option A • Types in the following URL in browser:       → www.example.com/wp-...
0
votes
0answers
20 views

WordPress transients not rendering

Could someone tell me what I might be doing wrong with my below cURL + Transient call? When the page loads the first time, it pulls in all the cURL data and then on refresh it's not loading anymore. ...
0
votes
0answers
202 views

cURL timeout error 28 in Site Health and Sucuri SiteCheck

I run a server hosting multiple WordPress installations with the iThemes Security Pro plugin installed. One of the things that this plugin does is it uses Sucuri SiteCheck to scan the site 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 ...
0
votes
0answers
30 views

WP-Cron: Cannot execute crons on servers without registered domains

My test environment does not execute WP-Crons properly because cURL can't connect to the "fake" domain. I'm using WP 5.23 on an NGINX server without a registered domain (by editing my hosts file). ...
0
votes
1answer
609 views

mysqli_query(): MySQL server has gone away for Curl Request

I have created a WordPress Plugin which after activating shows result in jquery Datatable. We are fetching the result via CURL Post. The Post URL is a ASP.Net Application on Windows Server. The plugin ...
0
votes
0answers
24 views

Where is the location header?

When I curl a page of mine, I notice that it is moved permanently to... itself: PS C:\Users\Ooker> curl -I xn--qucu-hr5aza.com/page/2 HTTP/1.1 301 Moved Permanently Server: nginx Date: Wed, 21 Aug ...
0
votes
1answer
456 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
446 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
745 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
226 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
4k 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
453 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
942 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
736 views

Does wp_remote_post() require curl?

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