• Home
  • Contact Me
WordPress Tavern
Where Every Drink Is On The House
Browse: Home / digg
Ben Gillbanks Launches WPVote

Ben Gillbanks Launches WPVote

By Jeffro on February 1, 2010

Ben Gillbanks also known as Binarymoon on Twitter has relaunched the domain, WPVote.com. The first thing you’ll notice about the site is the colorful design which is better than the previous one. I especially like the use of red to direct attention to the number of votes each article has received. Registering to the site was easy thanks to a quick registration form in lightbox fashion. In the past, digg like websites that were created to center around WordPress content were either built on Pligg or some other system. WPVote is powered by WordPress, which it should be. Starting in late 2009, Ben has shared each step of the rebuilding process of the site. Part one even includes a screenshot of what the site used to look like.

As a registered user, you have limited access to the back-end of the website. Users have the ability to access the tools menu in case they want to install Google Gears. The dashboard shows activity all across the site, including the most recent comments. I have not been keeping tabs on Ben’s posts but I’m intrigued on whether he plans on creating an all new back-end specifically centered around what is happening on the front-end.

The submission process is also in lightbox form with text fields to include an article title, article URL, tags, category, and a description of the article with a captcha field at the bottom. After the article is submitted, you’ll either be told the submission was successful or denied. If the article is successful, you’ll have to click the X to remove the box and then nothing happens. I’d like to be redirected to the part of the site that has my submission just so I can confirm its there and possibly edit it if necessary. I ended up refreshing the page and my article submission appeared in the sidebar on the right under Recent Submissions. However, I still think it shouldn’t need the end user to refresh the site to see it. The page refresh can occur at the same time I am redirected to the page where the article is.

The article page itself is nicely laid out. Breadcrumb navigation, great structure, and links to share the content or subscribe to the Comments Feed for that post.

Will It Succeed?:

That’s the question that only time can answer but based on what I’ve seen in the past, the chances are slim. No other digg like site that has been created with a focus around WordPress only content has become successful to the point where it’s the go to place for social interactivity and link sharing. To a large extent, I’d say it will be even harder to take off thanks to the likes of Twitter and retweeting. Would you rather share a link or retweet a cool WordPress story to people on Twitter, or go through the submission form on a site like WPVote where the site has a lesser chance of being noticed? Digg itself is still chugging along but there are a ton of factors that go into why that is. As for WPVote, it will take a considerable amount of mentions from prominent members of the community as well as continued effort on their part to help turn WPVote into a success. I wish Ben the best of luck on the uphill battle.

Personally, I think it would be cool to see the powers that be of WordPress to take something like WPVote and use the system in place of the entire WordPress Planet. Something like WPVote could become the new WordPress Planet where the community plays a larger role in what gets seen and what doesn’t.

Share this:

  • Email
  • Facebook
  • Reddit
  • Twitter
  • Google +1

Posted in News | Tagged digg, gillbanks, social, wpvote | 9 Responses

Social Bookmarking With WordPress Plugin

Social Bookmarking With WordPress Plugin

By Jeffro on April 12, 2009

In this article by Vladimir Prelovac, we will learn to create our first functional WordPress plugin and learn how to interact with the WordPress API (this is the WordPress interface to PHP) on the way. The knowledge you will gain in this article alone will allow you to write a lot of similar plugins.

Let’s get moving! This article is extracted from the “WordPress Plugin Development ” book. In this article, you will learn:

  • Creating a new plugin and having it displayed in the plugins admin panel

  • Checking the WordPress version and control activation of the plugin
  • Accessing API features—for example the title and permalink URL of each post
  • Using WordPress hooks to execute your plugin code when it’s needed
  • Using conditional tags to control the flow of your plugins

You will learn these by creating a Social Bookmarking type of plugin that adds a Digg button to each post on your blog

As you probably know, Digg is a very popular service for promoting interesting content on the Internet. The purpose of a Digg button on your blog is to make it easier for Digg users to vote for your article and also to bring in more visitors to your blog.

The plugin we’ll create in this article will automatically insert the necessary code to each of your posts. So let’s get started with WordPress plugin development!

Plugging in your first plugin

Usually, the first step in plugin creation is coming up with a plugin name. We usually want to use a name that is associated with what the plugin does, so we will call this plugin, WP Digg This. WP is a common prefix used to name WordPress plugins.

To introduce the plugin to WordPress, we need to create a standard plugin header. This will always be the first piece of code in the plugin file and it is used to identify the plugin to WordPress.

Time for action – Create your first plugin

In this example, we’re going to write the code to register the plugin with WordPress, describe what the plugin does for the user, check whether it works on the currently installed version of WordPress, and to activate it.

  1. Create a file called wp-digg-this.php in your favorite text editor. It is common practice to use the plugin name as the name for the plugin file, with dashes ‘-’ instead of spaces.
  2. Next, add a plugin information header. The format of the header is always the same and you only need to change the relevant information for every plugin:
    <?php
    /*
    Plugin Name: WP Digg This
    Version: 0.1
    Description: Automatically adds Digg This button to your posts.
    Author: Vladimir Prelovac
    Author URI: http://www.prelovac.com/vladimir
    Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/
    wp-digg-this
    */
    ?>
  3. Now add the code to check the WordPress version:
    /* Version check */
    global $wp_version;
    $exit_msg='WP Digg This requires WordPress 2.5 or newer.
    <a href="http://codex.wordpress.org/Upgrading_WordPress">Please
    update!</a>';
    if (version_compare($wp_version,"2.5","<"))
    {
    exit ($exit_msg);
    }
    ?>
  4. Upload your plugin file to the wp-content/plugins folder on your server using your FTP client.
  5. Go to your WordPress Plugins admin panel. You should now see your plugin listed among other plugins:

  6. This means we have just completed the necessary steps to display our plugin in WordPress. Our plugin can be even activated now—although it does not do anything useful (yet).

What just happened?

We created a working plugin template by using a plugin information header and the version check code. The plugin header allows the plugin to be identified and displayed properly in the plugins admin panel. The version check code will warn users of our plugin who have older WordPress versions to upgrade their WordPress installation and prevent compatibility problems.

The plugin information header

To identify the plugin to WordPress, we need to include a plugin information header with each plugin.

The header is written as a PHP comment and contains several fields with important information.

This code alone is enough for the plugin to be registered, displayed in the admin panel and readied for activation.

If your future plugin has more than one PHP file, the plugin information should be placed only in your main file, the one which will include() or require()  the other plugin PHP files.

Checking WordPress versions

To ensure that our plugin is not activated on incompatible WordPress versions, we will perform a simple WordPress version check at the very beginning of our code.

WordPress provides the global variable $wp_version that provides the current WordPress version in standard format. We can then use PHP function version_compare() to compare this and our required version for the plugin, using the following code:

if (version_compare($wp_version,"2.6","<"))
{
// do something if WordPress version is lower then 2.6
}

If we want to stop the execution of the plugin upon activation, we can use the exit() function with the error message we want to show.

In our case, we want to show the required version information and display the link to the WordPress upgrade site.

$exit_msg='WP Digg This requires WordPress 2.6 or newer. <a
href="http://codex.wordpress.org/Upgrading_WordPress">Please
update!</a>';
if (version_compare($wp_version,"2.6","<"))
{
exit ($exit_msg);
}

While being simple, this piece of code is also very effective. With the constant development of WordPress, and newer versions evolving relatively often, you can use version checking to prevent potential incompatibility problems.

The version number of your current WordPress installation can be found in the footer text of the admin menu. To begin with, you can use that version in your plugin version check (for example, 2.6).

Later, when you learn about WordPress versions and their differences, you’ll be able to lower the version requirement to the minimal your plugin will be compatible with. This will allow your plugin to be used on more blogs, as not all blogs always use the latest version of WordPress.

Checking the plugin

You can go ahead and activate the plugin. The plugin will be activated but will do nothing at this moment.

Time for Action – Testing the version check

  1. Deactivate the plugin and change the version check code to a higher version. For example, replace 2.6 with 5.0.
    if (version_compare($wp_version,"5.0","<"))
  2. Re-upload the plugin and try to activate it again. You will see a WordPress error and a message from the plugin:

What just happened?

The version check fails and the plugin exits with our predefined error message. The same thing will happen to a user trying to use your plugin with outdated WordPress installation, requiring them to update to a newer version.

Have a go Hero

We created a basic plugin that you can now customize.

  • Change the plugin description to include HTML formatting (add bold or links to the description).
  • Test your plugin to see what happens if you have two plugins with the same name (upload a copy of the file under a different name).

WordPress Plugin Development (Beginner’s Guide)
 
WordPress Plugin Development (Beginner's Guide)
  • Build powerful, interactive plug-ins for your blog and to share online
  • Everything you need to create and distribute your own plug-ins following WordPress coding standards
  • Walk through the development of six complete, feature-rich, real-world plug-ins that are being used by thousands of WP users
  • Written by Vladimir Prelovac, WordPress expert and developer of WordPress plug-ins such as Smart YouTube and Plugin Central
  • Part of Packt’s Beginners Guide series: expect step-by-step instructions with an emphasis on experimentation and tweaking code

  http://www.packtpub.com/wordpress-plug-in-development/book


Share this:

  • Email
  • Facebook
  • Reddit
  • Twitter
  • Google +1

Posted in Plugins | Tagged development, digg, Plugins, vladimir prelovac

© Copyright WPTavern 2013 All rights reserved About / Poll Archive / Site Archive // Powered by WordPress Mtn. Dew And Hybrid
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.