78% woocommerce-custom-tab-lite

Code Review | Woocommerce Custom Tab Lite

WordPress plugin Woocommerce Custom Tab Lite scored78%from 54 tests.

About plugin

  • Plugin page: woocommerce-custo...
  • Plugin version: 1.4.4
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0+
  • WordPress version: 6.3.1
  • First release: Jun 26, 2015
  • Latest release: Jan 24, 2020
  • Number of updates: 135
  • Update frequency: every 12.4 days
  • Top authors: phoeniixx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /7,611 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
Installer ran successfully

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

Analyzing server-side resources used by Woocommerce Custom Tab Lite
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.53 ▲3.48
Dashboard /wp-admin3.31 ▲0.0144.03 ▼6.00
Posts /wp-admin/edit.php3.36 ▲0.0145.52 ▼5.18
Add New Post /wp-admin/post-new.php5.89 ▲0.0188.51 ▼2.75
Media Library /wp-admin/upload.php3.23 ▲0.0135.86 ▲2.01

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Woocommerce Custom Tab Lite
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.19 ▼1.201.68 ▲0.0143.11 ▲3.96
Dashboard /wp-admin2,210 ▲194.86 ▼0.01107.61 ▲5.7643.19 ▲1.22
Posts /wp-admin/edit.php2,092 ▼02.01 ▲0.0139.99 ▼3.2836.16 ▼2.06
Add New Post /wp-admin/post-new.php1,546 ▲1818.45 ▲0.15588.61 ▼47.8363.53 ▲9.33
Media Library /wp-admin/upload.php1,392 ▲74.20 ▼0.0795.16 ▼5.4343.05 ▼1.87

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/woocommerce-custom-tab-lite/all_tabs.php
    • > /wp-content/plugins/woocommerce-custom-tab-lite/all-plugin.php
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/woocommerce-custom-tab-lite/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/woocommerce-custom-tab-lite/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/woocommerce-custom-tab-lite/wp_table.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/woocommerce-custom-tab-lite/tabs.php:95
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/woocommerce-custom-tab-lite/wp_table.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/woocommerce-custom-tab-lite/wctm_premium.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/woocommerce-custom-tab-lite/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/woocommerce-custom-tab-lite/wp_table.php on line 9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed: Please take inspiration from this readme.txt

woocommerce-custom-tab-lite/woocommerce_custom_tab_manager.php 85% from 13 tests

The entry point to "Woocommerce Custom Tab Lite" version 1.4.4 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woocommerce-custom-tab-lite.php" instead of "woocommerce_custom_tab_manager.php")
  • 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
No dangerous file extensions were detected2,480 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP116791,6992,461
JavaScript112019

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity44.38
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity4.15
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods110
▷ Static methods54.55%
▷ Public methods8779.09%
▷ Protected methods2320.91%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
13 PNG files occupy 0.25MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/image-frame-odd.png0.90KB0.81KB▼ 10.31%
images/logo-wp.png1.20KB0.57KB▼ 52.72%
images/premium-btn.png5.72KB5.28KB▼ 7.69%
images/Product_Specific.png38.66KB13.73KB▼ 64.48%
images/category_tab_option.png43.00KB13.01KB▼ 69.76%