78% gsheetconnector-easy-digital-downloads

Code Review | Easy Digital Downloads Google Sheet Connector

WordPress plugin Easy Digital Downloads Google Sheet Connector scored78%from 54 tests.

About plugin

  • Plugin page: gsheetconnector-e...
  • Plugin version: 1.6.6
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Dec 28, 2021
  • Latest release: Aug 26, 2023
  • Number of updates: 40
  • Update frequency: every 15.2 days
  • Top authors: abdullah17 (52.5%)westerndeal (50%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,038 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

Server-side resources used by Easy Digital Downloads Google Sheet Connector
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.25 ▼2.86
Dashboard /wp-admin3.31 ▲0.0143.24 ▼3.79
Posts /wp-admin/edit.php3.36 ▲0.0142.54 ▼4.20
Add New Post /wp-admin/post-new.php5.89 ▲0.0188.77 ▲2.71
Media Library /wp-admin/upload.php3.23 ▲0.0133.14 ▼1.66
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius3.0122.77
Google Sheet /wp-admin/edit.php?post_type=download&page=edd-gsheet-config3.0125.84

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 1,276 new files
Database: no new tables, 17 new options
New WordPress options
widget_theysaidso_widget
gs_edd_sheetId
fs_accounts
widget_recent-posts
gs_edd_feeds
gs_edd_verify
gs_edd_settings
fs_debug_mode
gs_edd_tab_roles_setting
gs_edd_checkbox_settings
...

Browser metrics Passed 4 tests

A check of browser resources used by Easy Digital Downloads Google Sheet Connector
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.18 ▼1.201.76 ▼0.0838.49 ▼5.80
Dashboard /wp-admin2,209 ▲214.86 ▼0.02102.78 ▼5.0839.99 ▼2.73
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0133.35 ▼4.0933.90 ▼1.97
Add New Post /wp-admin/post-new.php1,543 ▲1017.99 ▼5.19618.99 ▼25.2851.94 ▼18.24
Media Library /wp-admin/upload.php1,388 ▼34.28 ▼0.1094.24 ▼5.5442.78 ▼1.90
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius280.440.093.55
Google Sheet /wp-admin/edit.php?post_type=download&page=edd-gsheet-config280.440.103.66

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
  • This plugin does not fully uninstall, leaving 17 options in the database
    • widget_theysaidso_widget
    • gs_edd_sheetId
    • widget_recent-posts
    • widget_recent-comments
    • gs_edd_tab_roles_setting
    • db_upgraded
    • fs_active_plugins
    • gs_edd_access_code
    • gs_edd_checkbox_settings
    • gs_edd_settings
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 674× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/gsheetconnector-easy-digital-downloads/lib/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/gsheetconnector-easy-digital-downloads/lib/vendor/google/apiclient-services/src/Sheets/UpdateSlicerSpecRequest.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/gsheetconnector-easy-digital-downloads/lib/vendor/google/apiclient-services/src/Sheets/Padding.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractSyslogHandler' not found in wp-content/plugins/gsheetconnector-easy-digital-downloads/lib/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/gsheetconnector-easy-digital-downloads/lib/vendor/google/apiclient-services/src/Sheets/DataSourceChartProperties.php:20
    • > PHP Fatal error
      Trait 'Google\\Auth\\CacheTrait' not found in wp-content/plugins/gsheetconnector-easy-digital-downloads/lib/vendor/google/auth/src/GCECache.php on line 38
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\Common\\AsymmetricKey' not found in wp-content/plugins/gsheetconnector-easy-digital-downloads/lib/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH.php:44
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\GroupHandler' not found in wp-content/plugins/gsheetconnector-easy-digital-downloads/lib/vendor/monolog/monolog/src/Monolog/Handler/FallbackGroupHandler.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\DH' not found in wp-content/plugins/gsheetconnector-easy-digital-downloads/lib/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH/PublicKey.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'Google\\Auth\\FetchAuthTokenInterface' not found in wp-content/plugins/gsheetconnector-easy-digital-downloads/lib/vendor/google/auth/src/OAuth2.php:37

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=freemius
    • > Network (severe)
    wp-admin/admin.php?page=freemius - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/edit.php?post_type=download&page=edd-gsheet-config
    • > Network (severe)
    wp-admin/edit.php?post_type=download&page=edd-gsheet-config - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #3 (Permission popup-1 after logged-in to your account.), #4 (Permission popup-2 after logged-in to your account.), #5 (After successful integration - Displays "Currently Active".), #6 (Get Sheet and Tab Id from the Google Sheet URL.), #7 (Add Action Screen for Google Sheets Easy Digital Downloads), #8 (Google Sheet settings page with input box Sheet Name, Sheet Id, Tab Name, Tab Id.), #9 (Google Sheet headers with form submitted data.)
You can look at the official readme.txt

gsheetconnector-easy-digital-downloads/gsheetconnector-easy-digital-downloads.php Passed 13 tests

The principal PHP file in "Easy Digital Downloads Google Sheet Connector" v. 1.6.6 is loaded by WordPress automatically on each request
72 characters long description:
Send your Easy Digital Downloads data to your Google Sheets spreadsheet.

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
Everything looks great! No dangerous files found in this plugin115,883 lines of code in 1,191 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,10421,18467,066106,857
Markdown321,77005,183
JSON26002,105
CSS15113841,053
JavaScript4103114497
Python1222572
YAML46163
XML30041
make1409
Bourne Shell1203

PHP code 0% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Cyclomatic complexity of classes should 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.39
Average class complexity13.08
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity2.72
▷ Minimum method complexity1.00
▷ Maximum method complexity105.00
Code structure
Namespaces82
Interfaces49
Traits14
Classes965
▷ Abstract classes21622.38%
▷ Concrete classes74977.62%
▷ Final classes526.94%
Methods7,205
▷ Static methods87412.13%
▷ Public methods5,95382.62%
▷ Protected methods4015.57%
▷ Private methods85111.81%
Functions276
▷ Named functions13548.91%
▷ Anonymous functions14151.09%
Constants667
▷ Global constants11917.84%
▷ Class constants54882.16%
▷ Public constants51593.98%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 0.19MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/img/GSheet-Connector_logo.png23.37KB4.89KB▼ 79.07%
assets/img/help.png1.51KB1.35KB▼ 10.25%
assets/img/btn_google_signin_dark_pressed_web.png4.14KB2.15KB▼ 48.09%
assets/img/sync.png3.51KB2.75KB▼ 21.56%