83% wc-gsheetconnector

Code Review | WooCommerce Google Sheet Connector

WordPress plugin WooCommerce Google Sheet Connector scored83%from 54 tests.

About plugin

  • Plugin page: wc-gsheetconnector
  • Plugin version: 1.3.10
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 4, 2021
  • Latest release: Dec 2, 2023
  • Number of updates: 51
  • Update frequency: every 14.9 days
  • Top authors: westerndeal (64.71%)abdullah17 (37.25%)

Code review

54 tests

User reviews

9 reviews

Install metrics

2,000+ active /16,076 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

This is a short check of server-side resources used by WooCommerce Google Sheet Connector
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.52 ▼3.20
Dashboard /wp-admin3.31 ▲0.0147.73 ▼1.40
Posts /wp-admin/edit.php3.36 ▲0.0145.89 ▼5.10
Add New Post /wp-admin/post-new.php5.89 ▲0.0180.75 ▼16.47
Media Library /wp-admin/upload.php3.24 ▲0.0136.13 ▲1.48

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 1,572 new files
Database: no new tables, 17 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
gs_woo_tab_roles_setting
gs_woo_settings
widget_theysaidso_widget
gs_woo_verify
gs_woo_token
fs_accounts
widget_recent-posts
can_compress_scripts
...

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Google Sheet Connector
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲2814.28 ▼0.441.88 ▼0.2344.10 ▼0.35
Dashboard /wp-admin2,195 ▲215.61 ▲0.0396.14 ▼6.0444.22 ▼4.16
Posts /wp-admin/edit.php2,100 ▼32.01 ▲0.0438.80 ▼10.1835.07 ▼2.40
Add New Post /wp-admin/post-new.php1,526 ▼023.33 ▼0.02681.86 ▲76.3666.71 ▲8.38
Media Library /wp-admin/upload.php1,397 ▼04.15 ▼0.0996.78 ▼2.5241.58 ▲0.82

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 17 options
    • gs_woo_sheetId
    • theysaidso_admin_options
    • fs_debug_mode
    • widget_recent-comments
    • gs_woo_settings
    • gs_woo_tab_roles_setting
    • widget_theysaidso_widget
    • gs_woo_feeds
    • fs_accounts
    • widget_recent-posts
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 969× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wc-gsheetconnector/lib/vendor/guzzlehttp/psr7/src/LimitStream.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/wc-gsheetconnector/lib/vendor/google/apiclient-services/src/Sheets/CopyPasteRequest.php:20
    • > PHP Warning
      Class 'Google\\Http\\MediaFileUpload' not found in wp-content/plugins/wc-gsheetconnector/lib/src/aliases.php on line 33
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Service\\Resource' not found in wp-content/plugins/wc-gsheetconnector/lib/vendor/google/apiclient-services/src/Sheets/Resource/SpreadsheetsSheets.php:31
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Cache\\CacheException' not found in wp-content/plugins/wc-gsheetconnector/lib/vendor/psr/cache/src/InvalidArgumentException.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wc-gsheetconnector/lib/vendor/guzzlehttp/psr7/src/AppendStream.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\DH' not found in wp-content/plugins/wc-gsheetconnector/lib/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH/PrivateKey.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wc-gsheetconnector/lib/vendor/guzzlehttp/psr7/src/CachingStream.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/wc-gsheetconnector/lib/vendor/monolog/monolog/src/Monolog/Handler/OverflowHandler.php:37
    • > PHP Warning
      Class 'Google\\Service' not found in wp-content/plugins/wc-gsheetconnector/lib/src/aliases.php on line 33

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: You are using too many tags: 27 tag instead of maximum 10
  • Screenshots: Add images for these screenshots: #7 (Google Sheet Tab Creation as per order status.), #8 (Google Sheet headers with form submitted data.)
The official readme.txt might help

wc-gsheetconnector/wc-gsheetconnector.php 92% from 13 tests

The main PHP script in "WooCommerce Google Sheet Connector" version 1.3.10 is automatically included on every request by WordPress
The following require your attention:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.3" instead of "3.2.0")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin137,733 lines of code in 1,488 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,40922,76785,180127,047
Markdown321,80105,277
CSS144941372,657
JSON20002,092
JavaScript46588380
YAML452127
PO File13132107
XML20034
make1409
Bourne Shell1203

PHP code 0% from 2 tests

A short review of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,073)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 105)
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity10.73
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity2.29
▷ Minimum method complexity1.00
▷ Maximum method complexity105.00
Code structure
Namespaces85
Interfaces50
Traits14
Classes1,266
▷ Abstract classes21717.14%
▷ Concrete classes1,04982.86%
▷ Final classes535.05%
Methods9,832
▷ Static methods8758.90%
▷ Public methods8,56587.11%
▷ Protected methods4084.15%
▷ Private methods8598.74%
Functions298
▷ Named functions15652.35%
▷ Anonymous functions14247.65%
Constants729
▷ Global constants11615.91%
▷ Class constants61384.09%
▷ Public constants57393.47%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.20MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/help.png1.51KB1.35KB▼ 10.25%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/wc-gsheetconnector.png18.82KB8.26KB▼ 56.11%
assets/img/permission_screen.png29.71KB9.43KB▼ 68.24%
assets/img/comingsoon.png127.56KB42.99KB▼ 66.30%