68% wc-reporting-by-small-fish-analytics

Code Review | WooCommerce Reporting By Small Fish Analytics

WordPress plugin WooCommerce Reporting By Small Fish Analytics scored68%from 54 tests.

About plugin

  • Plugin page: wc-reporting-by-s...
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.5.2
  • WordPress version: 6.3.1
  • First release: Jun 20, 2016
  • Latest release: Jul 18, 2016
  • Number of updates: 22
  • Update frequency: every 1.4 days
  • Top authors: canship (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /825 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼1.95MB] [CPU: ▼55.24ms] Passed 4 tests

A check of server-side resources used by WooCommerce Reporting By Small Fish Analytics
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.05 ▼1.413.89 ▼35.26
Dashboard /wp-admin2.07 ▼1.285.50 ▼55.84
Posts /wp-admin/edit.php2.07 ▼1.295.53 ▼40.55
Add New Post /wp-admin/post-new.php2.07 ▼3.825.12 ▼89.30
Media Library /wp-admin/upload.php2.07 ▼1.165.83 ▼28.49

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Reporting By Small Fish Analytics
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,874 ▲11313.53 ▼1.098.67 ▲7.0439.10 ▼1.01
Dashboard /wp-admin2,200 ▲195.61 ▼0.1082.88 ▼20.2640.84 ▼1.55
Posts /wp-admin/edit.php2,102 ▲22.01 ▲0.0138.49 ▲0.7437.62 ▲8.23
Add New Post /wp-admin/post-new.php1,530 ▲423.11 ▲0.12647.11 ▼15.9954.36 ▼4.40
Media Library /wp-admin/upload.php1,405 ▲84.39 ▲0.2496.40 ▼9.5143.04 ▼1.44

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the flot handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 fix the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wc-reporting-by-small-fish-analytics/includes/sfa-woocommerce-notices.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_current_value() on null in wp-content/plugins/wc-reporting-by-small-fish-analytics/includes/sfa-woocommerce-charts.php:5
    • > PHP Notice
      Undefined variable: revenue_report in wp-content/plugins/wc-reporting-by-small-fish-analytics/includes/sfa-woocommerce-charts.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: analytics, woocommerce, reporting, charts

wc-reporting-by-small-fish-analytics/class-sfa-woocommerce-reports.php 92% from 13 tests

The entry point to "WooCommerce Reporting By Small Fish Analytics" version 1.2.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wc-reporting-by-small-fish-analytics.php" instead of "class-sfa-woocommerce-reports.php")

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
Success! There were no dangerous files found in this plugin1,083 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP1215914983
CSS122098
JavaScript1002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity4.44
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.76
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes111.11%
▷ Concrete classes888.89%
▷ Final classes00.00%
Methods45
▷ Static methods00.00%
▷ Public methods3168.89%
▷ Protected methods1431.11%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
No PNG files were detected