84% amp-for-contact-form-7

Code Review | AMP for Contact Form 7

WordPress plugin AMP for Contact Form 7 scored 84% from 54 tests.

About plugin

  • Plugin page: amp-for-contact-f...
  • Plugin version: 1.3.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8.1
  • WordPress version: 6.3.1
  • First release: Feb 26, 2020
  • Latest release: Sep 9, 2021
  • Number of updates: 39
  • Update frequency: every 14.4 days
  • Top authors: esoftarena (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active / 4,071 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

An overview of server-side resources used by AMP for Contact Form 7
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.51 ▼10.70
Dashboard /wp-admin3.31 ▲0.0042.25 ▼24.79
Posts /wp-admin/edit.php3.36 ▲0.0039.29 ▼14.80
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.20 ▼25.30
Media Library /wp-admin/upload.php3.23 ▲0.0033.96 ▼0.44

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 40 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

AMP for Contact Form 7: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.74 ▲0.442.06 ▼0.3844.09 ▼10.90
Dashboard /wp-admin2,209 ▲184.89 ▼0.01112.54 ▼10.5744.60 ▼5.88
Posts /wp-admin/edit.php2,089 ▼02.03 ▼0.0139.01 ▼1.1332.03 ▼8.83
Add New Post /wp-admin/post-new.php1,534 ▼023.31 ▲1.63706.15 ▼13.4354.19 ▼21.34
Media Library /wp-admin/upload.php1,388 ▲34.21 ▲0.06113.46 ▼23.6746.38 ▼15.89

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

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 no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amp-for-contact-form-7/includes/FrontEnd/modules/quiz.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amp-for-contact-form-7/includes/FrontEnd/modules/file.php:2
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/amp-for-contact-form-7/includes/FrontEnd/modules/clearform.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amp-for-contact-form-7/includes/FrontEnd/modules/checkbox.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amp-for-contact-form-7/includes/FrontEnd/modules/select.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amp-for-contact-form-7/includes/FrontEnd/modules/number.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amp-for-contact-form-7/includes/FrontEnd/modules/textarea.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amp-for-contact-form-7/includes/FrontEnd/modules/date.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amp-for-contact-form-7/includes/FrontEnd/modules/text.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Donate link: Invalid URI ("")
The official readme.txt might help

amp-for-contact-form-7/amp-for-contact-form-7.php 92% from 13 tests

The main PHP file in "AMP for Contact Form 7" ver. 1.3.2 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 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
No dangerous file extensions were detected1,298 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP263623331,191
CSS110084
JSON20021
JavaScript1002

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity6.64
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes19.09%
Methods48
▷ Static methods36.25%
▷ Public methods4491.67%
▷ Protected methods00.00%
▷ Private methods48.33%
Functions20
▷ Named functions1995.00%
▷ Anonymous functions15.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected