84% wc-brand

Code Review | Woocommerce Brand

WordPress plugin Woocommerce Brand scored 84% from 54 tests.

About plugin

  • Plugin page: wc-brand
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.8.1
  • WordPress version: 6.3.1
  • First release: Jun 10, 2015
  • Latest release: Dec 7, 2016
  • Number of updates: 8
  • Update frequency: every 102.3 days
  • Top authors: iwcontribution (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active / 6,169 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

A check of server-side resources used by Woocommerce Brand
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0045.69 ▲7.64
Dashboard /wp-admin3.31 ▲0.0052.80 ▼3.72
Posts /wp-admin/edit.php3.36 ▲0.0056.35 ▲0.70
Add New Post /wp-admin/post-new.php5.89 ▲0.00100.70 ▲5.70
Media Library /wp-admin/upload.php3.23 ▲0.0035.50 ▼1.71

Server storage [IO: ▲0.29MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Woocommerce Brand
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲1113.29 ▼1.511.81 ▼0.0442.26 ▼4.49
Dashboard /wp-admin2,206 ▼05.92 ▲1.03110.54 ▼0.1841.09 ▼2.11
Posts /wp-admin/edit.php2,092 ▼02.05 ▲0.0039.75 ▲0.4438.38 ▲2.84
Add New Post /wp-admin/post-new.php1,534 ▲123.49 ▲0.26608.87 ▼129.6544.67 ▼20.97
Media Library /wp-admin/upload.php1,388 ▼04.17 ▼0.0797.19 ▲1.6640.87 ▼0.48

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • 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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wc-brand/class/widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/wc-brand/woocommerce-brand.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

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: woocommerce, woocommerce brand, woocommerce extension, brand

wc-brand/woocommerce-brand.php 92% from 13 tests

Analyzing the main PHP file in "Woocommerce Brand" version 1.0.0
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wc-brand.php" instead of "woocommerce-brand.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin4,094 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript22815531,932
CSS470741,606
PHP36963556

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity30.00
▷ Minimum class complexity30.00
▷ Maximum class complexity30.00
Average method complexity8.25
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected