WordPress.org

Ready to get started?Download WordPress

Forums

Hotspots Analytics - Heatmaps, User Activity & Custom Event Tracking
[resolved] Plugin tables in the db do not use WP prefixes (14 posts)

  1. Hassan
    Member
    Posted 1 year ago #

    This plugin has been getting better with each update. Great to see a committing dev.

    I have noticed that this plugin creates two new tables in the database of my website (hsp_filter) and (hsp_hotspot), however, they are not prefixed with the default database prefix which I've set in my wp-config.php file, and therefore, they look odd alongside ALL other tables which are properly prefixed.

    http://wordpress.org/extend/plugins/hotspots/

  2. dpowney
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Hassan,

    You are right. I have changed the prefix to the WordPress database table prefix in 2.1.2 available now.

    You can delete the tables hsp_filter and hsp_hotspot as they are no longer used or ignore them.
    DROP TABLE 'hsp_filter';
    DROP TABLE 'hsp_hotspot';

    If you want to keep your old data in these tables you will have to manually migrate them.
    i.e. try something like this:
    INSERT INTO '<prefix>filter' SELECT * FROM 'hsp_filter';
    INSERT INTO '<prefix>hotspots' SELECT * FROM 'hsp_hotspots';

    Thanks,
    Daniel.

  3. Hassan
    Member
    Posted 1 year ago #

    Thanks for the quick reaction, Daniel.

    One thing: I don't see any new prefixed tables in my db :|
    The two old tables are still there with the data, but there is no new tables.

    Plugins should generally have tables prefixed in the pattern: WP default db prefix -> Plugin-specific prefix -> table name

    So, if my WP db prefix is wp_ then this plugin's tables should be something like: wp_hsp_filter and wp_hsp_hotspot

  4. Hassan
    Member
    Posted 1 year ago #

    Also, can't you move the old data to the new db tables automatically? I guess some users would be annoyed if/when they update and they don't find their old heatmaps anymore.

  5. dpowney
    Member
    Plugin Author

    Posted 1 year ago #

    Done. 2.1.3 will do data migration and cleanup tables on activation.

    Thanks,
    Daniel

  6. Hassan
    Member
    Posted 1 year ago #

    Daniel,

    Just updated to v2.1.3 but I see no change at all. Old tables are still there with the data, no new prefixed tables, and admin page still shows no data; all my old heatmaps are not there.

    Perhaps you should do more testing man.. no rush :D

  7. dpowney
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Hassan,

    Can you clear the database first and then deactivate and activate.

    Thanks again

  8. dpowney
    Member
    Plugin Author

    Posted 1 year ago #

    If your prefix is wp_, then I've setup the tables to be named wp_hotspot and wp_filter. I'll look into why you do not see the tables and try to fix the problem.

  9. Hassan
    Member
    Posted 1 year ago #

    Okay, just installed the latest 2.1.4 update, and now the new prefixed tables are created, but that was after deactivating/reactivating the plugin.

    However, the old un-prefixed tables are still there- with ALL of my old heatmap records. I'm afraid they were not migrated properly to the new tables, therefore, I still see no heatmap data in the plugin's admin page.

  10. dpowney
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Hassan,

    What version of PHP ate you using? I was able to reproduce the data migration issue in PHP 5.3. It was fine though with PHP 5.5. I'll work on this today.

    Thanks,
    Daniel

  11. Hassan
    Member
    Posted 1 year ago #

    Daniel,

    Yes, I am using PHP 5.3 on my server.

    And what's up with that 5.5 you're using? I thought it's still in its early ages and not ready for production yet.

    Appreciate your work on this.

  12. dpowney
    Member
    Plugin Author

    Posted 1 year ago #

    My test environment is PHP 5.3. But I've got PHP 5.5 which I play around with for development.

    Please try version 2.1.5 available now which has a fix for the data migration issue.

    Thanks,
    Daniel.

  13. Hassan
    Member
    Posted 1 year ago #

    Ok, that finally worked. BUT, I had to deactivate/reactivate the plugin to make the effects take change. I did not remember to do that at first which gave a couple minutes of frustration.

    Now, I've got some other bugs for you: typos! :D

    On the bottom of the page, the title for the "Heat Maps" section says "Heap Maps" and in the table header it says "Hest Map Data" lol

  14. dpowney
    Member
    Plugin Author

    Posted 1 year ago #

    Do you manually install the plugin?

    I'm going to mark this as resolved now. As for the typo, a bit embarrassing. I'll remember to fix that in the next release of enhancements.

    Thanks. Daniel.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic