WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] CyStats Option Deletion Problem (3 posts)

  1. TripleDeek
    Member
    Posted 5 years ago #

    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.

  2. cywhale
    Member
    Posted 5 years ago #

    $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?

  3. cywhale
    Member
    Posted 5 years ago #

    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);

    But the right constants are named CYSTATS_TABLE_STATISTICS / CYSTATS_TABLE_STATISTICS_RAW:

    define('CYSTATS_TABLE_STATISTICS','TABLE_STATISTICS');
    define('CYSTATS_TABLE_STATISTICS_RAW','TABLE_STATISTICS_RAW');

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags