84% commission-widget-for-dokan

Code Review | Commission Widget for Dokan

WordPress plugin Commission Widget for Dokan scored 84% from 54 tests.

About plugin

  • Plugin page: commission-widget...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.0.2
  • WordPress version: 6.3.1
  • First release: Dec 30, 2018
  • Latest release: Dec 30, 2018
  • Number of updates: 6
  • Update frequency: every 1.8 days
  • Top authors: Lucyproductionz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 1,874 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

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

A check of server-side resources used by Commission Widget for Dokan
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.08 ▼3.73
Dashboard /wp-admin3.32 ▲0.0144.91 ▼3.38
Posts /wp-admin/edit.php3.37 ▲0.0140.36 ▼7.10
Add New Post /wp-admin/post-new.php5.90 ▲0.01100.82 ▼3.32
Media Library /wp-admin/upload.php3.24 ▲0.0138.43 ▲3.99

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Commission Widget for Dokan
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲5413.23 ▼1.421.69 ▼0.3043.91 ▲5.36
Dashboard /wp-admin2,228 ▲405.84 ▲0.96113.31 ▼0.8647.28 ▲6.47
Posts /wp-admin/edit.php2,114 ▲252.00 ▲0.0036.74 ▼3.6433.93 ▼1.97
Add New Post /wp-admin/post-new.php1,562 ▲2923.20 ▲0.03725.73 ▲88.9056.00 ▲15.26
Media Library /wp-admin/upload.php1,413 ▲284.25 ▲0.04109.91 ▼4.9951.82 ▼0.81

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

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 everything seems fine, this is not 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 take a closer look at the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/commission-widget-for-dokan/templates/dashboard/commission-widget.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/commission-widget-for-dokan/commissionwidgetfordokan.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Dokan_Template_Dashboard' not found in wp-content/plugins/commission-widget-for-dokan/classes/dashboard.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed: The official readme.txt is a good inspiration

commission-widget-for-dokan/commissionwidgetfordokan.php 92% from 13 tests

The entry point to "Commission Widget for Dokan" version 1.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("commission-widget-for-dokan.php" instead of "commissionwidgetfordokan.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin186 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP361179186

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity9.50
▷ Minimum class complexity5.00
▷ Maximum class complexity14.00
Average method complexity1.85
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods210.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
There are no PNG files in this plugin