Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2018-03-24 14:48:29

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,260

Re: Situation around plugin (de-)activation in preferences

I’ve read your post(s) several times, but for my graphic designer brain your considerations sound quite complicated, I can hardly follow. Additionally, what you’re aiming at seems too much for what Textpattern has represented throughout its existence.

My suspect is it might be easier to accomplish to switch off all plugin-use altogether with switch “a”, and with switch “b” turn off only admin side ones, so the website is running normally for the public. (Then, of course, hiding/graying-out switch b as long as switch a is ON.)

Then, on the Plugins panel, a banner should inform about the deactivated-in-prefs setting, be it a general or an admin-side deactivation.

On Diagnostics, an additional sentence might give an analogous hint to anyone reading that text.
To those only? Quite hard to spot.

Which brings in one more idea: It might be useful to indicate the plugin deactivation in each admin panel, so that the deactivation is not forgotten when the admin is sidetracked somehow.

Bloke wrote #310287:

There’s no such thing as a “public-only” plugin.

I think there’s nothing to misunderstand in this sentence, and you’ll have tested thoroughly. Yet it sounds hard to grasp to me that e.g. the many conditional plugins aren’t public-only.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#14 2018-03-24 20:34:54

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

Re: Situation around plugin (de-)activation in preferences

uli wrote #310313:

what you’re aiming at seems too much for what Textpattern has represented throughout its existence.

Sorry if it’s confusing but that’s how Textpattern works now, and has worked since at least 4.0.7 (or whenever admin-only plugins were introduced, and probably before).

  • On the public site, both admin AND public plugins are always loaded UNLESS you set the Use plugins pref off.
  • On the admin-side, only admin-side plugins are loaded UNLESS you set the Use admin-side plugins pref off.

So, consider this:

  1. You turn OFF admin-side plugins (Use admin-side plugins in prefs). No Extensions panels appear, there are no extra plugin features on the admin side. Nothing plugin related runs at all.
  2. You visit the Diagnostics panel. It still shows that some plugins with admin-side components are active. Why? Because they are! Because if you visit the public site, they still run. They might have public tags defined in them.

The fact you’ve turned off the plugins on the admin-side does not affect their status on the public site. So what is showing on Diagnostics is correct. Although you might no longer be able to administer their settings, they are still technically active.

The only plugins that should not be shown on Diagnostics in this situation are the ones designated as “admin-only” (type 3). The fact they are still shown is a bug and we should hide them in this specific case.

Now consider this:

  1. You turn OFF public plugins (Use plugins in prefs). No public tags are available from any plugins.
  2. You visit the Diagnostics panel. It still shows that plugins with admin-side components are active. Why? Because they are! Because if you visit the admin side, they still run.

The only time you should see no plugins in the Diagnostics panel is if BOTH plugin-related prefs are off. That, again, is a bug and should be fixed, because currently they are listed as active.

My suspect is it might be easier to accomplish to switch off all plugin-use altogether with switch “a”, and with switch “b” turn off only admin side ones, so the website is running normally for the public. (Then, of course, hiding/graying-out switch b as long as switch a is ON.)

Yes, but this raises a backwards-compatibility issue. We’d have to work around it (by introducing a third pref and phasing out the old ‘Use plugins’ one). For now, we should probably just relabel them:

  • Allow plugins to run on the public site.
  • Allow plugins to run on the admin side.

it might be useful to indicate the plugin deactivation in each admin panel, so that the deactivation is not forgotten when the admin is sidetracked somehow.

No, sorry. The choice of not running plugins might be a conscious one on behalf of an admin. Maybe the site doesn’t need any. Or they’re disabled for security reasons. We shouldn’t nag people on every panel for something they might have chosen to do.

On the plugins panel, sure, a helpful indicator of which types are disabled might be handy. Similarly on the Diagnostics panel just before the list of “active” plugins, maybe. Beyond that, nothing.


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

#15 2018-03-24 20:45:54

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

Re: Situation around plugin (de-)activation in preferences

uli wrote #310313:

it sounds hard to grasp to me that e.g. the many conditional plugins aren’t public-only.

At the risk of making this more complicated than it is:

  • The plugin type (0-5) determines where it runs – public side (0) or admin side (3) or both (1). Ignore ‘Ajax mode’ for now, that’s a distraction.
  • Inside the plugin code, the author can do a check “Am I running on the public site? or “Am I running on the admin side?” and execute relevant code based on where it is running

It’s perfectly feasible to construct a plugin that is designated as “Admin” (type 1) – remember, this type really means “Both admin and public” but is poorly labelled – and have code inside it that is only executed if the plugin is running on the public site! It’s poor design and wastes processor cycles on the admin side to load a plugin that’s never used there, but it’s possible.

Likewise, you could construct a “type 1” plugin that has no public components, because you do an ‘if’ inside the code to detect only the admin-side case. Again, wastes cycles to load it on the public site, but it’s possible. It’s down to the plugin author to choose the appropriate type.

However:

  • it’s not possible to write a “type 0” plugin that runs on the admin-side. They are never loaded there.
  • it’s not possible to write a “type 3” plugin that runs on the public site. They are never loaded there.

How’s that?!


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

#16 2018-03-25 14:02:32

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,753
Website

Re: Situation around plugin (de-)activation in preferences

+1

It has got more consideration here than it ever has up to this point.

I think what’s important for you, Stef, and probably what Uli is getting at, is: as devs, you have the diagnostics feedback written in the way that best gives you the information you need to troubleshoot a given persons problems when they share their diagnostics info.

One of those, ‘dev’s choice’ things.

How’s that‽ ;)

Offline

#17 2018-03-27 12:41:11

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,260

Re: Situation around plugin (de-)activation in preferences

Thanks, Stef, for your explanations.

The thing you seem to put most effort in ( = the considerations I didn’t understand—and all these consideration were probably addressing the dev team, not me), is listing all really active plugins, while I was just thinking of a simple remark inside the Diagnostics textarea like
Below plugins might be currently disabled via the plugin settings on Preferences > Publish
(and a similar banner in the Plugins panel, respectively)
Hence I was speaking of “too much”. But certainly your plan will be much more useful for the user and all people offering help in the forum, than were my simplistic idea.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#18 2018-03-27 12:47:28

etc
Developer
Registered: 2010-11-11
Posts: 4,545
Website GitHub

Re: Situation around plugin (de-)activation in preferences

uli wrote #310313:

it sounds hard to grasp to me that e.g. the many conditional plugins aren’t public-only.

A possible reason is that previewing unpublished articles happens on the admin side, which is a bit weird. So public-only tags wouldn’t be available in previews.

Offline

#19 2018-03-27 12:57:24

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,260

Re: Situation around plugin (de-)activation in preferences

etc wrote #310402:

previewing unpublished articles happens on the admin side

Oh——K!


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#20 2018-03-27 13:49:12

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

Re: Situation around plugin (de-)activation in preferences

uli wrote #310401:

I was just thinking of a simple remark inside the Diagnostics textarea

Yes, and we may still do this (perhaps in 4.7.1 or later now, to save burdening translators with yet another new string). Not sure it’s entirely necessary but we’ll see what happens.

For now I’m just looking at the simplest option to denote that plugins on the Plugins panel are – or may be – deactivated globally. In reality this will only be possible for:

  • Type 0 (solely Public, if Use plugins is off).
  • Type 3 (solely Admin, if Use admin-side plugins is off).
  • Type 1 (public+admin IF both options are off in prefs).

On the Diagnostics panel, likewise. I will make it omit:

  • Type 0 if Use plugins is off.
  • Type 3 if Use admin-side plugins is off.
  • The entire list if both options are off.

Beyond that, we’ll worry about using a proper system of flags, perhaps something like I mentioned above, in another version.

etc wrote #310402:

previewing unpublished articles happens on the admin side

Yes, and this is a direct by-product of us forbidding access to unpublished content on the public site. If we relax this in teh status-mods branch and make it (perhaps) so that logged-in users with article.preview capability can view articles on the public site, then we can forego this nonsense situation.

That will probably require changes to <txp:article/> and <txp:article_custom/> tags (and maybe other tags that take a status) to permit all statuses to be displayed.

It would be a boon for people who wanted to show all articles to logged-in users (via the new <txp:if_logged_in> tag perhaps) and offer direct links to the admin side for editing. But we’d need to be very careful not to expose such articles to regular visitors, even if the URLs were typed by hand. Future future…


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

#21 2018-03-27 19:35:46

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

Re: Situation around plugin (de-)activation in preferences

Try the bleeding edge dev and let me know how you get on. In the Plugins panel I’ve struck out any plugins that are not considered, and omitted them from the Diagnostics panel entirely.

Just remember the caveats in my post above. It can only omit/strike out plugins that it knows for sure are not active based on the settings. If there’s any doubt (i.e the plugin could appear on both admin and public sides) then the plugin is considered ‘active’.

EDIT: I wanted to display the strikethrough only on plugins that had ‘Yes’ (since if a plugin is locally disabled, it doesn’t matter what the global setting is) but since it does an AJAX call to toggle it and that function is used elsewhere (e.g. the Sections panel) I can’t hijack it to toggle the strikethrough. Perhaps if we had a strikeout class or something instead of wrapping the content in <s>...</s> tags that would be better as we could then target whether we act upon the class or not, on a per-panel basis. Maybe that’s something we look into in future.

Last edited by Bloke (2018-03-27 19:43:21)


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

#22 2018-03-29 12:01:08

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,260

Re: Situation around plugin (de-)activation in preferences

I’ve currently not enough time to play with it exhaustively, sorry. For the moment, I’ve just looked at it in the demo, one plugin, rss_admin_db_manager.

The current state, i.e. just striking through the “Active” indicator in the Plugins panel, is a little free of unequivocal information on what the strike-through means, when there is no banner, no hover-help etc.

Re Diagnostics I’ve finetuned my initial opinion a little: I’d not remove inactive plugins entirely, cause that withholds information on what may have lead to the user’s complications. I’d find it useful to separate the list of all (installed, usually active) plugins in two groups, one that’s deactivated 100% sure, and one we can’t tell safely, and give these groups an apt caption each.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#23 2018-03-29 13:07:08

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

Re: Situation around plugin (de-)activation in preferences

uli wrote #310438:

The current state, i.e. just striking through the “Active” indicator in the Plugins panel, is a little free of unequivocal information on what the strike-through means.

True. All extra strings, though. I’m trying to minimize those (he says, having just added some Plugin code that requires more strings, and potentially more changes with the new/create changes).

Re Diagnostics… I’d not remove inactive plugins entirely, cause that withholds information on what may have lead to the user’s complications.

How? If they’re not active (turned off by hand in the Plugins panel or definitely deactivated via the prefs) then they can’t possibly be causing any issues, because they’re not loaded.

The only situation I can think of is that, when asked to post diagnostics, someone turns on/off plugins or tinkers with the prefs first. And if that’s the case, the results may well be different and the problem might go away, leading to them solving the issue themselves. Am I missing a use case?

EDIT: if the cause of the issue is “tag not found” on the public site, then the act of omitting the plugin also leads to the swift resolution!

I’d find it useful to separate the list of all (installed, usually active) plugins in two groups, one that’s deactivated 100% sure, and one we can’t tell safely, and give these groups an apt caption each.

That’s certainly a possibility. Before considering it, I’d like to find if I’ve missed anything with regards the above.

Last edited by Bloke (2018-03-29 13:08:41)


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

#24 2018-03-29 20:35:32

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,260

Re: Situation around plugin (de-)activation in preferences

Bloke wrote #310440:

The only situation I can think of is that, when asked to post diagnostics, someone turns on/off plugins or tinkers with the prefs first.

That’s what I meant, for the forgetful, for hasty people, non-techies and other muddlers. People like me.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

Board footer

Powered by FluxBB