93% contact-form-7-phone-mask-module

Code Review | Contact Form 7 Phone Module

WordPress plugin Contact Form 7 Phone Module scored 93% from 53 tests.

About plugin

  • Plugin page: contact-form-7-ph...
  • Plugin version: 2.3.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.5.1
  • WordPress version: 5.8.1
  • First release: Aug 26, 2012
  • Latest release: Dec 26, 2013
  • Number of updates: 20
  • Update frequency: every 24.4 days
  • Top authors: Gabriel Reguly (100%)

Code review

53 tests

User reviews

7 reviews

Install metrics

600+ active / 15,985 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼278.58ms] Passed 4 tests

Analyzing server-side resources used by Contact Form 7 Phone Module
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.1633.41 ▲12.96
Dashboard /wp-admin3.10 ▲0.0541.16 ▼5.13
Posts /wp-admin/edit.php3.15 ▲0.0542.23 ▼4.30
Add New Post /wp-admin/post-new.php5.46 ▲0.0389.45 ▼1,094.35
Media Library /wp-admin/upload.php3.04 ▲0.0429.58 ▼10.52

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Contact Form 7 Phone Module
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,650 ▲4415.76 ▲0.126.85 ▼2.6945.59 ▼5.97
Dashboard /wp-admin2,934 ▲815.91 ▲0.04139.49 ▲11.53107.28 ▲3.04
Posts /wp-admin/edit.php2,703 ▼02.69 ▲0.0061.63 ▼2.3792.42 ▼0.88
Add New Post /wp-admin/post-new.php1,651 ▼38717.18 ▼2.07365.71 ▼9.07108.76 ▼1.17
Media Library /wp-admin/upload.php1,772 ▼35.03 ▲0.02145.76 ▼11.11109.21 ▼8.04

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-form-7-phone-mask-module/phone.php:33

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Screenshot #1 (screenshot-1.png) image missing
The official readme.txt is a good inspiration

contact-form-7-phone-mask-module/phone.php 92% from 13 tests

The principal PHP file in "Contact Form 7 Phone Module" v. 2.3.4.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("contact-form-7-phone-mask-module.php" instead of "phone.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin507 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript12210250
PHP15534213
PO File1111244

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.03MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png31.37KB30.69KB▼ 2.18%