• Hello Guys,

    I had this issue.

    I left that plugin to run on my WordPress sites. After a while my database became very very huge (2GB) due to the information that was saved in wp_watu_takings database.

    My question is: can I limit the database to not write in it, or maybe I can limit from watu/views/takings.php with some detail info from your side to only use 10 rows?

    Anyway, I’m not interested to store those infos regarding user’s history (points obtained, IP, date, etc.)

    Could you help me?

    https://wordpress.org/plugins/watu/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Bob

    (@prasunsen)

    Hello,

    There are two ways to approach this:

    1. You can delete all existing data from the quiz “Takings” page, where is a link: “Delete all user-submitted data for this exam”

    2. We don’t yet have a setting to not store the history, however you can achieve it with a small code change. In controllers/show_exam.php there are two queries you can skip altogether:

    // insert taking
    	$uid = $user_ID ? $user_ID : 0;
    	$wpdb->query($wpdb->prepare("INSERT INTO ".WATU_TAKINGS." SET exam_id=%d, user_id=%d, ip=%s, date=CURDATE(),
    		points=%d, grade_id=%d, result=%s, snapshot=''", $exam_id, $uid, $_SERVER['REMOTE_ADDR'], $achieved, $g_id, $grade));
    	$taking_id = $wpdb->insert_id;

    and few lines later:

    // update snapshot
    	$wpdb->query($wpdb->prepare("UPDATE ".WATU_TAKINGS." SET snapshot=%s WHERE ID=%d", $snapshot, $taking_id));

    Alternatively you can remove only the second query because the snapshot takes the most space.

    We will add some configurations for this soon, thanks for drawing my attention to it.

    Thread Starter dumitrudany

    (@dumitrudany)

    Hi,

    Your second option was the one that I’m looking for. Indeed for the future. One beer for it 🙂

    The first option was not so good. It’s hardly to manange all my quizes. But my way was the true one: I connected to my database that was created to my site using myPHPAdmin and I erased all the infos from wp_watu_takings

    Before
    After

    Many thanks for the second option! It really helped me to avoid in the future this issue.

    Plugin Author Bob

    (@prasunsen)

    Excellent, happy to have helped.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘limiting the exapansion of "wp_watu_takings" database’ is closed to new replies.