66% wp-audit

Code Review | ​WP Audit

WordPress plugin ​WP Audit scored66%from 54 tests.

About plugin

  • Plugin page: wp-audit
  • Plugin version: 0.5.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9.7
  • WordPress version: 6.3.1
  • First release: May 5, 2018
  • Latest release: Aug 2, 2018
  • Number of updates: 14
  • Update frequency: every 6.4 days
  • Top authors: xitadel (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /938 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼4.77ms] Passed 4 tests

This is a short check of server-side resources used by ​WP Audit
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1138.30 ▲2.96
Dashboard /wp-admin3.42 ▲0.1147.03 ▼1.95
Posts /wp-admin/edit.php3.54 ▲0.1748.16 ▼3.78
Add New Post /wp-admin/post-new.php6.03 ▲0.1481.62 ▼13.97
Media Library /wp-admin/upload.php3.35 ▲0.1135.23 ▲0.62
WP Audit /wp-admin/index.php?page=wp-audit3.3231.62

Server storage [IO: ▲0.10MB] [DB: ▲0.00MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for ​WP Audit
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.54 ▲0.191.65 ▲0.0639.34 ▲0.22
Dashboard /wp-admin2,196 ▲185.55 ▼0.0884.88 ▼15.9840.15 ▼4.75
Posts /wp-admin/edit.php2,104 ▲41.94 ▼0.0933.72 ▼8.0835.80 ▼1.18
Add New Post /wp-admin/post-new.php1,529 ▲123.10 ▲0.03666.46 ▲68.1856.28 ▼1.37
Media Library /wp-admin/upload.php1,404 ▲74.29 ▼0.0194.34 ▼5.5445.02 ▼1.07
WP Audit /wp-admin/index.php?page=wp-audit8891.9430.3232.04

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/index.php?page=wp-audit
    • > Notice in wp-content/plugins/wp-audit/wp-audit.php+515
    Undefined index: HTTPS
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/index.php?page=wp-audit
    • > Deprecated in wp-content/plugins/wp-audit/wp-audit.php+748
    Non-static method WPAudit_Helpers::formatBytes() should not be called statically
    • > GET request to /wp-admin/index.php?page=wp-audit
    • > Deprecated in wp-content/plugins/wp-audit/wp-audit.php+520
    Non-static method WPAudit_Helpers::get_php_curl() should not be called statically
    • > GET request to /wp-admin/index.php?page=wp-audit
    • > Deprecated in wp-content/plugins/wp-audit/wp-audit.php+521
    Non-static method WPAudit_Helpers::get_php_loaded_extensions() should not be called statically
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/index.php?page=wp-audit
    • > Deprecated in wp-content/plugins/wp-audit/wp-audit.php+731
    Non-static method WPAudit_Helpers::folderSize() should not be called statically
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/index.php?page=wp-audit
    • > Deprecated in wp-content/plugins/wp-audit/wp-audit.php+538
    Non-static method WPAudit_Helpers::folderInfo() should not be called statically
    • > GET request to /wp-admin/index.php?page=wp-audit
    • > Notice in wp-content/plugins/wp-audit/wp-audit.php+477
    Undefined property: mysqli::$stat
    • > GET request to /wp-admin/index.php?page=wp-audit
    • > Notice in wp-content/plugins/wp-audit/wp-audit.php+480
    Undefined offset: 1

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 8× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-audit/admin/tabs/privacy.php
    • > /wp-content/plugins/wp-audit/admin/tabs/plugins.php
    • > /wp-content/plugins/wp-audit/admin/tabs/environment.php
    • > /wp-content/plugins/wp-audit/admin/tabs/content.php
    • > /wp-content/plugins/wp-audit/admin/tabs/wordpress.php
    • > /wp-content/plugins/wp-audit/admin/tabs/tools.php
    • > /wp-content/plugins/wp-audit/admin/tabs/performance.php
    • > /wp-content/plugins/wp-audit/admin/tabs/database.php
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-audit/wp-audit.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_home_path() in wp-content/plugins/wp-audit/admin/tabs/errors.php:7
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-audit/admin/footer.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-audit/admin/tab-environment.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_style() in wp-content/plugins/wp-audit/admin/header.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/index.php?page=wp-audit
    • > Network (severe)
    wp-content/plugins/wp-audit/admin/js/slimtable.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === wp-audit === )
Please take inspiration from this readme.txt

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

The main PHP file in "​WP Audit" ver. 0.5.7 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,495 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP14223801,064
CSS16115397
JavaScript292134

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity17.33
▷ Minimum class complexity4.00
▷ Maximum class complexity43.00
Average method complexity2.14
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods43
▷ Static methods00.00%
▷ Public methods43100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin