93% diffen

Code Review | Diffen

WordPress plugin Diffen scored 93% from 54 tests.

About plugin

  • Plugin page: diffen
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1
  • WordPress version: 5.8.1
  • First release: Mar 22, 2013
  • Latest release: Dec 18, 2014
  • Number of updates: 30
  • Update frequency: every 21.2 days
  • Top authors: jasuja (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,937 total downloads

Benchmarks

Plugin footprint Passed 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.02MB] [CPU: ▼147.44ms] Passed 4 tests

A check of server-side resources used by Diffen
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1439.89 ▲14.02
Dashboard /wp-admin3.08 ▲0.0351.15 ▼3.11
Posts /wp-admin/edit.php3.13 ▲0.0252.09 ▼5.38
Add New Post /wp-admin/post-new.php5.44 ▲0.0198.78 ▼585.33
Media Library /wp-admin/upload.php3.02 ▲0.0238.39 ▲4.06

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Diffen
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,705 ▲6815.99 ▲0.3813.84 ▲2.9248.64 ▲2.02
Dashboard /wp-admin2,969 ▲326.13 ▲0.15145.35 ▼24.80123.72 ▼3.89
Posts /wp-admin/edit.php2,741 ▲22.73 ▲0.0173.73 ▲8.9794.67 ▼4.94
Add New Post /wp-admin/post-new.php1,617 ▼6620.93 ▲2.73286.79 ▼103.26115.98 ▼4.77
Media Library /wp-admin/upload.php1,806 ▼15.04 ▼0.01153.60 ▲7.48131.40 ▼4.03

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller 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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'DiffenComparisonToolPlugin' not found in wp-content/plugins/diffen/action.api.php:16
    • > PHP Notice
      Undefined index: diffen_comp1 in wp-content/plugins/diffen/action.api.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_script() in wp-content/plugins/diffen/view.form.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/diffen/plugin.diffen.php:15
    • > PHP Notice
      Undefined index: diffen_comp2 in wp-content/plugins/diffen/action.api.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: There are too many tags (15 tag instead of maximum 10)
The official readme.txt might help

diffen/plugin.diffen.php 85% from 13 tests

The entry point to "Diffen" version 2.1 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 149 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("diffen.php" instead of "plugin.diffen.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected317 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP32958190
JavaScript1414127

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.09
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods11100.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
There are no PNG files in this plugin