Make plugin uninstalable on older versions of WordPress

I think you’re taking the right approach: version-checking and die. The only thing I might recommend would be to hook it into the Plugin activation hook.

Out of curiosity, though: why aren’t you using wp_die() (Codex ref)?

As a side note: I would love to see the Theme and Plugin repositories implement some sort of UI similar to AMO, that indicates whether a given Theme/Plugin is compatible with the user’s current WordPress version. Plugins have a Requires: WordPress-version header tag that would work sufficiently for this functionality, and I would think that Themes could implement the same, just as easily.

p.s. I would strongly recommend against using the “Compatibility rating”; that functionality is beyond broken.

Leave a Comment