[wp-hackers] Testing for PHP 5 before activating

Kris Young KrisY at tbs.uk.com
Mon Jul 12 17:31:23 UTC 2010


Okay, that's a fair point. Admitting that I used to be one of those WP-newbies that would install incompatible plugins, and it does way more harm than good.

Good luck with your project!

Kris 

-----Original Message-----
From: wp-hackers-bounces at lists.automattic.com [mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Eric Mann
Sent: 12 July 2010 18:10
To: wp-hackers at lists.automattic.com
Subject: Re: [wp-hackers] Testing for PHP 5 before activating

I've been using a custom XMLRPC reporter on my new plug-ins to report back when
the scripts throw errors (to make up for the "It's broke" messages I get without
any details regarding what broke or what they were trying to do).
 Unfortunately, my system only works with PHP5, so I don't know how many people
are using PHP4 ...
 
... but it's frighteningly common for people to try to install my plug-ins on
WordPress 2.7 or lower when they explicitly require 2.9 or higher (I've had
people try to install them on version 2.0!!!  Then they email me a few days
later and try to claim the plug-in is broken because it won't work on their
system!).
 
So no, a stern warning on the plugin download page isn't enough.  I wonder if
anyone (lay users) actually reads the full download page before installing or if
they just read the name and say "oh, that sounds good."

On July 12, 2010 at 5:02 PM Kris Young <KrisY at tbs.uk.com> wrote:

> Would have thought that a stern warning on the plugin download page would do
> enough. Especially in coding policy on WordPress 3, PHP4 is being slowly
> squeezed out.
>
> Do you anticipate a lot of PHP4 users, or is it a 'better-safe-than-sorry'
> measure?
>
> Kris
>
> -----Original Message-----
> From: wp-hackers-bounces at lists.automattic.com
> [mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Eric Mann
> Sent: 12 July 2010 15:31
> To: wp-hackers at lists.automattic.com
> Subject: Re: [wp-hackers] Testing for PHP 5 before activating
>
> John,
>  
> We'd need to see how your try/catch structure is formed to help you fix that
> ... 
>
> On July 12, 2010 at 2:26 PM John Eckman <eckman.john at gmail.com> wrote:
>
> > Otto - recently in wp-hackers you reposted this code, which I've seen posted
> > before.
> >
> > I'm using it in wpbook (wordpress.org/extend/plugins/wpbook) but I'm still
> > having an issue.
> >
> > Because my plugin uses try/catch syntax, the minute it gets uploaded, before
> > the user can even activate it, they get a syntax error about an unexpected
> > open curly brace {.
> >
> > Any suggestions on how to work around that?
> >
> >
> > On Jul 9, 2010, at 3:49 AM, Otto <otto at ottodestruct.com> wrote:
> >
> > > /**
> > > * plugin_activation_check()
> > > *
> > > * Replace "plugin" with the name of your plugin
> > > */
> > > function plugin_activation_check(){
> > >         if (version_compare(PHP_VERSION, '5.0.0', '<')) {
> > >                 deactivate_plugins(basename(__FILE__)); // Deactivate
> > >ourself
> > >                 wp_die("Sorry, but you can't run this plugin, it requires
> > >PHP 5 or higher.");
> > >         }
> > > }
> > > register_activation_hook(__FILE__, 'plugin_activation_check');
> > >
> > >
> > > -Otto
> >
> >
> > ----------------------------------------
> > John Eckman
> > eckman.john at gmail.com
> > http://www.johneckman.com/
> >
> >
> >
> >
> >
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list