Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2011-07-29 23:28:26
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
sed_cleaner
Perhaps useful to some who posted opinions here.
- Basic Use video (Ogg Vorbis format)
- Advanced Use video (Ogg Vorbis format)
NB: >>>>> THIS IS FOR USE ON NEW SITES <<<<<
A little plugin that’s meant to be used right after first installation on a new textpattern site. It…
- Removes default content (comments, links, files, articles, images & categories of all kinds)
- Resets a few prefs (custom fields, spam lookups)
- Allows auto-installation of your favourite plugins
- Allows auto-installation/update of pages, forms and styles.
- Allows scripted config of your favourite preferences
- Allows scripted removal of sections, pages & forms
- Allows scripted blanking of pages, forms and styles (with special handling for the default page)
- Allows scripted addition of sections
- Attempts to remove the setup directory†
- Can try to remove other directories such as the RPC server files†
- then removes itself.
† These operations may fail if the filesystem permissions don’t allow the script to make the changes.
Please don’t use on any install with content you wish to keep.
Change Log & download links.
| Version | Date | Notes | Source | Download Link |
|---|---|---|---|---|
| v0.8 | 1st Sep, 2011 | Improved warning messages and fixed bad URL (Thanks Adi) | Source | Compressed |
| v0.7 | 11th Aug, 2011 | Added warning on install. Added confirmation on use in sites with 2 or more articles. No longer deletes the entire content of the files directory — so should leave any backups in place if you happen to have some there. | Source | Compressed |
| v0.6 | 5th Aug, 2011 | Switched plugins over to .plugin extension. Added page, form, style imports from the files directory. Extended the AddSection scripting command. |
Source | Use later version |
| v0.5 | 1st Aug. 2011 | Added new cleanup actions: RemoveSection, AddSection, RemovePage, BlankPage, BlankCSS, RemoveForm & BlankForm. Updated cleanups.php to show how to do jpdupont’s requested cleanups. | Source | Use later version |
| v0.4.2 | 1st Aug. 2011 | Bugfix: Don’t remove the category roots. (Thanks jpdupont) | Source | Use later version |
| v0.4.1 | 31st Jul, 2011 | Bugfix: Use table prefixes where needed. (Thanks jpdupont) | Source | Use later version |
| v0.4 | 31st Jul, 2011 | Move cleanups.php to the /files directory. Add plugin auto-loading from /files too. Auto-loads occur before your cleanups are done and cleanups can now enable plugins. |
Source | Use later version |
| v0.3 | 30th Jul, 2011 | Adds a small scripting module to allow you to record and perform your favourite cleanups/pref settings. Now you can quickly setup the prefs the way you want on all your new sites via the cleanups.php file. | Source | Use later version |
| v0.2 | 30th Jul, 2011 | Adds removal of setup directory (where possible). | Source | Use later version |
| v0.1 | 29th Jul, 2011 | Initial release. Removes default content & resets some prefs. | Source | Use later version |
Last edited by net-carver (2011-09-01 17:07:16)
— Steve
Offline
#2 2011-07-30 00:14:38
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,320
Re: sed_cleaner
The blank slate!
Thaaanks, Steve! :)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#3 2011-07-30 07:30:35
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: sed_cleaner
Uli
Thanks. Still needs some work on sections, pages, styles & forms.
— Steve
Offline
Re: sed_cleaner
Perfect – saves me writing it! Thanks, Steve!
Offline
Offline
Re: sed_cleaner
Sweet :)
Does it also mean that the ID# of the first article I will publish will be #1 instead of #2?
(that will give it a really cool “format” feel)
Offline
Re: sed_cleaner
Thanks for the heads up, Steve. Very nice!
Offline
#8 2011-07-30 14:09:49
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: sed_cleaner
THE BLUE DRAGON wrote:
Sweet :)
Does it also mean that the ID# of the first article I will publish will be #1 instead of #2? (that will give it a really cool “format” feel)
It should reset all auto-incrementing IDs on the articles and other content it removes as it uses a MySQL TRUNCATE TABLE query to do its thing. Specifically from the documentation for that call…
“The table handler does not remember the last used AUTO_INCREMENT value, but starts counting from the beginning. This is true even for MyISAM and InnoDB, which normally do not reuse sequence values.”
— Steve
Offline
Re: sed_cleaner
It should reset all auto-incrementing IDs on the articles and other content it removes
Oh that would be terrific. Thank you for this plugin.
Offline
#10 2011-07-30 15:34:02
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: sed_cleaner
— Steve
Offline
#11 2011-07-30 20:59:42
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: sed_cleaner
Version 0.3 released
Adds…
- …a small scripting module to allow you to record and perform your favourite cleanups/pref settings
Simply work out your must-have settings and record them into the example cleanups.php file. Include this in the textpattern directory of your standard installation and when you activate sed_cleaner it will perform the cleanups you have specified/scripted in cleanups.php after it has done its standard cleanups.
— Steve
Offline
#12 2011-07-31 06:46:15
- jpdupont
- Member
- Registered: 2004-10-01
- Posts: 752
Re: sed_cleaner
Thank Steve! Very nice!
Is it possible to put in the same directory as cleanups.php all the plugins text files and insert them in the same initialisation process ?
Offline
#13 2011-07-31 10:17:51
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: sed_cleaner
Hi jpdupont
I already have a published plugin that auto-loads other plugins but it’s pretty old (even by my standards) and needs some work.
all
I’m a little wary of turning this into a full blown theme installer and I don’t really want to get into the realm of changing existing presentation items, though I would be ok with adding scripted removal of non-default forms/pages/sections/styles.
Perhaps, as jpdupont has suggested, there is a little more headroom at the front-end of the boot-strap process for getting an initial set of plugins installed — a set which could include your theme installer of choice. If so, would others use a plugin auto-load feature if I merged it from my old plugin? Done anyway as I might find it useful myself.
Last edited by net-carver (2011-07-31 15:06:01)
— Steve
Offline
#14 2011-07-31 15:04:59
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: sed_cleaner
Ok, v0.4 is out.
Changes…
- Attempts to load plugins from the
/filessub-directory, before any scripted cleanups are run. - Location of cleanups.php has been moved to the
/filessub-directory to allow you clean your site without needing ftp or ssh access to the filesystem. - Your cleanups can now enable auto-loaded plugins using the ‘enableplugin’ directive.
— Steve
Offline
#15 2011-07-31 19:58:08
- jpdupont
- Member
- Registered: 2004-10-01
- Posts: 752
Re: sed_cleaner
Steve,
I try the plugin (last 0.4.20) on a fresh TXP install, in a subdirectory.
I get this error messages, with debug on, below.
It seems the plugin don’t care of the table prefix here “demo_”, and dont’ care of the subdir “demo”, to remove files ….
TRUNCATE TABLE `txp_discuss`
Erreur lors du chargement du plugin sed_cleaner -> User_Warning: Table 'alysseinfo3.txp_discuss' doesn't exist
TRUNCATE TABLE `txp_discuss` on line 89
TRUNCATE TABLE `txp_link`
Erreur lors du chargement du plugin sed_cleaner -> User_Warning: Table 'alysseinfo3.txp_link' doesn't exist
TRUNCATE TABLE `txp_link` on line 89
TRUNCATE TABLE `txp_category`
Erreur lors du chargement du plugin sed_cleaner -> User_Warning: Table 'alysseinfo3.txp_category' doesn't exist
TRUNCATE TABLE `txp_category` on line 89
TRUNCATE TABLE `textpattern`
Erreur lors du chargement du plugin sed_cleaner -> User_Warning: Table 'alysseinfo3.textpattern' doesn't exist
TRUNCATE TABLE `textpattern` on line 89
TRUNCATE TABLE `txp_image`
Erreur lors du chargement du plugin sed_cleaner -> User_Warning: Table 'alysseinfo3.txp_image' doesn't exist
TRUNCATE TABLE `txp_image` on line 89
update demo_txp_prefs set `val`='' where `name`='site_slogan'
update demo_txp_prefs set `val`='' where `name`='custom_1_set'
update demo_txp_prefs set `val`='' where `name`='custom_2_set'
update demo_txp_prefs set `val`='' where `name`='spam_blacklists'
update demo_txp_prefs set `val`='0' where `name`='use_dns'
update demo_txp_prefs set `val`='1' where `name`='never_display_email'
Removing setup/en-gb.php
Erreur lors du chargement du plugin sed_cleaner -> Warning: unlink(setup/en-gb.php) [function.unlink]: Permission non accordée on line 230
Removing setup/index.php
Erreur lors du chargement du plugin sed_cleaner -> Warning: unlink(setup/index.php) [function.unlink]: Permission non accordée on line 230
Removing setup/setup-langs.php
Erreur lors du chargement du plugin sed_cleaner -> Warning: unlink(setup/setup-langs.php) [function.unlink]: Permission non accordée on line 230
Removing setup/txpsql.php
Erreur lors du chargement du plugin sed_cleaner -> Warning: unlink(setup/txpsql.php) [function.unlink]: Permission non accordée on line 230
Removing setup
Erreur lors du chargement du plugin sed_cleaner -> Warning: rmdir(setup) [function.rmdir]: Permission non accordée on line 212
Erreur lors du chargement du plugin sed_cleaner -> Notice: Undefined variable: event on line 19
Auto Install Plugins... Accessing dir(/home/www/fc1f7630122da37fd45afdf6fbcfbfdb/web/demo/files) ... no plugins found: exiting.
No installation specific cleanup file found.
TRUNCATE TABLE `txp_file`
Erreur lors du chargement du plugin sed_cleaner -> User_Warning: Table 'alysseinfo3.txp_file' doesn't exist
TRUNCATE TABLE `txp_file` on line 89
Offline