10% smart-tools-for-woocommerce

Code Review | Constellation: Smart Tools for WooCommerce

WordPress plugin Constellation: Smart Tools for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: smart-tools-for-w...
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-5.8.1
  • WordPress version: 6.3.1
  • First release: Oct 1, 2021
  • Latest release: Apr 23, 2022
  • Number of updates: 9
  • Update frequency: every 23.0 days
  • Top authors: elnath78 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,459 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • The plugin did not install without errors
    • > Error in wp-content/plugins/smart-tools-for-woocommerce/includes/stwc_functions.php+22
    Uncaught Error: Call to undefined function wp_get_active_network_plugins() in wp-content/plugins/smart-tools-for-woocommerce/includes/stwc_functions.php:22
    Stack trace:
    #0 wp-content/plugins/smart-tools-for-woocommerce/constellation-smart-tools-for-woocommerce.php(126): stwc_activation_check()
    #1 wp-includes/class-wp-hook.php(310): stwc_activation()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/includes/plugin.php(693): do_action()

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

A check of server-side resources used by Constellation: Smart Tools for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.0040.78 ▼5.50
Dashboard /wp-admin3.57 ▼0.0649.95 ▼17.32
Posts /wp-admin/edit.php3.68 ▲0.0055.69 ▲6.06
Add New Post /wp-admin/post-new.php6.15 ▲0.0087.39 ▼28.70
Media Library /wp-admin/upload.php3.49 ▲0.0040.40 ▲0.06

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 190 new files
Database: no new tables, 10 new options
New WordPress options
fs_accounts
can_compress_scripts
fs_gdpr
db_upgraded
fs_debug_mode
widget_theysaidso_widget
theysaidso_admin_options
fs_active_plugins
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Constellation: Smart Tools for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲1814.75 ▲0.441.76 ▼0.1043.26 ▲1.76
Dashboard /wp-admin2,195 ▲185.60 ▼0.0686.33 ▼4.7639.07 ▼5.54
Posts /wp-admin/edit.php2,097 ▼32.02 ▼0.0239.50 ▼0.9236.55 ▲1.38
Add New Post /wp-admin/post-new.php1,545 ▼523.12 ▼0.32596.70 ▼105.4846.96 ▼10.98
Media Library /wp-admin/upload.php1,403 ▲34.25 ▲0.0296.61 ▼11.9842.53 ▼4.70

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 10 options in the database
    • fs_active_plugins
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • fs_gdpr
    • fs_debug_mode
    • fs_accounts
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/smart-tools-for-woocommerce/includes/stwc_functions.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/smart-tools-for-woocommerce/includes/stwc_process.php:3

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 an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: buynow, vat, shop, woocommerce, gdpr

smart-tools-for-woocommerce/constellation-smart-tools-for-woocommerce.php 92% from 13 tests

This is the main PHP file of "Constellation: Smart Tools for WooCommerce" version 1.1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("smart-tools-for-woocommerce.php" instead of "constellation-smart-tools-for-woocommerce.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin31,950 lines of code in 133 files:
LanguageFilesBlank linesComment linesLines of code
PHP1147,45216,47431,550
JavaScript54269253
SVG11091
CSS1341256

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,911)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity90.15
▷ Minimum class complexity1.00
▷ Maximum class complexity2,911.00
Average method complexity4.60
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes46
▷ Abstract classes24.35%
▷ Concrete classes4495.65%
▷ Final classes00.00%
Methods1,170
▷ Static methods17314.79%
▷ Public methods83070.94%
▷ Protected methods151.28%
▷ Private methods32527.78%
Functions131
▷ Named functions131100.00%
▷ Anonymous functions00.00%
Constants142
▷ Global constants11480.28%
▷ Class constants2819.72%
▷ Public constants28100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 1.17MB with 0.55MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/discord-deal.png48.61KB31.05KB▼ 36.13%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
screenshot-2.png165.07KB81.99KB▼ 50.33%
screenshot-1.png247.42KB118.49KB▼ 52.11%
screenshot-4.png185.10KB89.04KB▼ 51.90%