New project pains

I have started a new project.

It consists of WordPress based web site and Go based automated publishing tool.

Challenges:

  • I have never programmed in Go, so there is new language to learn
  • The go-wordpress library is there but the documentation is not the best for someone who is just starting with WordPress and go.
  • The php setup on the web host has a strange set up which does not bring in the basic http authentication (certain versions of php do not bring in$_SERVER[‘PHP_AUTH_USER’] when running in CGI/FastCGI mode). This required several hours of troubleshooting, tracking down what’s wrong and applying rewrite rules and then learning a bit more on how to use the Apache mod_rewrite. The trick was to adjust the rewrite rule to make sure that it’s not the only rule that gets executed by taking out option [L] out of it.

Make PHP Basic Authorisation variables available in WordPress

WordPress .htaccess modification to include the PHP Authorisation variables when PHP is running in CGI/FastCGI mode:

Plugins that are required by go-wordpress

  • WP-API plugin
  • WP-API’s BasicAuth plugin (for authentication) – I was unable to find it this plugin published anywhere outside of github. But it was easy to just choose Clone or Download -> Download ZIP as in the image below:Screenshot from 2016-07-16 13:47:09
    After that the downloaded zip file can be treated as a standard plugin.
  • WP REST API Meta Endpoints plugin (for Meta endpoints). This can be installed through standard WordPress plugin directory here.
Advertisements