52% isms-contact-form-with-2-factor-authenticator

Code Review | iSMS Contact Form with 2 Factor Authenticator

WordPress plugin iSMS Contact Form with 2 Factor Authenticator scored 52% from 54 tests.

About plugin

  • Plugin page: isms-contact-form...
  • Plugin version: 1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.7.2
  • WordPress version: 6.3.1
  • First release: Aug 24, 2020
  • Latest release: May 24, 2021
  • Number of updates: 7
  • Update frequency: every 41.4 days
  • Top authors: mobiweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 438 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.91MB] [CPU: ▼48.14ms] Passed 4 tests

An overview of server-side resources used by iSMS Contact Form with 2 Factor Authenticator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.386.51 ▼35.29
Dashboard /wp-admin2.10 ▼1.217.00 ▼37.36
Posts /wp-admin/edit.php2.10 ▼1.267.31 ▼38.80
Add New Post /wp-admin/post-new.php2.10 ▼3.797.67 ▼81.10
Media Library /wp-admin/upload.php2.10 ▼1.138.36 ▼24.11
Add new /wp-admin/admin.php?page=isms-authform-new2.107.63
Forms /wp-admin/admin.php?page=isms-authform-list2.107.79
Sent Mail /wp-admin/admin.php?page=isms-authform-sent2.107.66
/wp-admin/admin.php?page=isms-authform-update2.106.22
iSMS Contact with Authenticator /wp-admin/admin.php?page=isms-authform-setting2.107.53

Server storage [IO: ▲1.21MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 29 new files
Database: 6 new tables, 6 new options
New tables
wp_isms_authform_form_form_meta
wp_isms_authform_form
wp_isms_authform_otp
wp_isms_authform_form_sent
wp_isms_authform_form_fields
wp_isms_authform_form_message
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

iSMS Contact Form with 2 Factor Authenticator: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,989 ▲20013.83 ▼0.919.90 ▲8.3033.66 ▼12.16
Dashboard /wp-admin2,246 ▲435.79 ▼0.0198.27 ▲2.2544.03 ▲6.31
Posts /wp-admin/edit.php2,138 ▲461.98 ▼0.0237.24 ▲0.9738.82 ▲9.10
Add New Post /wp-admin/post-new.php1,399 ▼13520.39 ▼2.82566.90 ▼63.5135.92 ▼25.61
Media Library /wp-admin/upload.php1,428 ▲404.17 ▼0.0596.26 ▼7.5650.00 ▲5.08
Add new /wp-admin/admin.php?page=isms-authform-new1,3911.9332.4075.74
Forms /wp-admin/admin.php?page=isms-authform-list1,0001.9529.3443.46
Sent Mail /wp-admin/admin.php?page=isms-authform-sent9822.0327.7043.65
/wp-admin/admin.php?page=isms-authform-update1,3421.9328.4949.68
iSMS Contact with Authenticator /wp-admin/admin.php?page=isms-authform-setting2,6412.9940.2341.82

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/iSMSAuthFormProcess.php+18
    Trying to access array offset on value of type bool
  • This plugin does not fully uninstall, leaving 4 tables in the database
    • wp_isms_authform_form
    • wp_isms_authform_form_form_meta
    • wp_isms_authform_form_message
    • wp_isms_authform_form_sent
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 15 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=isms-authform-setting
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/iSMSAuthFormProcess.php+80
    Trying to access array offset on value of type bool
  • 20 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=isms-authform-setting
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+6
    Undefined index: id
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+16
    Trying to get property 'title' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+39
    Trying to get property 'shortcode' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+191
    Trying to get property 'fields' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+184
    Trying to get property 'form_data' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+202
    Trying to get property 'mail_to' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+206
    Trying to get property 'mail_from' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+210
    Trying to get property 'mail_subject' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+214
    Trying to get property 'mail_additional_header' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+218
    Trying to get property 'mail_body' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+223
    Trying to get property 'html_format' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+231
    Trying to get property 'mobile_invalid' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+235
    Trying to get property 'sent_successfully' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+240
    Trying to get property 'failed_to_send' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+245
    Trying to get property 'errors_occurred' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+250
    Trying to get property 'referred_to_as_spam' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+255
    Trying to get property 'sender_must_accept' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+260
    Trying to get property 'sender_must_fill_in' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+265
    Trying to get property 'max_allowed_length' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+270
    Trying to get property 'min_allowed_length' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+275
    Trying to get property 'date_invalid' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+280
    Trying to get property 'date_min_limit' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+285
    Trying to get property 'date_max_limit' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+290
    Trying to get property 'upload_error' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+295
    Trying to get property 'upload_file_type_error' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+300
    Trying to get property 'upload_file_too_large' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+305
    Trying to get property 'upload_php_error' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+310
    Trying to get property 'invalid_number' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+315
    Trying to get property 'number_min_limit' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+320
    Trying to get property 'number_max_limit' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+325
    Trying to get property 'incorrect_quiz' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+330
    Trying to get property 'email_invalid' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+335
    Trying to get property 'url_invalid' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-authform-update
    • > Notice in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php+339
    Trying to get property 'tel_invalid' of non-object

SRP 0% 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 take a closer look at the following
  • 6× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/iSMSAuthFormProcess.php
    • > /wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/iSMSAuthForm.php
    • > /wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/iSMSAuthFormTableList.php
    • > /wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/add-new.php
    • > /wp-content/plugins/isms-contact-form-with-2-factor-authenticator/isms-authform.php
    • > /wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/Plugin.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/add-new.php:360
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php:7
    • > PHP Notice
      Undefined index: id in wp-content/plugins/isms-contact-form-with-2-factor-authenticator/includes/update-form.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention: Please take inspiration from this readme.txt

isms-contact-form-with-2-factor-authenticator/isms-authform.php 77% from 13 tests

The main PHP file in "iSMS Contact Form with 2 Factor Authenticator" ver. 1.1 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: It is recommended to name the main PHP file as the plugin slug ("isms-contact-form-with-2-factor-authenticator.php" instead of "isms-authform.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Requires PHP: The required version number must match the one declared in readme.txt ("5.6.20" instead of "5.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 plugin8,524 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP97075883,571
JavaScript82017403,108
CSS66871,231
XML300614

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity76.83
▷ Minimum class complexity1.00
▷ Maximum class complexity182.00
Average method complexity3.95
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods154
▷ Static methods42.60%
▷ Public methods13084.42%
▷ Protected methods2113.64%
▷ Private methods31.95%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.23MB with 0.15MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/prefix/img/flags.png69.20KB23.42KB▼ 66.16%
assets/prefix/img/flags@2x.png170.28KB68.04KB▼ 60.04%