78% swp-contact-form-7-analytics

Code Review | Contact Form 7 Analytics

WordPress plugin Contact Form 7 Analytics scored78%from 54 tests.

About plugin

  • Plugin page: swp-contact-form-...
  • Plugin version: 0.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.8
  • WordPress version: 6.3.1
  • First release: Jul 4, 2017
  • Latest release: Jul 4, 2017
  • Number of updates: 6
  • Update frequency: every 0.2 days
  • Top authors: hswplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /598 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲2.95MB] [CPU: ▲16.14ms] Passed 4 tests

Server-side resources used by Contact Form 7 Analytics
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /6.18 ▲2.7261.50 ▲19.06
Dashboard /wp-admin6.31 ▲3.0163.37 ▲10.69
Posts /wp-admin/edit.php6.36 ▲3.0166.45 ▲15.41
Add New Post /wp-admin/post-new.php8.97 ▲3.08111.04 ▲19.39
Media Library /wp-admin/upload.php6.30 ▲3.0778.71 ▲39.70
Tools /wp-admin/edit.php?post_type=acf-field-group&page=acf-settings-tools6.1763.44
Field Groups /wp-admin/edit.php?post_type=acf-field-group6.2960.12
Info /wp-admin/edit.php?post_type=acf-field-group&page=acf-settings-info6.1948.08
Add New /wp-admin/post-new.php?post_type=acf-field-group6.3870.36

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

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

Browser metrics Passed 4 tests

Contact Form 7 Analytics: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲10314.46 ▲0.082.18 ▼0.1136.65 ▼9.38
Dashboard /wp-admin2,252 ▲705.80 ▼0.05104.90 ▼6.2838.29 ▼8.17
Posts /wp-admin/edit.php2,138 ▲492.02 ▲0.0335.12 ▼3.3133.14 ▼0.92
Add New Post /wp-admin/post-new.php6,769 ▲5,23525.94 ▲2.83976.32 ▲330.6574.25 ▲17.63
Media Library /wp-admin/upload.php2,008 ▲6178.27 ▲4.04204.49 ▲101.9364.08 ▲22.63
Tools /wp-admin/edit.php?post_type=acf-field-group&page=acf-settings-tools9972.1941.9833.56
Field Groups /wp-admin/edit.php?post_type=acf-field-group1,2242.2743.5037.91
Info /wp-admin/edit.php?post_type=acf-field-group&page=acf-settings-info1,0812.0526.9664.29
Add New /wp-admin/post-new.php?post_type=acf-field-group2,1422.8451.6358.42

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • acf_version
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 88× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/swp-contact-form-7-analytics/acf/fields/time_picker.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/swp-contact-form-7-analytics/acf/core/third_party.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/swp-contact-form-7-analytics/acf/core/compatibility.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/swp-contact-form-7-analytics/acf/fields/wysiwyg.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/swp-contact-form-7-analytics/acf/fields/taxonomy.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/swp-contact-form-7-analytics/acf/admin/settings-tools.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function acf_extract_var() in wp-content/plugins/swp-contact-form-7-analytics/acf/admin/views/settings-tools-export.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/swp-contact-form-7-analytics/acf/fields/radio.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/swp-contact-form-7-analytics/acf/fields/date_picker.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/swp-contact-form-7-analytics/acf/fields/date_time_picker.php:16

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=acf-field-group
    • > Network (severe)
    wp-content/plugins/swp-cf7-analytics/acf/assets/css/acf-global.css?ver=5.5.14 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=acf-field-group
    • > Network (severe)
    wp-content/plugins/swp-cf7-analytics/acf/assets/css/acf-input.css?ver=5.5.14 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=acf-field-group
    • > Network (severe)
    wp-content/plugins/swp-cf7-analytics/acf/pro/assets/css/acf-pro-input.css?ver=5.5.14 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=acf-field-group
    • > Network (severe)
    wp-content/plugins/swp-cf7-analytics/acf/assets/inc/select2/3/select2.css?ver=3.5.2 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=acf-field-group
    • > Network (severe)
    wp-content/plugins/swp-cf7-analytics/acf/assets/inc/datepicker/jquery-ui.min.css?ver=1.11.4 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=acf-field-group
    • > Network (severe)
    wp-content/plugins/swp-cf7-analytics/acf/assets/inc/timepicker/jquery-ui-timepicker-addon.min.css?ver=1.6.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=acf-field-group
    • > Network (severe)
    wp-content/plugins/swp-cf7-analytics/acf/assets/js/acf-input.min.js?ver=5.5.14 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=acf-field-group
    • > Network (severe)
    wp-content/plugins/swp-cf7-analytics/acf/pro/assets/js/acf-pro-input.min.js?ver=5.5.14 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=acf-field-group
    • > Network (severe)
    wp-content/plugins/swp-cf7-analytics/acf/assets/inc/select2/3/select2.min.js?ver=3.5.2 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=acf-field-group
    • > Network (severe)
    wp-content/plugins/swp-cf7-analytics/acf/assets/inc/timepicker/jquery-ui-timepicker-addon.min.js?ver=1.6.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=acf-field-group
    • > Network (severe)
    wp-content/plugins/swp-cf7-analytics/acf/assets/css/acf-field-group.css?ver=5.5.14 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=acf-field-group
    • > Network (severe)
    wp-content/plugins/swp-cf7-analytics/acf/pro/assets/css/acf-pro-field-group.css?ver=5.5.14 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=acf-field-group
    • > Network (severe)
    wp-content/plugins/swp-cf7-analytics/acf/assets/js/acf-field-group.min.js?ver=5.5.14 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=acf-field-group
    • > Network (severe)
    wp-content/plugins/swp-cf7-analytics/acf/pro/assets/js/acf-pro-field-group.min.js?ver=5.5.14 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 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: contact form 7, google analytics, cf7

swp-contact-form-7-analytics/swp-contact-form-7-analytics.php 85% from 13 tests

This is the main PHP file of "Contact Form 7 Analytics" version 0.2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages/" does not exist
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin81,608 lines of code in 150 files:
LanguageFilesBlank linesComment linesLines of code
PO File2718,52325,74239,944
JavaScript1610,0646,81620,181
PHP9315,08115,43415,957
CSS122157765,379
JSON100118
SVG10029

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity22.32
▷ Minimum class complexity1.00
▷ Maximum class complexity127.00
Average method complexity3.52
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes69
▷ Abstract classes00.00%
▷ Concrete classes69100.00%
▷ Final classes00.00%
Methods584
▷ Static methods00.00%
▷ Public methods584100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions303
▷ Named functions303100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

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
8 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
acf/assets/inc/datepicker/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
acf/assets/inc/datepicker/images/ui-bg_highlight-soft_0_ffffff_1x100.png0.20KB0.08KB▼ 58.62%
acf/assets/inc/datepicker/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
acf/assets/images/sprite@2x.png6.38KB2.80KB▼ 56.14%
acf/assets/inc/datepicker/images/ui-icons_DDDDDD_256x240.png6.76KB4.17KB▼ 38.25%