10% ot-woocommerce-brands

Code Review | WooCommerce Brands

WordPress plugin WooCommerce Brands scored10%from 54 tests.

About plugin

  • Plugin page: ot-woocommerce-br...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.5
  • WordPress version: 6.3.1
  • First release: Sep 15, 2017
  • Latest release: Apr 19, 2018
  • Number of updates: 6
  • Update frequency: every 36.0 days
  • Top authors: caselock (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /955 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)

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

Server-side resources used by WooCommerce Brands
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.74 ▼3.78
Dashboard /wp-admin3.31 ▲0.0048.40 ▼7.14
Posts /wp-admin/edit.php3.36 ▲0.0051.90 ▲3.34
Add New Post /wp-admin/post-new.php5.89 ▲0.0094.45 ▼0.93
Media Library /wp-admin/upload.php3.23 ▲0.0036.04 ▼3.93

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

WooCommerce Brands: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼0.961.79 ▼0.1544.53 ▼0.78
Dashboard /wp-admin2,206 ▲185.90 ▲0.98106.90 ▲1.7539.32 ▲0.66
Posts /wp-admin/edit.php2,089 ▲32.03 ▲0.0239.27 ▲0.7236.85 ▲2.26
Add New Post /wp-admin/post-new.php1,533 ▼923.06 ▼0.10661.62 ▼46.8458.32 ▼4.20
Media Library /wp-admin/upload.php1,388 ▲34.19 ▼0.0994.85 ▼14.5943.10 ▼8.88

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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 fix the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otwcbr_e() in wp-content/plugins/ot-woocommerce-brands/otwoocommercebrands-options.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ot-woocommerce-brands/otwoocommercebrands-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/ot-woocommerce-brands/otwoocommercebrands.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 16 tag instead of maximum 10
Please take inspiration from this readme.txt

ot-woocommerce-brands/otwoocommercebrands.php 92% from 13 tests

The entry point to "WooCommerce Brands" version 1.1.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ot-woocommerce-brands.php" instead of "otwoocommercebrands.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected635 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP49518554
JavaScript15059
CSS10322

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity17.00
▷ Minimum class complexity3.00
▷ Maximum class complexity33.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods2496.00%
▷ Protected methods14.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin