WordPress.org

Forums

[Plugin: WP Facebook Like] Some thoughts on this plugin (7 posts)

  1. Frumph
    Member
    Posted 4 years ago #

    This plugin is very well written using WordPress Core code and the xfbml is implemented properly.

    Needs options for selecting it to be used on is_page()

    Might want to start using TRUE or FALSE instead of strings 'true' or 'false' so they can be true boolean.

    the class name might not be unique enough with all the other facebook like button plugins that are available

    http://wordpress.org/extend/plugins/wp-facebook-like/

  2. joch
    Member
    Posted 4 years ago #

    There could be a problem changing the class name now that it's out there, but if people are having problems, I'll definitely change it. I will look into the boolean strings as well.

    I was thinking about implementing some options for only enabling the button on posts, pages, not the front page etc, for the next version.

  3. edelen
    Member
    Posted 4 years ago #

    I ran my site through the W3C HTML validator and the plugin threw a ton of invalid XHTML errors. Isn't it supposed to be XHTML valid?

    Thanks.

  4. Piotr Sochalewski
    Member
    Posted 4 years ago #

    How to disable it for pages, because I just don't need it on them?

  5. joch
    Member
    Posted 4 years ago #

    Support for that it coming in the next version, which will be out in a week or two.

  6. udi86
    Member
    Posted 4 years ago #

    Great plugin, I gave it 4 stars, here's the things which could help reach the 5th star:

    Add a Settings button to the Plugins page, so we can set things up right away after installing it (I guess that's the reason people gave it a poor rating, they didn't find the settings). Here's the code, just add it to the bottom of your wp-facebook-like.php script:

    /**
     * Add a settings link to the Plugins page, so people can go straight from the plugin page to the
     * settings page.
     */
    function wpfblike_plugin_actions( $links, $file ){
    	// Static so we don't call plugin_basename on every plugin row.
    	static $this_plugin;
    	if ( ! $this_plugin ) $this_plugin = plugin_basename(__FILE__);
    	if ( $file == $this_plugin ){
    		$settings_link = '<a href="options-general.php?page=wpfblike-options">' . __('Settings') . '</a>';
    		array_unshift( $links, $settings_link ); // before other links
    	}
    	return $links;
    }
    add_filter( 'plugin_action_links', 'wpfblike_plugin_actions', 10, 2 );

    Add an automatic option to the language option list, preferably to the top, but you should make it default (admin-options.php). After that, you can set up an 'automatic' value for fblanguage, and all you need to do is get the real language code for your WordPress page. Put the following code on the top of your get_footer function on wp-facebook-like.php (don't place it into __construct, the language value is not defined there yet!):

    // Automatic language
    if ($this->fblanguage == 'automatic') $this->fblanguage = strtr(get_bloginfo('language', false), '-', '_');

    It's a one-liner, could be hard to understand, but here's what it does: asks wordpress for the language value (get_bloginfo('language')), it returns the language code, but separated with a dash, not and underline, so we replace that with strtr, then we set this value for fblanguage. That makes setting up the plugin easier, one less option to set. Plus, that's the easiest way for multi-lingual blogs to display the like button in the current language.

    One small issue in the readme file: you have &lg and &gt codes under the templete developers section, replace them with proper opening and closing tags! Also you should encourage using a conditional check, before inserting functions into templetes:

    <?php
    if (function_exists('wpfblike')) {
      echo wpfblike();
    }
    ?>

    That won't litter up the template if they remove your great plugin for whatever reason. I hope you include these settings in the next release. I'll give you 5 stars then :).

  7. joch
    Member
    Posted 4 years ago #

    Thanks for the suggestions!

    I have implemented your improvements and will release an update tomorrow, after I have done some testing.

    I also added support for choosing whether to show the button on posts or pages, or both, and a check for verify that the user is running PHP5, which is the minimum required version.

Topic Closed

This topic has been closed to new replies.

About this Topic