94% watchman

Code Review | Watchman

WordPress plugin Watchman scored 94% from 54 tests.

About plugin

  • Plugin page: watchman
  • Plugin version: 0.7.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.4
  • WordPress version: 5.8.1
  • First release: Dec 11, 2014
  • Latest release: Dec 19, 2015
  • Number of updates: 8
  • Update frequency: every 47.6 days
  • Top authors: desaiuditd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 985 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼136.14ms] Passed 4 tests

This is a short check of server-side resources used by Watchman
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0335.30 ▲0.24
Dashboard /wp-admin3.11 ▲0.0652.34 ▲10.72
Posts /wp-admin/edit.php3.22 ▲0.1145.84 ▲1.42
Add New Post /wp-admin/post-new.php5.48 ▲0.0596.46 ▼539.72
Media Library /wp-admin/upload.php3.05 ▲0.0432.23 ▼6.49

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Watchman
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,699 ▲10316.21 ▲0.358.37 ▲0.4147.76 ▼1.69
Dashboard /wp-admin2,993 ▲596.04 ▼0.07134.37 ▲0.27107.98 ▼4.50
Posts /wp-admin/edit.php2,759 ▲232.69 ▼0.0164.20 ▼2.1189.62 ▼2.42
Add New Post /wp-admin/post-new.php1,749 ▲7316.70 ▼2.16353.51 ▼2.07109.12 ▼6.71
Media Library /wp-admin/upload.php1,830 ▲234.98 ▼0.13164.96 ▲16.21118.30 ▲5.66

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/watchman/tests/bootstrap.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/watchman/tests/wm-test-case.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WM_TestCase' not found in wp-content/plugins/watchman/tests/tests/test-watchman.php:9
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/watchman/tests/bootstrap.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Donate link: Please fix this invalid URI: ""
The official readme.txt is a good inspiration

watchman/watchman.php Passed 13 tests

The main file in "Watchman" v. 0.7.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
75 characters long description:
A WordPress plugin to track revisions of your posts, pages and custom posts

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin557 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP8151294434
Markdown136075
CSS15038
SVG11010

PHP code Passed 2 tests

This is a very shot review of 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.33
Average class complexity7.43
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods37
▷ Static methods12.70%
▷ Public methods3594.59%
▷ Protected methods00.00%
▷ Private methods25.41%
Functions6
▷ Named functions233.33%
▷ Anonymous functions466.67%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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