#42383 closed feature request (duplicate)
Creating "Frameworks" in "wp-content"
| Reported by: | tazotodua | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Plugins | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description (last modified by )
I had an idea, just i dont know if it's worth to do or not...
well, lets say there are many frameworks (like Visual-Composer, Gantry or many other PHP libraries and frameworks).
On WordPress repository, maybe thousands of themes/plugins use the same package...
Thus while I have 20 plugins and 5 themes installed on my site, i have same library installed 5-10 times (in individual plugin/theme folders).
Also, when framework is updated, then all of the plugin/theme developers manually submit those changed files to SVN... and that makes tracing more complex...
What if WordPress created a flexible repository for Frameworks/libraries, that can be called from plugins/themes easily. For example, in "my-xyz-plugin".
<?php
/*
Plugin Name: My XYZ Plugin
....
*/
wp_include_framework('visual-composer', '4.15');
...
...
?>
so, the "wp_include_framework" should be native WP function, which will do the following (phseudo-code):
function wp_include_framework($name, $version){
//check if folder doesnt exist
if(!is_dir(ABSPATH.'/wp-content/frameworks/visual-composer/4.15/')){
download_and_unzip("svn.wordpress.org/frameworks/visual-composer/4.15.zip");
}
include_once(ABSPATH.'/wp-content/frameworks/visual-composer/4.15/loader.php');
}
So, whenever plugin/theme is updated, the SVN only gets update of 1 line in plugin/theme PHP code, instead of updating whole library file ( authors of thousands of plugins and themes doing the same thing).
I dont know what "cons" does this idea have.
p.s. if someone need to explicitly include the library into own plugin/theme folder, he can still do that of course.
Change History (4)
#2
@
9 years ago
similar thing with js libraries...
I think that will make things more standartized...
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
p.s. once in a while, wp-cron-job can loop thought active plugins and delete all folders in
wp-content/frameworks/*which are not used in any active plugins by the functionwp_include_framework.