84% materialize-contact-form

Code Review | Materialize contact form

WordPress plugin Materialize contact form scored84%from 54 tests.

About plugin

  • Plugin page: materialize-conta...
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Jun 15, 2017
  • Latest release: Aug 9, 2023
  • Number of updates: 34
  • Update frequency: every 66.1 days
  • Top authors: jul6art (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /2,566 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼1.86ms] Passed 4 tests

An overview of server-side resources used by Materialize contact form
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1439.54 ▼4.64
Dashboard /wp-admin3.44 ▲0.1448.04 ▲0.36
Posts /wp-admin/edit.php3.56 ▲0.2044.13 ▼1.97
Add New Post /wp-admin/post-new.php6.02 ▲0.1487.70 ▼1.20
Media Library /wp-admin/upload.php3.36 ▲0.1333.62 ▲3.16

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Materialize contact form
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲7713.20 ▼1.181.78 ▼0.0444.27 ▼2.88
Dashboard /wp-admin2,221 ▲304.83 ▼0.09103.42 ▼11.2938.40 ▼9.29
Posts /wp-admin/edit.php2,101 ▲122.02 ▲0.0033.87 ▼5.5234.54 ▲2.16
Add New Post /wp-admin/post-new.php1,553 ▲1918.25 ▼4.87641.79 ▼31.6856.43 ▲6.01
Media Library /wp-admin/upload.php1,403 ▲124.24 ▼0.0296.79 ▼0.9242.76 ▲0.77

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_mcf_widget

Smoke tests 75% 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/materialize-contact-form/inc/mcf_widget.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/materialize-contact-form/materialize-contact-form.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/materialize-contact-form/inc/mcf_view.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === materialize-contact-form === )
You can look at the official readme.txt

materialize-contact-form/materialize-contact-form.php Passed 13 tests

Analyzing the main PHP file in "Materialize contact form" version 1.1.4
72 characters long description:
A simple materialize style contact form with google REcaptcha optionally

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin1,702 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP673223792
CSS18899720
PO File24242125
JavaScript2102165

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity10.20
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity3.56
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods1688.89%
▷ Protected methods00.00%
▷ Private methods211.11%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants10
▷ Global constants00.00%
▷ Class constants10100.00%
▷ Public constants10100.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
PNG images were not found in this plugin