[wp-trac] Re: [WordPress Trac] #5651: Optimize get_plugin_data

WordPress Trac wp-trac at lists.automattic.com
Sat Jan 12 22:12:01 GMT 2008


#5651: Optimize get_plugin_data
----------------------------------------------+-----------------------------
 Reporter:  filosofo                          |        Owner:  anonymous
     Type:  defect                            |       Status:  new      
 Priority:  normal                            |    Milestone:  2.5      
Component:  General                           |      Version:  2.5      
 Severity:  normal                            |   Resolution:           
 Keywords:  has-patch get_plugin_data memory  |  
----------------------------------------------+-----------------------------
Comment (by DD32):

 1. get_plugin_data @ since shouldnt be 2.5
 1. never trust plugin authors to have all the data within 1kb at the top
 of the file, I've come accross several with huge FAQ's at the top of the
 file (and then the metadata)

 My thoughts is that the file should be read until the first comment block
 is in, then match for details. That'd work for files like this:
 {{{
 /*
 Name: Blah
 */
 }}}

 But wouldnt work for some others i've seen lately of:
 {{{
 // Plugin Name: Blaah
 // Author: Me!
 }}}

 Unless the reading function was smarter.

 While i'd say reading the entire file isnt a problem for the admin since
 its only called once in awhile, However, as you point out, others are
 having troubles, with such low memory limits(8M), i'm supprised the rest
 of WP is loading(Which is shown by furthur pages where install cant run
 due to it)


 So maybe a function to read in the first /**/ comment block, Or to read
 all the lines starting with // if a /**/ is not found? How common is the
 // comment style for metadata?(I've only ever seen it once)

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5651#comment:6>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list