84% woocommerce-groups-by-sales

Code Review | Woocommerce Groups by Sales

WordPress plugin Woocommerce Groups by Sales scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-group...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.6
  • WordPress version: 6.3.1
  • First release: Jun 29, 2015
  • Latest release: Aug 20, 2016
  • Number of updates: 6
  • Update frequency: every 70.5 days
  • Top authors: eggemplo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,200 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼9.46ms] Passed 4 tests

This is a short check of server-side resources used by Woocommerce Groups by Sales
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.14 ▼7.05
Dashboard /wp-admin3.31 ▼0.0441.07 ▼19.38
Posts /wp-admin/edit.php3.36 ▲0.0044.64 ▲0.89
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.35 ▼11.79
Media Library /wp-admin/upload.php3.23 ▲0.0033.49 ▲0.39

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Woocommerce Groups by Sales
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.22 ▼1.431.87 ▼0.2238.65 ▼6.22
Dashboard /wp-admin2,206 ▲215.83 ▼0.05101.03 ▼8.2339.05 ▼5.71
Posts /wp-admin/edit.php2,089 ▼02.04 ▼0.0034.94 ▲0.4632.27 ▼2.35
Add New Post /wp-admin/post-new.php1,533 ▲523.31 ▲0.09652.47 ▼49.5252.49 ▼3.29
Media Library /wp-admin/upload.php1,388 ▼04.18 ▼0.0995.16 ▼2.9945.30 ▲1.23

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/woocommerce-groups-by-sales/woo-groups-by-sales-light.php on line 36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-groups-by-sales/core/class-woogroupsbysaleslight.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/woocommerce-groups-by-sales/woo-groups-by-sales-light.php:39

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Settings - The settings page.), #2 (Users - See a customer added to multiple groups.)
You can take inspiration from this readme.txt

woocommerce-groups-by-sales/woo-groups-by-sales-light.php 92% from 13 tests

The main PHP script in "Woocommerce Groups by Sales" version 1.2 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woocommerce-groups-by-sales.php" instead of "woo-groups-by-sales-light.php")

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 plugin318 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP27590269
PO File14410149

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity24.00
▷ Minimum class complexity21.00
▷ Maximum class complexity27.00
Average method complexity3.88
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods16100.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
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 PNG files occupy 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png28.27KB7.89KB▼ 72.10%
screenshot-2.png35.15KB9.80KB▼ 72.12%