79% smart-phone-field-for-gravity-forms

Code Review | Smart phone field for Gravity Forms

WordPress plugin Smart phone field for Gravity Forms scored 79% from 54 tests.

About plugin

  • Plugin page: smart-phone-field...
  • Plugin version: 2.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Jan 19, 2021
  • Latest release: Jul 23, 2023
  • Number of updates: 14
  • Update frequency: every 65.4 days
  • Top authors: kaisarahmmed (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

5,000+ active / 18,716 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.54MB] [CPU: ▼1.74ms] 75% from 4 tests

An overview of server-side resources used by Smart phone field for Gravity Forms
Please have a look at the following items
  • CPU: Try to keep total CPU usage under 500.00ms (currently 2,024.16ms on /wp-admin/options-general.php?page=smart-phone-field-for-gravity-forms-pro)
PageMemory (MB)CPU Time (ms)
Home /4.05 ▲0.5949.13 ▼2.47
Dashboard /wp-admin3.90 ▲0.5958.74 ▲3.18
Posts /wp-admin/edit.php3.95 ▲0.5958.59 ▲8.90
Add New Post /wp-admin/post-new.php6.44 ▲0.5597.92 ▼8.49
Media Library /wp-admin/upload.php3.66 ▲0.4341.78 ▲0.83
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius3.9944.32
Smart Phone Field /wp-admin/options-general.php?page=smart-phone-field-for-gravity-forms-pro3.902,024.16

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Smart phone field for Gravity Forms
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲3613.56 ▲0.331.52 ▼0.4834.15 ▼10.24
Dashboard /wp-admin2,242 ▲335.87 ▲1.01108.49 ▼0.3441.62 ▼10.30
Posts /wp-admin/edit.php2,125 ▲362.05 ▲0.0540.54 ▲0.2539.69 ▲4.96
Add New Post /wp-admin/post-new.php1,536 ▲1617.64 ▼5.72635.57 ▲4.1252.05 ▼4.38
Media Library /wp-admin/upload.php1,424 ▲334.27 ▲0.0497.07 ▼7.6242.84 ▼5.40
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0741.8526.6929.64
Smart Phone Field /wp-admin/options-general.php?page=smart-phone-field-for-gravity-forms-pro9892.0228.0962.75

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/smart-phone-field-for-gravity-forms/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 9 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • fs_active_plugins
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • fs_accounts
    • fs_debug_mode
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: phone validation, smart phone field, gravityforms, international telephone field, international phone input...

smart-phone-field-for-gravity-forms/gravityforms-smart-phone-field.php 85% from 13 tests

Analyzing the main PHP file in "Smart phone field for Gravity Forms" version 2.1
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("smart-phone-field-for-gravity-forms.php" instead of "gravityforms-smart-phone-field.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis 97% from 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 plugin35,320 lines of code in 151 files:
LanguageFilesBlank linesComment linesLines of code
PHP1218,06517,21433,714
JavaScript874106847
PO File37676281
CSS16480262
Markdown1680214
SVG2002

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity86.21
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.57
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes52
▷ Abstract classes23.85%
▷ Concrete classes5096.15%
▷ Final classes00.00%
Methods1,271
▷ Static methods19815.58%
▷ Public methods88269.39%
▷ Protected methods171.34%
▷ Private methods37229.27%
Functions107
▷ Named functions107100.00%
▷ Anonymous functions00.00%
Constants150
▷ Global constants10368.67%
▷ Class constants4731.33%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 PNG files occupy 0.27MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
backend/img/restrict-dates.png2.59KB1.28KB▼ 50.47%
freemius/assets/img/smart-phone-field-for-gravity-forms-pro.png3.02KB1.50KB▼ 50.19%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
frontend/img/flags.png69.20KB23.42KB▼ 66.16%
frontend/img/invalid.png0.44KB0.32KB▼ 25.56%