83% wp-document-revisions

Code Review | WP Document Revisions

WordPress plugin WP Document Revisions scored83%from 54 tests.

About plugin

  • Plugin page: wp-document-revis...
  • Plugin version: 3.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.1.1
  • WordPress version: 6.3.1
  • First release: Apr 30, 2011
  • Latest release: Feb 28, 2023
  • Number of updates: 241
  • Update frequency: every 18.1 days
  • Top authors: benbalter (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

3,000+ active /147,161 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.98MB] [CPU: ▲1.03ms] Passed 4 tests

An overview of server-side resources used by WP Document Revisions
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.27 ▲0.8141.62 ▲1.48
Dashboard /wp-admin4.34 ▲1.0454.20 ▲5.02
Posts /wp-admin/edit.php4.39 ▲1.0457.93 ▲8.44
Add New Post /wp-admin/post-new.php7.01 ▲1.1397.54 ▼10.82
Media Library /wp-admin/upload.php4.26 ▲1.0343.66 ▲10.26
All Documents /wp-admin/edit.php?post_type=document4.3152.39
Add Document /wp-admin/post-new.php?post_type=document4.4163.39
Validate Structure /wp-admin/edit.php?post_type=document&page=wpdr_validate4.1738.55
Workflow States /wp-admin/edit-tags.php?taxonomy=workflow_state&post_type=document4.2645.41

Server storage [IO: ▲1.79MB] [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: 107 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_wp_document_revisions_recently_revised_widget

Browser metrics Passed 4 tests

WP Document Revisions: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,893 ▲13613.20 ▼1.604.44 ▲2.6640.95 ▲0.89
Dashboard /wp-admin2,278 ▲905.90 ▲0.06103.37 ▼8.8573.06 ▲26.39
Posts /wp-admin/edit.php2,136 ▲472.01 ▲0.0137.94 ▼2.5433.26 ▼1.59
Add New Post /wp-admin/post-new.php6,452 ▲4,92428.78 ▲10.47951.97 ▲343.6340.96 ▼11.84
Media Library /wp-admin/upload.php1,427 ▲394.24 ▼0.0896.52 ▼1.5871.63 ▲26.26
All Documents /wp-admin/edit.php?post_type=document1,2462.2129.4332.81
Add Document /wp-admin/post-new.php?post_type=document2,4917.70162.90125.69
Validate Structure /wp-admin/edit.php?post_type=document&page=wpdr_validate9262.2529.1826.15
Workflow States /wp-admin/edit-tags.php?taxonomy=workflow_state&post_type=document1,5222.1426.0535.98

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_wp_document_revisions_recently_revised_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
Please fix the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_upload_dir() in wp-content/plugins/wp-document-revisions/includes/class-wp-document-revisions.php:118
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Document_Revisions' not found in wp-content/plugins/wp-document-revisions/includes/revision-feed.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-document-revisions/includes/class-wp-document-revisions-recently-revised-widget.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% 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 your attention:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
Please take inspiration from this readme.txt

wp-document-revisions/wp-document-revisions.php 85% from 13 tests

The main PHP file in "WP Document Revisions" ver. 3.5.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 149 characters long)
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.6" instead of "4.9")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin21,212 lines of code in 87 files:
LanguageFilesBlank linesComment linesLines of code
PO File326,7927,62714,319
PHP99952,6814,332
JavaScript1054551,243
Markdown164470769
Bourne Again Shell44357212
CoffeeScript16031136
CSS411668
YAML35049
XML10032
Bourne Shell618030
Ruby16122

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity114.00
▷ Minimum class complexity32.00
▷ Maximum class complexity292.00
Average method complexity4.65
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods186
▷ Static methods147.53%
▷ Public methods17694.62%
▷ Protected methods00.00%
▷ Private methods105.38%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icon64.png0.91KB0.77KB▼ 14.87%
img/icon32.png0.60KB0.50KB▼ 17.43%
screenshot-1.png59.46KB29.39KB▼ 50.58%
img/menu-icon.png1.07KB0.15KB▼ 86.00%