Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2008-06-16 19:18:40

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,433
Website GitHub

Re: smd_where_used: help keep your admin side tidy

v0.13 | gzipped

Adds the ability to match whole words (or not if you feel so inclined).

Is there an award for “most versions of a plugin in one afternoon” :-D


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

#14 2008-06-16 19:30:01

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

Re: smd_where_used: help keep your admin side tidy

Zanza wrote:

If I search for ‘home’, it also catch all the derivatives. Can an option be added to search only for the string as a single word, or as a part of longer word?

I join zanza in this one, this will be vey useful. (DANG! Again you release a new version while I’m typing yet :)

Regarding dashboard: Sorry, I didn’t want to demand a great deal of you, thought it’d be done by adding something like register_tab('extensions', 'rendez_wu', 'jmd_dashboard'); And: yes, it really can eat space!

I’ve found something I’m not quite sure of if it’s intended or not, I’ve tried out too little so far: I filled in the name of one of my forms (p_navi_links), and it returns “Default” for both, include and exclude. Sorry, my fault. Default has several instances, on sections, pages, and forms.

Last edited by uli (2008-06-16 19:38:09)


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

Offline

#15 2008-06-16 19:52:01

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,433
Website GitHub

Re: smd_where_used: help keep your admin side tidy

uli wrote:

Regarding dashboard… thought it’d be done by adding something like register_tab('extensions', 'rendez_wu', 'jmd_dashboard');

*shrug* maybe. I don’t know how dashboards work as I’ve never installed one. Do they have their own admin area or something then? I suppose I should start by finding out what a dashboard is in this context and perhaps trying one out :-)

Glad you found the ‘section’ thing — had me confused for a bit there ;-)


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 2008-06-16 19:55:47

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: smd_where_used: help keep your admin side tidy

Very, very fine effort,… and that’s an understatement.

Thanks Stef! :-)

Offline

#17 2008-06-16 20:27:48

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,433
Website GitHub

Re: smd_where_used: help keep your admin side tidy

masa wrote:

Very, very fine effort,… and that’s an understatement. Thanks Stef! :-)

You’re very welcome. I was just updating a sprawling mess of a site this morning, flitting back and forth between pages and forms and plugins and getting in a right mess, then thought “y’know, a little search plugin might just help”. A couple of hours later I’d thrown this together (hence the higgledy piggledy layout; really gotta get some CSS in there to line stuff up better!)

If you find anything odd or can think of any enhancements, feel free to let me know.

And big thanks to all who have contributed so far today. Wouldn’t be here without ya.

Last edited by Bloke (2008-06-16 20:28:12)


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

#18 2008-06-16 20:46:14

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: smd_where_used: help keep your admin side tidy

sounds great, bookmarked for future reference. however, i guess in my soon to come workflow this will be obsolote thanks to textmates built-in “find in project” :)

Offline

#19 2008-06-16 20:56:19

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,433
Website GitHub

Re: smd_where_used: help keep your admin side tidy

sthmtc wrote:

this will be obsolote thanks to textmates built-in “find in project” :)

Hehehe, for those that use Macs and Christian’s awesome plugin for versioning, or have a logical brain with a healthy sense of style, layout, design and a good plan, this plugin is already obsolete :-D


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

#20 2008-06-16 21:32:20

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: smd_where_used: help keep your admin side tidy

Subscribed Another one in my list of ‘favorites still to be tested’ :)

No, I am very disciplined compared to Stefs scenario above. I do delete or disable plugins and forms if I don’t use them anymore. I even try out semantic names cutting my form editor down to the minimum this way :) But the list is growing nevertheless…


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#21 2008-06-17 00:54:49

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

Re: smd_where_used: help keep your admin side tidy

Bloke wrote:

If you […] can think of any enhancements, feel free to let me know.

I can’t appraise if the following exceeds what you mean, but let’s see.

I’ve been dealing with thoughts on such matter two weeks ago (leftovers mentioned here). My final plans were to automatically find only orphaned forms (but to get rid of unused plugins this way would be fine for me). Thus my suggestion is a more independent search, so that in principle we won’t have to test for each existing name manually, we don’t have to enter them and we don’t even have to remember them. We’d simply check mode “Find orphans”, select “forms” and press “Go”.
If this results in a list, there should be checkboxes to select … same procedure as we all know from the forms tab.

Is this something within reach?

BTW, I’d apply for beta testing this shredder ;)


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

Offline

#22 2008-06-17 05:04:06

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: smd_where_used: help keep your admin side tidy

Stef

I think Uli’s idea re automatic location of orphaned “whatnots” is a good one. Should be quite easy to do too. Not too sure about automatically deleting them though — some plugins have uninstall routines that would need running to really clean things up.

Maybe you could present a list of orphans and have some checkboxes and an action select or something. Kind of like the Txp articles tab.


Steve

Offline

#23 2008-06-17 07:39:50

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,433
Website GitHub

Re: smd_where_used: help keep your admin side tidy

Not a bad idea Uli/Steve. I can probably rustle up some way of showing what’s not used and leave the decision as to what to do with them to you.

Leave it with me.


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 2008-06-17 10:38:29

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,433
Website GitHub

Re: smd_where_used: help keep your admin side tidy

OK, so my SQL brain is not quite as good as I hoped it would be.

Dealing with uli’s request I need to make up a series of queries that pull out records that have no reference to a particular name in any other (reasonable) table. I have narrowed it down to these queries:

  1. Every page that is not assigned from a section
  2. Every stylesheet that is not assigned from a section
  3. Every section that has no articles in it (excluding ‘default’ which cannot have an article anyway)
  4. Every plugin that is not referenced from an article (body/excerpt) or another form or page
  5. Every form that has no reference to it in any article (body/excerpt/override) or another form or page

The first three are easy using LEFT/RIGHT JOINs and some IS NULL magic. Well, “easy” but it makes no provision for things like rvm_maintenance which uses an “error_503” page and a “maintenance” stylesheet that are only referenced from a form/within the plugin itself, so they are incorrectly flagged as orphans. Guess we’ll have to live with things like that. Also, should error_default be ignored or does anyone actually ever assign it to a section?

I am, however, struggling with query|ies, joins or subselects for the last two. If anyone has any glimmers of SQL knowledge in this regard, please would you put me out of my misery and shove me in the right direction. I don’t particularly want to grab every form, page and article then iterate over them all one by one to see if any of them reference each other :-\ My intuition says there’ll be some SQL skulduggery that will ease the process, I just can’t figure what it is.

Many thanks in advance.

Last edited by Bloke (2008-06-17 10:39:57)


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

Board footer

Powered by FluxBB