Home Knowledge Base Melapress File Monitor Melapress File Monitor database documentation

Melapress File Monitor database documentation

Melapress File Monitor monitors your files and code for any changes. It alerts you whenever a change is detected, either through email or the administrator dashboard. It uses exclusive smart technology to detect core, plugin, and theme changes while reducing false alarms to help you increase administrative efficiency.

This article explains how the file integrity monitor plugin for WordPress stores file change events in the WordPress database.

Melapress File Monitor SQL tables structure

You can safely access file change events from the WordPress dashboard. However, in exceptional circumstances, you might need to access events from the database itself. This may be the case, for example, if you cannot log in to the administration console and want to look at logs as part of your troubleshooting process.

Developers might also want to use this information to integrate a system or read the data directly from the database.

Melapress File Monitor uses a number of custom tables as part of its process. 

There are three sets of tables:

  • A working table and a storage table for directory scanning
  • A working table and a storage table for file scanning
  • A table for Melapress File Monitor events and a metadata table

We will now detail each and the structure they employ.

mfm_scanned_directories and mfm_stored_directories

The mfm_scanned_directories table temporarily stores the results of the currently active directory scan. Once all changes have been calculated, the contents are transferred to the mfm_stored_directories table. Data stored in the mfm_stored_directories table is then used as the baseline for the next directory scan.

Both tables follow the below schema:

  • id: A unique identifier for the record
  • path: The directory path
  • time: The time stamp of when the record was taken
Melapress File Monitor scanned directories schema

mfm_scanned_files and mfm_stored_files

Much like the previous two tables, the mfm_scanned_files table temporarily stores the results of the currently active scan. Once all changes have been calculated, the contents are transferred to the mfm_stored_files table. Data stored in the latter table is then used as a baseline for the next file scan.

Both tables follow the below schema:

  • id: A unique ID identifier for the record
  • path: The parent directory path
  • file_paths: An array of paths contained within path
  • file_hashes: An array of hashes of paths contained within
  • file_timestamps – array of file last-edit time stamps
  • data_hash: The overall directory hash
  • file_permission: Array of file permissions
  • time: The time stamp of when the record was taken

mfm_events

The mfm_events table stores each change event that Melapress File Monitor reports as follows:

  • id: A unique ID identifier for the record
  • path: The path of the directory affected by the change
  • data: An array of reported changes
  • event_type: A summary of the event (For a list of event types, see โ€˜Event typesโ€™ below)
  • is_read:  Has the event been read
  • time: The time stamp of when the record was taken
  • scan_run_id: scan run ID the event belongs to

mfm_events_metadata

The mfm_events_metadata table stores event metadata for events that include a lot of changes (for example, if a directory had 1000 new files added to it)

  • id: A unique ID identifier for the record
  • event_id: The wp_mfm_events id of the event which the metadata belongs to
  • data: An array of reported changes
  • event_type: A summary of the event (For a list of event types, see โ€˜List of possible event typesโ€™ below)
  • scan_run_id: scan run ID the event belongs to

Event types

The following is the list of event types and their corresponding labels used when displaying the event data:

  • file-scan-started: File scan started
  • core-file-modified: Core file modified
  • file-scan-complete: File scan complete
  • other-file-added: File(s) added
  • other-file-modified: File(s) modified 
  • other-file-removed: File(s) removed 
  • other-directory-added: Directory added
  • other-directory-modified: Directory modified 
  • other-directory-removed: Directory removed
  • plugin-file-modified: Plugin file(s) modified
  • plugin-directory-removed: Plugin removed
  • plugin-directory-added: Plugin added 
  • plugin-updated: Plugin updated 
  • theme-file-modified: Theme file(s) modified
  • theme-directory-removed: Theme removed 
  • theme-directory-added: Theme added
  • theme-updated: Theme updated

Getting further help

You can learn more about Melapress File Monitor by referring to the Knowledge Base or opening a support ticket for further assistance.

Close the CTA
Were you able to find what you were looking for?