Using the wordpress jetpack json api - wordpress

I've installed the jetpack plugin for my self-hosted wordpress site. The JSON API feature in jetpack allows me to use the rest API (http://developer.wordpress.com/docs/api/). However i don't understand how to use it.
https://public-api.wordpress.com/rest/v1/sites/$site/posts/
How do i find my $site for example?
Any examples that anyone can share?

Just replace $site with the URL of your site.
https://public-api.wordpress.com/rest/v1/sites/www.yoursite.com/posts/

You can replace $site with the domain and (if needed) path of your selfhosted Wordpress site that has jetpack installed.
Just try this example where $site was replaced with discover.wordpress.com
https://public-api.wordpress.com/rest/v1.1/sites/discover.wordpress.com/posts/
If you get the error: {"error":"unauthorized","message":"API calls to this blog have been disabled."} with your own site make sure that you enabled the json api in the general section of your jetpack plugin settings.

This doesn't directly answer your question but maybe others coming across this post, as I did, would want to know how to possible fix the problem.
In my case I am:
Using Jetpack
Self-hosted site
I was receiving the error:
{"error":"unauthorized","message":"API calls to this blog have been disabled."}
In order to fix it:
Disconnect the Jetpack plugin
Reconnect again.
Fixed the issue!

Related

Wordpress api is not working, getting 401 error

I was trying to integrate ship rocket with WordPress,
But when I try to access the URL endpoint to integrate it, getting an error just like below.
*The requested URL /wc-auth/v1/login/ was not found on this server..*
I have updated Permalink structure to
https://hapso.in/sample-post/ and still getting the same error.
Thanks in advance.
For what it's worth, REST API endpoint URLs for WooCommerce often start with /wp-json/wc/v3/ or something similar. Yours starts with /wc-auth/.
And, make sure your web server implements mod_rewrite. If other permalinks work correctly, that is already done.

Wordpress Blocks My Theme's İmportant Api

I use wordpress for my website. I have a api system in my current theme for follow-unfollow system. When I try to follow or unfollow, my api request blocking.
My Url;
https://my_website.com/wp-content/themes/my_theme/api.php?
I got 403 error.
How can I solve it?
I am using Aksimet Anti Spam, iThemes Security, Wp Scan and Loginizier.
Try to make a page api and make the api.php a template. Try to access it from there, I'm not sure if any of your plugins refuse access to the wp-content/themes or what but my api is a template on a page :)

Website hosted on Wordpress sending request to other servers remotely

I have a WordPress website hosted on Amazon Ubuntu.
Amazon reported that my server is sending a WordPress login attempt requests to other servers on Amazon.
My website is just a landing page with a contact form. How do I prevent such incidents?
You can block external http requests check adding
define( 'WP_HTTP_BLOCK_EXTERNAL', true );
in wp-config.php
Since you have already found a bad curl call in your source, I strongly suggest you check the integrity of your Wordpress installation.
If you have WP CLI available you can do this with the command wp core verify-checksums.
If you don't have WP CLI available you can use this excellent solution by Jan Reilink (either directly or as a starting point for your own code).
Either way you'll get output that tells you whether or not additional files have been modified (you could then restore them from the same WP version source). This will not be a catch-all-method in regards to malware, but I think it can be helpful in your specific situation.
Given that the code that's causing these requests is not part of the Wordpress core the answer to your question is some of the general best security practices for Wordpress:
Keep Wordpress and plugins updated
Use strong passwords for users
Add a captcha and brute force protection to your login page if possible

WP Plugin Resource URL not accessible

I am using Wordpress 3.8.4 with Total Cache (ver 0.9.4) and SyntaxHighlighter Evolved (ver 3.1.10) on my custom hosted wp site hosted at hostgator.
After I added SyntaxHighlighter plugin recently, I found its files are not loading properly when I am viewing site as a regular visitor (logged out), if I logged in as admin, it works fine.
The issue I was able to find was a some query string in URL being added to the plugin files which was added by SyntaxHighlighter plugin. But I have no clue how to fix this. If I check manually after removing query strings from URL it works.
Here is the URL that it is requesting and not loading:
http://domain.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/styles/shCore.css?b3141b?ver=3.0.9
This gives following error:
This one works:
http://domain.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/styles/shCore.css?b3141b
Can anyone point me to right direction, what could be the issue, and how to resolve this?

Wordpress clone on Dreamhost

So I created a new subdomain on Dreamhost. One-click installed Wordpress. Fresh Copied the olddomain.com to newdomain.com exported all the tables with the drop attribute to the new wordpress database via phpmyadmin. Then followed this post to update the urls.
The site doesn't load, giving me this error message:
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
This problem can sometimes be caused by disabling or refusing to accept cookies.
I would make sure to check the 'www' rules in Fully Hosted (from the web panel: Manage Domains > Web Hosting > Edit), compared with your site URL settings in the WordPress dashboard. Make sure those aren't conflicting first.
If you need further assistance, just let me know the domain name and I can take a look. Please also feel free to start a LiveChat from the panel or submit a ticket; our support team is here to help 24/7!
Thanks!
Ellice S
DreamHost Staff
I finally ended up creating an empty site and then using the WP Duplicator plugin. Worked like a charm!

Resources