[wp-hackers] Re: [wp-trac] Re: [WordPress Trac] #3875: Proposal for a new plugin architecture

jacobsantos at branson.com jacobsantos at branson.com
Wed Aug 1 16:33:44 GMT 2007

I uploaded a new diff to WordPress Trac system for the ticket. I've 
tested it, profiled it (running at 0.3 ms for 
_wp_filter_build_unique_id()), and wrote unit testing. The unit test 
only covers the _wp_filter_build_unique_id() function, so it is at only 
21% of the plugins.php file. If you want to add in the other 
add_filter() and remove_filter to make absolutely sure that it works, 
then let me know and I'll attach the unit test to the ticket also.

For the last email I sent, I didn't do tests for Use Cases 3 and 4, but 
I figured that 1 and 2 would cover that at this point. Do you think I 
should install a couple of plugins that use Classes to be sure that it 
works correctly? The plugin that started the issue would be a good 
candidate, but also perhaps Subscribe2 (which I know uses array(&$this, 
'methodname') in its code) with others?

One thing that I had to do with the unit testing was remove the class 
comparsion checking. It didn't seem to function properly. I just figured 
that if the class already has $wp_filter_id, then it must have already 
been through the process. Oh wait, $wp_filter_id should be 
$_wp_filter_id, in case any class might use that for some reason. Would 
have to find a better unique name.

The modification shouldn't require any changes to existing classes, 
because of the above usage. In my profiling, with 206 calls to the 
function, it takes only 4ms.

More information about the wp-hackers mailing list