78% mas-woocommerce-brands

Code Review | MAS Brands for WooCommerce

WordPress plugin MAS Brands for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: mas-woocommerce-b...
  • Plugin version: 1.0.7
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.0.1
  • WordPress version: 6.3.1
  • First release: Mar 23, 2020
  • Latest release: Oct 17, 2023
  • Number of updates: 17
  • Update frequency: every 76.8 days
  • Top authors: farookibrahim (58.82%)madrasthemes (35.29%)yousufansa (17.65%)

Code review

54 tests

User reviews

1 review

Install metrics

10,000+ active /153,161 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

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

This is a short check of server-side resources used by MAS Brands for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.60 ▼0.06
Dashboard /wp-admin3.32 ▼0.0346.56 ▼16.12
Posts /wp-admin/edit.php3.37 ▲0.0146.62 ▼0.58
Add New Post /wp-admin/post-new.php5.90 ▲0.0184.03 ▼16.07
Media Library /wp-admin/upload.php3.24 ▲0.0134.57 ▲1.79

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for MAS Brands for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.72 ▲0.371.68 ▲0.1244.63 ▲4.33
Dashboard /wp-admin2,198 ▲185.64 ▲0.0483.08 ▼5.9739.59 ▲0.08
Posts /wp-admin/edit.php2,100 ▲31.97 ▲0.0236.16 ▲1.3933.07 ▼5.36
Add New Post /wp-admin/post-new.php1,535 ▲718.19 ▼5.02612.30 ▼64.2163.79 ▲3.87
Media Library /wp-admin/upload.php1,394 ▼94.17 ▲0.0296.86 ▼2.3842.84 ▲3.04

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/mas-woocommerce-brands/templates/shortcodes/brands-a-z.php
  • 14× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: thumbnail in wp-content/plugins/mas-woocommerce-brands/templates/widgets/brand-description.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/mas-woocommerce-brands/templates/shortcodes/single-brand.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/mas-woocommerce-brands/includes/widgets/class-mas-wc-widget-brand-thumbnails.php:12
    • > PHP Notice
      Undefined variable: index in wp-content/plugins/mas-woocommerce-brands/templates/shortcodes/brands-a-z.php on line 25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_template() in wp-content/plugins/mas-woocommerce-brands/templates/widgets/brand-thumbnails.php:8
    • > PHP Notice
      Undefined variable: index in wp-content/plugins/mas-woocommerce-brands/templates/shortcodes/brands-a-z.php on line 14
    • > PHP Notice
      Undefined variable: columns in wp-content/plugins/mas-woocommerce-brands/templates/shortcodes/brand-thumbnails.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/mas-woocommerce-brands/includes/class-mas-wc-brands-admin-settings.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpautop() in wp-content/plugins/mas-woocommerce-brands/templates/widgets/brand-description.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_validate_boolean() in wp-content/plugins/mas-woocommerce-brands/templates/shortcodes/brand-thumbnails.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: woocommerce product attribute, woocommerce brands, woocommerce manufacturer, woocommerce, woocommerce product

mas-woocommerce-brands/mas-woocommerce-brands.php 92% from 13 tests

Analyzing the main PHP file in "MAS Brands for WooCommerce" version 1.0.7
The following require your attention:
  • 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 check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin1,914 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
Sass8297191988
PHP14248358883
JavaScript214841
CSS2002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity11.71
▷ Minimum class complexity4.00
▷ Maximum class complexity33.00
Average method complexity2.79
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes114.29%
Methods42
▷ Static methods716.67%
▷ Public methods4095.24%
▷ Protected methods00.00%
▷ Private methods24.76%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants5
▷ Global constants5100.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 files were detected