[wp-trac] [WordPress Trac] #42383: Creating "Frameworks" in "wp-content"

WordPress Trac noreply at wordpress.org
Thu Nov 2 06:34:09 UTC 2017


#42383: Creating "Frameworks" in "wp-content"
-----------------------------+------------------------
 Reporter:  tazotodua        |       Owner:
     Type:  feature request  |      Status:  closed
 Priority:  normal           |   Milestone:
Component:  Plugins          |     Version:
 Severity:  normal           |  Resolution:  duplicate
 Keywords:                   |     Focuses:
-----------------------------+------------------------
Description changed by SergeyBiryukov:

Old description:

> 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.

New description:

 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.

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42383#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list