10% premmerce-woocommerce-brands

Code Review | Premmerce Brands for WooCommerce

WordPress plugin Premmerce Brands for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: premmerce-woocomm...
  • Plugin version: 1.2.13
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Sep 18, 2017
  • Latest release: Aug 11, 2023
  • Number of updates: 33
  • Update frequency: every 65.3 days
  • Top authors: premmerce (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

4,000+ active /45,301 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.

Server metrics [RAM: ▲4.97MB] [CPU: ▲15.77ms] 75% from 4 tests

This is a short check of server-side resources used by Premmerce Brands for WooCommerce
The following require your attention
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,853.57ms on /wp-admin/admin.php?page=premmerce-woocommerce-brands)
PageMemory (MB)CPU Time (ms)
Home /8.85 ▲5.3862.33 ▲23.66
Dashboard /wp-admin8.87 ▲5.5269.93 ▲7.13
Posts /wp-admin/edit.php8.87 ▲5.5170.06 ▲22.53
Add New Post /wp-admin/post-new.php9.34 ▲3.46107.49 ▲9.77
Media Library /wp-admin/upload.php8.87 ▲5.6477.02 ▲42.75
Premmerce Brands for WooCommerce /wp-admin/admin.php?page=premmerce-woocommerce-brands8.871,853.57
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.8769.76

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Premmerce Brands for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲6714.22 ▼0.181.69 ▼0.0628.10 ▼10.84
Dashboard /wp-admin2,219 ▲425.66 ▲0.0083.14 ▼9.1840.33 ▼0.73
Posts /wp-admin/edit.php2,124 ▲242.10 ▲0.1238.08 ▼2.7635.14 ▼3.10
Add New Post /wp-admin/post-new.php1,537 ▲1123.04 ▼0.53615.03 ▼20.3247.68 ▼15.36
Media Library /wp-admin/upload.php1,424 ▲274.22 ▲0.03100.96 ▼5.5145.54 ▲1.27
Premmerce Brands for WooCommerce /wp-admin/admin.php?page=premmerce-woocommerce-brands9771.6528.8862.81
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0541.7028.8429.53

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.
  • The uninstall procedure has failed, leaving 9 options in the database
    • can_compress_scripts
    • fs_accounts
    • widget_recent-comments
    • fs_debug_mode
    • fs_active_plugins
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Interface 'Premmerce\\SDK\\V2\\Plugin\\PluginInterface' not found in wp-content/plugins/premmerce-woocommerce-brands/src/BrandsPlugin.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/premmerce-woocommerce-brands/src/Frontend/Widgets/BrandsWidget.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: woocommerce brands, product brands, brands

premmerce-woocommerce-brands/premmerce-brands.php 77% from 13 tests

The main file in "Premmerce Brands for WooCommerce" v. 1.2.13 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("premmerce-woocommerce-brands.php" instead of "premmerce-brands.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("4.8" instead of "3.0.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected35,302 lines of code in 176 files:
LanguageFilesBlank linesComment linesLines of code
PHP1488,32217,88634,303
Markdown21210284
JavaScript55667282
PO File3122209264
CSS16186109
JSON20060

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please tend to the following items
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity78.42
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.46
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces9
Interfaces1
Traits0
Classes58
▷ Abstract classes23.45%
▷ Concrete classes5696.55%
▷ Final classes00.00%
Methods1,357
▷ Static methods21816.06%
▷ Public methods96070.74%
▷ Protected methods171.25%
▷ Private methods38028.00%
Functions107
▷ Named functions10093.46%
▷ Anonymous functions76.54%
Constants150
▷ Global constants9865.33%
▷ Class constants5234.67%
▷ Public constants52100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/frontend/img/placeholder.png15.49KB5.17KB▼ 66.65%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/premmerce-woocommerce-brands.png7.63KB4.09KB▼ 46.39%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%