Title: Trigger Action &amp; Network Usage
Last modified: August 20, 2016

---

# Trigger Action & Network Usage

 *  Resolved [G](https://wordpress.org/support/users/gnetworkau/)
 * (@gnetworkau)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/trigger-action-network-usage/)
 * hi dartiss, good on you mate, for making this plugin – excessive transients in
   database have always bothered me.
 * i have 2 questions before trying it.
 * 1. is there a way to trigger the action of the plugin immediately, to see its
   effect?
    then if a problem occurs, i may restore the db.
 * 2. on a wp network, i assume it will work if installed on each blog seperately?
 * thankyou, G.
 * [http://wordpress.org/extend/plugins/artiss-transient-cleaner/](http://wordpress.org/extend/plugins/artiss-transient-cleaner/)

Viewing 15 replies - 1 through 15 (of 15 total)

 *  Plugin Author [David Artiss](https://wordpress.org/support/users/dartiss/)
 * (@dartiss)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/trigger-action-network-usage/#post-3230553)
 * Hi,
 * 1.Yes. The plugin hooks into the daily housekeeping which can be activated using`
   do_action( 'wp_scheduled_delete' )`.
 * 2. Yes.
 * David.
 *  Thread Starter [G](https://wordpress.org/support/users/gnetworkau/)
 * (@gnetworkau)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/trigger-action-network-usage/#post-3230554)
 * Hi dartiss, I installed and tried to activate function by inserting php code 
   you gave into a file and running it – no joy, all transients still appear in 
   db.
 *  Plugin Author [David Artiss](https://wordpress.org/support/users/dartiss/)
 * (@dartiss)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/trigger-action-network-usage/#post-3230555)
 * I’m assuming you added it to WordPress theme file?
 * I’ve not tried that code myself, but was suggested by a WP developer. If it doesn’t
   work I’ll try and work out a way to force just my plugin to run.
 * David.
 *  Thread Starter [G](https://wordpress.org/support/users/gnetworkau/)
 * (@gnetworkau)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/trigger-action-network-usage/#post-3230556)
 * I put the code (with php tag) in a file called trans.php
    then ran it from a 
   browser, tried from: /wp-content/plugins/trans.php and /trans.php
 * nothing changed.
 * You said: “I’ll try and work out a way to force just my plugin to run.”
 * I think that would be a good idea, to make it run immediately upon activation.
   
   This would allow admin to see the effects of the plugin’s action, and if there
   is a problem, can reverse any damage right away.
 *  Plugin Author [David Artiss](https://wordpress.org/support/users/dartiss/)
 * (@dartiss)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/trigger-action-network-usage/#post-3230557)
 * No, it needs to be in one of your theme files, otherwise it won’t recognise the
   WordPress components.
 * Good idea about the immediate run upon activation – I’ll add that in for the 
   next release (should be in the next week or so).
 * David.
 *  Plugin Author [David Artiss](https://wordpress.org/support/users/dartiss/)
 * (@dartiss)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/trigger-action-network-usage/#post-3230559)
 * The new version has been released (1.1) and will automatically trigger a “clean”
   when activated.
 * David.
 *  Thread Starter [G](https://wordpress.org/support/users/gnetworkau/)
 * (@gnetworkau)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/trigger-action-network-usage/#post-3230561)
 * It didn’t do anything on mine (all transients remain), activated or network-activated.
 *  Plugin Author [David Artiss](https://wordpress.org/support/users/dartiss/)
 * (@dartiss)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/trigger-action-network-usage/#post-3230563)
 * Sorry about that. Having looked at multi-site installations further I can see
   there may be issues, but I’m going to need to look at it at a lot further (e.
   g. I don’t know if the triggered overnight housekeeping job is run per blog or
   per installation).
 * I’m going to set up a multi-site test blog for myself and have a play further.
 * David.
 *  Thread Starter [G](https://wordpress.org/support/users/gnetworkau/)
 * (@gnetworkau)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/trigger-action-network-usage/#post-3230564)
 * Thanks for your efforts. Looking forward to it.
 *  Plugin Author [David Artiss](https://wordpress.org/support/users/dartiss/)
 * (@dartiss)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/trigger-action-network-usage/#post-3230565)
 * Hi G,
 * Okay, I’ve built myself an MU version of WordPress and have both tested my plugin
   and looked at some of the WP core code to see how it handles MU in these circumstances.
 * My conclusion is that I believe it DOES work happily with MU set-ups.
 * There are 2 things to consider here…
    1. It doesn’t clear down all transients unless a database update has occurred –
       the daily run (and the run it does upon activation) only clears down expired
       transients, and only those left behind (many expired transients are cleared).
       Therefore it’s possible you didn’t see any activity because there was nothing
       to delete.
    2. In an MU set-up each blog has its own options table – each one is cleared when
       it activated the daily housekeeping (or when the plugin is activated). This 
       is not done at a site level, but per-blog. When my plugin runs, WordPress simply
       tells if which options table to clear (depending on which blog its running under).
 * I hope this makes sense to you. As I say, I can’t see an issue but am open to
   being convinced otherwise!
 * David.
 *  Thread Starter [G](https://wordpress.org/support/users/gnetworkau/)
 * (@gnetworkau)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/trigger-action-network-usage/#post-3230566)
 * Thankyou David.
 * The problem is in my mind at the moment, as I always exercise due caution when
   installing plugins – this one is difficult as I can’t see it working. When installing
   plugins, I follow this approach to keep safe:
 * 1. Download plugin and look at code, to make sure it looks ok and no hidden gremlins.
   
   2. Backup database (files too, if plugin modifies files) 3. Install plugin 4.
   Do Settings for plugin (if avail) 5. Check its working, and test all functions
   and output are good. 6. Check error_log to make sure its not throwing errors 
   behind the scenes (some plugins look to work fine, but throw errors and may cause
   unknown problems) 7. If all is well, I keep the plugin and enjoy, if no, I delete
   it and restore the database
 * So you see from the above, why its difficult for me to install and forget – because
   I may wake up later to find my sites have disappeared or something. I am not 
   happy leaving a plugin active whose actions are not seen and untested.
 * You say: “It doesn’t clear down all transients unless a database update has occurred…”
 * Can you tell me how to get this “database update” to occur, so I can SEE the 
   immediate results?
 *  Plugin Author [David Artiss](https://wordpress.org/support/users/dartiss/)
 * (@dartiss)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/trigger-action-network-usage/#post-3230567)
 * Transients are used for good reasons, hence why deleting them all ad-hoc is not
   a good idea.
 * A database upgrade sometimes occurs after a WordPress update – if the format 
   of the WordPress database has changed. It therefore makes sense to clear down
   the transients in case they cause any issues as a result. However, just to check
   out the plugins functionality, I wouldn’t recommend it.
 * I run the plugin on my live site – artiss.co.uk – and am happy to do so. Sometimes
   you’re just not going to be able to test all the functionality of the plugin 
   up-front and this is one such case. If as a result you can’t trust it, then please
   uninstall it.
 * David.
 *  [Clifford Paulick](https://wordpress.org/support/users/cliffpaulick/)
 * (@cliffpaulick)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/trigger-action-network-usage/#post-3230588)
 * Came looking for multisite compatibility. Skimming through here it seems running
   this per blog (i.e. activating per blog) makes it work per blog. Does this include
   network activation? If I network activate it, does it still run for all sub-sites
   at that single activation action?
 * Do I also have to add do_action( ‘wp_scheduled_delete’ ); to all themes’ functions.
   php to be used on the network?
 * Thank you.
 *  Plugin Author [David Artiss](https://wordpress.org/support/users/dartiss/)
 * (@dartiss)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/trigger-action-network-usage/#post-3230590)
 * No, you don’t need to add anything – the housekeeping job that this plugin uses
   runs individually for each blog.
 * David.
 *  [Clifford Paulick](https://wordpress.org/support/users/cliffpaulick/)
 * (@cliffpaulick)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/trigger-action-network-usage/#post-3230592)
 * 🙂

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Trigger Action & Network Usage’ is closed to new replies.

 * ![](https://ps.w.org/artiss-transient-cleaner/assets/icon.svg?rev=3100149)
 * [Transient Cleaner](https://wordpress.org/plugins/artiss-transient-cleaner/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/artiss-transient-cleaner/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/artiss-transient-cleaner/)
 * [Active Topics](https://wordpress.org/support/plugin/artiss-transient-cleaner/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/artiss-transient-cleaner/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/artiss-transient-cleaner/reviews/)

 * 15 replies
 * 3 participants
 * Last reply from: [Clifford Paulick](https://wordpress.org/support/users/cliffpaulick/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/trigger-action-network-usage/#post-3230592)
 * Status: resolved