[wp-trac] [WordPress Trac] #11059: Discourage plugin authors calling wp-config.php directly

WordPress Trac wp-trac at lists.automattic.com
Thu Nov 5 21:25:13 UTC 2009


#11059: Discourage plugin authors calling wp-config.php directly
-------------------------+--------------------------------------------------
 Reporter:  strider72    |        Owner:          
     Type:  enhancement  |       Status:  reopened
 Priority:  normal       |    Milestone:          
Component:  General      |      Version:  2.9     
 Severity:  normal       |   Resolution:          
 Keywords:  has-patch    |  
-------------------------+--------------------------------------------------

Comment(by westi):

 Replying to [comment:12 Viper007Bond]:
 > Replying to [comment:9 josephscott]:
 > > Plugins and themes should never, ever, ever, ever load wp-config.php,
 wp-load.php, wp-blog-header.php, etc. directly.
 >
 > Erm, why not? I mean stuff like dynamic `.css` files and stuff can
 instead be done by `http://site.com/?outputmycss`, but there's gotta be
 some type of situation out there where a plugin needs to load WordPress
 from a stand alone file and so `wp-load.php` has to be used.

 I think what Joseph means here is that a plugin/theme php file which is
 {{{include}}}'d by WordPress by virtue of being used in the plugin or
 theme should not load in these files.

 If you had a standalone php file you were calling which you then wanted to
 pull in the WordPress code you would then need to pull in the correct
 file.

 I'm not sure what benefit you would gain over a query-string based url and
 using the available hooks though.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11059#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list