Support » Plugins » CyStats Option Deletion Problem

  • Resolved TripleDeek


    I recently deleted all of the database data using CyStats, and now my Guestbook Plugin (DMSGuestbook) is not working because of missing options, and my Recent Posts widget is also acting funny (giving me “Page Not Found” error messages). Everything was working fine before I deleted the data, and I was wondering if the data deletion is what caused this and how I could fix this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • $r=$wpdb->query('DELETE FROM '.$wpdb->prefix.'options WHERE option_name LIKE \'cystats_%\'');
    Deletes every database table with name starting with ‘cystats_’ in the WP options table.

    $r=$wpdb->query('DROP TABLE '.$wpdb->prefix.TABLE_STATISTICS_RAW);
    $r=$wpdb->query('DROP TABLE '.$wpdb->prefix.TABLE_STATISTICS);
    Delete the two statistics tables named ‘YourDBPrefixTABLE_STATISTICS/TABLE_STATISTICS_RAW’

    Those are the important lines in the source code for the ‘delete all including otions’ in CyStats admin panel.

    I do not doubt that your mentioned plugins do not work anymore but I cannot see the deletion functions as a cause for this (the other plugins database tables should not be named like the cystats ones).

    Missing-options-problem: Maybe a simple reinstall restores the options?

    Just tried removing all CyStats data from database (options+tables) using the cystats admin panel after installing and activating DMSGuestbook, checked database table and ‘DMSGuestbook_options’ is still there, no problem here.

    Nevertheless you made me find another bug in the delete-tables-functions (but it does no harm, though):

    CyStats uses:

    $r=$wpdb->query('DROP TABLE '.$wpdb->prefix.TABLE_STATISTICS_RAW);
    $r=$wpdb->query('DROP TABLE '.$wpdb->prefix.TABLE_STATISTICS);



    This does no harm because the undefinded constants TABLE_STATISTICS and TABLE_STATISTICS_RAW will automatically convert to their text aquivalents which results in the correct table naming which might be the reason this bug was not discovered for this long time.
    Nevertheless this has to be fixed in next update.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘CyStats Option Deletion Problem’ is closed to new replies.