84% import-products-from-gsheet-for-woo-importer

Code Review | GSheet For Woo Importer

WordPress plugin GSheet For Woo Importer scored84%from 54 tests.

About plugin

  • Plugin page: import-products-f...
  • Plugin version: 2.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Nov 25, 2019
  • Latest release: May 21, 2023
  • Number of updates: 54
  • Update frequency: every 23.6 days
  • Top authors: mrDollar4444 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /3,061 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.54MB] [CPU: ▲2.21ms] Passed 4 tests

This is a short check of server-side resources used by GSheet For Woo Importer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.46 ▼11.37
Dashboard /wp-admin4.06 ▲0.7660.94 ▲8.25
Posts /wp-admin/edit.php4.11 ▲0.7657.59 ▲6.25
Add New Post /wp-admin/post-new.php6.58 ▲0.6999.74 ▲6.98
Media Library /wp-admin/upload.php3.92 ▲0.6945.29 ▲6.97

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 1,201 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for GSheet For Woo Importer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲6614.47 ▼0.282.20 ▲0.0343.17 ▼2.15
Dashboard /wp-admin2,215 ▲304.84 ▼1.06113.19 ▲5.5444.70 ▲4.06
Posts /wp-admin/edit.php2,101 ▲122.02 ▲0.0340.19 ▲3.5136.17 ▼3.58
Add New Post /wp-admin/post-new.php1,531 ▲1223.32 ▲0.04610.36 ▼74.7149.52 ▼1.37
Media Library /wp-admin/upload.php1,400 ▲184.23 ▼0.01105.33 ▲0.0845.54 ▼0.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

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 everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 674× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\Common\\Formats\\Keys\\OpenSSH' not found in wp-content/plugins/import-products-from-gsheet-for-woo-importer/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\Common\\Formats\\Keys\\PKCS' not found in wp-content/plugins/import-products-from-gsheet-for-woo-importer/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/PKCS1.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Collection' not found in wp-content/plugins/import-products-from-gsheet-for-woo-importer/vendor/google/apiclient-services/src/Drive/Permission.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/import-products-from-gsheet-for-woo-importer/vendor/paragonie/constant_time_encoding/tests/RFC4648Test.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\Curves\\sect409r1' not found in wp-content/plugins/import-products-from-gsheet-for-woo-importer/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistb409.php:16
    • > PHP Fatal error
      Trait 'Google\\Auth\\CacheTrait' not found in wp-content/plugins/import-products-from-gsheet-for-woo-importer/vendor/google/auth/src/GCECache.php on line 38
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/import-products-from-gsheet-for-woo-importer/vendor/google/apiclient-services/src/Sheets/RefreshDataSourceRequest.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/import-products-from-gsheet-for-woo-importer/vendor/google/apiclient-services/src/Sheets/UpdateValuesByDataFilterResponse.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/import-products-from-gsheet-for-woo-importer/vendor/google/apiclient-services/src/Sheets/GridProperties.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/import-products-from-gsheet-for-woo-importer/vendor/google/apiclient-services/src/Sheets/DeleteDeveloperMetadataRequest.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: importer, woocommerce, google sheet

import-products-from-gsheet-for-woo-importer/import-products-from-gsheet-for-woo-importer.php Passed 13 tests

The main PHP file in "GSheet For Woo Importer" ver. 2.3 adds more information about the plugin and also serves as the entry point for this plugin
82 characters long description:
Import woocommerce products from google sheet by using native woocommerce importer

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected110,404 lines of code in 1,164 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,02613,59855,26192,206
JavaScript662,5927929,824
Markdown341,82605,264
JSON22002,322
CSS2560426
YAML11459324
XML20028
Dockerfile18010

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity9.32
▷ Minimum class complexity1.00
▷ Maximum class complexity670.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces89
Interfaces39
Traits12
Classes936
▷ Abstract classes21823.29%
▷ Concrete classes71876.71%
▷ Final classes537.38%
Methods5,988
▷ Static methods70511.77%
▷ Public methods5,10285.20%
▷ Protected methods3806.35%
▷ Private methods5068.45%
Functions235
▷ Named functions9239.15%
▷ Anonymous functions14360.85%
Constants619
▷ Global constants609.69%
▷ Class constants55990.31%
▷ Public constants559100.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 files were detected