• Resolved velozer

    (@velozer)


    Hi,

    Thanks a lot for this useful plugin.

    I have installed this plugin yesterday. I have done some tests and I do not see anything in the results graph.
    I’ve seen that the timestamp is not saved in database. Maybe this is the problem.
    The timestamp for all records is “0000-00-00 00:00:00”.

    This is a known problem?

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor DanFoster

    (@danfoster)

    Hello,

    I’m afraid it’s not a known problem. What do you have set for your server and WordPress timezones?

    Thread Starter velozer

    (@velozer)

    Hello,

    Thanks for your answer.
    I’ve checked the timezone and I found that it was erroneous on WordPress.
    But after corrected it, the problem is not solved.
    Also, I’ve uninstalled and installed again, but not works.

    timedatectl
          Local time: Tue 2022-03-29 12:43:43 CEST
      Universal time: Tue 2022-03-29 10:43:43 UTC
            RTC time: Tue 2022-03-29 10:43:43
           Time zone: Europe/Madrid (CEST, +0200)
         NTP enabled: yes
    NTP synchronized: yes
     RTC in local TZ: no
          DST active: yes
    Plugin Contributor DanFoster

    (@danfoster)

    It sounds like you’re comfortable looking in the database itself – is the timestamp on the hit records still showing up as “0000-00-00 00:00:00”? Is the database you’re using a normal MySQL or MariaDB installation?

    Thread Starter velozer

    (@velozer)

    Yes, the records still “0000-00-00 00:00:00”.
    The MySQL is normal:mysql-community-server-8.0.23

    Plugin Contributor DanFoster

    (@danfoster)

    It looks like your MySQL has a non-default setting (explicit_defaults_for_timestamp disabled). https://dev.mysql.com/doc/refman/8.0/en/timestamp-initialization.html

    I’ll update Track The Click to use an explicit default – look for a new version with this change in the next day or two.

    Thread Starter velozer

    (@velozer)

    This var is enabled:

    mysql> show variables like 'explicit_defaults_for_timestamp';
    +---------------------------------+-------+
    | Variable_name                   | Value |
    +---------------------------------+-------+
    | explicit_defaults_for_timestamp | ON    |
    +---------------------------------+-------+
    1 row in set (0.00 sec)

    I just tested with the variable enabled and disabled and the result is the same.

    Thread Starter velozer

    (@velozer)

    I have changed the table wp_track_the_click_hit.
    In the field ‘timestamp’ I’ve put the value ‘CURRENT_TIMESTAMP’.

    CREATE TABLEwp_track_the_click_hit` (
    id bigint UNSIGNED NOT NULL,
    link_id bigint UNSIGNED NOT NULL,
    timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;`

    Now works fine!

    Thanks a lot.

    Plugin Contributor DanFoster

    (@danfoster)

    Perfect, thank you for testing the change that’s coming in the next version!

    Plugin Contributor DanFoster

    (@danfoster)

    0.2.19 has just been released which fixes this issue.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘No timestamp saved in database’ is closed to new replies.