|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 - 3 - 4 - 5 | Next > |
|
|
Re: Plugin dependency checkingHaha. (Sorry). I've been trying to keep up with this thread and have
been doing fairly well up to this point. Austin, could you put this last bit a little less concisely? Austin Matzko wrote: > If it's a matter of wanting the child plugins to be able to redefine > the pluggable function, you could let the parent plugin define the > pluggable function as a wrapper of a parent plugin's factory method, > which would then open up the possibility of child plugins re-defining > the behavior of the pluggable function. > -- Code Is Freedom Burt Adsit _______________________________________________ wp-hackers mailing list wp-hackers@... http://lists.automattic.com/mailman/listinfo/wp-hackers |
|
|
Re: Plugin dependency checkingOn Fri, Jun 12, 2009 at 7:29 PM, Burt Adsit<burt@...> wrote:
> Austin Matzko wrote: >> >> If it's a matter of wanting the child plugins to be able to redefine >> the pluggable function, you could let the parent plugin define the >> pluggable function as a wrapper of a parent plugin's factory method, >> which would then open up the possibility of child plugins re-defining >> the behavior of the pluggable function. > > Haha. (Sorry). I've been trying to keep up with this thread and have been > doing fairly well up to this point. Austin, could you put this last bit a > little less concisely? Let's say you want either a parent plugin or one of its children to be able to redefine the behavior of a pluggable function, such as wp_authenticate(). Then in the parent plugin, you could have something like the following: class ParentPluggableAuthenticate { function __construct($username, $password) { // some logic to determine which child plugin's method should be used to replace wp_authenticate()'s functionality // call that child method } } function wp_authenticate($username, $password) { return new ParentPluggableAuthenticate($username, $password); } Or something like that. _______________________________________________ wp-hackers mailing list wp-hackers@... http://lists.automattic.com/mailman/listinfo/wp-hackers |
|
|
Re: Plugin dependency checkingLOL. I followed it, but it *is* starting to sound a bit like an
Abbott and Costello routine... ;-) Stephen On Jun 12, 2009, at 7:29 PM, Burt Adsit wrote: > Haha. (Sorry). I've been trying to keep up with this thread and have > been doing fairly well up to this point. Austin, could you put this > last bit a little less concisely? > > Austin Matzko wrote: >> If it's a matter of wanting the child plugins to be able to redefine >> the pluggable function, you could let the parent plugin define the >> pluggable function as a wrapper of a parent plugin's factory method, >> which would then open up the possibility of child plugins re-defining >> the behavior of the pluggable function. _______________________________________________ wp-hackers mailing list wp-hackers@... http://lists.automattic.com/mailman/listinfo/wp-hackers |
|
|
Re: Plugin dependency checkingOn Jun 12, 2009, at 11:34 AM, Mike Schinkel wrote: >> The same plugin appearing in more than one place will >> confuse the heck out of users. > > While I like your sub-plugin model, will it confuse users if two (2) > different plugins use the same sub-plugin? I know you are thinking > of plugins specifically made for another plugin but someone could > easily choose to implement the same interface so they could have > ready-made add-ins for their own plugin. Could you give me an example, because seriously I can't think of any. Again note the distinction between dependent plugins and sub-plugins. If I make a "Spam Karma ReCaptcha" sub-plugin with "Spam Karma" as the master, I can't imagine that ever being *also* a sub plugin for some other plugin. If you're talking a framework plugin, you have it turned around. The Framework would be the master, and plugins based on it would be dependent on it (but probably NOT sub-plugins.) Stephen _______________________________________________ wp-hackers mailing list wp-hackers@... http://lists.automattic.com/mailman/listinfo/wp-hackers |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Plugin dependency checkingNOTE:
You can read all of this for the discussion, or you may just choose to jump to the bottom, where the rug gets yanked out from under.... On Jun 13, 2009, at 1:56 AM, Mike Schinkel wrote: > "Stephen Rider" <wp-hackers@...> wrote: >>> While I like your sub-plugin model, will it confuse users if two (2) >>> different plugins use the same sub-plugin? I know you are thinking >>> of plugins specifically made for another plugin but someone could >>> easily choose to implement the same interface so they could have >>> ready-made add-ins for their own plugin. >> >> Could you give me an example, because seriously I can't think of any. >> Again note the distinction between dependent plugins and sub-plugins. > > Sure I can give an example and one I think is highly likely. > > Let's say the fine folks who are offering WP e-Commerce decided to > create payment processor sub-plugins; one for PayPal, one for Google > Checkout, etc. etc. I in my opportunistic wisdom decide to create > my own ecommerce solution targeted at video cartoon characters with > blogs on WordPress which I choose to call "WP Super Mario > Cart" (oblivious to the obvious trademark lawsuits that will be > hurled at me.) But rather than worry about implementing all those > tedious payment processing modules I just implement the same > interface that WP e-Commerce chose to implement. Presto bango, I now > have a bunch of dependent sub-plugins that will work for my new > shopping cart. So... we have "WP e-Commerce" and "Paypal Module" sub-plugin for WP e- Commerce. Paypal Module plugin has some code in it that says "this is a sub-plugin of WP e-Commerce". *By Definition* that means it is dependent on WP e-Commerce. (Sub plugins are just a special kind of dependent plugin.) That means that unless WP e-Commerce is present and activated, Paypal Module *doesn't even load*. You would have to hack it to say "This is a sub-plugin of Mario Cart". This is all very similar to frameworks. Something I've been working on, on the side, is a WP plugin framework called Strider Core. When I get it done, all of my plugins are going to be built on top of it. In this situation I would not use the sub-plugin formula but simple dependencies -- Strider Core would be a plain-old plugin and the others would have the Header that says "this plugin depends on Strider Core". Here's another thought. If someone deletes a plugin that has subs, all of its sub-plugins should logically be deleted along with it, because *by definition* the sub plugins are nothing without their Master plugin. IF I get rid of "Spam Karma", I really don't need the "Spam Karma Anubis" plugin sticking around. In fact I don't need any of the TEN sub-plugins that ship with Spam Karma. What you're asking for in your example is the ability to switch from Push to Pull -- you want a plugin to be able to say, "Plugin Z is a sub-plugin of Me". The **simplest** solution to your example is that PayPal module shouldn't have ANY dependencies. It's just some functions and an add_action, which doesn't do anything unless some other plugin calls the corresponding do_action. You're not asking for real dependency, you just want the visual appearance of a sub-plugin. Might be doable, but it's a different thing. Here's the real UI problem with that though: Okay, Paypal Module appears on the Plugins list underneath both WP e- Commerce and Mario Cart. I go to the one under WP e-Commerce and deactivate it. Ooops! I just deactivated it for Mario Cart too! In WordPress, a plugin is either activated or it's not (at runtime the file is either include()ed or it isn't.) What you need is code within the two Cart plugins that say "use sub-plugin X or don't", which is -- and should be -- beyond the scope of WP's plugin management. <snip> > If you already knew all this about interfaces, forgive me. Some > people on wp-hackers have a deep computer science background and > others first learned to program in order to modify WordPress and > since I don't know who knows what I figured I'd inject a bit of this > background. Heh. I learned programming by typing games into my Apple ][+. Still, more of the latter than the former. :) > Validation would be HUGELY beneficial. If could allow us to disable > non-conforming plugins during an upgrade and even make it possible > to determine if there will be problems prior to an upgrade. > WP_Interface() would go a long way towards making larger companies > and agencies more comfortable with using WordPress because over time > it would increase the robustness of the WordPress platform. Are you talking about what Firefox does where add-on authors have to continually update their add-ons just to bump the version of Firefox that their stuff is compatible with? > Wrapping up by coming back to your concept of "dependent plugins" > vs. "sub-plugins" I really don't think we should make any such > distinction. They are basically the same thing. Dependent means that if Henchman Plugin is dependent on Boss Plugin(s), Henchman doesn't even load (in PHP, isn't included) unless Boss is loaded. A Sub-Plugin is exactly the same, except for the added UI that it appears underneath a specified Boss in Manage Plugins, and if that specific Boss is deleted, so are all Subs. > As for the admin UI I do agree that it would be nice to have a way > to display those that are generally only there to be supportive of > another plugin in a tree view up that plugin, but that should be > determined by WordPress inspecting the two plugins not by anything > defining a plugin as a "master" and another as a "slave." IMO, anyway. ... *sigh* 10,000 words later, I think you've talked me out of the whole idea. I'm seeing problems with the whole plan. Plugins can already make themselves dependent on another by checking for the existence of the needed functions from the "master". Or they can just offer up functionality via add_action that is called or not by some other plugin. The only REAL important part of all this is that the dependency relationship allows for proper loading order. So... rather than Master/Slave, or even "dependent", what we need is something in WP Core that allows for some plugins to say "offers X" and others to say "uses X"; and if the two match up then we get the "sub plugin" UI changes. (And forget the bit about deleting sub- plugins!) This is really a complete change from previous discussion, but probably the best. Stephen -- Stephen Rider http://striderweb.com/ _______________________________________________ wp-hackers mailing list wp-hackers@... http://lists.automattic.com/mailman/listinfo/wp-hackers |
|
|
|
|
|
|
|
|
|
|
|
Re: Plugin dependency checking"scribu" <scribu@...> wrote:
> One or more child plugins can use functionality provided by one > parent plugin. Parent plugins are not aware of the additional > functionality that each child plugin provides. That's the basic > model. As with discussion with Steven on the list, let me urge not to have the child name its parent but instead have the child name the "interface" that its parents can consume. Steven called is "offers" and "uses"; most any terms will work but coupling children directly to parents will really limit what can be done with their children and IMO would be a mistake. -Mike Schinkel Custom Wordpress Plugins http://mikeschinkel.com/custom-wordpress-plugins _______________________________________________ wp-hackers mailing list wp-hackers@... http://lists.automattic.com/mailman/listinfo/wp-hackers |
|
|
|
|
|
Re: Plugin dependency checking"scribu" <scribu@...> wrote:
> Yes, not using interfaces would would limit what could be done > with their children, but on the other hand, interfaces would > limit what child plugins could do themselves. How so? I don't see it. Minimally (for the proposed use in WordPress) an "interface" is simply a name that parent and child agree to offer and to use. It could be more than just a name but it would not have to be. > It's the same tradeoff that would happen if normal plugins would > have to have an interface that the core would have to check. I think it would be the other way around, i.e. core would implement (an) interface(s) that plugins would use. BTW, that is what already happens implicitly anyway, so we are not loosing anything by formalizing into a name. Let me see if I can find time to work on some examples. I think you'll "see" it more readily with code. -Mike Schinkel Custom Wordpress Plugins http://mikeschinkel.com/custom-wordpress-plugins _______________________________________________ wp-hackers mailing list wp-hackers@... http://lists.automattic.com/mailman/listinfo/wp-hackers |
|
|
Re: Plugin dependency checking-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 I got some good news. While I was reading all these messages I went ahead (and watching ID4) I created a new "class": WP_Dependency This class with the proper registration of the plugin when it's read will test to see if the theme or plugin will allow you to even activate once it's tied into the WordPress main code. I just finished the "class" and didn't tie it into any WordPress code code. Just a test file. The way I have it "coded" right now is that when the plugin is even placed in WordPress it attaches itself to the 'register' part of the class so it can say 'Hello. I am installed and these are my dependencies based on version of WordPress and Plugins Needed and their versions for me to work properly.' I am working on one more feature that was suggested on the #wordpress-dev channel. There be a field for 'recommended' for the plugin dependencies. A little warning would show up only saying that you should have at least this version, but not required. Let me know what you think about this. I'll post the sample code on my website (bugssite.org) in later in the day. Your Friend, Shane Mike Schinkel wrote: > "scribu" <scribu@...> wrote: >> Yes, not using interfaces would would limit what could be done >> with their children, but on the other hand, interfaces would >> limit what child plugins could do themselves. > > How so? I don't see it. > > Minimally (for the proposed use in WordPress) an "interface" is simply a name that parent and child agree to offer and to use. It could be more than just a name but it would not have to be. > >> It's the same tradeoff that would happen if normal plugins would >> have to have an interface that the core would have to check. > > I think it would be the other way around, i.e. core would implement (an) interface(s) that plugins would use. BTW, that is what already happens implicitly anyway, so we are not loosing anything by formalizing into a name. > > Let me see if I can find time to work on some examples. I think you'll "see" it more readily with code. > > -Mike Schinkel > Custom Wordpress Plugins > http://mikeschinkel.com/custom-wordpress-plugins > _______________________________________________ > wp-hackers mailing list > wp-hackers@... > http://lists.automattic.com/mailman/listinfo/wp-hackers > Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJKN2HiAAoJEChMcQvNqPqmDb8P/3mAOTqkP+ooaoQE28qbryXe PhYXz7c5MMm4qN8XHT6rZ+vk1WkBTvs+N4snNMRcS4Qo2jIodnd7+7+drAfPi1vb LYvvc0d+w4Bet6wL0xuXauBPJkvK3KvqFL0EWDOEdzBVnCpC//zwXm/XMxxzB7pC gjzHiVI0h3Hcf6k7pLcOiM4RBCzjmx0aaD23gWHd6gWU7VTZ6KOKb5TfwkgZ6b4C YCgf83oRqj5t16hCVu35rjjYdcr6NRJDq9udZAWNAJkKrRFMO8L+RVO0M/ofFJTa o04bE0YrXlsg72cw6kgfWcirCOXNxTo+9pRQ4m3vXO7LkTbrTfkQvft7pWU1qh3D oLY4Y7+nBDOBLRybRU6mCtPf9A9gzb0Csv+AFOQq1dLeWFEjMXKyhbTj13v0xmf5 pMFomLb59I/o3w4MP+dfV+RI4XW66ufjqwhIbJ4zKOnHbR3msIiAGxdsK7O0scXK oE83QfcoDneET+iC6vf8XhETYnjwggDIxy/gswKLy9iPlTP6OUtb19ShHlVPUtes r+Tu6aI4mYGajzk2GMG0X874f2O3d/WyFNc4Nsvab4hLq6wm7IPoDgnmmV3sWWqi gfusmzHIQPH/pBtCEH0B1U+dMHktiy+vOEhQQLyw/tgfbkTQVP9IEr5JDgNT72Wo VsIW8Nx28BTQDqmTuqZm =82Yt -----END PGP SIGNATURE----- _______________________________________________ wp-hackers mailing list wp-hackers@... http://lists.automattic.com/mailman/listinfo/wp-hackers |
|
|
Re: Plugin dependency checkingOn Jun 15, 2009, at 6:39 PM, Mike Schinkel wrote: > As with discussion with Steven on the list, let me urge not to have > the child name its parent but instead have the child name the > "interface" that its parents can consume. Steven called is "offers" > and "uses"; Just for the record, I wan't calling it anything, I was using the words as verbs. ;-) If we're going to find a terminology for it, I like the idea of an unambiguous metaphor for something that connects to something else: plug/socket button/buttonhole Tab A/Slot B toast/toaster ;-) I don't know what, exactly, but "interfaces" is too broad -- unless you know what it is, you don't know what it is. If it's named properly authors can have an idea of how they work just from the name. Stephen _______________________________________________ wp-hackers mailing list wp-hackers@... http://lists.automattic.com/mailman/listinfo/wp-hackers |
|
|
Re: Plugin dependency checking-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 I put the class file on trac if anyone wants to take a look at it. http://core.trac.wordpress.org/ticket/10190 Your Friend, Shane scribu wrote: > Ok, now I get what you were trying to say with "Interfaces". > > Yes, not using interfaces would would limit what could be done with > their children, but on the other hand, interfaces would limit what > child plugins could do themselves. It's a tradeoff. > > It's the same tradeoff that would happen if normal plugins would have > to have an interface that the core would have to check. > > On 6/16/09, Mike Schinkel <mikeschinkel@...> wrote: >> "scribu" <scribu@...> wrote: >>> One or more child plugins can use functionality provided by one >>> parent plugin. Parent plugins are not aware of the additional >>> functionality that each child plugin provides. That's the basic >>> model. >> As with discussion with Steven on the list, let me urge not to have the >> child name its parent but instead have the child name the "interface" that >> its parents can consume. Steven called is "offers" and "uses"; most any >> terms will work but coupling children directly to parents will really limit >> what can be done with their children and IMO would be a mistake. >> >> -Mike Schinkel >> Custom Wordpress Plugins >> http://mikeschinkel.com/custom-wordpress-plugins >> >> _______________________________________________ >> wp-hackers mailing list >> wp-hackers@... >> http://lists.automattic.com/mailman/listinfo/wp-hackers >> > > Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJKN8d4AAoJEChMcQvNqPqmT2sP/RPW7qSoVhv0aixFNl6DnPlN RMvYLdDxLKG/Lh0Tjr/d4GZ39lth6K5AC9sXUgH4tIbRWJE4XSzl1PemjywuEm07 I8LIgLXuMcuB+iDAb3NiuMr32Vjfn1J3SgycOdfTPtbxpqxZchMaR31tLsYYFihk +6o0QAfhIsvB9w9EsK2XSRUyI/sZ/CIZNbNyN2qIZ589Odw2r7XqyDCUtv+nbXCd IxhHo24/gspjrLmLIuTzPcf2V0uVVGsydpJDBs7c0htnzYaY/JzzjrWqut9BERTV 8oom1rChv6cOTHIMXcCgpenlsc/5uENXvgK6a8onPdl38lSmCr5aMpq30jT+rhSD u66KiXk6EQC2DWs4QXyeJYI9Lr39avEr/J1udLHR87KTIczuNgdmdL9+9lmvt+LI Goil1c65oJNoMLTy74KD1OTO6c7ngBP3VyLfF1SxiYJcCLBTT3DGtW3yT7e6Q0GW wxdRzmDy4Nihz6ZLukTC67bZpO0UB7JzlquOMgLQoeltfVg264w4Y6TB7KJEsz98 p0cc3Vo5x0tmhJFZuZ8OtEjZby9QDMrgHnoDg6C7F/C1NdHnQtve/4j4zz8w+6gE 9YaGwvX9DOgL3AUIJ5udIUaeYm+oRjkBRrTLoF+MYiUOp5JHTK/Ze9CkEEpXL4jL FieqtBSiDIDm1NkLHV7G =4dGN -----END PGP SIGNATURE----- _______________________________________________ wp-hackers mailing list wp-hackers@... http://lists.automattic.com/mailman/listinfo/wp-hackers |
|
|
Re: Plugin dependency checkingOn Jun 16, 2009, at 4:12 AM, Shane A. Froebel wrote: > The way I have it "coded" right now is that when the plugin is even > placed in WordPress it attaches itself to the 'register' part of the > class so it can say 'Hello. I am installed and these are my > dependencies > based on version of WordPress and Plugins Needed and their versions > for > me to work properly.' Certainly in the context of this thread, we have moved away from the idea of specifying plugin dependencies in favor of one plugin providing some sort of function that another plugin can look for. Certainly within current WordPress plugins it is frowned upon to look for "WordPress version x.x"; instead coders are encouraged to look to see if a certain functionality exists. This is because the latter is a more robust method. For example I know that some people eliminate the WP Version string entirely for "security reasons" (aside: let's not get into arguments as to whether this is actually a security improvement!), but if a function exists, then it exists! Mike Schinkel's argument is correct that even if I program a dependent plugin intending it to be used with "Plugin A", it might be entirely legitimate for someone to create "Plugin B" that can also use that "sub plugin". This breaks if the sub plugin is checking for a specific "master"; but works just fine if the sub plugin says "I can do X for you" and the (any) master says "If any plugins can do X, do it now". Stephen -- Stephen Rider http://striderweb.com/ _______________________________________________ wp-hackers mailing list wp-hackers@... http://lists.automattic.com/mailman/listinfo/wp-hackers |
|
|
Re: Plugin dependency checkingOn Jun 15, 2009, at 12:44 AM, Mike Schinkel wrote: > Dayum! I should have read ahead. I just wrote a ton and in this last > paragraph you essentially described interfaces. So I deleted > everything that came before and am just sending this. Heh. Sorry about that. I tried to warn you: > You can read all of this for the discussion, or you may just choose > to jump to the bottom, where the rug gets yanked out from under.... Question for people who know more programming languages than I do: Would it make sense to call these offered functions "services"? Would this conflict with some other similar system that provides "services" (and uses that term)? Stephen -- Stephen Rider http://striderweb.com/ _______________________________________________ wp-hackers mailing list wp-hackers@... http://lists.automattic.com/mailman/listinfo/wp-hackers |
| < Prev | 1 - 2 - 3 - 4 - 5 | Next > |
| Free embeddable forum powered by Nabble | Forum Help |