WordPress Rubik Plugin

Ever since the interest in the Rubik's cube started to grow around the millenium (aka the second Rubik's cube resurgence) speedcubing afficionados have created Rubik's cube websites. Searching for "Rubik's cube site" on Google at the time of writing already returns 973 results. Many sites have a tutorial or at least a list of move sequences, the so-called algorithms.

The Rubik's cube plugin for WordPress is a tool that can help you write Rubik's cube solutions online. A sequence of moves can be displayed in an article or comment using a simple code. It will either show an animated cube in a java applet, an image of what the cube looks like before the (solving) algorithm is applied, or a link that goes to an applet animation.

Usage

The general format is [ rubik name="value" name="value" ... ] (sans the spaces near the square brackets, otherwise you would now see an applet). Note that the quotes are mandatory. The default value of the type attribute is 'webgl', meaning it will show an animation. However, not every browser can show these, and they can also slow down a page when many of these applets are shown. Therefore an alternative is to show a PNG image of the cube using type="image". For this to work correctly your WordPress hosting company has to offer GD support. The final two types, iframe and link, will work on any page, since they don't actually run on your site, but instead use content of this website (vanderblonk.com).

Installation

  • In your WordPress admin, choose Plugins, then Add New, then Upload
  • Upload the plugin zip file
  • Activate the plugin
  • Start writing shortcodes in your posts and pages.

Examples

Animation

  1. [ rubik alg="FRUR'U'F'" ] - The simplest one that will show an algorithm with all other options defaulted.
    moves will appear here
  2. [ rubik alg="FRUR'U'F'" width="100" height="120" ] - a very small cube.
    moves will appear here
  3. [ rubik alg="FRUR'U'F'" bgcolor="#ccc" ] - a cube on a gray background in case you wish to have a different color for the background of the cube. Note that the default is transparent, so you normally wouldn't have to do anything to blend the cube with your site's background color.
    moves will appear here
  4. [ rubik alg="R'D'RD'R'D2RyR'D'RD'R'D2R" bgcolor="#f5f5f5" displayLines="0" ]
    moves will appear here

And that is definitely not all you can do with this wonderful plugin. The user manual should tell you some more advanced uses. If you still can't find what you're looking for send me an email.

Image

  1. [ rubik alg="R'D'RD'R'D2RyR'D'RD'R'D2R" type="image" width="240" ]
  2. [ rubik alg="R'D'RD'R'D2RyR'D'RD'R'D2R" type="image" width="120" ]

Link

A link is of course the easiest and the most lightweight method of inserting an algorithm. The link has to point somewhere, and I chose to show a popup with an animated cube.

[ rubik alg="FRUR'U'F'" type="link" ]

FRUR'U'F'

Popup

[ rubik alg="FRUR'U'F'" type="popup" ]

FRUR'U'F'

Known issues

  • Unfortunately WordPress automatically converts quotes to smart quotes. Smart quotes had to be disabled to make the code work. If you really like smart quotes you can get the unformat plugin, which allows you to enable/disable these for individual posts.

Download

Download the latest version of WP-Rubik:

WP Rubik - version 2.1 (no applets)

Version 2.1 is now working with WebGL, meaning it works in every modern browser, even with Java disabled

Older versions

One thought on “WordPress Rubik Plugin

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.