62% gootracking-for-woocommerce

Code Review | GooTracking for WooCommerce

WordPress plugin GooTracking for WooCommerce scored62%from 54 tests.

About plugin

  • Plugin page: gootracking-for-w...
  • Plugin version: 0.1.59
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.3-4.5.3
  • WordPress version: 6.3.1
  • First release: May 13, 2016
  • Latest release: Aug 8, 2016
  • Number of updates: 164
  • Update frequency: every 0.5 days
  • Top authors: alan345 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /1,939 total downloads

Benchmarks

Plugin footprint 48% 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.00MB] [CPU: ▼2.57ms] Passed 4 tests

Analyzing server-side resources used by GooTracking for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.57 ▼1.88
Dashboard /wp-admin3.31 ▲0.0143.82 ▼3.09
Posts /wp-admin/edit.php3.36 ▲0.0044.31 ▼0.47
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.64 ▼4.82
Media Library /wp-admin/upload.php3.23 ▲0.0035.73 ▲2.14

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 271 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for GooTracking for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3714.35 ▼0.041.75 ▲0.1538.23 ▼5.38
Dashboard /wp-admin2,207 ▲305.62 ▲0.0284.50 ▼3.8338.29 ▼0.01
Posts /wp-admin/edit.php2,110 ▲101.96 ▼0.0435.97 ▲1.4532.41 ▼2.86
Add New Post /wp-admin/post-new.php1,549 ▲2318.37 ▼4.80648.18 ▲6.6247.44 ▼3.46
Media Library /wp-admin/upload.php1,409 ▲154.23 ▲0.0997.88 ▲0.7742.11 ▼0.62

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Error in wp-content/plugins/gootracking-for-woocommerce/gootracking.php+153
    Uncaught Error: Class 'gootracking_option' not found in wp-content/plugins/gootracking-for-woocommerce/gootracking.php:153
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): gootracking_deactivate()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(816): do_action()
  • This plugin has failed uninstalling correctly, leaving 271 files (23.10MB) in the plugin directory
    • (new file) assets/Green.png
    • (new file) assets/close.png
    • (new file) assets/UPSAndPickupClient.png
    • (new file) assets/b16x16_cancel.png
    • (new file) assets/UPS.png
    • (new file) assets/delete.png
    • (new file) assets/692069053_opticon-opi-2002-2.jpg
    • (new file) assets/LogoSliderWEB-03.jpg
    • (new file) assets/button_ok.png
    • (new file) assets/access_point.png
    • ...
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • widget_recent-comments
    • theysaidso_admin_options

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
  • 47× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Use of undefined constant _JPGRAPH_PATH - assumed '_JPGRAPH_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/gootracking-for-woocommerce/lib/mpdf/graph.php on line 32
    • > PHP Warning
      require_once(_MPDF_PATHclasses/ttfontsuni.php): failed to open stream: No such file or directory in wp-content/plugins/gootracking-for-woocommerce/lib/mpdf/classes/ttfontsuni_analysis.php on line 3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/gootracking-for-woocommerce/lib/mpdf/includes/CJKdata.php:18
    • > PHP Warning
      include_once(_JPGRAPH_PATHjpgraph_bar.php): failed to open stream: No such file or directory in wp-content/plugins/gootracking-for-woocommerce/lib/mpdf/graph.php on line 31
    • > PHP Warning
      include_once(_JPGRAPH_PATHjpgraph_pie3d.php): failed to open stream: No such file or directory in wp-content/plugins/gootracking-for-woocommerce/lib/mpdf/graph.php on line 30
    • > PHP Warning
      Use of undefined constant _JPGRAPH_PATH - assumed '_JPGRAPH_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/gootracking-for-woocommerce/lib/mpdf/graph.php on line 26
    • > PHP Fatal error
      'break' not in the 'loop' or 'switch' context in wp-content/plugins/gootracking-for-woocommerce/lib/mpdf/classes/svg.php on line 2710
    • > PHP Warning
      include_once(_JPGRAPH_PATHjpgraph_line.php): failed to open stream: No such file or directory in wp-content/plugins/gootracking-for-woocommerce/lib/mpdf/graph.php on line 25
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/gootracking-for-woocommerce/lib/mpdf/config.php:6
    • > PHP Notice
      Undefined index: filename in wp-content/plugins/gootracking-for-woocommerce/lib/mpdf/includes/out.php on line 5

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Screenshots: Screenshot #6 (Here's a screenshot of it in action) image not found
The official readme.txt might help

gootracking-for-woocommerce/gootracking.php 85% from 13 tests

The main PHP script in "GooTracking for WooCommerce" version 0.1.59 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("gootracking-for-woocommerce.php" instead of "gootracking.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 187 characters long)

Code Analysis 95% 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 plugin153,114 lines of code in 162 files:
LanguageFilesBlank linesComment linesLines of code
PHP1399,3219,093140,547
JavaScript142,1222,63011,135
PO File1514875634
CSS66727506
SVG100288
INI1104

PHP code 0% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 10,218)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 1,542)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity227.92
▷ Minimum class complexity1.00
▷ Maximum class complexity10,218.00
Average method complexity16.99
▷ Minimum method complexity1.00
▷ Maximum method complexity1,542.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes77
▷ Abstract classes00.00%
▷ Concrete classes77100.00%
▷ Final classes00.00%
Methods1,092
▷ Static methods777.05%
▷ Public methods1,07198.08%
▷ Protected methods211.92%
▷ Private methods00.00%
Functions151
▷ Named functions151100.00%
▷ Anonymous functions00.00%
Constants373
▷ Global constants6316.89%
▷ Class constants31083.11%
▷ Public constants310100.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
23 PNG files occupy 0.68MB with 0.29MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/gootracking-256.png14.37KB6.19KB▼ 56.96%
assets/button_ok.png0.88KB0.82KB▼ 6.33%
assets/b16x16_cancel.png1.11KB1.01KB▼ 8.56%
assets/UPSAndPickupClient.png81.83KB22.63KB▼ 72.34%
assets/UPS.png131.86KB38.40KB▼ 70.88%