Finally I found some time to fix the WordPress MochiAds plugin and make a working beta.
Please notice it’s just a working beta, install it on your own risk on an empty blog.
There are some interesting features already developed, and a million more features to do.
Also, I am releasing the plugin, not the theme, because I am not satisfied with it. The plugin will only create the posts from MochiAds feed, then it’s up to you to display them properly.
As said, there is an enormous list of features to add to the plugin. If you want to contribute it, your name and site will get credited in the plugin.
You need a server able to host WordPress with PHP 5.2.0 and a decent amount of memory. I am running my plugin on HostGator and it’s working fine.
How to install
Download the plugin, unzip it and copy the content into your
wp-content/plugins directory… line all other plugins. Then activate it, like all other plugins…
You will find a new item in the Dashboard called MochiAds.
Click it and you will open a menu. Let’s see how does it work.
This is the main page… only saying it’s a beta and inviting to visit the blog for more information or contributions.
To do: turn this page into a small dashboard with options and statistics. Also, a little help about how to use the plugin should be written, eventually in more than one language. An installation wizard would be appreciated.
Mochi Table page
(a picture would be useless…)
This page creates the table that will store all your games data. Without such table, the plugin won’t be able to create the posts, so this is the next page you need to visit.
It creates a table called with your WP prefix (usually
wp_) followed by
mochi, so usually this table is called
wp_mochi. I will refer to this table with its default name from now on.
You can call this page everytime you want without getting mysql erros if the table already exists.
To do: displaying more information about the table, such as size, number of lines (games) and an option to reset it.
Now you should click on this page to create the categories. I included all MochiAds categories plus the “High Scores” one, where to list all games with high scores. Again, you can access to this page anytime you want without getting any error for duplicate categories.
To do: giving the ability to create only some categories by selecting them. At the moment, the script creates all categories. Creation of a “featured” category to show the so-called “frontpage games”
Feed Games page
This page will look for the last 100 games added in the Mochi feed and add them to the
wp_mochi table if the aren’t already there. Then displays the games just added.
To do: First, the user has to be able to select how many games he wants to look for. I set the limit to 100 to avoid any memory issue, anyway during my tests I was able to feed 4,500 games with no errors. Also, having a limit will make you lose the first released games. It would be nice to parse the feed in different ways other than simply retrieving the last n games. The feed should be automatic at a specific hour of the day.
Add games to blog page
This page will look for games in the
wp_mochi table that aren’t published on the blog and publish them. To give the most freedom to custom results in the preferred theme, all game attributes such as width, height, description and so on are saved in a custom field.
To do: The user should be able to select what game he wants to post on the blog. At the moment the plugin posts all games.
And that’s all. I hope some WP gurus can help me to improve the plugin.
If you have any question about the plugin or how does it work, post it as a comment and I’ll reply at once.
And don’t forget to visit triqui.com to see it in action!