84% amp-contact-form-7

Code Review | AMP Contact FORM 7 - AMPCF7

WordPress plugin AMP Contact FORM 7 - AMPCF7 scored84%from 54 tests.

About plugin

  • Plugin page: amp-contact-form-7
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9.6
  • WordPress version: 6.3.1
  • First release: Jun 30, 2018
  • Latest release: Jul 1, 2018
  • Number of updates: 8
  • Update frequency: every 0.1 days
  • Top authors: arshidkv12 (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

1,000+ active /5,809 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.65ms] Passed 4 tests

An overview of server-side resources used by AMP Contact FORM 7 - AMPCF7
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.94 ▼1.04
Dashboard /wp-admin3.34 ▲0.0345.31 ▼1.99
Posts /wp-admin/edit.php3.39 ▲0.0343.68 ▼2.69
Add New Post /wp-admin/post-new.php5.92 ▲0.0392.38 ▼4.87
Media Library /wp-admin/upload.php3.26 ▲0.0337.95 ▲4.21

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for AMP Contact FORM 7 - AMPCF7
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.42 ▼0.221.84 ▼0.1242.68 ▲5.22
Dashboard /wp-admin2,203 ▲155.81 ▲0.9398.11 ▼0.7241.38 ▼3.79
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0336.26 ▼4.3630.25 ▼10.32
Add New Post /wp-admin/post-new.php1,542 ▲818.21 ▼4.82599.37 ▼79.3054.38 ▲4.04
Media Library /wp-admin/upload.php1,385 ▼64.19 ▼0.0696.46 ▼5.1642.08 ▼0.53

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

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
Good news, no errors were detected

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
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'AMP_Base_Sanitizer' not found in wp-content/plugins/amp-contact-form-7/includes/class-amp-form-sanitizer.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amp-contact-form-7/amp-contact-form-7.php:22

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 Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: amp, contact form 7, cf7, amp contact form 7

amp-contact-form-7/amp-contact-form-7.php Passed 13 tests

The main PHP script in "AMP Contact FORM 7 - AMPCF7" version 1.0.1 is automatically included on every request by WordPress
44 characters long description:
Enable Contact Form 7 plugin support in AMP.

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 detected261 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP257102218
CSS11043

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity18.00
▷ Minimum class complexity18.00
▷ Maximum class complexity18.00
Average method complexity9.50
▷ Minimum method complexity3.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin