Textpattern Forum

You are not logged in. Register | Login | Help

#71 2010-01-29 05:40:15

speeke
Member
From: Bruny Island, Australia
Registered: 2009-03-29
Posts: 161
Website

Re: smd_where_used: help keep your admin side tidy

I was wondering if this (very useful!) plugin could be modified to include a magic button to automatically disable any plugins that aren’t being used?

After awhile it’s difficult to remember which plugins are being used, and so currently I manually copy/paste the name of each one into smd_where_used to check.

Just a thought … :)


“People who value their privileges above their principles soon lose both.”
Dwight D. Eisenhower

Offline

#72 2010-01-29 09:39:06

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,916
Website

Re: smd_where_used: help keep your admin side tidy

speeke wrote:

I was wondering if this (very useful!) plugin could be modified to include a magic button to automatically disable any plugins that aren’t being used?

Sadly no. “In use” is a very esoteric term that the plugin interprets like this: is there any reference to the plugin from any Page or Form (can’t remember if it checks articles as well… it may do).

This is fine for most cases, but it has a few shortfalls:

  • admin side plugins are missed entirely (hence the fact you can choose to exclude them by clicking the button again to toggle ‘C’ and ‘A+C’)
  • library plugins such as smd_lib may be required but are never “used” (as such)
  • plugins such as rvm_maintenance may be switched on so you don’t expose your site to the outside world. It too is never ‘used’ — just toggled on and off — so an auto switch in smd_where_used would switch it off, which is undesirable

There are probably other reasons, but that kind of thing is why I chose to make the plugin report only on what it finds and not take any direct action like delete stuff or change anything — I’m bound to get it wrong and kill something important! My philosophy is: leave humans in the loop :-) So, sorry: no can do.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#73 2010-02-04 17:05:47

geroldbraun
Member
Registered: 2010-01-19
Posts: 19
Website

Re: smd_where_used: help keep your admin side tidy

a very valuable plugin, thank you. My usage today: I set up a subdomain (pagetest.mydomain.com) for testing before i will go life with my new txp-site. And soon i will have to look for links (in articles, in static-sites, in sidebars, etc.) that i will have to change from http://pagetest.mydomain.com to http://mydomain.com. None can’t be forgotten – just typed in “pagetest” .. now i can sleep quietly smooth :-))

Last edited by geroldbraun (2010-02-04 17:11:39)


Smile, Breath, Go slowly – Thich Nhat Hanh

Offline

#74 2010-02-04 17:58:15

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,388
Website

Re: smd_where_used: help keep your admin side tidy

geroldbraun wrote:

And soon i will have to look for links (in articles, in static-sites, in sidebars, etc.) that i will have to change from http://pagetest.mydomain.com to http://mydomain.com.

Here’s a very good reason for not hardcoding your internal URLs :) Use txp:site_url /> and the only thing that needs to be changed is ‘Site URL’ in preferences.


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

#75 2010-02-05 11:26:15

geroldbraun
Member
Registered: 2010-01-19
Posts: 19
Website

Re: smd_where_used: help keep your admin side tidy

Ohh what a beautiful tip, Els, thank you


Smile, Breath, Go slowly – Thich Nhat Hanh

Offline

#76 2010-02-05 12:30:12

geroldbraun
Member
Registered: 2010-01-19
Posts: 19
Website

Re: smd_where_used: help keep your admin side tidy

arrgh – i think there is a little bug with <txp:site_url />. If i use it in forms everything is fine, but .. used in “article” to display a picture, the design of the site goes broken.
Example: a hardcoded <img src=“http://www.subpage.mydomain.de/images/6.jpg”> will do what expected; a tag-coded <img src=”<txp:site_url />images/6.jpg”> will not show the picture but “kill” the design.


Smile, Breath, Go slowly – Thich Nhat Hanh

Offline

#77 2010-02-05 12:47:15

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,916
Website

Re: smd_where_used: help keep your admin side tidy

geroldbraun wrote:

If i use it in forms everything is fine, but .. used in “article” to display a picture, the design of the site goes broken.

It’s not a bug — it’s more than likely Textile getting in the way. If you want Textile in your articles, try:

==<img src="<txp:site_url />images/6.jpg">==

to switch textile off around that tag (or put the image on its own line with two spaces before it, which does the same thing) — I’m not sure if either technique works, I’ve never tried it when embedded inside an anchor.

Better still, if the image is managed by TXP’s Images tab, use:

<txp:image id="6" />

Last edited by Bloke (2010-02-05 12:48:14)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#78 2010-02-05 12:58:55

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 2,989
Website

Re: smd_where_used: help keep your admin side tidy

@geroldbraun:

Also, for all internal links or references to files, images, etc, you don’t need to specify the domain. You can use an absolute path without including the full domain.

Like: <img src="/images/6.jpg" />
Or: <a href="/contact/">Contact me</a>

Those should remain working when you move your site.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#79 2010-02-05 21:38:59

geroldbraun
Member
Registered: 2010-01-19
Posts: 19
Website

Re: smd_where_used: help keep your admin side tidy

both of you maniqui and Bloke gave good advice, thank you. The textile turn-off == works fine and also omitting the url at all.


Smile, Breath, Go slowly – Thich Nhat Hanh

Offline

#80 2010-05-19 21:30:26

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,916
Website

Re: smd_where_used: help keep your admin side tidy

Just a heads-up for those of you running SVN >= 3300. The pre-release version of smd_where_used (v0.3) can be grabbed from the beta download page. It adds the ability to search for text strings inside Stylesheets.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB