Error while tracking download stats

Viewing 7 posts - 1 through 7 (of 7 total)
#145382

Carlos Cid
Participant

This error appears on error_log when a user downloads a file:

[Wed Jan 27 13:14:00.734042 2021] [fcgid:warn] [pid 20985] [client 158.xx.xx.xxx:53788] mod_fcgid: stderr: Error Unknown column 'filename' in 'field list' de la base de datos de WordPress para la consulta INSERT INTOxxxxx_ahm_download_stats(pid,uid,oid,year,month,day,timestamp,ip,filename,agent,version) VALUES ('45964', '135523', '', '2021', '01', '27', '1611749640', '158.99.1.128', '/xxxxxxxxxx/httpdocs/wp-content/uploads/download-manager-files/1600159091wpdm_Sofia Educacional.zip', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36', '') realizada por require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, WPDM\\libs\\Apply->triggerDownload, include('/plugins/download-manager/wpdm-start-download.php'), WPDM\\libs\\DownloadStats->add, referer: https://www.xxxxxx.xxx/xxxxxxx/

This started happening after upgrading the plugin to version 3.1.12

The structure of my table is:

CREATE TABLE xxxxx_ahm_download_stats (
id int(11) NOT NULL,
pid int(11) NOT NULL,
uid int(11) NOT NULL,
oid varchar(100) NOT NULL,
year int(4) NOT NULL,
month int(2) NOT NULL,
day int(2) NOT NULL,
timestamp int(11) NOT NULL,
ip varchar(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

#145483

Nayeem Riddhi
Moderator

Which PHP version and WP version you are using, please let me know

thanks

#145538

Carlos Cid
Participant

WP 5.6

PHP 7.3.19

I think the problem is that in the last upgrade of the plugin, the upgrade process is not upgrading the ahm_download_stats table structure.

#145901

Carlos Cid
Participant

Any update?

A fix for me can be the ALTER TABLE statement that was missed during the upgrade process.

I wouldn’t like to create a fork to fix my installation.

Many thanks.

#145904

Nayeem Riddhi
Moderator

Please, give your temporary wp-admin login details in a private reply for checking the issue.

Thanks

#145909

Carlos Cid
Participant

This is not required. I have already found the problem and a workaround.

Deactivating and re-activating the plugin fix the problem, as it triggers the code:

            $installer->addColumn('ahm_download_stats', 'version', 'varchar(255) NOT NULL');
            $installer->addColumn('ahm_download_stats', 'agent', 'TEXT');
            $installer->addColumn('ahm_download_stats', 'filename', 'TEXT');

On Installer::updateDB() and this code creates the missing columns.

Anyway I would suggest you to investigate why this code didn’t run during the plugin upgrade process.

Thanks for indirectly pointing me out the solution ๐Ÿ˜‰

#145923

Nayeem Riddhi
Moderator

Glad to hear this your problem has been resolved

thanks

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Error while tracking download stats’ is closed to new replies.