Should I add sharing buttons using a plugin or directly in my theme files?

This question relates to plugins for Linkedin Share buttons, Twitter Tweet buttons, and Facebook Like buttons.

These are for blog posts on a WordPress blog which is at a subdomain of a site that is built in CakePHP.

Read More

Considering the possibility that plugins can become outdated, and that if this happens there is a possibility of losing the counts of shares / tweets / likes, I’m wondering if it’s better to add in these sharing buttons manually into the single.php theme file.

Is it better to use plugins to add in these buttons, or to add the buttons manually into the single.php theme file?

Related posts

Leave a Reply

5 comments

  1. Using a plugin is always a quick and easy thing to do, until it goes wrong. I am a fan of less plugins (unless you really need them) and more hard-code reason is that you then have full control of what goes into your project.

    And at the comment on “plugins can become outdated and that…” i think you answered your own question with that one line 🙂

    Write more, worry about less -> thats my motto 😀

  2. Basically This becomes a question of Plugin VS. Custom coding,

    This question as been asked before and some people feel that if there is a plugin then go with it, while others feel that they rather trust no one with there site’s code and functionality, or know they can code it in a better way so they write there own code.

    I follow my golden rule of if its coded good and working “why reinvent the wheel?” .

    So if i need some kind of functionality i look for plugins that are by known coders, have more then a single version and are regularly updated.
    If nothing comes near that i look at old plugins that “used to work” study them and then i either fix them and change them to my specific needs or write as new from scratch.

    The same way a plugin could stop working (not function as expected) so can your own code that you put in your single.php or any other file for that matter especially when working with external API’s like FaceBook, Twitter and LinkedIn that keep changing every now and then.

    That’s just my opinion there are no right and wrong here.

  3. If you are very sure that you are not going to change the theme then it is fine if you add these buttons in your single.php file. But if there is a plausibility that you will be changing template frequently then using a plugin would be better option.

  4. I prefer to do this directly in my themes. Considering how many issues can arise from either using too many plugins (lots of clients will install 50 plugins and then notice things not working), plugins with bad interactions or plugins that think they need to include their own copies of things like JS libraries.

    The biggest con is that your code will become outdated eventually. With plugins you don’t have to worry about maintaining the code for the rest of time.

  5. Plugin, even if you code it yourself. the administration seems to go more smoothly for me. Even if your theme is fully custom, feature separation is still a solid practice.

    If you switch themes, if the code becomes outdated, if you want to remove it, if you need to extend it… any changes become simpler to implement.