[wp-trac] Re: [WordPress Trac] #3047: get_plugininfo()

WordPress Trac wp-trac at lists.automattic.com
Thu Aug 17 22:04:39 GMT 2006


#3047: get_plugininfo()
-----------------------------------+----------------------------------------
 Reporter:  forceagainstsomething  |        Owner:  anonymous
     Type:  enhancement            |       Status:  new      
 Priority:  normal                 |    Milestone:           
Component:  Administration         |      Version:  2.1      
 Severity:  normal                 |   Resolution:           
 Keywords:                         |  
-----------------------------------+----------------------------------------
Comment (by forceagainstsomething):

 To start with, although already posted to the wp-hackers list, I profiled
 the current code by running it 1,000 times.  That only added 0.137 to
 WordPress's total running time.  Realistically the function would only be
 called a dozen or so times altogether.  So using this function has almost
 no impact on execution time.

 get_plugininfo(plugin_basename(FILE),$info) wouldn't work.  Picture a
 plugin with this structure:

 /plugins/myplugin/myplugin.php

 /plugins/myplugin/includes/classes/myplugin_class.php

 If get_plugininfo(plugin_basename(FILE),$info) was called from the
 myplugin_class.php script, it would fail.

 Sure, it's not the biggest pain in the neck to simply define the values
 yourself when you're writing the plugin.  That being said, any good
 programmer would move constantly recurring code into a function. The vast
 majority of the plugins I've looked at are always defining those values,
 so why not move them into a function?

 BTW - You can also find out the blog's URL using some PHP code, but that
 hasn't stopped the devs from creating the get_bloginfo() function, which
 can return the URL. These types of functions are for convenience.  It
 makes it easier to work with WP, thus making more people want to write
 code for WP.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3047>
WordPress Trac <http://wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list