78% custom-products-fields-woo

Code Review | custom products fields woo

WordPress plugin custom products fields woo scored78%from 54 tests.

About plugin

  • Plugin page: custom-products-f...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Sep 23, 2016
  • Latest release: Sep 26, 2016
  • Number of updates: 11
  • Update frequency: every 0.3 days
  • Top authors: joydipme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,102 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼5.18ms] Passed 4 tests

Server-side resources used by custom products fields woo
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0935.11 ▼1.46
Dashboard /wp-admin3.39 ▲0.0553.70 ▼4.93
Posts /wp-admin/edit.php3.45 ▲0.0947.10 ▲4.57
Add New Post /wp-admin/post-new.php5.97 ▲0.0976.35 ▼14.31
Media Library /wp-admin/upload.php3.32 ▲0.0932.38 ▼0.03
woo_custom_products_fields /wp-admin/options-general.php?page=woo_custom_products_fields3.2829.46

Server storage [IO: ▲0.02MB] [DB: ▲0.50MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for custom products fields woo
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,775 ▲2914.71 ▲0.331.66 ▲0.0337.99 ▼2.74
Dashboard /wp-admin2,209 ▲355.76 ▲0.2296.73 ▲11.6842.99 ▼1.99
Posts /wp-admin/edit.php2,104 ▲42.03 ▲0.0543.17 ▲6.3136.77 ▲4.26
Add New Post /wp-admin/post-new.php1,539 ▲1118.20 ▼4.84596.20 ▼80.6566.67 ▲6.41
Media Library /wp-admin/upload.php1,401 ▲14.24 ▼0.08100.75 ▲0.7443.16 ▼3.32
woo_custom_products_fields /wp-admin/options-general.php?page=woo_custom_products_fields6971.516.0021.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=woo_custom_products_fields
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/custom-products-fields-woo/templates/settings.php on line 5 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/custom-products-fields-woo/templates/settings.php(5): do_settings_fields()
    #1 wp-content/plugins/custom-products-fields-woo/woo_custom_products_fields.php(70): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(310): woo_custom_products_fields->plugin_settings_page()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #7 {main}
    thrown

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 take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/custom-products-fields-woo/templates/settings.php:4

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 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Requires at least: Invalid plugin version format
  • Tested up to: Invalid plugin version format
The official readme.txt is a good inspiration

custom-products-fields-woo/woo_custom_products_fields.php 92% from 13 tests

Analyzing the main PHP file in "custom products fields woo" version 1.0
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("custom-products-fields-woo.php" instead of "woo_custom_products_fields.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin384 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP34779384

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.17
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.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
No PNG images were found in this plugin