83% custom-dokan-fields

Code Review | Custom Dokan Fields

WordPress plugin Custom Dokan Fields scored83%from 54 tests.

About plugin

  • Plugin page: custom-dokan-fields
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 10, 2023
  • Latest release: Mar 10, 2023
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: phppoet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /313 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
Install script ran successfully

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

Server-side resources used by Custom Dokan Fields
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.32 ▼20.56
Dashboard /wp-admin3.32 ▲0.0154.07 ▲2.19
Posts /wp-admin/edit.php3.37 ▲0.0149.46 ▼2.96
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.01 ▼17.43
Media Library /wp-admin/upload.php3.24 ▲0.0136.33 ▼2.34

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Custom Dokan Fields
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.67 ▼0.761.65 ▼0.4341.45 ▼1.20
Dashboard /wp-admin2,200 ▲125.84 ▲0.79116.32 ▲6.6243.26 ▲2.30
Posts /wp-admin/edit.php2,092 ▼02.02 ▲0.0238.05 ▼10.2433.51 ▼2.29
Add New Post /wp-admin/post-new.php1,533 ▲1323.11 ▲0.12636.90 ▼6.0753.07 ▲0.81
Media Library /wp-admin/upload.php1,385 ▼34.31 ▲0.03106.41 ▼7.2845.50 ▼0.43

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Roles' not found in wp-content/plugins/custom-dokan-fields/include/admin/forms/dcfpp_show_new_form.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/custom-dokan-fields/include/admin/forms/dcfpp_admin_billing_fields_form.php:6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/custom-dokan-fields/include/admin/forms/dcfpp_admin_extra_fields_form.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-dokan-fields/include/admin/dcfpp_admin_settings.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-dokan-fields/include/update_checkout_fields_class.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/custom-dokan-fields/include/manage_extrafield_class.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (2.), #3 (4.)
The official readme.txt is a good inspiration

custom-dokan-fields/custom-dokan-fields.php 85% from 13 tests

The entry point to "Custom Dokan Fields" version 1.0.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.0" instead of "3.3")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected16,326 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
CSS9223758,513
JavaScript101,2013755,342
PHP81,3481092,242
SVG100229

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 107)
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity83.33
▷ Minimum class complexity23.00
▷ Maximum class complexity135.00
Average method complexity8.26
▷ Minimum method complexity1.00
▷ Maximum method complexity107.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods34
▷ Static methods00.00%
▷ Public methods34100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
3 compressed PNG files occupy 0.01MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/chosen-sprite.png0.63KB0.88KB0.00%
assets/css/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
assets/images/icon.png0.75KB0.92KB0.00%