10% extension-for-contact-form-7-and-googlesheet

Code Review | Contact Form 7 GoogleSheet Extension

WordPress plugin Contact Form 7 GoogleSheet Extension scored10%from 54 tests.

About plugin

  • Plugin page: extension-for-con...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-4.5.3
  • WordPress version: 6.3.1
  • First release: Dec 12, 2016
  • Latest release: Dec 20, 2016
  • Number of updates: 6
  • Update frequency: every 1.2 days
  • Top authors: Pardeep Nadha (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,102 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/extension-for-contact-form-7-and-googlesheet/php-google-oauth/service/Google_Utils.php+58
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.66MB] [CPU: ▼50.10ms] Passed 4 tests

Analyzing server-side resources used by Contact Form 7 GoogleSheet Extension
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.33 ▼1.137.43 ▼35.93
Dashboard /wp-admin2.35 ▼0.967.89 ▼42.01
Posts /wp-admin/edit.php2.35 ▼1.019.37 ▼38.51
Add New Post /wp-admin/post-new.php2.35 ▼3.547.84 ▼83.94
Media Library /wp-admin/upload.php2.35 ▼0.888.65 ▼27.33
GoogleSheet Integration /wp-admin/admin.php?page=googlesheet2.359.43

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 106 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Contact Form 7 GoogleSheet Extension: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4714.47 ▼0.221.75 ▼0.2743.38 ▼2.17
Dashboard /wp-admin2,207 ▲194.86 ▼0.01108.92 ▼13.9944.46 ▲2.78
Posts /wp-admin/edit.php2,092 ▲32.02 ▼0.0341.25 ▼0.6534.92 ▼0.17
Add New Post /wp-admin/post-new.php1,531 ▼223.28 ▲0.36597.89 ▼59.7653.81 ▼2.70
Media Library /wp-admin/upload.php1,395 ▲104.20 ▼0.0299.57 ▲0.9945.41 ▲4.32
GoogleSheet Integration /wp-admin/admin.php?page=googlesheet8722.0624.5523.92

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/extension-for-contact-form-7-and-googlesheet/php-google-oauth/service/Google_Utils.php+58
    Array and string offset access syntax with curly braces is deprecated
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=googlesheet
    • > Deprecated in wp-content/plugins/extension-for-contact-form-7-and-googlesheet/php-google-oauth/service/Google_Utils.php+58
    Array and string offset access syntax with curly braces is deprecated

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
  • 61× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/extension-for-contact-form-7-and-googlesheet/php-google-oauth/contrib/Google_PlusService.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/extension-for-contact-form-7-and-googlesheet/php-google-oauth/contrib/Google_GanService.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/extension-for-contact-form-7-and-googlesheet/php-google-oauth/contrib/Google_AdsenseService.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/extension-for-contact-form-7-and-googlesheet/php-google-spreadsheet-client/tests/Google/Spreadsheet/ServiceRequestFactoryTest.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Spreadsheet\\Exception' not found in wp-content/plugins/extension-for-contact-form-7-and-googlesheet/php-google-spreadsheet-client/src/Google/Spreadsheet/UnauthorizedException.php:26
    • > PHP Fatal error
      require_once(): Failed opening required 'io/Google_HttpRequest.php' (include_path='.:/usr/share/php') in wp-content/plugins/extension-for-contact-form-7-and-googlesheet/php-google-oauth/io/Google_IO.php on line 18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Cache' not found in wp-content/plugins/extension-for-contact-form-7-and-googlesheet/php-google-oauth/cache/Google_ApcCache.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/extension-for-contact-form-7-and-googlesheet/connect_google.php:12
    • > PHP Warning
      require_once(service/Google_Utils.php): failed to open stream: No such file or directory in wp-content/plugins/extension-for-contact-form-7-and-googlesheet/php-google-oauth/auth/Google_OAuth2.php on line 20
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/extension-for-contact-form-7-and-googlesheet/php-google-oauth/contrib/Google_BigqueryService.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: google sheet, contact form 7, integration, sheet, google

extension-for-contact-form-7-and-googlesheet/contact-form-7-pk-googlesheet-extension.php 85% from 13 tests

The main PHP script in "Contact Form 7 GoogleSheet Extension" version 1.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("extension-for-contact-form-7-and-googlesheet.php" instead of "contact-form-7-pk-googlesheet-extension.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 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
Good job! No executable or dangerous file extensions detected35,644 lines of code in 101 files:
LanguageFilesBlank linesComment linesLines of code
PHP922,0539,93635,189
XML700285
Markdown1570140
JSON10030

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.05
Average class complexity1.92
▷ Minimum class complexity1.00
▷ Maximum class complexity49.00
Average method complexity1.11
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces2
Interfaces2
Traits0
Classes915
▷ Abstract classes40.44%
▷ Concrete classes91199.56%
▷ Final classes00.00%
Methods7,497
▷ Static methods220.29%
▷ Public methods7,46499.56%
▷ Protected methods90.12%
▷ Private methods240.32%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants16
▷ Global constants00.00%
▷ Class constants16100.00%
▷ Public constants16100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin