81% oc-google-sheet-with-contact-form-7

Code Review | Elegant Apps Integration of Google Sheet With Contact Form 7

WordPress plugin Elegant Apps Integration of Google Sheet With Contact Form 7 scored 81% from 54 tests.

About plugin

  • Plugin page: oc-google-sheet-w...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Apr 7, 2021
  • Latest release: Feb 26, 2022
  • Number of updates: 5
  • Update frequency: every 65.4 days
  • Top authors: elegantapps27 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 176 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼175.95ms] Passed 4 tests

Analyzing server-side resources used by Elegant Apps Integration of Google Sheet With Contact Form 7
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0024.80 ▲2.50
Dashboard /wp-admin3.06 ▼0.0031.00 ▼6.26
Posts /wp-admin/edit.php3.11 ▲0.0031.71 ▲0.20
Add New Post /wp-admin/post-new.php5.42 ▼0.0269.23 ▼699.66
Media Library /wp-admin/upload.php3.00 ▲0.0025.12 ▲1.94
Google Sheet /wp-admin/admin.php?page=elgent_cf7glgsheet_googlesheet2.7416.27

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 1,063 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Elegant Apps Integration of Google Sheet With Contact Form 7
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,690 ▲8915.56 ▼0.395.24 ▼3.5074.01 ▼1.59
Dashboard /wp-admin2,933 ▲386.09 ▼0.23117.12 ▼14.25170.13 ▼5.11
Posts /wp-admin/edit.php2,740 ▼03.36 ▲0.1269.31 ▲4.79156.34 ▲12.79
Add New Post /wp-admin/post-new.php3,808 ▲11018.19 ▼0.18429.70 ▼41.15166.96 ▲9.84
Media Library /wp-admin/upload.php1,752 ▼05.52 ▲0.02146.99 ▲7.12184.75 ▼1.48
Google Sheet /wp-admin/admin.php?page=elgent_cf7glgsheet_googlesheet280.940.0317.24

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 25% 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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/oc-google-sheet-with-contact-form-7/oc_googlesheetcf7.php
  • 669× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/oc-google-sheet-with-contact-form-7/lib/vendor/google/apiclient-services/src/Sheets/DeveloperMetadataLocation.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/oc-google-sheet-with-contact-form-7/lib/vendor/guzzlehttp/promises/src/Promise.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Collection' not found in wp-content/plugins/oc-google-sheet-with-contact-form-7/lib/vendor/google/apiclient-services/src/Sheets/DataSourceSheetDimensionRange.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\BufferHandler' not found in wp-content/plugins/oc-google-sheet-with-contact-form-7/lib/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Collection' not found in wp-content/plugins/oc-google-sheet-with-contact-form-7/lib/vendor/google/apiclient-services/src/Sheets/Sheet.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Processor\\ProcessorInterface' not found in wp-content/plugins/oc-google-sheet-with-contact-form-7/lib/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/oc-google-sheet-with-contact-form-7/lib/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/oc-google-sheet-with-contact-form-7/lib/vendor/psr/log/Psr/Log/Test/TestLogger.php:57
    • > PHP Warning
      Class 'Google\\Collection' not found in wp-content/plugins/oc-google-sheet-with-contact-form-7/lib/src/aliases.php on line 33
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/oc-google-sheet-with-contact-form-7/lib/vendor/google/apiclient-services/src/Drive/DriveFileCapabilities.php:20

User-side errors 0% from 1 test

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

Optimizations

Plugin configuration 87% 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: You can take inspiration from this readme.txt

oc-google-sheet-with-contact-form-7/oc_googlesheetcf7.php 85% from 13 tests

"Elegant Apps Integration of Google Sheet With Contact Form 7" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("oc-google-sheet-with-contact-form-7.php" instead of "oc_googlesheetcf7.php")
  • Domain Path: The domain path folder was not found ("/languages")

Code Analysis 97% 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
Good job! No executable or dangerous file extensions detected77,715 lines of code in 1,033 files:
LanguageFilesBlank linesComment linesLines of code
PHP96912,88448,56070,757
Markdown281,61204,814
JSON20001,676
YAML7311143
CSS152140
Python1222577
JavaScript1141854
XML30041
make1409
Bourne Shell1203
SVG1001

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 105)
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity8.75
▷ Minimum class complexity1.00
▷ Maximum class complexity660.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity105.00
Code structure
Namespaces81
Interfaces43
Traits14
Classes911
▷ Abstract classes21423.49%
▷ Concrete classes69776.51%
▷ Final classes395.60%
Methods5,838
▷ Static methods65411.20%
▷ Public methods4,98285.34%
▷ Protected methods3846.58%
▷ Private methods4728.08%
Functions193
▷ Named functions5830.05%
▷ Anonymous functions13569.95%
Constants506
▷ Global constants183.56%
▷ Class constants48896.44%
▷ Public constants46895.90%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/support.png6.44KB5.59KB▼ 13.09%
includes/images/review.png15.87KB11.90KB▼ 25.01%
includes/images/star.png39.75KB10.35KB▼ 73.95%