Support » Plugin: Slimstat Analytics » A request for upgrade methods

  • Resolved kjmtsh


    Hi, camu

    Thank you for a beautiful plugin.

    I would like to enable my plugin (SQLite Integration) users to use your WP Slimstat. I rewrote the table creation method and succeeded in creating tables for WP Slimstat, but I still have another problem.

    When activating for the first time, every upgrade method wp-slimstat/admin/wp-slimstat-admin.php is executed.

    activate() method gets option values from the database but there’s no values (at least for the first time). wp_slimstat::$options[‘version’] becomes empty string. And update_tables_and_options() checks WP Slimstat version number. In this case, version_compare() function that compares empty string with the given number returns always true:

    if (version_compare(wp_slimstat::$options['version'], '3.1', '<')){

    And subsequent queries are all executed, which I think is not necessary for users to activate for the first time. So, I’m wondering if you could add another condition to if statement like below.

    if (!empty(wp_slimstat::$options['version']) && version_compare(wp_slimstat::$options['version'], '3.1, '<')) {

    SQLite database has a few command for ALTER TABLE. If it is possible, installing and activating WP Slimstat with my plugin will be very easy.

    Thank you.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘A request for upgrade methods’ is closed to new replies.