i notice that traces of some plugins i have installed and then uninstalled remain in the database and appear in some places in the site; such as the account statistics panel in user settings..
e.g. izap_videos - count - remains in the statistics panel even though i have uninstalled it.
does the garbage collector clear these details out? is it perhaps not running on my site?
or is there another way to do this?
(elgg 1.8.8)
thanks
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
If anyone is seriously considering using the above code, it needs a false as the last parameter of ElggBatch or you'll only delete half of them:
@Matt Beckett thanks a lot, @Mohammed Aqeel thank you for giving good guideline.
How I can use the below codes to remove the entries of my plugins which I have used in the past from my elgg database.
<?php
set_time_limit(0);
function delete_by_subtype($object, $getter, $options) {
$object->delete();
}
$options = array('type' => 'object', 'subtype' => $subtype, 'limit' => 0);
$batch = new ElggBatch('elgg_get_entities', $options, 'delete_by_subtype', 50);
you need to put 'false' at the end of the last line, as was stated.
place the code in a php file that your site will run, such as the start file to your theme.. then upload and when a page is loaded, the theme code will be processed and the code will be triggered.
i just ran this on my test site and it worked correctly.. removing 100 or so izap_videos took about 45 seconds on the server i am using.
@Matt Beckett,
Thank you matt, I just deleted so many unwanted things from database...
Just want to create a cron to delete old Blog posts (say more than 2 years)
when i run this cron all blog posts got deleted.. is there any way to do this
$date = date('Y-m-j');
$newdate = strtotime ( '-2 year' , strtotime ( $date ) );
$newdate = date ( 'Y-m-j' , $newdate );
@dhrupdescoop
so entering $newdate in time created_upper => will work?
thats 4 U to code & test ;-)
theres 2 dates in the call -- upper and lower ;-oO
t-r-y ;-P
no response ? hmmm...;X next time. . .
i dont know how to make it... and afraid of deleting if all data goes out ??
- Previous
- 1
- 2
- 3
- Next
You must log in to post replies.