WordPress

How to Use “Count Per Day” in PHP8

If you try to use the WordPress plugin “Count Per Day” in a PHP8 environment, an error will occur.

It can be used by modifying some of the code.

The modifications are as follows.

Modify the file “counter-core.php” directly under the plugin directory “count-per-day”.

Change the line at about line 1517,

$last = strtolower($val{strlen($val)-1});

to the following:

$last = strtolower($val[strlen($val)-1]);

It will then be usable.