74% woo-product-front-fields

Code Review | WooCommerce Product Front Fields

WordPress plugin WooCommerce Product Front Fields scored74%from 54 tests.

About plugin

  • Plugin page: woo-product-front...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Oct 15, 2018
  • Latest release: Oct 23, 2018
  • Number of updates: 7
  • Update frequency: every 1.6 days
  • Top authors: aposidelov (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /673 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼14.01ms] Passed 4 tests

Server-side resources used by WooCommerce Product Front Fields
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0140.20 ▼6.11
Dashboard /wp-admin3.32 ▼0.0351.85 ▼21.83
Posts /wp-admin/edit.php3.37 ▲0.0154.08 ▲4.12
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.15 ▼26.94
Media Library /wp-admin/upload.php3.24 ▲0.0137.28 ▼1.16

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 412 new files
Database: 4 new tables, 15 new options
New tables
wp_wpf_fields_products
wp_wpf_fields
wp_wpf_fields_products_options
wp_wpf_fields_options
New WordPress options
wpf_base_price_info
wpf_checkbox_is_checked_label
db_upgraded
wpf_radio_field_empty_label
wpf_product_teaser_button_text
wpf_field_profile_show_links
widget_theysaidso_widget
wpf_select_field_empty_label
can_compress_scripts
wpf_field_profiles
...

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Product Front Fields
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲3914.28 ▼0.101.72 ▼0.0545.13 ▲2.65
Dashboard /wp-admin2,200 ▲205.55 ▼0.1384.28 ▼7.5041.03 ▼2.86
Posts /wp-admin/edit.php2,112 ▲122.02 ▲0.0239.05 ▲3.8535.50 ▲0.32
Add New Post /wp-admin/post-new.php1,539 ▲1022.96 ▼0.01673.00 ▼9.7560.49 ▼9.43
Media Library /wp-admin/upload.php1,411 ▲144.31 ▲0.13100.19 ▼15.5042.75 ▼4.95

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure failed, leaving 4 tables in the database
    • wp_wpf_fields_products_options
    • wp_wpf_fields_products
    • wp_wpf_fields
    • wp_wpf_fields_options
  • Zombie WordPress options detected upon uninstall: 15 options
    • wpf_base_price_label
    • wpf_field_profile_show_links
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • wpf_select_field_empty_label
    • wpf_field_profiles
    • wpf_fields_location
    • wpf_base_price_info
    • widget_theysaidso_widget
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
  • 37× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/woo-product-front-fields/libs/cmb2/includes/CMB2_hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller' not found in wp-content/plugins/woo-product-front-fields/libs/cmb2/includes/rest-api/CMB2_REST_Controller_Boxes.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/woo-product-front-fields/libs/cmb2/includes/types/CMB2_Type_Multi_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/woo-product-front-fields/libs/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-product-front-fields/libs/cmb2/init.php:127
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/woo-product-front-fields/libs/cmb2/includes/types/CMB2_Type_File_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Select' not found in wp-content/plugins/woo-product-front-fields/libs/cmb2/includes/types/CMB2_Type_Select_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/woo-product-front-fields/libs/cmb2/includes/types/CMB2_Type_Colorpicker.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-product-front-fields/libs/cmb2/includes/helper-functions.php:127
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/woo-product-front-fields/libs/cmb2/includes/types/CMB2_Type_Select.php:13

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
10 plugin tags: custom options, extra product options, custom product option, woocommerce product, price options...

woo-product-front-fields/woo-product-front-fields.php 92% from 13 tests

The main file in "WooCommerce Product Front Fields" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • 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 Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin50,174 lines of code in 264 files:
LanguageFilesBlank linesComment linesLines of code
PO File12013,78717,89031,582
PHP1042,4927,15511,093
CSS171,1291,1745,225
JavaScript183615621,934
LESS4571285
Markdown112055

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity15.48
▷ Minimum class complexity1.00
▷ Maximum class complexity182.00
Average method complexity2.96
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes111
▷ Abstract classes1311.71%
▷ Concrete classes9888.29%
▷ Final classes00.00%
Methods818
▷ Static methods9211.25%
▷ Public methods69685.09%
▷ Protected methods9111.12%
▷ Private methods313.79%
Functions83
▷ Named functions7995.18%
▷ Anonymous functions44.82%
Constants25
▷ Global constants416.00%
▷ Class constants2184.00%
▷ Public constants21100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
14 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
libs/cmb2/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
libs/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
libs/cmb2/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
libs/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
libs/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%