78% smart-phone-addon-for-ninja-forms

Code Review | Smart Phone Addon for Ninja Forms

WordPress plugin Smart Phone Addon for Ninja Forms scored78%from 54 tests.

About plugin

  • Plugin page: smart-phone-addon...
  • Plugin version: 1.2.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4.0
  • WordPress version: 6.3.1
  • First release: Jan 5, 2023
  • Latest release: Oct 31, 2023
  • Number of updates: 15
  • Update frequency: every 19.9 days
  • Top authors: yaroslavborodii (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /627 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

This is a short check of server-side resources used by Smart Phone Addon for Ninja Forms
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0046.45 ▲5.78
Dashboard /wp-admin3.31 ▼0.0445.62 ▼11.50
Posts /wp-admin/edit.php3.36 ▲0.0048.65 ▲4.62
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.29 ▼12.65
Media Library /wp-admin/upload.php3.23 ▲0.0032.64 ▼3.73

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 51 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Smart Phone Addon for Ninja Forms
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▼0.021.94 ▲0.3444.93 ▲1.46
Dashboard /wp-admin2,195 ▲155.58 ▼0.08102.68 ▲11.6742.76 ▲5.78
Posts /wp-admin/edit.php2,103 ▲31.96 ▲0.0243.08 ▲2.8239.25 ▲1.64
Add New Post /wp-admin/post-new.php1,526 ▼923.58 ▲5.53719.32 ▲12.2853.96 ▼4.77
Media Library /wp-admin/upload.php1,394 ▼34.20 ▼0.0594.55 ▼1.1843.86 ▲5.43

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 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 everything seems fine, this is not an exhaustive test

SRP 0% 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 fix the following items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/smart-phone-addon-for-ninja-forms/public/partials/ninja-forms-spn-addon-public-display.php
    • > /wp-content/plugins/smart-phone-addon-for-ninja-forms/admin/partials/ninja-forms-spn-addon-admin-display.php
    • > /wp-content/plugins/smart-phone-addon-for-ninja-forms/admin/ninja-forms-builder-templates/templates/select-multiple.html.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'NF_Fields_Phone' not found in wp-content/plugins/smart-phone-addon-for-ninja-forms/admin/ninja-forms-fields/class-spn-field.php:12

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: spn, intltelinput, smart phone addon, international telephone input, ninja forms

smart-phone-addon-for-ninja-forms/ninja-forms-spn-addon.php 85% from 13 tests

The main file in "Smart Phone Addon for Ninja Forms" v. 1.2.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("smart-phone-addon-for-ninja-forms.php" instead of "ninja-forms-spn-addon.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
Everything looks great! No dangerous files found in this plugin1,122 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript17128348585
PHP17179716400
Markdown113049
HTML111046
JSON10027
Sass14014
CSS2041

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity2.27
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.44
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods32
▷ Static methods39.38%
▷ Public methods2578.12%
▷ Protected methods13.12%
▷ Private methods618.75%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.24MB with 0.15MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/intltelinput/flags.png68.68KB24.74KB▼ 63.98%
assets/images/intltelinput/flags@2x.png179.65KB69.58KB▼ 61.27%