84% sweet-woocommerce

Code Review | Sweet Analytics WooCommerce

WordPress plugin Sweet Analytics WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: sweet-woocommerce
  • Plugin version: 0.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 2.2-6.3.1
  • WordPress version: 6.3.1
  • First release: Nov 12, 2019
  • Latest release: Oct 12, 2023
  • Number of updates: 8
  • Update frequency: every 178.9 days
  • Top authors: sweetanalytics (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /758 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼4.71ms] Passed 4 tests

This is a short check of server-side resources used by Sweet Analytics WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1426.36 ▼11.22
Dashboard /wp-admin3.46 ▲0.1649.85 ▲1.99
Posts /wp-admin/edit.php3.51 ▲0.1648.14 ▲4.40
Add New Post /wp-admin/post-new.php6.04 ▲0.1681.26 ▼13.04
Media Library /wp-admin/upload.php3.39 ▲0.1638.33 ▲3.45
Logs /wp-admin/edit.php?post_type=wp_log3.4337.96
Tags /wp-admin/edit-tags.php?taxonomy=wp_log_type&post_type=wp_log3.5137.00
Add New /wp-admin/post-new.php?post_type=wp_log3.5049.46

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
SWEET_INIT_SUCCESS
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Sweet Analytics WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,513 ▼23314.32 ▲0.030.94 ▼0.6513.97 ▼27.29
Dashboard /wp-admin2,229 ▲495.62 ▼0.0382.36 ▼1.8336.31 ▼4.31
Posts /wp-admin/edit.php2,131 ▲312.01 ▼0.0134.46 ▲0.8633.84 ▲1.33
Add New Post /wp-admin/post-new.php1,552 ▲2623.54 ▲0.45672.84 ▲11.4771.91 ▲0.27
Media Library /wp-admin/upload.php1,428 ▲254.18 ▲0.0198.31 ▲5.6946.58 ▲6.50
Logs /wp-admin/edit.php?post_type=wp_log1,0951.9830.9827.88
Tags /wp-admin/edit-tags.php?taxonomy=wp_log_type&post_type=wp_log1,4312.1327.2530.40
Add New /wp-admin/post-new.php?post_type=wp_log2,2567.63163.0059.76

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • SWEET_INIT_SUCCESS
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SweetAnalytics\\add_action() in wp-content/plugins/sweet-woocommerce/sweet-tracker-functions.php:171
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SweetAnalytics\\plugin_dir_path() in wp-content/plugins/sweet-woocommerce/class/setup.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SweetAnalytics\\register_activation_hook() in wp-content/plugins/sweet-woocommerce/sweet-admin-functions.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SweetAnalytics\\plugin_dir_path() in wp-content/plugins/sweet-woocommerce/class/setup.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SweetAnalytics\\add_action() in wp-content/plugins/sweet-woocommerce/core/Logger.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
8 plugin tags: insights, ecommerce, analytics, tracking code, sweet...

sweet-woocommerce/sweet-woocommerce.php Passed 13 tests

Analyzing the main PHP file in "Sweet Analytics WooCommerce" version 0.0.6
53 characters long description:
WooCommerce tracking integration with Sweet Analytics

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin830 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP7216210697
CSS14099
SVG40025
JavaScript1009

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity8.75
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods23
▷ Static methods834.78%
▷ Public methods1773.91%
▷ Protected methods00.00%
▷ Private methods626.09%
Functions11
▷ Named functions981.82%
▷ Anonymous functions218.18%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin