What would be the best way to implement Magic Link logins in WordPress?
What would be the best way to implement Magic Link logins in WordPress?
What would be the best way to implement Magic Link logins in WordPress?
Its nonsensical to lock activation, unless the functional part of your code remains on your site. You essentially can make a service that you hide behind a login or apikey (like akismet) which may or may not make sense for your plugin. Calling home for permission to activate is a terrible idea, because idealistically, it’s … Read more
Simply register an additional sub-admin page for your plugin More info here. Then perform a wp_remote_request() to fetch the data. Loop through the results, display it in some sort of view for the end user – for e.g. a WP_List_Table and save your post types. Name the admin sub menu entry “Updates” and you’re done. … Read more
If the API is expecting a JSON object you should change your args to: $args = array ( ‘sslverify’ => false, ‘data_format’ => ‘body’, ‘headers’ => [ ‘Authorization: Bearer {API_KEY}’, ‘Content-Type: application/json’ ], ‘body’ => json_encode([ ‘region’ => ‘USA’, ‘plan’ => 1, ‘label’ => ‘API Test’, ‘app_id’ => 2 ]), ); Encode your data into … Read more
From quick look at source mechanics seem very similar, my first suggestion for WP would be to try and bump HTTP transport to curl (I do it with plugin in WP so no idea about specific code). curl seems to be considerably more robust for corner cases and it’s not WP’s first choice.
You could try with the following instead to detect if rest if ( is_admin() || defined( ‘REST_REQUEST’ ) && REST_REQUEST ) { }
You should be able to use both wp_remote_request() and wp_remote_post() for a ‘POST’ request, as they are just wrappers for the same WP_Http::request method that supports the methods: ‘GET’, ‘POST’, ‘HEAD’, ‘PUT’, ‘DELETE’, ‘TRACE’, ‘OPTIONS’, ‘PATCH’. and the default one is ‘GET’. The difference is that wp_remote_post() function has the ‘POST’ method explicitly set via … Read more
Proxy not working with Requests::request_multiple()?
For the record, I have uninstalled curl and wordpress was working on seamlessly. So I confirm that curl is not a dependency of wordpress. However, some plugins may require curl.
To answer my own question, when you use WP_Http, the transport used is selected, in this order, from this array: $request_order = array( ‘curl’, ‘streams’, ‘fsockopen’ ); If your PHP supports curl, WP_Http_Curl is used. Curl doesn’t support adding the body array parameters when the method is GET WP_Http_Streams and WP_Http_Fsockopen on the other hand, … Read more