elementor / activity-log

Get aware of any activities that are taking place on your dashboard! Imagine it like a black-box for your WordPress site.
http://wordpress.org/plugins/aryo-activity-log/
183 stars 54 forks source link

Recommend running the aal_skip_insert_log filter before the duplicates check SQL query #208

Closed petenelson closed 7 months ago

petenelson commented 7 months ago

The check for duplicate records is running before the aal_skip_insert_log filter is being fired, but if the filter could be preventing inserts anyway, there is no reason to check for duplicates.

I'd recommend running that filter before the duplicate check query. On a large number of records, that could unnecessarily slow down the function call. Very grateful the new aal_skip_insert_log filter was added recently, as we found about 1 million extra records in our log recently cause by our own internal logging plugin. Any time we'd make our own log entry (a custom post type), the Activity Log plugin also recorded the log entry being created, and we didn't need it duplicated. We were able to modify our plugin and prevent this behavior.

KingYes commented 7 months ago

Hi @petenelson

1) You're right, thanks for your feedback! 2) If you have the old installed plugin, I recommend you to re-index by these indexes: https://github.com/pojome/activity-log/blob/d160e2ff297e4bf96639217fec750a799ad7df62/classes/class-aal-maintenance.php#L59-L79