Broken Link Checker Plugin Version 0.3

I’ve gotten some interesting feature suggestions for my link checker WordPress plugin since I released the last version several months ago. During the last week I finally got around to implementing some of them. Enjoy 🙂

What’s New

Making broken links look different
There’s now an option to add a “broken_link” CSS class to known broken links. In the default configuration this will simply add a strike-through effect to the links. If you know CSS, you can define your own style in the Options -> Link Checker tab, or in your stylesheet. The style is only applied when a post is displayed, so your posts won’t actually be modified.

Exclusion list
Links that contain (in the URL) any of the excluded words won’t be checked. You can also add domain names or complete URLs to the list. Note that this doesn’t affect links that already show up as broken. If you want to permanently hide some of those, update the exclusion list accordingly and “discard” the broken links.

Remove broken links without editing the post
The list of broken links (Manage -> Broken links) now has a new button for each link – “Unlink”. It will remove all instances of the broken link from the post, but will leave the link text intact. So “a link” would turn into “a link”. This doesn’t work for missing images though.

Get the Update

Download : broken-link-checker.zip (~9Kb).
Or, if you have WP 2.3.x, use my Single Click Plugin Updater to upgrade the link checker plugin 😉

Related posts :

52 Responses to “Broken Link Checker Plugin Version 0.3”

  1. beachbum says:

    I am using this plugin on a huge site.
    started to click on “unlink” as soon as i ran it, and the ajax deleted the post from the list, but the total count stayed the same, and when i refreshed the page they were all back.

    was thinking the cue had to be 100% finished before you could “unlink”

    2 days later im @ 3000(mostly media file links from pre 1999) broken links and the cue is done ( can you please describ the “session time” setting a lil more in dept. i toggled between 27 and 270.)

    tryed to “unlink” again and same thing.

    if i manually edit the post them the count goes down.

    is the unlink feature still underconstruction or something. this pluggin will same a huge amount of time if the unlink function works.

    what would be cool also if the unlink totally deleted the link and name.

    /s

  2. White Shadow says:

    The “Unlink” button is supposed to work, but there’s obviously no warranties with free tools like this one 😉 Anyway, I’ll look into it.

    As for the session length – the link checking is done in fixed-duration sessions. This has several reasons – for example, many hosting providers limit the maximal script execution time, so you can’t just check all links in one go. Another reason is that if the checker “hangs” for some reason, the checking process will be restarted when the current “session” ends.

    Many servers limit the max. execution time to 30 seconds, so the default session duration is 27 seconds.

    As for how long it “should” be, there’s no single answer. Long sessions are slightly more efficient if your webhost can handle them (if it can’t long sessions will just waste time without getting much work done). Short sessions (less than 20 seconds) can lead to working links being reported as broken because they time out too soon. Use what works for you 🙂

  3. White Shadow says:

    I’ve just uploaded a new version that will (hopefully) fix the “Unlink” button.

  4. Jonathan says:

    I’m seeing the following message at my dashboard:

    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/public_html/wordpress/wp-content/plugins/broken-link-checker/wsblc_ajax.php on line 251

  5. White Shadow says:

    That’s because your server has safe mode enabled. You can make the message go away by changing this line in wsblc_ajax.php :

    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

    to this :

    @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

    (Note the @ symbol.)

    Personally I think turning off safe_mode is a better solution, but that’s probably not an option for most shared hosting accounts (I assume your website is on shared hosting).

  6. Jeton says:

    Doesnt work for me didnt detect a broken link that i posted on purpouse.

  7. White Shadow says:

    Not enough information 😛

  8. c says:

    A fab, much-needed plugin! I’m just dusting off my unloved blog and upgrading it to WP 2.5, so discovering new (to me) plugins like yours is a joy. Of course, one finds a fair number of broken links after leaving a site fallow for a while, too. Am I mistaken, or does your plugin not check the Links (nÊe Blogroll) links? ‘Cos that would be handy it would.

  9. White Shadow says:

    Yes, it only checks links in posts and pages, but no the blogroll. Ah well, I’ve added your idea to the ever-growing wishlist 😉

  10. Dade says:

    i would like to the ability to delete the post from the broken llnks page as well as a mass delete option by checking boxes of posts that are broken.

  11. White Shadow says:

    Hmm, that’s not going to happen. Your situation is probably very rare if you need to delete a post just because a link becomes invalid.

  12. Dade says:

    would it be hard to place a delete post link in a colum on the broken links manager ? beside each post so i can click delete?

  13. White Shadow says:

    Not extremely hard, but it would be useless to most people, and only take up screen space.

  14. Dade says:

    ok could i perhaps be able to convince you to create a version with it for me and perhaps anyone else who wants it 😉

  15. White Shadow says:

    Hmm….
    If it was easy – maybe. However, I just looked at the code and it seems that it would be pretty hard to add a “Delete Post” button that works both in WP 2.3 and WP 2.5 (due to the significant interface changes in WordPress 2.5).

    If you’re okay with it working only in WP 2.3 then I can add it.

  16. Dade Williams says:

    ahh, im using wp 2.5 now ;(

  17. White Shadow says:

    Well, I did some tests and it seems it may work in WP 2.5, too… I’ll get back to it tomorrow 😉

  18. Dade Williams says:

    awesome thank you

  19. White Shadow says:

    New version is up!

  20. Dade Williams says:

    thank you very very much works like a charm

Leave a Reply