Questions tagged [curl]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
461 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
0answers
23 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
28 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’...
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....
0
votes
2answers
49 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 ...
1
vote
2answers
749 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
1answer
27 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 ...
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: $...
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
0answers
35 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. ...
5
votes
1answer
621 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
55 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
159 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
747 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: ...
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 ...
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 ...
0
votes
2answers
107 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
469 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
114 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
853 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
280 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 ...
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 ...
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 ...
1
vote
2answers
4k 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
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 ...
1
vote
0answers
244 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
votes
1answer
82 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 ...
0
votes
1answer
483 views

Error: Can´t access facebook comment plugin admin page

The plugin i'm talking about is facebook-comments-plugin The problem is i can´t access admin page: /wp-admin/options-general.php?page=fbcomments This error is happening: PHP Warning: DOMDocument::...
1
vote
0answers
278 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
43 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, ...
1
vote
1answer
940 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
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
682 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 ...
1
vote
2answers
10k views

Creating login session via CURL

Using the following code I experienced some problems: Login works but every link in the dashboard I will click will follow into the 404 not found page. It seems that there won't be a working session ...
0
votes
0answers
619 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
907 views

calling admin-ajax.php from admin-ajax.php

I'm writing a plugin that calls the output of another plugin's ajax, which is set-up at wp_ajax_ I would have called the functions directly, but limitations in the plugin make that a non-option. To ...
17
votes
4answers
39k 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
0answers
911 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 ...
17
votes
3answers
10k 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
1answer
286 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
2k views

Accessing an API with jQuery and AJAX

As a proof of concept I'm trying to access an API using jQuery and AJAX and posting the results to a page. After following some online tutorials and doing my best to put it all together, I have the ...
0
votes
1answer
54 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 ...
2
votes
1answer
3k 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
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:...
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
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 ...