94% cf7-material-design

Code Review | Contact Form 7 Material Design

WordPress plugin Contact Form 7 Material Design scored 94% from 53 tests.

About plugin

  • Plugin page: cf7-material-design
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.2
  • WordPress version: 5.8.1
  • First release: Dec 9, 2017
  • Latest release: Nov 7, 2019
  • Number of updates: 20
  • Update frequency: every 35.0 days
  • Top authors: damianaquiine (100%)

Code review

53 tests

User reviews

9 reviews

Install metrics

1,000+ active / 8,466 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼275.14ms] Passed 4 tests

An overview of server-side resources used by Contact Form 7 Material Design
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0351.96 ▲19.83
Dashboard /wp-admin3.07 ▲0.0140.20 ▲0.36
Posts /wp-admin/edit.php3.12 ▲0.0144.08 ▲6.02
Add New Post /wp-admin/post-new.php5.43 ▼0.0090.39 ▼1,103.42
Media Library /wp-admin/upload.php3.01 ▲0.0033.88 ▼3.51
Contact /wp-admin/admin.php?page=mdcf7_contact_submenu2.9827.57
Help /wp-admin/admin.php?page=mdcf7_help_submenu2.9925.58
Material CF7 /wp-admin/admin.php?page=mdcf7_options2.9940.46

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 25 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Contact Form 7 Material Design
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,908 ▲30217.13 ▲1.2721.70 ▲13.4335.23 ▼8.99
Dashboard /wp-admin3,008 ▲1586.58 ▲0.74141.62 ▲6.55123.62 ▲23.52
Posts /wp-admin/edit.php2,785 ▲792.77 ▲0.0766.73 ▲0.81126.16 ▲37.27
Add New Post /wp-admin/post-new.php1,631 ▼22218.47 ▼0.67372.02 ▼13.77102.22 ▼5.18
Media Library /wp-admin/upload.php1,854 ▲825.17 ▲0.16131.49 ▼27.73104.59 ▼11.79
Contact /wp-admin/admin.php?page=mdcf7_contact_submenu1,1132.5859.7394.79
Help /wp-admin/admin.php?page=mdcf7_help_submenu2,6962.6566.1099.13
Material CF7 /wp-admin/admin.php?page=mdcf7_options4,4944.25130.1490.17

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-material-design/inc/menu.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-material-design/inc/functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-material-design/inc/functions.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === cf7-material-design === )
The official readme.txt is a good inspiration

cf7-material-design/mdcf7_form.php 92% from 13 tests

The main PHP file in "Contact Form 7 Material Design" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("cf7-material-design.php" instead of "mdcf7_form.php")

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
Success! There were no dangerous files found in this plugin9,954 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
Sass27262084,326
JavaScript38571,5083,862
CSS62035950
PHP45117816

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.18MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/thumbnail.png8.18KB3.51KB▼ 57.11%
assets/banner-1544x500.png94.18KB42.09KB▼ 55.31%
assets/icon-128x128.png11.17KB5.32KB▼ 52.36%
assets/banner-772x250.png40.37KB17.92KB▼ 55.60%
assets/icon-256x256.png28.44KB12.56KB▼ 55.83%