68% perfect-woocommerce-brands

Code Review | Perfect Brands for WooCommerce

WordPress plugin Perfect Brands for WooCommerce scored68%from 54 tests.

About plugin

  • Plugin page: perfect-woocommer...
  • Plugin version: 3.2.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Jun 2, 2016
  • Latest release: Nov 13, 2023
  • Number of updates: 224
  • Update frequency: every 12.1 days
  • Top authors: quadlayers (84.38%)titodevera (15.63%)

Code review

54 tests

User reviews

375 reviews

Install metrics

60,000+ active /1,651,874 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.42MB] [CPU: ▲3.87ms] 75% from 4 tests

An overview of server-side resources used by Perfect Brands for WooCommerce
Please have a look at the following items
  • CPU: Try to keep total CPU usage under 500.00ms (currently 512.43ms on /wp-admin/admin.php?page=wc-settings_suggestions)
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4347.52 ▲7.86
Dashboard /wp-admin3.82 ▲0.5150.74 ▼2.43
Posts /wp-admin/edit.php3.82 ▲0.4653.73 ▲5.52
Add New Post /wp-admin/post-new.php6.29 ▲0.4095.17 ▲5.85
Media Library /wp-admin/upload.php3.63 ▲0.4039.83 ▲6.54
Suggestions /wp-admin/admin.php?page=wc-settings_suggestions4.13512.43

Server storage [IO: ▲0.83MB] [DB: ▲0.06MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 139 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
pwb_activate_on
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Perfect Brands for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,913 ▲15114.09 ▼0.621.72 ▲0.0840.86 ▼3.17
Dashboard /wp-admin2,321 ▲1445.62 ▲0.0391.97 ▼6.8642.48 ▼4.57
Posts /wp-admin/edit.php2,126 ▲261.97 ▼0.0639.91 ▲0.2236.51 ▲1.80
Add New Post /wp-admin/post-new.php1,549 ▲2223.33 ▲0.27630.34 ▼36.4354.17 ▼5.83
Media Library /wp-admin/upload.php1,428 ▲254.25 ▲0.0495.54 ▼10.3443.01 ▼1.13
Suggestions /wp-admin/admin.php?page=wc-settings_suggestions1,9512.4835.2152.44

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/perfect-woocommerce-brands/uninstall.php+19
    unlink(wp-content/uploads/pwb-export.json): No such file or directory
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • old_wc_pwb_admin_tab_slug
    • can_compress_scripts
    • pwb_activate_on

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 33× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/perfect-woocommerce-brands/lib/admin/class-brands-custom-fields.php
    • > /wp-content/plugins/perfect-woocommerce-brands/lib/admin/class-admin-tab.php
    • > /wp-content/plugins/perfect-woocommerce-brands/templates/widgets/filter-by-brand.php
    • > /wp-content/plugins/perfect-woocommerce-brands/lib/admin/class-exporter-support.php
    • > /wp-content/plugins/perfect-woocommerce-brands/lib/admin/class-system-status.php
    • > /wp-content/plugins/perfect-woocommerce-brands/lib/admin/class-edit-brands-page.php
    • > /wp-content/plugins/perfect-woocommerce-brands/lib/shortcodes/class-carousel.php
    • > /wp-content/plugins/perfect-woocommerce-brands/lib/admin/class-importer-support.php
    • > /wp-content/plugins/perfect-woocommerce-brands/templates/admin/brands-exporter.php
    • > /wp-content/plugins/perfect-woocommerce-brands/lib/shortcodes/class-brand.php
  • 13× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/perfect-woocommerce-brands/jetpack_vendor/quadlayers/wp-notice-plugin-promote/src/templates/notice.php:13
    • > PHP Fatal error
      Trait 'QuadLayers\\WP_Notice_Plugin_Promote\\Traits\\PluginActionsLinks' not found in wp-content/plugins/perfect-woocommerce-brands/jetpack_vendor/quadlayers/wp-notice-plugin-promote/src/Traits/PluginActions.php on line 20
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/perfect-woocommerce-brands/jetpack_vendor/quadlayers/wp-plugin-suggestions/src/Table.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/perfect-woocommerce-brands/jetpack_vendor/quadlayers/wp-plugin-suggestions/src/view/suggestions.php:21
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-plugin-install-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/perfect-woocommerce-brands/jetpack_vendor/quadlayers/wp-plugin-suggestions/src/Table.php on line 14
    • > PHP Fatal error
      Trait 'QuadLayers\\WP_Notice_Plugin_Promote\\Traits\\PluginActions' not found in wp-content/plugins/perfect-woocommerce-brands/jetpack_vendor/quadlayers/wp-notice-plugin-promote/src/PluginBySlugV2.php on line 20
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installer\\LibraryInstaller' not found in wp-content/plugins/perfect-woocommerce-brands/vendor/automattic/jetpack-composer-plugin/src/class-manager.php:18
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-plugin-install-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/perfect-woocommerce-brands/jetpack_vendor/quadlayers/wp-plugin-suggestions/src/Table.php on line 14
    • > PHP Fatal error
      Trait 'QuadLayers\\WP_Notice_Plugin_Promote\\Traits\\PluginDataByFile' not found in wp-content/plugins/perfect-woocommerce-brands/jetpack_vendor/quadlayers/wp-notice-plugin-promote/src/PluginByFile.php on line 20
    • > PHP Fatal error
      Trait 'QuadLayers\\WP_Notice_Plugin_Promote\\Traits\\PluginActions' not found in wp-content/plugins/perfect-woocommerce-brands/jetpack_vendor/quadlayers/wp-notice-plugin-promote/src/PluginBySlug.php on line 20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: woocommerce manufacturer, woocommerce, e-commerce, woocommerce product, woocommerce supplier...

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

The principal PHP file in "Perfect Brands for WooCommerce" v. 3.2.9 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Requires at least: Required version must match the one declared in readme.txt ("4.7" instead of "4.0")

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
Everything looks great! No dangerous files found in this plugin12,854 lines of code in 109 files:
LanguageFilesBlank linesComment linesLines of code
PHP801,1662,0016,071
JavaScript6498594,822
Markdown122700730
JSON100458
Sass2275266
LESS2236247
CSS4445239
SVG11013
Ruby1208

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity16.33
▷ Minimum class complexity1.00
▷ Maximum class complexity106.00
Average method complexity3.48
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces15
Interfaces0
Traits3
Classes43
▷ Abstract classes00.00%
▷ Concrete classes43100.00%
▷ Final classes12.33%
Methods276
▷ Static methods7125.72%
▷ Public methods22782.25%
▷ Protected methods20.72%
▷ Private methods4717.03%
Functions21
▷ Named functions14.76%
▷ Anonymous functions2095.24%
Constants26
▷ Global constants26100.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
10 compressed PNG files occupy 0.07MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/frontend/img/dummy-data/brand2.png5.92KB6.65KB0.00%
assets/frontend/img/dummy-data/brand5.png6.28KB7.01KB0.00%
assets/frontend/img/dummy-data/brand10.png7.90KB8.81KB0.00%
assets/frontend/img/dummy-data/brand4.png7.60KB8.64KB0.00%
assets/frontend/img/dummy-data/brand8.png7.26KB8.13KB0.00%