84% cf7-phone-mask-field

Code Review | Contact Form 7 - Phone mask field

WordPress plugin Contact Form 7 - Phone mask field scored84%from 54 tests.

About plugin

  • Plugin page: cf7-phone-mask-field
  • Plugin version: 1.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.6
  • WordPress version: 6.3.1
  • First release: Nov 13, 2017
  • Latest release: Jan 7, 2021
  • Number of updates: 39
  • Update frequency: every 29.5 days
  • Top authors: heorhiiev (100%)

Code review

54 tests

User reviews

24 reviews

Install metrics

20,000+ active /84,100 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Contact Form 7 - Phone mask field
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.73 ▼3.91
Dashboard /wp-admin3.31 ▲0.0145.10 ▼0.94
Posts /wp-admin/edit.php3.36 ▲0.0145.05 ▼5.63
Add New Post /wp-admin/post-new.php5.89 ▲0.0186.37 ▼3.56
Media Library /wp-admin/upload.php3.23 ▲0.0135.95 ▼0.55

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Contact Form 7 - Phone mask field
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲13413.46 ▼0.819.15 ▲7.2943.08 ▼1.72
Dashboard /wp-admin2,198 ▲215.61 ▼0.0289.48 ▼4.1535.43 ▼7.81
Posts /wp-admin/edit.php2,079 ▼211.98 ▼0.0433.41 ▼4.7032.29 ▼0.66
Add New Post /wp-admin/post-new.php1,526 ▼223.20 ▲0.24596.04 ▼17.1364.48 ▲5.33
Media Library /wp-admin/upload.php1,403 ▲34.17 ▲0.0198.04 ▼0.3542.99 ▼7.18

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/cf7-phone-mask-field/cf7-phone-mask-field.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-phone-mask-field/cf7-phone-mask-field.php:34

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)
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
Please take inspiration from this readme.txt

cf7-phone-mask-field/cf7-phone-mask-field.php Passed 13 tests

"Contact Form 7 - Phone mask field" version 1.4.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
105 characters long description:
This plugin adds a new field in which you can set the phone number entry mask or other to Contact Form 7.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected482 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript31811227
PHP16768217
PO File1141638

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.39
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%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin