68% cf-google-sheets

Code Review | Google Sheets Integration for Caldera Forms

WordPress plugin Google Sheets Integration for Caldera Forms scored68%from 54 tests.

About plugin

  • Plugin page: cf-google-sheets
  • Plugin version: 2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.9.3
  • WordPress version: 6.3.1
  • First release: Apr 26, 2017
  • Latest release: Sep 25, 2023
  • Number of updates: 95
  • Update frequency: every 24.7 days
  • Top authors: alexagr (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

2,000+ active /48,247 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.54MB] [CPU: ▼41.42ms] Passed 4 tests

Server-side resources used by Google Sheets Integration for Caldera Forms
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.4042.22 ▼5.25
Dashboard /wp-admin3.42 ▲0.0727.90 ▼70.83
Posts /wp-admin/edit.php3.42 ▲0.0628.55 ▼24.25
Add New Post /wp-admin/post-new.php3.42 ▼2.4735.59 ▼64.55
Media Library /wp-admin/upload.php3.42 ▲0.1925.16 ▼6.06
Google Sheets /wp-admin/admin.php?page=caldera-forms-google-sheet-config3.4227.97

Server storage [IO: ▲28.14MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
Please fix the following
  • Try to limit filesystem usage to 25MB (currently using 28.14MB)
Filesystem: 11,643 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
gs2_token_v4
gs2_client_id
gs2_client_secret
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Google Sheets Integration for Caldera Forms
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.62 ▼0.751.84 ▼0.1446.94 ▼0.18
Dashboard /wp-admin2,206 ▲245.79 ▼0.06108.55 ▼76.1639.29 ▼15.85
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0538.44 ▼9.0536.13 ▲0.79
Add New Post /wp-admin/post-new.php1,514 ▼1417.66 ▼0.38677.37 ▲32.3159.00 ▲5.52
Media Library /wp-admin/upload.php1,382 ▼34.39 ▲0.2495.63 ▼5.9339.68 ▼4.22
Google Sheets /wp-admin/admin.php?page=caldera-forms-google-sheet-config8572.0426.0024.46

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/cf-google-sheets/cf-google-sheets.php+110
    Use of undefined constant CFCORE_VER - assumed 'CFCORE_VER' (this will throw an Error in a future version of PHP)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=caldera-forms-google-sheet-config
    • > Warning in wp-content/plugins/cf-google-sheets/cf-google-sheets.php+110
    Use of undefined constant CFCORE_VER - assumed 'CFCORE_VER' (this will throw an Error in a future version of PHP)

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
The following issues need your attention
  • 4095× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service_Resource' not found in wp-content/plugins/cf-google-sheets/lib/vendor/google/apiclient-services/src/Google/Service/AndroidPublisher/Resource/Reviews.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/cf-google-sheets/lib/vendor/google/apiclient-services/src/Google/Service/Appengine/RepairApplicationRequest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/cf-google-sheets/lib/vendor/google/apiclient-services/src/Google/Service/Slides/UpdateVideoPropertiesRequest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/cf-google-sheets/lib/vendor/google/apiclient-services/src/Google/Service/Bigquery/TableFieldSchema.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/cf-google-sheets/lib/vendor/google/apiclient-services/src/Google/Service/ShoppingContent/PosInventoryResponse.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\MailHandler' not found in wp-content/plugins/cf-google-sheets/lib/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/cf-google-sheets/lib/vendor/google/apiclient-services/src/Google/Service/Gmail/SmtpMsa.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/cf-google-sheets/lib/vendor/google/apiclient-services/src/Google/Service/Pubsub/Topic.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/cf-google-sheets/lib/vendor/google/apiclient-services/src/Google/Service/HangoutsChat/UserMentionMetadata.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service_Resource' not found in wp-content/plugins/cf-google-sheets/lib/vendor/google/apiclient-services/src/Google/Service/CloudMemorystoreforMemcached/Resource/ProjectsLocationsOperations.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: caldera forms, google sheets, google, sheets

cf-google-sheets/cf-google-sheets.php Passed 13 tests

Analyzing the main PHP file in "Google Sheets Integration for Caldera Forms" version 2.5
45 characters long description:
Send data to Google Sheets on form submission

Code Analysis 97% from 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
Everything looks great! No dangerous files found in this plugin569,815 lines of code in 11,618 files:
LanguageFilesBlank linesComment linesLines of code
PHP11,55629,336348,630563,109
Markdown401,83005,214
JSON15001,316
CSS11074
YAML26043
JavaScript13429
XML10011
Dockerfile18010
make1409

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 106)
Cyclomatic complexity
Average complexity per logical line of code0.04
Average class complexity1.54
▷ Minimum class complexity1.00
▷ Maximum class complexity632.00
Average method complexity1.07
▷ Minimum method complexity1.00
▷ Maximum method complexity106.00
Code structure
Namespaces35
Interfaces33
Traits9
Classes11,498
▷ Abstract classes100.09%
▷ Concrete classes11,48899.91%
▷ Final classes130.11%
Methods81,528
▷ Static methods1560.19%
▷ Public methods81,09799.47%
▷ Protected methods1740.21%
▷ Private methods2570.32%
Functions173
▷ Named functions6034.68%
▷ Anonymous functions11365.32%
Constants888
▷ Global constants323.60%
▷ Class constants85696.40%
▷ Public constants83797.78%

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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/sheets-logo.png3.11KB2.06KB▼ 33.55%