73% smart-brands-for-woocommerce

Code Review | Smart Brands for WooCommerce

WordPress plugin Smart Brands for WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: smart-brands-for-...
  • Plugin version: 1.0.8
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 18, 2022
  • Latest release: Nov 13, 2023
  • Number of updates: 17
  • Update frequency: every 25.4 days
  • Top authors: rubel_miah (76.47%)Shamimmiashuhagh (23.53%)shapedplugin (11.76%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /2,524 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: ▲1.14MB] [CPU: ▲6.88ms] Passed 4 tests

This is a short check of server-side resources used by Smart Brands for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.62 ▲1.1547.47 ▲6.52
Dashboard /wp-admin4.44 ▲1.1353.62 ▲6.45
Posts /wp-admin/edit.php4.55 ▲1.1958.79 ▲8.84
Add New Post /wp-admin/post-new.php7.03 ▲1.1494.17 ▲5.71
Media Library /wp-admin/upload.php4.36 ▲1.1346.89 ▲15.10
Help /wp-admin/edit.php?post_type=smart_brand_sc&page=brand_help4.2037.09
Settings /wp-admin/edit.php?post_type=smart_brand_sc&page=smart-brands-settings4.2032.99

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 133 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
sp_smart_brand_settings
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Smart Brands for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4214.31 ▲0.101.54 ▼0.2938.45 ▼9.29
Dashboard /wp-admin2,207 ▲275.74 ▲0.1289.21 ▼11.4241.58 ▼0.37
Posts /wp-admin/edit.php2,115 ▲122.02 ▲0.0135.11 ▼1.3634.61 ▲0.61
Add New Post /wp-admin/post-new.php6,213 ▲4,68726.24 ▲2.61855.63 ▲178.3168.76 ▲19.57
Media Library /wp-admin/upload.php1,412 ▲94.17 ▼0.0298.61 ▼1.1842.67 ▲0.24
Help /wp-admin/edit.php?post_type=smart_brand_sc&page=brand_help280.410.083.96
Settings /wp-admin/edit.php?post_type=smart_brand_sc&page=smart-brands-settings280.410.064.01

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • sp_smart_brand_settings
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means 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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/smart-brands-for-woocommerce/core/Admin/Brands/Brands.php
  • 88× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ShapedPlugin\\SmartBrands\\Frontend\\Manager' not found in wp-content/plugins/smart-brands-for-woocommerce/core/Frontend/templates/brand/brand.php:19
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/smart-brands-for-woocommerce/core/Frontend/partials/configurations.php on line 31
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/smart-brands-for-woocommerce/core/Frontend/partials/configurations.php on line 39
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/smart-brands-for-woocommerce/core/Frontend/partials/configurations.php on line 18
    • > PHP Notice
      Undefined variable: views_meta in wp-content/plugins/smart-brands-for-woocommerce/core/Frontend/partials/configurations.php on line 53
    • > PHP Notice
      Undefined variable: views_meta in wp-content/plugins/smart-brands-for-woocommerce/core/Frontend/partials/configurations.php on line 31
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/smart-brands-for-woocommerce/core/Frontend/partials/configurations.php on line 54
    • > PHP Notice
      Undefined variable: views_meta in wp-content/plugins/smart-brands-for-woocommerce/core/Frontend/partials/configurations.php on line 29
    • > PHP Notice
      Undefined variable: views_meta in wp-content/plugins/smart-brands-for-woocommerce/core/Frontend/partials/configurations.php on line 40
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/smart-brands-for-woocommerce/core/Frontend/partials/configurations.php on line 31

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/edit.php?post_type=smart_brand_sc&page=brand_help
    • > Network (severe)
    wp-admin/edit.php?post_type=smart_brand_sc&page=brand_help - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/edit.php?post_type=smart_brand_sc&page=smart-brands-settings
    • > Network (severe)
    wp-admin/edit.php?post_type=smart_brand_sc&page=smart-brands-settings - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Tags: There are too many tags (24 tag instead of maximum 10)
Please take inspiration from this readme.txt

smart-brands-for-woocommerce/smart-brands-for-woocommerce.php Passed 13 tests

The main PHP file in "Smart Brands for WooCommerce" ver. 1.0.8 adds more information about the plugin and also serves as the entry point for this plugin
139 characters long description:
Smart Brands for WooCommerce plugin allows you to add brands for products and gain credibility by displaying them in your WooCommerce shop.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin19,374 lines of code in 116 files:
LanguageFilesBlank linesComment linesLines of code
Sass1595534,819
PHP661,3552,6744,805
CSS147104423,968
JavaScript107982313,083
SVG10302,694
JSON1005

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity20.56
▷ Minimum class complexity1.00
▷ Maximum class complexity141.00
Average method complexity5.33
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces11
Interfaces0
Traits1
Classes44
▷ Abstract classes24.55%
▷ Concrete classes4295.45%
▷ Final classes00.00%
Methods206
▷ Static methods6230.10%
▷ Public methods19996.60%
▷ Protected methods00.00%
▷ Private methods73.40%
Functions23
▷ Named functions1982.61%
▷ Anonymous functions417.39%
Constants6
▷ Global constants6100.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
2 compressed PNG files occupy 0.02MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
core/Admin/Framework/assets/images/checkerboard.png1.26KB1.26KB0.31%
core/Admin/GutenbergBlock/assets/wp-brand-block-preview.png23.75KB25.04KB0.00%