CcMarc / AbuseIPDB

AbuseIPDB integration for Zen Cart
Other
2 stars 2 forks source link

hardcoded table names #1

Closed webchills closed 1 year ago

webchills commented 1 year ago

Two suggestions for 2.0.1:

admin/includes/extra_datafiles/abuseipdb_settings.php has this unused definition which should be removed: define('TABLE_ABUSEIPDB_SETTINGS', DB_PREFIX . 'zen_abuseipdb_settings');

The new table abuseipdb_cache is hardcoded everywhere. Zen Cart standard is to use constants for tables.

Remove the unused definition and add instead to admin/includes/extra_datafiles/abuseipdb_settings.php: define('TABLE_ABUSEIPDB_CACHE', DB_PREFIX . 'abuseipdb_cache');

Create a new file for the frontend definition: includes/extra_datafiles/abuseipdb.php with <?php define('TABLE_ABUSEIPDB_CACHE', DB_PREFIX . 'abuseipdb_cache');

And change all instances of abuseipdb_cache to " . TABLE_ABUSEIPDB_CACHE . " in admin/includes/init_includes/init_abuseipdb_observer.php includes/classes/observers/class.abuseipdb_observer.php

CcMarc commented 1 year ago

All done, thank for the feedback - See v2.0.1