WordPress MochiAds plugin beta released

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.

All in all, on triqui.com is working fine and is compatible with WordPress 2.7.

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.

System requirements

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.

MochiAds page

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.

Categories page

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!

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (6 votes, average: 4.33 out of 5)
Loading ... Loading ...
If you found this post useful, please consider a small donation.
» WordPress themes are designs for WordPress - one of the most popular blogging software nowadays.
You will be pleasantly surprised by WordPress Themes provided by Template Monster. All of them are of professional design and high quality.

42 Responses to “WordPress MochiAds plugin beta released”

  1. dix-huit on December 14th, 2008 4:04 pm

    Hurrah! Well done, you got there in the end!

    May all your geese be swans.

  2. hybrid on December 15th, 2008 4:06 am

    Nice, thanks for your great work. I look forward to seeing this grow.

  3. egdcltd on December 17th, 2008 12:08 pm

    Great, I’ve downloaded it and am having a fiddle.

    Now, I’ve never actually used Wordpress before, so this may sound a bit dense. This plugin makes the posts and retrieves the game data from Mochi, then the template needs altering to actually display the game? Having a bit of trouble working out what needs altering currently, because I’m unfamiliar with the root software.

  4. Emanuele Feronato on December 17th, 2008 12:18 pm

    Yes, the template needs some alterings to display custom fields.

    You can find a brief explaination at this link:
    http://www.emanueleferonato.com/2008/07/27/creation-of-a-flash-arcade-site-using-wordpress-step-2/

  5. egdcltd on December 17th, 2008 12:30 pm

    Thanks, I’ve now got games displaying on their own pages. Looks dreadful currently, need to tweak the template a lot more, but it’s working. Nice.

  6. mas on December 19th, 2008 1:25 am

    Hi,

    I just want to have 1 category only, lets say I want category RACING CAR

    How to edit to make 1 category RACING CAR only?

  7. Jeremy on December 19th, 2008 6:11 am

    Plugin is working great but I noticed that the it embeds the game from mochi ads rather than downloading the game. It is my understanding that you do not receive any ad revenue from mochi ads unless the game is hosted on you own server. Are there any plans to modify the script so that it will transfer the game.

  8. Emanuele Feronato on December 19th, 2008 10:45 am

    @ Jeremy: nice idea, have to insert it in the TO-DO list.

  9. pq on December 22nd, 2008 11:23 pm

    hi there,

    nice plugin, thanks :) Will you still gonna release the wordpress theme?

  10. Emanuele Feronato on December 23rd, 2008 12:00 am

    @pq: sure, as soon as I’ll have a decent theme

  11. mas on December 27th, 2008 6:49 am

    Hi,

    How do you limit the categories? I don’t want display all the categories

  12. del on December 27th, 2008 6:53 am

    Hi Emanuel, i try your plugins on my site, its says “Table wp_mochi successfully created”…then made categories as you mention and it successfully created, and next i click on feed games its says “No new games at the moment…” then i click add games to blog its says “No new games to add”, did i missed something ?, please i need your help

  13. MO on January 27th, 2009 9:41 am

    Hi Emanuele, thanks for the great tutorial.

    Hi del, probably the table is not created, because you are using MySQL < 5. Try creating the table manually:

    CREATE TABLE `wp_mochi` (
    `id` int(11) NOT NULL auto_increment,
    `rating` text NOT NULL,
    `updated` text NOT NULL,
    `popularity` text NOT NULL,
    `description` text NOT NULL,
    `key_mappings` text NOT NULL,
    `height` text NOT NULL,
    `controls` text NOT NULL,
    `game_url` text NOT NULL,
    `tags` text NOT NULL,
    `slug` text NOT NULL,
    `categories` text NOT NULL,
    `instructions` text NOT NULL,
    `uuid` text NOT NULL,
    `author` text NOT NULL,
    `control_scheme` text NOT NULL,
    `author_link` text NOT NULL,
    `feed_approval_created` text NOT NULL,
    `name` text NOT NULL,
    `swf_url` text NOT NULL,
    `recommended` text NOT NULL,
    `thumbnail_url` text NOT NULL,
    `created` text NOT NULL,
    `game_tag` text NOT NULL,
    `leaderboard_enabled` text NOT NULL,
    `zip_url` text NOT NULL,
    `width` text NOT NULL,
    `status` text NOT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM;

  14. Likwit_Snake on February 1st, 2009 8:05 pm

    I had the same problem as del.
    Tried Mo’s solution, but that didn’t work for me…

    Anyone who can help me out in this?

  15. dan on February 4th, 2009 12:10 am

    It doesnt work for me either. the plugin feeds the games and it says it adds the games to the blog. I even get the following:

    Add Games to blog

    Woodbox Marble Lines
    Categories: Board Game,Puzzles
    Leaderboard enabled
    BotCatch
    Categories: Action,Other
    Mini-parachutes
    Categories: Other,Shooting
    Football GATE
    Categories: Action,Sports

    However, I do not see them as individual posts. For now ill add everything manually

  16. taylan on February 6th, 2009 9:45 pm

    It doesnt work for me either. I have this message:
    Add Games to blog

    1. No new games to add

  17. Cool Games on February 7th, 2009 6:06 pm

    Just wanted to say thanks a million for this plugin! I’m using it now and I love it a lot!

  18. junxron on February 8th, 2009 6:31 am

    Help!!

    i could not add games now.. not sure why.. can the script be edited in such a way that when u press feed games, it automatically adds? rather than click add games again…

    if i could i would made it myself but i dun understand this line:

    $row = $wpdb->get_row(“SELECT * FROM “.$wpdb->prefix.”mochi where status = ‘new’ order by id asc”);

    i tried to echo it but its blank…

  19. Phil on February 16th, 2009 4:25 am

    I came cross the site at http://www.wordpressgames.com

    It looks decent. How can it work like that?

  20. DoFollow Webmaster Blog on February 16th, 2009 9:30 pm

    Awesome. I was following your other tutorial on using the JSON feed with the extra meta tags, but I think I will give this plugin a try out.

    Time to put my WP arcade back into development! :D

  21. Peter on February 18th, 2009 5:19 am

    Looks promising, although I can’t get it to work at this time. The same “No new games to add” message…

  22. Carter on February 19th, 2009 5:18 am

    I had the same problem… says “Table wp_mochi successfully created”… “100 new games found”…. but “No new games to add” message…

  23. mel on February 20th, 2009 11:52 pm

    I have the problem “No new games to add” also.

  24. antonio3407 on February 22nd, 2009 11:15 am

    I have the problem “No new games to add” also.

  25. Gintoni on March 20th, 2009 12:04 pm

    I am getting the same problem too.

    I follow up all the steps. It seems work fine until the last one when it try to add the games.

    “No new Games to add”

  26. Jacko on March 20th, 2009 2:33 pm

    I am also getting the error with no new games to add. I tried modding the code a bit to no avail, though i did notice that when i execute the add games function it gets all the into the loop that is executed 100 times, but it seems that it doesnt execute the “if($row)” so I can only assume the problem is with my database prefix? Do I need to set the prefix somewhere?

    Thanks.

  27. Online spel on March 24th, 2009 6:54 pm

    I like the idea of this plugin, but i can´t get i to work. It states “No new games to add…”

    If you get it too work i might donate some bucks to u :)

  28. junxron on March 27th, 2009 1:42 pm

    Hi guys,

    i think i have solved the problem..

    Please go to http://www.junxron.com/2009/03/mochi-script-edited/ for more info..

    Thanks..

  29. yoedcute on March 28th, 2009 6:15 pm

    didn’t work for me

  30. Bilal on April 8th, 2009 10:58 pm

    Hi, great plugin but I can’t use it because when I click on ‘feed games’ it says 100 new games found, then I press add games to the blog and it says no new games added. I have clicked on categories and table link and they have been made successfully.
    Please help me!!!

  31. kamikezo on May 13th, 2009 5:02 pm

    great guide and plugin..
    very detailed..
    thank you very much..

  32. arcadevine on May 16th, 2009 5:57 am

    Great plugin!

  33. iezcha on May 21st, 2009 2:49 am

    thank you but its not working anymore…

  34. serhan on June 3rd, 2009 5:09 pm

    Change your json limit to http://www.mochiads.com/feeds/games/XXXX/all/all?format=json&limit=1000 on line 291, upload and try again if you received “No new Games to add” error.
    P.S: XXXX Refers to your publisher id

  35. CosminP on June 12th, 2009 4:38 pm

    Hello,

    I’ve made the update with the new php, the “feed games” option updates me with the last 100 games but when I hit “add games to my blog”, I get the message “No new games to add” even if I didn’t added new games for several weeks.

    the wp_mochi table is empty..

    Best wishes,
    Cosmin

  36. Daniel on June 14th, 2009 9:40 pm
  37. dean on August 6th, 2009 1:50 pm

    change json limit on line 291 where? I can’t find it and I don’t understand cos I’ve already set up 2 sites using your theme and plugin and they are working fine, but when I tried to do a 3rd I can’t find the same info on this site – I’m sure I had to change something in the theme before but the info on that seems to have dissapeared.

  38. Harry on September 17th, 2009 2:46 pm

    I get same error as “CosminP”.

    Any clue how to resolve this?

    Thanks,

  39. Paul on December 27th, 2009 2:35 am

    Just reading through this site and thought I would chip in my 2cents as to why it works for some and not others. Check to see if your host allows the url_fopen wrapp, if not, then it is failing due to the line $feed = file_get_contents($mochi_url); as file_get_contents() needs the wrapper.You could add a switch into the script to use curl http://php.net/manual/en/book.curl.php curl is widely accepted on most hosts more than the fopen wrapper. Enjoy

  40. skuvy on January 29th, 2010 1:01 pm

    I am having the Add Games to blog ‘No new games to add’ issue..
    i have tried changing json limit on line 291 but no luck..
    also checked and url_fopen is enable on my host.

    has someone find any solution to this?
    I would really appreciate a little help here :)

    sK.

Leave a Reply




Trackbacks

  1. WordPress MochiAds plugin beta FIXED : Emanuele Feronato on April 14th, 2009 1:15 pm

    [...] time ago I released the WordPress MochiAds plugin beta, and after some time, it stopped [...]

  2. WordPress MochiAds plugin beta FIXED - UPGRADE : Emanuele Feronato on May 15th, 2009 7:05 pm

    [...] Released some months ago, it has been fixed when the mochi feed changed and while I was working to make it compatible with Gallery theme and add some new features, the feed changed again so I am updating the plugin again. [...]

flash games company