Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#97 2012-08-10 02:51:22

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Feedback to: Textpattern 4.5.0 Beta released

Any PHP file that is placed to the plugin cache directory is loaded globally, on each interface-side, on each type of response. This will evidently cause issues as the plugins will be loaded on places where they shouldn’t be.

Oh, that doesn’t sound encouraging :(
Being the convenience (imo) of installing/using the plugins directly from the plugin cache dir, I hope there could be some developments to make plugins running from cache dir to work exactly like those running from DB.
In any case, having some of them running from DB and others from cache dir won’t be a big deal, really, and I can live with that.

Thanks, Gogom.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#98 2012-08-21 04:16:14

Rimfya
Member
Registered: 2007-11-22
Posts: 31

Re: Feedback to: Textpattern 4.5.0 Beta released

Is there any timeframe for the stable release?

Offline

#99 2012-08-21 10:19:03

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,306
Website GitHub

Re: Feedback to: Textpattern 4.5.0 Beta released

maniqui wrote:

I hope there could be some developments to make plugins running from cache dir to work exactly like those running from DB.

That would probably involve either:

  • Reading the files as they are loaded, detecting the Type in the template (if indeed the files are in template format: they don’t have to be, which is why the cache dir is not recommended for production environments).
  • Permitting the filenames to indicate the plugin’s type (e.g. ied_plugin_composer_v1.00_TYPE4.php).
  • Introducing some kind of directory structure convention so the files can be organised by type, or function, or whatever.

The first two are cumbersome or slow. The last one might have merit and is (sort of) the way things can be organised now, albeit in a binary fashion, i.e. put all files you want to load in the cache dir and put any files you don’t want to load in some other subdirectory. As you well know, that gives the flexibility to switch plugins on and off by just moving them between directories, which is also very versioning friendly. This would just be an extension whereby some predefined directory names could trigger certain behaviour — a bit like the old ‘S’ and ‘K’ runlevel files in UNIX’s rc.d system. Maybe the directories are just the plugin types: drop all admin-and-ajax plugins in the 4 directory, for example. Things like library plugins would fall foul of the system so they’d need special dispensation, and it would have to be backwards compatible somehow.

Even if we do something like that one day, it won’t necessarily stop plugins from running on inapprpriate hook points because — as Gocom mentioned — they can attach at any point and could, therefore, get executed at an unexpected time. It may, however, offer some level of protection for plugin types 3/4/5 against sending non-AJAX responses to an AJAX request. Providing of course you put the plugins in the right subdirectory :-)

This whole cache dir thing could probably be improved overall though. We could toss around ideas on a separate thread if you like (in fact I’m sure there was a thread started ages ago about this…)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#100 2012-08-21 10:24:08

jpdupont
Member
From: Virton (BE)
Registered: 2004-10-01
Posts: 752
Website

Re: Feedback to: Textpattern 4.5.0 Beta released

I’ trying smd_macro on the new 4.5 beta.

My macro works on many 4.4.1 sites.

  1. On 4.5, I get a first error in the <txp:images tag I use in the macro : I must set a sort order to avoid the error.
  2. Then I get an other error on the <txp:smd_thumnail tag : “Textpattern Warning: tag does not exist while parsing form “None” on page “demo”

Here I don’t understand : smd_tumbnail is active, type expected is created (carre_100)

My test site is here : test45.alysse.com/demo

My macro (may be downloaded on the site above) :

<txp:variable name="image_ids">{img_id},<txp:images category="{img_cat}" break=","><txp:image_info type="id" /></txp:images></txp:variable>

<txp:variable name="counter" value="0" />
<txp:variable name="maxaff" value="{max_thumb_display}" />

<txp:images sort="id asc" break="" wraptag="" class="galerie" id='<txp:variable name="image_ids" />'>
   <a href="<txp:image_url />" class="{cls_fbox}" rel="{img_rel}">
      <txp:adi_calc name="counter" add="1"  />
<txp:smd_if field="txpvar:counter"
     operator="gt"
     value="txpvar:maxaff" >
      <txp:smd_thumbnail type="{thumb_type}" class="{cls_thumb_cache}" />
<txp:else />
      <txp:smd_thumbnail type="{thumb_type}" class="{cls_thumb}" />
</txp:smd_if>
   </a>
</txp:images>

Offline

#101 2012-08-21 10:33:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,306
Website GitHub

Re: Feedback to: Textpattern 4.5.0 Beta released

jpdupont wrote:

tag does not exist

As a stab in the dark, try setting the smd_thumbnall plugin type to ‘5’ and see if things improve (you can do that with the plugin composer, or alter it directly in phpMyAdmin). I really need to go through all the plugins and revamp them for 4.5 use. Just a matter of making time at the moment.

EDIT: don’t know about the txp:images error. Looks like it’s not substituting the stuff in single quotes for some reason. Weird.

Last edited by Bloke (2012-08-21 11:07:07)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#102 2012-08-21 10:55:12

Gocom
Plugin Author
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Feedback to: Textpattern 4.5.0 Beta released

Bloke wrote:

That would probably involve either:

Stef, that’s all good and all, but that doesn’t fix the other main issue which is installing and managing the plugins. Plugin cache doesn’t have an installer (plugin lifecycle), which literally defeats any point in using it.

Reading the files as they are loaded, detecting the Type in the template (if indeed the files are in template format: they don’t have to be, which is why the cache dir is not recommended for production environments).

I would give my big no to plugin templates. If you excuse me, kill it with fire. Please. Plugin templates are horrid mess of a system and should just die. They literally encourage bad practices. As far as the type goes, you would need to get the type from the source code. Which either involves use of tokenizer or import, where the latter can not work and the former is not a real option.

Things like library plugins would fall foul of the system so they’d need special dispensation, and it would have to be backwards compatible somehow.

I don’t see how. The goal would be extending the plugin cache to work like the database does, which for the first time actually implements library type plugins for the cache. As of now, the cache does not support on-demand library plugins.

Last edited by Gocom (2012-08-21 10:57:24)

Offline

#103 2012-08-21 11:04:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,306
Website GitHub

Re: Feedback to: Textpattern 4.5.0 Beta released

Gocom wrote:

doesn’t fix the other main issue which is installing and managing the plugins

Correct, hence my closing statement “This whole cache dir thing could probably be improved overall”. I’m sure there were some good points put forward on another thread about ways to make plugins better but I can’t find it, grrrr… let’s take this discussion out of this topic and hammer out ways to make the cache dir implementation — heck, even the entire plugin system — better.

Last edited by Bloke (2012-08-21 11:06:07)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#104 2012-08-21 11:14:20

jpdupont
Member
From: Virton (BE)
Registered: 2004-10-01
Posts: 752
Website

Re: Feedback to: Textpattern 4.5.0 Beta released

Bloke a écrit:

As a stab in the dark, try setting the smd_thumbnall plugin type to ‘5’ and see if things improve (you can do that with the plugin composer, or alter it directly in phpMyAdmin). I really need to go through all the plugins and revamp them for 4.5 use. Just a matter of making time at the moment.

Thanks Stef, setting the plugin type to ‘5’ do remove the error and now I see the images. OK !

I don’t understand what you mean with the txp:images error …

Offline

#105 2012-08-21 11:22:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,306
Website GitHub

Re: Feedback to: Textpattern 4.5.0 Beta released

jpdupont

Cool, glad it worked. When I tried your macro I got a MySQL error. Just chasing it down to find out why. But if you see everything OK, then that’s brilliant.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#106 2012-08-21 16:09:03

wet
Developer
From: Lenzing, Austria
Registered: 2005-06-06
Posts: 3,267
Website

Re: Feedback to: Textpattern 4.5.0 Beta released

Bloke wrote:

We could toss around ideas on a separate thread

Hint, hint.

This thread’s topic is Feedback to: Textpattern 4.5.0 Beta released. I’d rather keep it that way.

Offline

Board footer

Powered by FluxBB