78% woocommerce-custom-tabs

Code Review | Woocommerce Custom Tabs

WordPress plugin Woocommerce Custom Tabs scored78%from 54 tests.

About plugin

  • Plugin page: woocommerce-custo...
  • Plugin version: 1.0.29
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-5.4
  • WordPress version: 6.3.1
  • First release: Jan 25, 2014
  • Latest release: May 6, 2020
  • Number of updates: 64
  • Update frequency: every 35.8 days
  • Top authors: WebshopLogic (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

1,000+ active /67,886 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲1.05MB] [CPU: ▼5.10ms] Passed 4 tests

An overview of server-side resources used by Woocommerce Custom Tabs
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.44 ▲0.9844.55 ▲0.97
Dashboard /wp-admin4.33 ▲1.0353.68 ▲5.07
Posts /wp-admin/edit.php4.45 ▲1.0955.49 ▼3.06
Add New Post /wp-admin/post-new.php7.02 ▲1.1388.73 ▼23.39
Media Library /wp-admin/upload.php4.34 ▲1.1145.38 ▲9.98
WooCommerce Custom Tabs /wp-admin/options-general.php?page=woocommerce_custom_tabs4.2037.37

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 264 new files
Database: no new tables, 9 new options
New WordPress options
can_compress_scripts
acf_version
recovery_mode_email_last_sent
theysaidso_admin_options
widget_recent-posts
wct_general_settings
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Woocommerce Custom Tabs
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲7614.37 ▲0.172.14 ▲0.2444.75 ▼2.93
Dashboard /wp-admin2,206 ▲265.62 ▼0.0894.79 ▲1.8041.37 ▼11.10
Posts /wp-admin/edit.php2,105 ▲22.01 ▲0.0534.26 ▼7.1334.27 ▼4.97
Add New Post /wp-admin/post-new.php6,660 ▲5,13427.75 ▲4.591,031.65 ▲310.9238.79 ▼18.10
Media Library /wp-admin/upload.php1,943 ▲5438.14 ▲3.96207.18 ▲98.4148.45 ▼1.53
WooCommerce Custom Tabs /wp-admin/options-general.php?page=woocommerce_custom_tabs6891.127.5117.49

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 9 options
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • recovery_mode_email_last_sent
    • wct_general_settings
    • widget_recent-posts
    • acf_version

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=woocommerce_custom_tabs
    • > Error in wp-content/plugins/woocommerce-custom-tabs/wct-admin-page.php+124
    Uncaught Error: Call to undefined function showAdminMessage() in wp-content/plugins/woocommerce-custom-tabs/wct-admin-page.php:124
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): WCT_Admin_Page->add_options_page_callback()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #5 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 80× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/woocommerce-custom-tabs/advanced-custom-fields/includes/admin/views/html-location-rule.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function acf_idify() in wp-content/plugins/woocommerce-custom-tabs/advanced-custom-fields/includes/admin/views/field-group-field.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/woocommerce-custom-tabs/advanced-custom-fields/includes/fields/class-acf-field-email.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/woocommerce-custom-tabs/advanced-custom-fields/includes/fields/class-acf-field-google-map.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/woocommerce-custom-tabs/advanced-custom-fields/includes/fields/class-acf-field-wysiwyg.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/woocommerce-custom-tabs/advanced-custom-fields/includes/fields/class-acf-field-oembed.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/woocommerce-custom-tabs/advanced-custom-fields/includes/fields/class-acf-field-accordion.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/woocommerce-custom-tabs/advanced-custom-fields/includes/fields/class-acf-field-textarea.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/woocommerce-custom-tabs/advanced-custom-fields/includes/fields/class-acf-field-group.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function acf_register_store() in wp-content/plugins/woocommerce-custom-tabs/advanced-custom-fields/includes/acf-value-functions.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: custom tab, woocommerce product tabs, product tab, woocommerce

woocommerce-custom-tabs/woocommerce-custom-tabs.php 92% from 13 tests

"Woocommerce Custom Tabs" version 1.0.29's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
Success! There were no dangerous files found in this plugin90,189 lines of code in 203 files:
LanguageFilesBlank linesComment linesLines of code
PO File3423,34038,17349,276
JavaScript136,7116,57722,234
PHP13911,26118,08016,833
CSS13210611,650
JSON100124
Markdown230042
SVG118030

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity12.80
▷ Minimum class complexity1.00
▷ Maximum class complexity56.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes108
▷ Abstract classes00.00%
▷ Concrete classes108100.00%
▷ Final classes00.00%
Methods728
▷ Static methods60.82%
▷ Public methods72799.86%
▷ Protected methods00.00%
▷ Private methods10.14%
Functions422
▷ Named functions422100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.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
14 compressed PNG files occupy 0.23MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
advanced-custom-fields/assets/inc/datepicker/images/ui-bg_highlight-soft_0_ffffff_1x100.png0.08KB0.08KB0.00%
advanced-custom-fields/assets/inc/select2/3/select2.png0.51KB0.99KB0.00%
images/WCT_product_box_RIGHT_PRO_v1_235x235.png57.59KB18.53KB▼ 67.81%
advanced-custom-fields/assets/inc/datepicker/images/ui-icons_ffffff_256x240.png3.68KB4.17KB0.00%
advanced-custom-fields/assets/inc/datepicker/images/ui-icons_DDDDDD_256x240.png3.68KB4.17KB0.00%