84% komparu-comparison-module

Code Review | Komparu Comparison Module

WordPress plugin Komparu Comparison Module scored84%from 54 tests.

About plugin

  • Plugin page: komparu-compariso...
  • Plugin version: 1.0.33
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.9.8
  • WordPress version: 6.3.1
  • First release: Jun 19, 2015
  • Latest release: Oct 2, 2018
  • Number of updates: 91
  • Update frequency: every 13.2 days
  • Top authors: komparu (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /3,531 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.01MB] [CPU: ▼6.90ms] Passed 4 tests

A check of server-side resources used by Komparu Comparison Module
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0037.78 ▲1.72
Dashboard /wp-admin3.31 ▼0.0445.27 ▼12.51
Posts /wp-admin/edit.php3.36 ▲0.0045.33 ▼3.31
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.48 ▼13.49
Media Library /wp-admin/upload.php3.23 ▲0.0035.08 ▲3.13

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 969 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Komparu Comparison Module
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.27 ▼1.294.82 ▲2.9839.20 ▼0.97
Dashboard /wp-admin2,206 ▲204.84 ▼0.0997.79 ▼16.9538.15 ▼4.33
Posts /wp-admin/edit.php2,071 ▼182.06 ▲0.0435.30 ▼6.5233.97 ▼1.74
Add New Post /wp-admin/post-new.php1,542 ▲918.21 ▼5.08610.08 ▼62.8650.51 ▼2.48
Media Library /wp-admin/upload.php1,388 ▲34.19 ▼0.00101.57 ▲2.2841.99 ▼3.27

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 fix the following
  • 444× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Test' not found in wp-content/plugins/komparu-comparison-module/vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/komparu-comparison-module/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Extension' not found in wp-content/plugins/komparu-comparison-module/vendor/twig/twig/lib/Twig/Extension/Optimizer.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Test_NodeTestCase' not found in wp-content/plugins/komparu-comparison-module/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/komparu-comparison-module/vendor/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/komparu-comparison-module/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php:12
    • > PHP Fatal error
      Trait 'React\\Promise\\PromiseTest\\PromisePendingTestTrait' not found in wp-content/plugins/komparu-comparison-module/vendor/react/promise/tests/PromiseTest/FullTestTrait.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/komparu-comparison-module/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Test_NodeTestCase' not found in wp-content/plugins/komparu-comparison-module/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/komparu-comparison-module/vendor/composer/installers/src/Composer/Installers/TuskInstaller.php:7

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

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
2 plugin tags: compare, komparu

komparu-comparison-module/plugin.php 92% from 13 tests

Analyzing the main PHP file in "Komparu Comparison Module" version 1.0.33
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("komparu-comparison-module.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected41,887 lines of code in 703 files:
LanguageFilesBlank linesComment linesLines of code
PHP5536,81011,88033,231
reStructuredText972,4552,3143,558
Markdown772902,788
C1166150793
JSON900711
JavaScript21860196
make3415172
YAML6333147
XML560103
CSS29097
Twig54040
Python14019
HTML100016
C/C++ Header171311
m41215

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.54
▷ Minimum class complexity1.00
▷ Maximum class complexity116.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces32
Interfaces43
Traits16
Classes500
▷ Abstract classes204.00%
▷ Concrete classes48096.00%
▷ Final classes30.62%
Methods2,771
▷ Static methods1043.75%
▷ Public methods2,50490.36%
▷ Protected methods1605.77%
▷ Private methods1073.86%
Functions382
▷ Named functions6617.28%
▷ Anonymous functions31682.72%
Constants54
▷ Global constants23.70%
▷ Class constants5296.30%
▷ Public constants52100.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
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugin/assets/gfx/refresh.png0.63KB0.51KB▼ 19.69%
plugin/assets/gfx/copy.png1.10KB0.20KB▼ 82.13%
plugin/assets/gfx/icon.png1.60KB0.81KB▼ 49.60%