Questions tagged [curl]

The tag has no usage guidance.

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

wp_remote_post vs curl to send data in Wordpress plugin

I have this curl code and is working as intended. This code contacts my server: $curl = curl_init(); $post_data = array(); $post_data[] = "plugin: $plugin"; $post_data[] = &...
Toniq's user avatar
  • 397
1 vote
0 answers
50 views

Blocking the direct access to images in the upload folder WordPress

To prevent direct access for images in upload folder we have following configuration in Nginx configuration: location ~* \.(jpg|jpeg|png|gif)$ { valid_referers example.com https://example.com; ...
DevTeam's user avatar
  • 11
0 votes
0 answers
92 views

cURL error 28: SSL connection timeout while can download the plugin file

I have this error in a WordPress wp-admin (the error is translated and not sure the exact English error, but I add file name and line number): in /home/user/public_html/wp-includes/update.php on line ...
Saeed's user avatar
  • 109
0 votes
0 answers
463 views

rest_cannot_create_user - Sorry, you are not allowed to create new users. CURL WORDPRESS REST API

$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://localhost/wordpress/wp-json/wp/v2/users/'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, ...
Apurva's user avatar
  • 101
0 votes
1 answer
27 views

cURL request to plugin repository fails 403

I am trying to update a file in my plugin by getting the original contents from the wordpress repository via cURL The URL is of the format https://plugins.svn.wordpress.org/(plugin)/trunk/includes/...
Steve's user avatar
  • 263
1 vote
1 answer
617 views

How to use the HTTP API (wp_remote_get) instead of cURL?

I'm running into a problemen while trying to change my cURL request into a request using the HTTP API. Below code is my (old) cURL request. Here I'm getting some contents from an external URL. This is ...
DeltaG's user avatar
  • 869
0 votes
1 answer
44 views

Get single item from cURL plugin API call inside bash [closed]

I'm trying to get only the last_updated date from a plugin through an API call in a bash script. I'm trying to use cURL but that's giving me some issues. On the browser I can get to to plugin like ...
ecotechie's user avatar
0 votes
0 answers
90 views

Using file_get_contents within admin but keep logged in

Quick question as I'm not having much luck finding an answer on Google. I'm running a file_get_contents in a plugin I'm building to get the HTML of another page within the admin. The HTML is showing ...
ValhallaSkies's user avatar
0 votes
1 answer
292 views

cURL External API request displays content above other content on page

I've built a plugin to display our customer feedback on our WordPress website. We use an external feedback system called 'Customer Thermometer'. They have a simple API to use a URL to request stats ...
John Emmett's user avatar
1 vote
1 answer
710 views

How to convert this cURL to wp_remote_get?

I want to convert curl to wp_remote_get. $url = 'https://accounts.google.com/o/oauth2/token'; $curl_post = 'client_id=' . $client_id . '&redirect_uri=' . $redirect_uri . '&...
Yogesh's user avatar
  • 11
0 votes
0 answers
46 views

Curl error while creating user

I have a problem when trying to create users with authentication via plugin: "application passwords" curl -X POST --user "applogin:y530 8Uf9 OMSW sSsR Q0S8 zaqS" "http://...
Graig's user avatar
  • 3
1 vote
1 answer
119 views

File Type Is Not Permitted - Cronjob

I am currently developing a cron job that downloads a xml file from an external source and stores it within wordpress media. For debugging proposals, I have installed the plugin Advanced Cron Manager, ...
Basti's user avatar
  • 63
1 vote
0 answers
150 views

export a csv file from the database with a cronjob

I'm using an event plugin, which doesn't have a user-friendly function for showing a list of bookings. That's why I wrote a php+js script myself to display that data in a nice way. But to use my own ...
mathiflip's user avatar
0 votes
1 answer
2k views

Call external API in wordpress based on user input

I want to create a simple wordpress website in which I want to display a search box on a page. On searching a string in text/search box, an external API call should be made based on that string and ...
Vyom's user avatar
  • 3
0 votes
0 answers
98 views

CURL error with REST API

Having a very odd behavior. Using site health plugin; I was getting errors with CURL & Loopback. At any rate, I fixed both these issues on the server; however, it appears that other websites (also ...
Tamer Ziady's user avatar
0 votes
0 answers
179 views

Getting Download failed. cURL error 28: Connection timed out after 10001 milliseconds

I'm trying to install some external plugins that came with my theme and I can't see to find a way to get the communication to work properly. I also have this issue being reported when trying to start ...
Vast's user avatar
  • 1
1 vote
1 answer
94 views

How to create a post using REST API with sending data as a JSON body?

I am able to create posts on my WordPress website using it's REST API with the below curl request format. Website uses basic auth plugin for the authentication process. curl --user "username:...
Priyantha Buddhika's user avatar
1 vote
1 answer
349 views

Wordpress curl timing out and saying 'Moved Permanently'

I tried updating to wordpress 5.6 and it did not work. I tried installing a plugin for offline updates and the plugin install gave the same error: Download failed.: cURL error 28: Connection timed out ...
ehammer's user avatar
  • 13
0 votes
1 answer
200 views

cURL error for cron

I have this error which causes me a lot of trouble with all of my crons for some of my website : cURL error 28: connect() timed out! The websites are stored on a shared servers i guess, how can I ...
Morgan Tartreau's user avatar
0 votes
0 answers
2k 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 ...
omarhabeh's user avatar
0 votes
1 answer
1k views

Uploading a media item with the wp-json API to a specific path

I'm using the WP-JSON API to import all my posts from my live site to my development site. It's working fine for posts, categories and authors, but when I upload my images, the API treats the files as ...
Pezholio's user avatar
  • 101
1 vote
0 answers
771 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 ...
omarhabeh's user avatar
1 vote
1 answer
153 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 ...
jprice92's user avatar
  • 111
2 votes
0 answers
12 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 ...
Craig Stelter's user avatar
0 votes
0 answers
455 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 ...
user avatar
2 votes
0 answers
3k 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 ...
John's user avatar
  • 21
2 votes
1 answer
1k 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 ...
sialfa's user avatar
  • 319
0 votes
1 answer
398 views

Inconsistencies between wp_remote_post and cURL

I can successfully make the RESTful post using cURL: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.mindbodyonline.com/public/v6/usertoken/issue'); curl_setopt($ch, ...
MikeiLL's user avatar
  • 559
0 votes
0 answers
180 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-...
BBBBB86's user avatar
  • 13
0 votes
1 answer
606 views

WordPress transient not working with WP Engine

For some reason, when we we're on another server (Tierpoint) everything worked fine and we recently switched over to WP Engine and the transients that I was using for my module have stopped working. ...
user avatar
1 vote
2 answers
2k views

Download failed cURL error 7: . Can't update anything

Please, help. I want to update WordPress(or plugins), but always the same error: 'Download failed: cURL error 7: .' OS: Linux Fedora 30. Server: nginx. DB: MySQL 8.0. PHP 7.3 I have installed all ...
Yana Gushlevskaya's user avatar
2 votes
0 answers
527 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 ...
Kyle Calica-St's user avatar
1 vote
2 answers
2k 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 ...
Robert Andrews's user avatar
0 votes
1 answer
1k 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 ...
vanurag's user avatar
  • 111
4 votes
1 answer
2k 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’...
Seba's user avatar
  • 41
0 votes
2 answers
6k views

How to send a HTTP Post request using PHP Curl and Wordpress

I am working on a script to bring in an xml file from another server via Post request, This would then return another xml of data which I can then store into a wordpress database depending on certain ...
user1348927's user avatar
0 votes
1 answer
903 views

AJAX error handling for submit function in functions file

I have created a custom function in my functions.php to handle form submissions for a Mailchimp subscriber list. I am making an AJAX call in my JavaScript to process the PHP. The problem I am facing ...
user13286's user avatar
  • 393
6 votes
1 answer
3k views

cURL 28 error after switch from to brew php 7.2 on localhost

I've been running into trouble with all my localhost install of Wordpress reporting cURL error 28 (timeout) since (I believe!)I've switched my PHP version from 7.0 to 7.2 with brew on my local Mac OS ...
kontur's user avatar
  • 133
0 votes
0 answers
799 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 ...
user161783's user avatar
0 votes
1 answer
9k views

Add media with WP-Rest-API v2 II

I am having this exact question, asked in 2015, about adding media through the WP REST API. My code so far: curl -s -X POST http://www.example.com/wp-json/wp/v2/media/ -H "Content-Type: ...
Brethlosze's user avatar
0 votes
2 answers
1k views

Download file using cURL into wp-includes/uploads

I have a save post hook that looks like this, it should download youtube thumbnail to wp-includes/uploads base on video id provided. But it doesnt save anything. add_filter( 'save_post', function () ...
Jirka Kastan's user avatar
0 votes
0 answers
1k 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 ...
John Dee's user avatar
  • 493
2 votes
0 answers
2k 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 ...
Radoslav Stefanov's user avatar
1 vote
0 answers
48 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 ...
Shrinath Shetty's user avatar
0 votes
1 answer
2k views

SOAP Request/Parsing XML From wp_send_json_success

I'm developing a cURL and AJAX SOAP request to grab XML/WSDL data. The request is effectively grabbing the data I want and I am using wp_send_json_success(); to manipulate the response. The response I ...
zqhmagic's user avatar
0 votes
2 answers
1k views

Use WP admin AJAX url to hide API key

Currently I am using AJAX to request a simple JSON response from an external API. The problem is, that the API key is exposed. I'm aware the best method is to process this through admin-ajax and set ...
scopeak's user avatar
  • 213
1 vote
2 answers
34k views

cURL - How to send and fetch data in Wordpress

BACKGROUND After the user on domain1 clicks a link to domain 2, I need to send also the user-data (username,email,..) from server1/domain1 to server2/domain2 and to save it temporary in the server2/...
murcoder's user avatar
0 votes
0 answers
335 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 ...
Zoric's user avatar
  • 39
1 vote
0 answers
1k 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() { ...
Aliiiiiiii's user avatar
0 votes
2 answers
6k 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. ...
asprin's user avatar
  • 109