Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [curl]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
20 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
10 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
9 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
0answers
72 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 ...
0
votes
0answers
17 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 ...
0
votes
1answer
30 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 ...
0
votes
1answer
59 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 ...
0
votes
0answers
23 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
0answers
127 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
1answer
84 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
2answers
966 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 ...
0
votes
1answer
33 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 ...
0
votes
0answers
47 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. ...
6
votes
1answer
1k 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 ...
0
votes
0answers
248 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
1answer
1k 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: ...
0
votes
2answers
212 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 () ...
0
votes
0answers
597 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 ...
2
votes
0answers
224 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 ...
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 ...
0
votes
1answer
951 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 ...
0
votes
2answers
395 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 ...
1
vote
2answers
6k 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/...
0
votes
0answers
165 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 ...
1
vote
0answers
309 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() { ...
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. ...
-1
votes
1answer
125 views

How to send user data from one website to another

I need to send user data (some parts of user and user_meta), from Website A to Website B (both are Wordpress Websites) over a secure Protocol, after clicking on a button. According to this post, a ...
1
vote
1answer
2k views

Where Does Wordpress Make cURL Requests? How To Add cURL Option

I have been getting this error when trying to install plugins: Installation failed: Download failed. cURL error 18: transfer closed with 2126 bytes remaining to read. I have found a solution on how ...
1
vote
0answers
329 views

XML-code sent via the POST method to the URL (API) [closed]

I am building a webshop for a client who makes use of drop shipping service. The customer can place the order on the website and the order will be send to the dropshipper automatically. This is done ...
1
vote
1answer
54 views

How can i get the post's full html source by its ID?

Is there a way that i can get the HTML source of a single post dynamically from within WordPress site? for example, if i wanted an external html I would use: file_get_contents($url) or using cUrl, ...
2
votes
0answers
130 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....
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: $...
1
vote
1answer
1k views

How to send file by wp_remote_post?

I don't want cURL in my WordPress plugin Hi, cURL is not safe to use on WordPress site. And sometime, cURL has been disable on customer hosting. And i decided to use wp_remote_post to send file for ...
0
votes
1answer
417 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
746 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
672 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
2k views

cURL error 6 on news area, and also won't auto update

I'm trying to get my blog to work with the auto-updates, after recently getting hit with a "hack" where someone overwrote an article (nothing too malicious, but we lost the article). The problem is ...
0
votes
1answer
4k views

Problem with cURL and rest API

I use last version of wordpress and woocommerce but I get this {"code":"woocommerce_rest_cannot_view","message":"Sorry, you cannot list resources.","data":{"status":401}} when I try to get product by ...
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 ...
9
votes
1answer
2k views

Uploading media with the REST API

I am having trouble when uploading media to a WordPress site with the JSON REST API. With the following code I can upload the photos, but no info is assigned to them, not even the name - in fact the ...
0
votes
1answer
323 views

Using PODS data with save_post

I'm trying to use the save_post hook to send an SMS to a telephone number entered into a PODS custom post type. The SMS should be sent when the record is saved. add_action( 'save_post_appointment', '...
0
votes
1answer
59 views

Update File Once Every 30 Days

I'm building a plugin that requires a database file which is updated monthly. I would like to write a function that automatically replaces the old file once every 30 days. Here's what I have so far. ...
1
vote
2answers
3k views

Post to WordPress from another Server via PHP

I have running a wordpress site on - lets say - "site.com" and another site "input.com" hosted in completely different locations. As the name suggests, "input.com" should be used as a input site with ...
18
votes
4answers
43k views

How to use OAuth authentication with REST API via CURL commands?

I am trying to use the WordPress Rest Api with authentication to get more data from the API. I have installed the Oauth plugin, rest-api plugin, and gotten API credentials from WP-CLI. I have ...
1
vote
2answers
790 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 ...
3
votes
1answer
4k views

How can I use CURLOPT_USERPWD in wp_remote_post?

I'm trying to setup a proper cURL call in WordPress so am using wp_remote_post(). However, I'm having trouble authenticating the user via wp_remote_post(). Any idea how to convert the following to be ...
1
vote
0answers
881 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:...
0
votes
1answer
2k views

Use WordPress user database in external php application

As the title tells I'm looking for a solution on how to use my wordpress database in an external php application. I want to use Wordpress because I want only one place for users. One place one ...
0
votes
2answers
508 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( '...