rutgervanw
Forum Replies Created
-
Forum: Plugins
In reply to: [JSON API] WordPress 4.2 does not work with JSON API 1.1.1When I create a new installation (staging) with this plugin + WP 4.2.2 it works indeed.
But when I upgrade my production server, it does give me back a ‘ok’ message on /api but any further requests (for example /api/get_recent_posts) gives back an empty page…
Forum: Plugins
In reply to: [JSON API] Attachments emptyI had a similar problem, but I’m using the WP Read Only plugin (I’m running WordPress on Heroku). This plugin makes sure all images are uploaded to S3. The thumbnails were null also.
I rewritten the above function and deleted the checks whether the file exists. It works now, but obviously does not check for the file’s existence:
function query_images() { $sizes = array('thumbnail', 'medium', 'large', 'full'); if (function_exists('get_intermediate_image_sizes')) { $sizes = array_merge(array('full'), get_intermediate_image_sizes()); } $this->images = array(); $home = get_bloginfo('url'); $upload_dir = wp_upload_dir(); $basedir = $upload_dir['basedir']; $file = get_post_meta($this->id, '_wp_attached_file', true); foreach ($sizes as $size) { list($url, $width, $height) = wp_get_attachment_image_src($this->id, $size); $filename = $basedir . '/' . str_replace(basename($file), basename(parse_url($url, PHP_URL_PATH)), $file); list($measured_width, $measured_height) = getimagesize($filename); $this->images[$size] = (object) array( 'url' => $url, 'width' => $width, 'height' => $height ); } }
I have exactly the same problem. It took me ages to figure out what the problem was. I tried enabling/disabling all plugins and all the other options when you google ‘no visual editor wp’.
I ended up installing a fresh WordPress installation of a fresh EC2 instance, worked perfectly with our current theme. But when I put Cloudfront in front of it, the visual editor breaks…
I suspect it has something to do with domains and redirects. When you use Cloudfront, you have to add a CNAME in your DNS records that point to the Cloudfront url, in Cloudfront you take the ec2 url as source and configure that all requests, cookies and url parameters should be forwarded.
I’ve enabled logging in WordPress, Apache and Cloudfront, but I don’t see any errors or warnings about this. Anyone?
Forum: Plugins
In reply to: [JSON API] Request feature : authentificationFor clarity, this implements basic http authentication. So you can access it with a username and password, not with an API key as asked above. But almost every HTTP client (for example curl) has support for http basic aut. Good luck!
Forum: Plugins
In reply to: [JSON API] Request feature : authentificationI have authentication implemented with this API. How I did it:
– first specify an api path in the plugin options, mine was /api
– make a folder in the document root of your site, in this case a folder named “api”
– now place a .htaccess file in this directory (and nothing else)
– the contents of the .htaccess file:AuthUserFile /etc/users
AuthName “This is a protected area”
AuthGroupFile /dev/null
AuthType Basic
Require valid-user– Now go to your terminal and make a file called ‘users’ in /etc
– to add users follow this tutorial: https://www.htaccesstools.com/htpasswd-generator/