WordPress-Simple-History
WordPress-Simple-History copied to clipboard
Debug : No tables found
When the Simple History plugin is activated, the dashboard page becomes unresponsive, and under WordPress Settings > Simple History > Debug tab, nothing appears except for a 'No tables found' message. I have tried uninstalling and reinstalling the plugin, but to no avail.
All plugins except for Simple History are deactivated.
I am using Amazon Linux 2003, WordPress 6.4.3, Apache 2.4.56, and PHP FPM 8.2.7.
Also, all tables have been created.
Can someone please help?
Can you see the size of the tables, perhaps at the same place where you can see that they have been created?
Also, have Simple History worked on this site before?
I've been using it for a while, and since some update, there have been issues. Below are the sizes of the tables.
The wp_simple_history table has 21 rows, and the wp_simple_history_contexts table has 249 rows.
What version of MariaDB do you have? Nothing in any error logs?
Sorry, I didn't have debug mode enabled. When I enable debug mode, I get the following error. And yes I'm using MariaDB 10.11.x
[Unknown column 'AvailableUpdatesLogger' in 'where clause']
## START SQL_STATEMENT_LOG_ROWS SELECT simple_history_1.id, maxId, minId, simple_history_1.logger, simple_history_1.level, simple_history_1.date, simple_history_1.message, simple_history_1.initiator, simple_history_1.occasionsID, repeatCount, repeatCount AS subsequentOccasions FROM wp_simple_history AS simple_history_1 INNER JOIN ( ## START SQL_STATEMENT_MAX_IDS_AND_COUNT_TEMPLATE SELECT max(h.id) as maxId, min(h.id) as minId, max(historyWithRepeated.repeatCount) as repeatCount FROM wp_simple_history AS h INNER JOIN ( ## START INNER_SQL_QUERY_STATEMENT SELECT id, #message, IF(@a=occasionsID,@counter:=@counter+1,@counter:=1) AS repeatCount, IF(@counter=1,@groupby:=@groupby+1,@groupby) AS repeated, @a:=occasionsId, contexts.value as context_message_key FROM wp_simple_history AS h2 # Join column with message key so its searchable/filterable. LEFT OUTER JOIN wp_simple_history_contexts AS contexts ON (contexts.history_id = h2.id AND contexts.key = "_message_key") # Where statement. WHERE logger IN ("AvailableUpdatesLogger", "FileEditsLogger", "Plugin_ACF", "Plugin_BeaverBuilder", "Plugin_DuplicatePost", "Plugin_LimitLoginAttempts", "Plugin_Redirection", "PluginEnableMediaReplaceLogger", "PluginUserSwitchingLogger", "PluginWPCrontrolLogger", "SH_Jetpack_Logger", "SH_Privacy_Logger", "SH_Translations_Logger", "SimpleCategoriesLogger", "SimpleCommentsLogger", "SimpleCoreUpdatesLogger", "SimpleExportLogger", "SimpleLogger", "SimpleMediaLogger", "SimpleMenuLogger", "SimpleOptionsLogger", "SimplePluginLogger", "SimplePostLogger", "SimpleThemeLogger", "SimpleUserLogger", "SimpleHistoryLogger") AND date >= "2024-03-27 00:00:00" ORDER BY id DESC ## END INNER_SQL_QUERY_STATEMENT ) as historyWithRepeated ON historyWithRepeated.id = h.id # Outer where GROUP BY historyWithRepeated.repeated ORDER by maxId DESC # Limit LIMIT 0, 1 ## END SQL_STATEMENT_MAX_IDS_AND_COUNT_TEMPLATE ) AS max_ids_and_count ON simple_history_1.id = max_ids_and_count.maxId ORDER BY simple_history_1.id DESC ## END SQL_STATEMENT_LOG_ROWS
And below are Debug page errors.
SELECT table_name AS "table_name", round(((data_length + index_length) / 1024 / 1024), 2) "size_in_mb" FROM information_schema.TABLES WHERE table_schema = "kal_newsroom_test" AND table_name IN ("wp_simple_history", "wp_simple_history_contexts");
## START SQL_STATEMENT_LOG_ROWS SELECT simple_history_1.id, maxId, minId, simple_history_1.logger, simple_history_1.level, simple_history_1.date, simple_history_1.message, simple_history_1.initiator, simple_history_1.occasionsID, repeatCount, repeatCount AS subsequentOccasions FROM wp_simple_history AS simple_history_1 INNER JOIN ( ## START SQL_STATEMENT_MAX_IDS_AND_COUNT_TEMPLATE SELECT max(h.id) as maxId, min(h.id) as minId, max(historyWithRepeated.repeatCount) as repeatCount FROM wp_simple_history AS h INNER JOIN ( ## START INNER_SQL_QUERY_STATEMENT SELECT id, #message, IF(@a=occasionsID,@counter:=@counter+1,@counter:=1) AS repeatCount, IF(@counter=1,@groupby:=@groupby+1,@groupby) AS repeated, @a:=occasionsId, contexts.value as context_message_key FROM wp_simple_history AS h2 # Join column with message key so its searchable/filterable. LEFT OUTER JOIN wp_simple_history_contexts AS contexts ON (contexts.history_id = h2.id AND contexts.key = "_message_key") # Where statement. WHERE logger IN ("AvailableUpdatesLogger", "FileEditsLogger", "Plugin_ACF", "Plugin_BeaverBuilder", "Plugin_DuplicatePost", "Plugin_LimitLoginAttempts", "Plugin_Redirection", "PluginEnableMediaReplaceLogger", "PluginUserSwitchingLogger", "PluginWPCrontrolLogger", "SH_Jetpack_Logger", "SH_Privacy_Logger", "SH_Translations_Logger", "SimpleCategoriesLogger", "SimpleCommentsLogger", "SimpleCoreUpdatesLogger", "SimpleExportLogger", "SimpleLogger", "SimpleMediaLogger", "SimpleMenuLogger", "SimpleOptionsLogger", "SimplePluginLogger", "SimplePostLogger", "SimpleThemeLogger", "SimpleUserLogger", "SimpleHistoryLogger") ORDER BY id DESC ## END INNER_SQL_QUERY_STATEMENT ) as historyWithRepeated ON historyWithRepeated.id = h.id # Outer where GROUP BY historyWithRepeated.repeated ORDER by maxId DESC # Limit LIMIT 0, 1 ## END SQL_STATEMENT_MAX_IDS_AND_COUNT_TEMPLATE ) AS max_ids_and_count ON simple_history_1.id = max_ids_and_count.maxId ORDER BY simple_history_1.id DESC ## END SQL_STATEMENT_LOG_ROWS
Thanks for the queries/error! One more question: do you have any other plugins installed, perhaps any plugin that modifies the way queries are made? For example https://wordpress.org/plugins/hyperdb/ or anything similar?
No, I deactivated all plugins. Only Simple History is active.
Have you checked this issue? I've tried reinstalling everything from 4.13.0 down to 4.10.0, but not working. I proceeded as follows:
wp plugin uninstall simple-history --deactivate
wp plugin install simple-history --version=4.12.0 --activate
...
It works fine on my MacBook, but it's not working on the test/production environment (AWS+Ubuntu 22.04). The production environment has strict restrictions on external communications. Could this be the problem?
No update on this. I can not reproduce it. Also the error Unknown column 'AvailableUpdatesLogger' in 'where clause']
is really strange and I can't explain it.
I'm sorry. The database version is 10.6.15. The client version is mysqlnd 8.2.7 and I'm using AWS RDS.
I have tested all versions from 3.5.1 to 4.8.0, and they all work fine.
The error occurs from version 4.9.0 onwards, and the error message is as follows:
[Unknown column 'AvailableUpdatesLogger' in 'where clause']
When reinstall using wp plugin uninstall simple-history
wp plugin install simple-history
, the contents of the wp_simple_history table are as follows.
select * from wp_simple_history;
+----+---------------------+--------------------+-------+----------------------------------------------------------------------------------------------------------------+----------------------------------+-----------+
| id | date | logger | level | message | occasionsID | initiator |
+----+---------------------+--------------------+-------+----------------------------------------------------------------------------------------------------------------+----------------------------------+-----------+
| 1 | 2024-05-23 06:14:13 | SimplePluginLogger | info | Installed plugin "{plugin_name}" | 58c53c88116810eed617d397a5951e6d | wp_user |
| 2 | 2024-05-23 06:14:13 | SimplePluginLogger | info | Activated plugin "{plugin_name}" | de1302299d0874e5455ab6ed1dff00bd | wp_user |
| 3 | 2024-05-23 06:14:13 | SimpleLogger | info | Welcome to Simple History! This is the event history feed. It will contain events that this plugin has logged. | b44604c5600b062d4d33a091a04f7f4e | wp |
| 4 | 2024-05-23 06:14:33 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 72b71f2a4f21e0d1b9df1d9abf5ddc21 | wp_user |
+----+---------------------+--------------------+-------+----------------------------------------------------------------------------------------------------------------+----------------------------------+-----------+
4 rows in set (0.000 sec)
So I forcibly inserted the data below from another website.
select * from wp_simple_history;
+----+---------------------+------------------------+--------+----------------------------------------------------------------------------------------------------------------+----------------------------------+-----------+
| id | date | logger | level | message | occasionsID | initiator |
+----+---------------------+------------------------+--------+----------------------------------------------------------------------------------------------------------------+----------------------------------+-----------+
| 1 | 2024-03-03 06:59:04 | SimplePluginLogger | info | Installed plugin "{plugin_name}" | b99d33a0f866aadc398e9eedfdf2dc32 | wp_user |
| 2 | 2024-03-03 06:59:04 | SimplePluginLogger | info | Activated plugin "{plugin_name}" | de1302299d0874e5455ab6ed1dff00bd | wp_user |
| 3 | 2024-03-03 06:59:04 | SimpleLogger | info | Welcome to Simple History! This is the event history feed. It will contain events that this plugin has logged. | b44604c5600b062d4d33a091a04f7f4e | wp |
| 4 | 2024-03-03 07:04:14 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 334e86525efd521faf3ec9fb3c5e3cbd | wp_cli |
| 5 | 2024-03-03 07:04:30 | SimplePluginLogger | info | Installed plugin "{plugin_name}" | 4374243f3c5211c069b476bd94306ee0 | wp_cli |
| 6 | 2024-03-03 07:04:32 | SimplePluginLogger | info | Activated plugin "{plugin_name}" | 96fdc8fb5eedfe88475373ed83f72e5c | wp_cli |
| 7 | 2024-03-03 07:05:38 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 334e86525efd521faf3ec9fb3c5e3cbd | wp_cli |
| 8 | 2024-03-03 07:06:06 | SimpleMediaLogger | info | Created {post_type} "{attachment_title}" | 9f0efa9c26ed6e0ad6cfd0b3f5ae5a36 | wp_user |
| 9 | 2024-03-03 07:06:19 | SimplePostLogger | info | Created {post_type} "{post_title}" | cf23b477ae5e210435298b65754a2592 | wp_user |
| 10 | 2024-03-03 07:07:35 | SimplePostLogger | info | Updated {post_type} "{post_title}" | 34e2590c0e0c44096e44667984f80a30 | wp_user |
| 11 | 2024-03-03 07:09:30 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 5609197ce33426d6d68425d30766fe6a | wp_cli |
| 12 | 2024-03-03 07:09:30 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 1693dd138181d32eac122b63979f2e81 | wp_cli |
| 13 | 2024-03-03 07:09:31 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 9d41806446b1b784197ada5e8e7c52e5 | wp_cli |
| 14 | 2024-03-03 07:09:31 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | bd1b805b388c8dd6a79a94af6f02edff | wp_cli |
| 15 | 2024-03-03 07:09:31 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | c469972be43a54a9060904f8540a5962 | wp_cli |
| 16 | 2024-03-03 07:09:31 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 60598f23d55eec9ba8b0610dd5179f15 | wp_cli |
| 17 | 2024-03-03 07:09:31 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | d06d7d853c209350605f001e0cd80252 | wp_cli |
| 18 | 2024-03-03 07:09:31 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 89e22ee49e66f5108fa88b1dacc7cdc3 | wp_cli |
| 19 | 2024-03-03 07:09:31 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 8b8b4b056ee6e4cb44c797b97dcbf7ab | wp_cli |
| 20 | 2024-03-03 07:09:31 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 236ac9da89bae77314307bf977db0a34 | wp_cli |
| 21 | 2024-03-03 07:09:32 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 61d26d2b1943286c7787b3cdb75acf61 | wp_cli |
| 22 | 2024-03-03 07:09:32 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 95f3af9fd46242bd018b8224cb2dc585 | wp_cli |
| 23 | 2024-03-03 07:09:32 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | f97c657edc6f24fc19dfdb0905d8108b | wp_cli |
| 24 | 2024-03-26 06:01:35 | SimpleUserLogger | info | Logged in | 8a07554f81169faa6242b153388b508e | wp_user |
| 25 | 2024-03-26 06:01:40 | SimpleUserLogger | info | Logged in | 8a07554f81169faa6242b153388b508e | wp_user |
| 26 | 2024-03-26 06:01:42 | SimpleCategoriesLogger | info | Added term "{term_name}" in taxonomy "{term_taxonomy}" | 009a2c6da38c5d59fb13cb070c587980 | wp_user |
| 27 | 2024-03-26 06:01:43 | SimpleCategoriesLogger | info | Added term "{term_name}" in taxonomy "{term_taxonomy}" | 009a2c6da38c5d59fb13cb070c587980 | wp_user |
| 28 | 2024-03-26 06:01:43 | SimpleCategoriesLogger | info | Added term "{term_name}" in taxonomy "{term_taxonomy}" | 009a2c6da38c5d59fb13cb070c587980 | wp_user |
| 29 | 2024-03-26 06:02:01 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | adb83df323606c3220d71a107f0dae28 | wp_user |
| 30 | 2024-03-26 06:02:12 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 4b86a895a85c97c05b76d5d9b2d7cc7e | wp_user |
| 31 | 2024-04-03 05:34:23 | SimpleUserLogger | info | Logged in | 8a07554f81169faa6242b153388b508e | wp_user |
| 32 | 2024-04-03 05:34:27 | AvailableUpdatesLogger | notice | Found an update to WordPress | 0b6bbb08f8ffcab40a1b2937ed983f83 | wp |
| 33 | 2024-04-03 05:34:27 | AvailableUpdatesLogger | notice | Found an update to plugin "{plugin_name}" | 107116ac9608fe7b17c793dd32bae954 | wp |
| 34 | 2024-04-03 05:34:27 | AvailableUpdatesLogger | notice | Found an update to plugin "{plugin_name}" | 4afcf245ae1d3b3e160f592aa3322ed0 | wp |
| 35 | 2024-04-03 05:34:27 | AvailableUpdatesLogger | notice | Found an update to plugin "{plugin_name}" | 05ebad15af48e486275c2554f26d3825 | wp |
| 36 | 2024-04-03 05:34:27 | AvailableUpdatesLogger | notice | Found an update to plugin "{plugin_name}" | dd2b374230f41093639efb57827125e7 | wp |
| 37 | 2024-04-03 05:34:27 | AvailableUpdatesLogger | notice | Found an update to plugin "{plugin_name}" | 117887cb433f29b044e6938cb45deef2 | wp |
| 38 | 2024-04-03 05:34:28 | AvailableUpdatesLogger | notice | Found an update to plugin "{plugin_name}" | dba2d598d093fc860a360fb79dae1cb4 | wp |
| 39 | 2024-04-03 05:34:28 | AvailableUpdatesLogger | notice | Found an update to plugin "{plugin_name}" | 0e4ec9ce26f3bbffd8d3c6be830bba91 | wp |
| 40 | 2024-04-03 05:34:28 | AvailableUpdatesLogger | notice | Found an update to plugin "{plugin_name}" | f9e6e61405684ebbfa5749eb00e0c87c | wp |
| 41 | 2024-04-03 05:34:30 | AvailableUpdatesLogger | notice | Found an update to theme "{theme_name}" | 58dce115ddb07bea15a2a67a9e2b64f1 | wp |
| 42 | 2024-04-03 05:34:30 | AvailableUpdatesLogger | notice | Found an update to theme "{theme_name}" | 41009a166f4a2afcdd8ad6b2e3ec836f | wp |
| 43 | 2024-04-03 05:34:30 | AvailableUpdatesLogger | notice | Found an update to theme "{theme_name}" | 30f934d164d2b927dea1aa817020c9cc | wp |
| 44 | 2024-04-03 05:37:30 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 08ace3d42d75c262669f09ce596ba301 | wp_user |
| 45 | 2024-04-03 05:37:30 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | d06d7d853c209350605f001e0cd80252 | wp_user |
| 46 | 2024-04-03 05:37:30 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 89e22ee49e66f5108fa88b1dacc7cdc3 | wp_user |
| 47 | 2024-04-03 05:37:31 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 8b8b4b056ee6e4cb44c797b97dcbf7ab | wp_user |
| 48 | 2024-04-03 05:37:31 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 236ac9da89bae77314307bf977db0a34 | wp_user |
| 49 | 2024-04-03 05:37:31 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 61d26d2b1943286c7787b3cdb75acf61 | wp_user |
| 50 | 2024-04-03 05:37:31 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 95f3af9fd46242bd018b8224cb2dc585 | wp_user |
| 51 | 2024-04-03 05:37:31 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | f97c657edc6f24fc19dfdb0905d8108b | wp_user |
| 52 | 2024-04-03 05:37:33 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 5609197ce33426d6d68425d30766fe6a | wp_user |
| 53 | 2024-04-03 05:37:33 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 1693dd138181d32eac122b63979f2e81 | wp_user |
| 54 | 2024-04-03 05:37:33 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 9d41806446b1b784197ada5e8e7c52e5 | wp_user |
| 55 | 2024-04-03 05:37:34 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 479b8000b4f93173160dd5873b95473e | wp_user |
| 56 | 2024-04-03 05:37:34 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 057496ca90c3fe994fe38f3c33172fe7 | wp_user |
| 57 | 2024-04-03 05:37:34 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 334e86525efd521faf3ec9fb3c5e3cbd | wp_user |
| 58 | 2024-04-03 05:37:34 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | bd1b805b388c8dd6a79a94af6f02edff | wp_user |
| 59 | 2024-04-03 05:37:34 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | c469972be43a54a9060904f8540a5962 | wp_user |
| 60 | 2024-04-03 05:37:34 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 60598f23d55eec9ba8b0610dd5179f15 | wp_user |
| 61 | 2024-04-03 05:37:35 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | 5292b91b4774e97892ba7a56225fb097 | wp_user |
| 62 | 2024-04-03 05:37:35 | SimplePluginLogger | info | Deactivated plugin "{plugin_name}" | b56ce50e4d766e4844c67f9683572a48 | wp_user |
+----+---------------------+------------------------+--------+----------------------------------------------------------------------------------------------------------------+----------------------------------+-----------+
62 rows in set (0.000 sec)
However, the same error continues to occur.
I will also check if there is an issue with the environment. For now, it seems I have to use version 4.8.0.
Sorry, this was not a version issue.
It was because ANSI_QUOTES was enabled in the SQL MODE of the database.
For example, in the get_db_table_stats
function of the class-helpers.php
file:
The following code results in an error.
SELECT table_name AS "table_name", round(((data_length + index_length) / 1024 / 1024), 2) "size_in_mb" FROM information_schema.TABLES WHERE table_schema = "kal_newsroom_test" AND table_name IN ("wp_simple_history", "wp_simple_history_contexts");
ERROR 1054 (42S22): Unknown column 'kal_newsroom_test' in 'where clause'
The following code executes successfully.
SELECT table_name AS "table_name", round(((data_length + index_length) / 1024 / 1024), 2) "size_in_mb" FROM information_schema.TABLES WHERE table_schema = 'kal_newsroom_test' AND table_name IN ('wp_simple_history', 'wp_simple_history_contexts');
I resolved this issue by removing ANSI_QUOTES. I hope the plugin will accommodate ANSI_QUOTES in the future.
Thanks for the follow up. I was not aware of ANSI_QUOTES. I will make a local test install with a database with ANSI_QUOTES enabled so hopefully I can fix this issue.
I appreciate your hard work, and hope this issue can be resolved smoothly. Thank you.
@tuffkidd This should work now, I added support in version 4.16.0: https://simple-history.com/2024/simple-history-4-16-0/