A plugin for Textpattern.
You can download the latest compiled plugins from https://gist.github.com/1140873
Designed to do a little cleanup in new textpattern installations. Note the new in that statement.
It can also automatically install plugins that you might have included in your installation’s
When enabled, this plugin will terminate the following with extreme prejudice…
- Categories (of all types)
- Any files it loads as part of its advanced features
- Any additional table’s content you’ve scripted in your optional
Do not use this plugin in existing installations with any content you wish to keep.
In addition, this plugin will adjust a few preferences…
- The default custom fields are removed
- The site slogan is blanked
- DNS and spam lookups are turned off
- Email addresses are hidden in comments
- Any preference you’ve scripted in your optional
Where filesystem permissions allow, the plugin will…
- Remove the setup directory
- Remove the contents that it loads from the
filesdirectory (in case you used a cleanups file or autoloaded plugins — see later.) It does not remove the other files (if any) from that directory unless your
cleanups.phpfile instructs it to.
- Any directory you’ve scripted in your optional
After searching out all the above sed_cleaner will self-terminate.
Usage & Installation.
a) Basic content reset…
- Either compile the plugin or download the latest compiled version.
- In your new installation, go to
admin > pluginsand upload the plugin.
- Read the message that appears upon installation then click “Ok”.
- If you now Enable the plugin it will be live and ready to go. This can delete ALL your content.
- Navigate to any other admin side tab to activate the plugin.
Your site should now have all its content removed and the sed_cleaner plugin will no longer be installed.
PLUS automatic plugin installation…b) Content reset
- Upload the compiled plugin files you wish to have autoinstalled into the site’s
filesdirectory. Each plugin file must end with the extension
.pluginas all other extensions will be skipped. Uploading can be done via ftp or via textpattern’s
content > filestab. If you take the time to collate all your standard plugins into your deployment before you transfer it to your new site’s server then you are really cooking.
- Now proceed with the steps in a) above.
Your site should now have all its content removed and have all the plugins installed that you uploaded to the
PLUS customised prefs…c) Content reset, plugin installation
- Create a customised
- Upload it to the site’s
filesdirectory (either via ftp or textpattern’s
content > filestab.)
- Now proceed with the steps in b) above.
Your site should now have its content removed, plugins installed and preferences set.
PLUS presentation import…d) Content reset, plugin installation, custom prefs
- Prepare your pages, styles and forms for import. These must follow a specific naming convention for sed_cleaner to recognise them.
- Your stylesheets must follow the pattern: stylename.css where stylename is the name you wish the sheet to appear as inside Textpattern.
- Your pages must follow the pattern: pagename.page where pagename is the name of the page in Textpattern.
- Forms must follow the pattern: formname.type.form where formname is the name the form is to have and type is either article, link, comment, file or misc.
- Upload them to the site’s
filesdirectory (via the Textpattern interface, ftp, scp, sshfs or other mechanism.)
- Now proceed with the steps in c) above.
The cleanups.php file.
This optional file allows you to define additional custom actions to be taken by sed_cleaner.
You can customise the cleanup actions to be taken by editing the file. Once you’re happy with your cleanups file you should upload it to your site’s
files directory. If sed_cleaner finds this “scripting” file it will attempt to perform the additional cleanup actions defined in it.
||Sets the named preference to the given value.||The name of the preference, followed by the value in double quotes.||
||Resets the named table.||The name of the table to reset.||
||Removes the named directory (non recursive) relative to the textpattern directory||The directory to be removed.||
||Enables the named plugin (if installed)||The plugin to be enabled.||
||Disables the named plugin (if installed)||The plugin to be disabled.||
||Remove a section from the site.||The name (not the title) of the section to be deleted.||
||Adds a section to the site.||The title of the section to be deleted. The name will be infered from this. Optionally, the page to use, the style to use, appear in rss (0 or 1), on frontpage (0 or 1) and searchable (0 or 1)||
||Remove a page from the site.||The name of the page to be removed.||
||Remove the content of a page. If the page given is ‘default’ a little placeholder HTML will be inserted.||The name of the page to be blanked.||
||Remove the content of a stylesheet.||The name of the stylesheet to blank.||
||Remove a form from the site.||The name of the form to be removed.||
||Remove the content of a form.||The name of the form to be blanked.||
||Remove a file.||The name of the file to be removed. Must be one of ‘license.txt’, ‘lgpl-2.1.txt’, ‘../HISTORY.txt’ or ‘../README.txt’||
Please study the packaged cleanups.php file for more examples.