10% database-audit

Code Review | WP Database Audit

WordPress plugin WP Database Audit scored 10% from 54 tests.

About plugin

  • Plugin page: database-audit
  • Plugin version: 1.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9
  • WordPress version: 6.3.1
  • First release: Nov 21, 2017
  • Latest release: Nov 22, 2017
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: khanhtruong (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 610 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/database-audit/audit.php+162
    Undefined index: Extra

Server metrics [RAM: ▼0.69MB] [CPU: ▼14.41ms] Passed 4 tests

Analyzing server-side resources used by WP Database Audit
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0042.09 ▲1.79
Dashboard /wp-admin3.32 ▲0.0245.18 ▼4.94
Posts /wp-admin/edit.php3.37 ▲0.0150.61 ▲4.60
Add New Post /wp-admin/post-new.php3.10 ▼2.7933.97 ▼56.39
Media Library /wp-admin/upload.php3.24 ▲0.0135.78 ▲1.91
Database Audit /wp-admin/options-general.php?page=wp-db-audit3.3445.19

Server storage [IO: ▲0.04MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 16 new files
Database: 13 new tables, 6 new options
New tables
wp_term_taxonomy_audit
wp_links_audit
wp_options_audit
wp_usermeta_audit
wp_commentmeta_audit
wp_comments_audit
wp_terms_audit
wp_term_relationships_audit
wp_postmeta_audit
wp_posts_audit
...
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP Database Audit
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.74 ▲0.361.70 ▼0.4645.19 ▼2.70
Dashboard /wp-admin2,210 ▲225.85 ▲0.9096.37 ▼13.8938.26 ▼9.21
Posts /wp-admin/edit.php2,093 ▲42.02 ▲0.0035.63 ▲0.8932.98 ▼0.83
Add New Post /wp-admin/post-new.php1,127 ▼39311.55 ▼11.66308.20 ▼358.3749.73 ▼14.16
Media Library /wp-admin/upload.php1,392 ▲14.19 ▲0.0396.24 ▼3.9443.08 ▼2.89
Database Audit /wp-admin/options-general.php?page=wp-db-audit1,2372.1822.3527.67

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 21× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      require(WPDBAUDIT_PATH/controller/wpdbaudit_app_controller.php): failed to open stream: No such file or directory in wp-content/plugins/database-audit/controller/wpdbaudit_show_changes_controller.php on line 2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/database-audit/lib/wpdbaudit_audit_table_list.php on line 3
    • > PHP Notice
      Undefined variable: changesList in wp-content/plugins/database-audit/views/show_changes/index.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'wp_db_audit' not found in wp-content/plugins/database-audit/admin.php:14
    • > PHP Notice
      Undefined variable: auditTableList in wp-content/plugins/database-audit/views/audit_list/index.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to a member function display() on null in wp-content/plugins/database-audit/views/audit_list/index.php:16
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/database-audit/lib/wpdbaudit_changes_list.php on line 6
    • > PHP Notice
      Undefined index: page in wp-content/plugins/database-audit/views/show_changes/index.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/database-audit/lib/wpdbaudit_changes_list.php on line 6
    • > PHP Fatal error
      require(): Failed opening required 'WPDBAUDIT_PATH/controller/wpdbaudit_app_controller.php' (include_path='.:/usr/share/php') in wp-content/plugins/database-audit/controller/wpdbaudit_show_changes_controller.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: monitor, database, admin, logging, stats...

database-audit/wp-db-audit.php 92% from 13 tests

The principal PHP file in "WP Database Audit" v. 1.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("database-audit.php" instead of "wp-db-audit.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin927 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP11232411840
Bourne Shell311081
Markdown1106

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity7.90
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes110.00%
Methods57
▷ Static methods00.00%
▷ Public methods4273.68%
▷ Protected methods58.77%
▷ Private methods1017.54%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants240.00%
▷ Class constants360.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin