If you sell a WordPress product, then you’ve probably had a perspective customer ask if they could test it out first or if you have a demo available.┬áRecently, we realized that our demo of Ninja Forms wasn’t working properly. Also, none of the plugins or extensions were up to date. We currently have 28 extensions plus Ninja Forms itself, so let’s just say keeping them all updated can be a difficult endeavour.

Challenges with demo sites

  • They have to be kept up to date just like any other site. Let’s tell the truth; although demo sites can be great marketing tools, they often get put at the bottom our priority list. We need something we can set and forget.
  • Users need to be able to make changes, and our demo needs to maintain consistent, testable data. We need a way to reset the database regularly to a pristine copy. This way, users can do all the testing that they want without any of their changes “sticking” to the database.
  • The demo should be running the latest stable versions of our products. We need a system that will auto update core or any plugins or themes. This can seem at odds with the teflon database, so this needs to be automatic and not a pain in the rear.
  • Sometimes the demo data has to be modified or added to. We need to be able to thaw the database, putting the site into an update mode. This way we can make content and setting changes, and then freeze the database in this new state as our new pristine copy. If this isn’t easy, it is likely to not get updated very often.
  • Users don’t need to have access to everything within the WordPress admin.┬áTo fully test our plugins, users should be able to login as both an admin and a subscriber. Of course, we don’t want these admins being able to access everything within the wp-admin. Something that we can use to limit what admins have access to is a must.

We are currently working on a plugin that will accomplish all of the above and be super easy to set-up. What are your thoughts? Anything we’re missing?

Comments

  1. Robert says

    Sounds great! Some feedback from my side, as I am also offering a demo site for my mapping plugin “Maps Marker Pro”, available at http://demo.mapsmarker.com/.

    1. login in demo users automatically – done by the following snippet in functions.php:
    function lmm_custom_login() {
    $creds = array();
    $creds['user_login'] = 'USER';
    $creds['user_password'] = 'PASS';
    $creds['remember'] = true;
    $user = wp_signon( $creds, true);
    if ( is_wp_error($user) )
    echo $user->get_error_message();
    }
    add_action( 'after_setup_theme', 'lmm_custom_login' );

    As an alternative you can install the plugin “Memphis Custom Login” (http://www.kingofnothing.net/) which allows you to set a custom text above the login form – this gives you more flexibility as you can also login as admin without having to outcomment the snippets in functions.php.

    2. redirect to frontpage after logout – done by the following snipped in functions.php:
    add_action('wp_logout','auto_redirect_external_after_logout');
    function auto_redirect_external_after_logout(){
    wp_redirect( 'http://demo.mapsmarker.com' );
    exit();
    }

    3. set custom role for demo user by using the plugin “Capability Manager Enhanced” (http://presspermit.com/capability-manager)

    4. automatically reset the database by running a cronjob which does a full database restore. PHP-script which does this job can be found at http://www.mapsmarker.com/dev/database-restore.txt (you need to add your database connection and the sql-file to restore from at the bottom).

    5. On my site I also gave demo users the possibility to publish posts – as the database restore only restores the tables for my mapping plugins, I also installed the plugin “Post Expirator” (http://wordpress.org/extend/plugins/post-expirator/) which automatically trashes new blog posts every few hours.

    6. Hide unnecessary admin elements for the demo user by using the plugin “Adminimize” (http://bueltge.de/wordpress-admin-theme-adminimize/674/)

    I hope, you can use some of my input for your plugin.
    best,

    Robert

    • James Laws says

      Robert, thanks for your comment. I think you mis understood the project as we are hoping to automate all of this in one demo plugin to make it easier for people to set up demo sites without installing a bunch of separate plugins using what WordPress already provides. I’ll respond to your suggestion one at a time.

      1. 1. I like this idea on some level. Some demos need users to be able to log in and experience the plugin with different users roles so I can see us adding a simple widget that would have a link to automatically log in or switch the user to which roles the demo admin has set up. Great idea and I’m sure we will add something like this.
      2. 2. Easy enough and something we’ve already added in the initial build.
      3. 3. I believe most user will want visitors to demo their products in the natural user roles that WordPress ships with. The only exception would be if the product being demo’d has a custom user, then it would want to use that. We’ll have to see what the general consensus is on that but I know that’s true for our demo site. Also and again, we don’t want the need to string a bunch of unrelated plugins together.
      4. 4. Thanks for the script but we want to automate this so users can easily modify their demo content and create new restore points. The demo plugin users shouldn’t have to provide a sql file or credentials because we already have that info from WordPress. Our plugin will create a mysql dump automatically to be used as the restore point and the user can create new restore points by thawing the site, making changes, and then freezing the site again. The database can then be restored to that new state at whatever interval the user selects. This will also be true of files like the media library.
      5. 5. This demo plugin restores the entire database so posts, pages, custom post types, custom tables, and absolutely all settings (don’t forget files as well). so this is a non issue for us.
      6. 6. We are building this into the plugin as well so there won’t be a need of another plugin to accomplish this for demos.

      I hope that clears up what we’re building a little better and thanks for the comment. It definitely gave us a few ideas.

  2. Robert says

    Hi James,
    thanks for your reply – I know that your challenge is to pack all those features into a plugin and enabling users to set up a demo site without having to configure cron jobs or database dumps from phpmyadmin…just wanted to share my experience with you. Anyway my demo site proved as a powerful tool in showing potential customers the capabilities of my plugin without having them to install anything on their server.
    best,
    Robert

    • James Laws says

      Robert, absolutely and thank you for your experience. Our goal is to help people with products like yourself do this much easier without a lot of hacking and plugin spaghetti. We want you to get your next demo site up faster and with less maintenance so you can be more focused on further development and support. :)

  3. aristath says

    I recently migrated all my demo sites in a multisite installation. I find it easier to maintain and manage than having a dozen separate WordPress sites.
    Ideally this would work on multisites as well (on a per-site basis, not network-wide as in some cases the actual store is the main site on a multisite and sub-sites are for demo purposes).

    • James Laws says

      I’m not so sure we will make this work for multi-sites simply because we are doing a full database dump and folder backups. I personally like keeping my demo sites as separate installs. An exception would be when the whole multisite install is just a series of demos, that might work. Something to definitely consider the best way for that to work.

    • James Laws says

      Trent, thanks for stopping by and joining the conversation.

      Absolutely will work for themes or anything else run in WordPress. The goal is to make is flexible enough that you don’t have to worry about what the demo is for. Simply set-up the content and settings for your demo site, configure some demo settings, and freeze the site (create the restore point). After that the demo should just take care of itself unless you want to modify it. Then you just thaw it, make your changes, and re-freeze it.

  4. Ben says

    I agree with you guys. As a builder I need to see the functionality to see how it will work to understand if it is a solution for me. I love how you guys think most everything through. Can’t wait to see what you guys come up with for demos. Also would like to see the Stripe addon in demo to see how it can work.

    • James Laws says

      It’s not a bad script at all unfortunately we needed something a bit mote robust. Something that resets the database and makes it easy to create a new default loading point.

  5. Phil Derksen says

    Fantastic idea. I could definitely use something like this. I have yet to setup demos for my plugin “Pin It” Button Pro (http://pinplugins.com), but should do it soon.

    My plugin would involve media uploading so something that would reset the uploads to a specific state. I’m sure I’ll have a “base” of a bunch of images.

    Besides restricting the demo user to just modifying the one plugin’s settings, I’d like to hide or disable pieces of the admin in the demo only, such as the area to enter a license key. If this can simply be done if there are hooks in the plugin being demo’d that’s fine.

    Looking forward to seeing what comes of this!

    • James Laws says

      Hey, Phil. It will definitely handle the media reset and any other directory you might need. It will also let you prevent access to anything in the admin that you need via UI or easy filters.

Leave a Reply

Your email address will not be published. Required fields are marked *