62% isms-contact-form

Code Review | iSMS Contact Form

WordPress plugin iSMS Contact Form scored62%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.2-5.7.2
  • WordPress version: 6.3.1
  • First release: Jul 21, 2020
  • Latest release: May 21, 2021
  • Number of updates: 14
  • Update frequency: every 21.8 days
  • Top authors: mobiweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /448 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
Installer ran successfully

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

Analyzing server-side resources used by iSMS Contact Form
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.385.71 ▼35.25
Dashboard /wp-admin2.10 ▼1.207.25 ▼41.49
Posts /wp-admin/edit.php2.10 ▼1.268.06 ▼38.46
Add New Post /wp-admin/post-new.php2.10 ▼3.796.94 ▼77.59
Media Library /wp-admin/upload.php2.10 ▼1.136.89 ▼30.00
iSMS Account /wp-admin/admin.php?page=isms-contact-account2.106.28
iSMS Contact /wp-admin/admin.php?page=isms-contact2.106.52
Add new /wp-admin/admin.php?page=isms-contact-new2.106.49
/wp-admin/admin.php?page=isms-contact-update2.107.85
Sent Mail /wp-admin/admin.php?page=isms-contact-sent2.106.75

Server storage [IO: ▲1.18MB] [DB: ▲0.08MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 31 new files
Database: 5 new tables, 7 new options
New tables
wp_isms_contact_sent
wp_isms_contact_form_meta
wp_isms_contact_form_message
wp_isms_contact_form_fields
wp_isms_contact_form
New WordPress options
enable-sms
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by iSMS Contact Form
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,967 ▲22113.71 ▼0.649.95 ▲8.2138.35 ▼6.22
Dashboard /wp-admin2,237 ▲495.90 ▲1.0296.86 ▼18.1139.39 ▼5.35
Posts /wp-admin/edit.php2,123 ▲342.03 ▼0.0139.19 ▲1.5034.93 ▼2.53
Add New Post /wp-admin/post-new.php1,560 ▲2423.26 ▲0.16618.57 ▼10.0454.87 ▼10.25
Media Library /wp-admin/upload.php1,425 ▲374.21 ▼0.0199.60 ▲2.8642.04 ▼0.86
iSMS Account /wp-admin/admin.php?page=isms-contact-account2,5883.0240.2248.19
iSMS Contact /wp-admin/admin.php?page=isms-contact9701.9727.9938.30
Add new /wp-admin/admin.php?page=isms-contact-new1,3781.9628.4036.08
/wp-admin/admin.php?page=isms-contact-update1,3301.9527.8434.35
Sent Mail /wp-admin/admin.php?page=isms-contact-sent9641.9328.2430.82

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/isms-contact-form/includes/iSMSContactProcess.php+17
    Trying to access array offset on value of type bool
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • enable-sms
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=isms-contact-sent
    • > Notice in wp-content/plugins/isms-contact-form/includes/iSMSContactProcess.php+18
    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-contact-sent
    • > 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-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+6
    Undefined index: id
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+16
    Trying to get property 'title' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+38
    Trying to get property 'shortcode' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+190
    Trying to get property 'fields' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+183
    Trying to get property 'form_data' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+201
    Trying to get property 'mail_to' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+205
    Trying to get property 'mail_from' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+209
    Trying to get property 'mail_subject' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+213
    Trying to get property 'mail_additional_header' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+217
    Trying to get property 'mail_body' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+222
    Trying to get property 'html_format' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+230
    Trying to get property 'mobile_invalid' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+234
    Trying to get property 'sent_successfully' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+239
    Trying to get property 'failed_to_send' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+244
    Trying to get property 'errors_occurred' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+249
    Trying to get property 'referred_to_as_spam' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+254
    Trying to get property 'sender_must_accept' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+259
    Trying to get property 'sender_must_fill_in' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+264
    Trying to get property 'max_allowed_length' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+269
    Trying to get property 'min_allowed_length' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+274
    Trying to get property 'date_invalid' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+279
    Trying to get property 'date_min_limit' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+284
    Trying to get property 'date_max_limit' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+289
    Trying to get property 'upload_error' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+294
    Trying to get property 'upload_file_type_error' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+299
    Trying to get property 'upload_file_too_large' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+304
    Trying to get property 'upload_php_error' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+309
    Trying to get property 'invalid_number' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+314
    Trying to get property 'number_min_limit' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+319
    Trying to get property 'number_max_limit' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+324
    Trying to get property 'incorrect_quiz' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+329
    Trying to get property 'email_invalid' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+334
    Trying to get property 'url_invalid' of non-object
    • > GET request to /wp-admin/admin.php?page=isms-contact-update
    • > Notice in wp-content/plugins/isms-contact-form/includes/update-form.php+338
    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
Almost there! Just fix the following items
  • 8× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/isms-contact-form/captchaImageSource.php
    • > /wp-content/plugins/isms-contact-form/isms-contact-form.php
    • > /wp-content/plugins/isms-contact-form/includes/iSMSContactCaptcha.php
    • > /wp-content/plugins/isms-contact-form/includes/iSMSContact.php
    • > /wp-content/plugins/isms-contact-form/includes/add-new.php
    • > /wp-content/plugins/isms-contact-form/includes/Plugin.php
    • > /wp-content/plugins/isms-contact-form/includes/iSMSContactProcess.php
    • > /wp-content/plugins/isms-contact-form/includes/iSMSContactTableList.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/isms-contact-form/includes/add-new.php:210
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/isms-contact-form/includes/update-form.php:7
    • > PHP Notice
      Undefined index: id in wp-content/plugins/isms-contact-form/includes/update-form.php on line 6

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: customer enquiry form, customer contact builder, tags contact form

isms-contact-form/isms-contact-form.php 92% from 13 tests

The principal PHP file in "iSMS Contact Form" v. 1.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Requires PHP: Required version 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 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin8,229 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP116895783,413
JavaScript81486792,970
CSS66371,232
XML300614

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity64.86
▷ Minimum class complexity1.00
▷ Maximum class complexity182.00
Average method complexity3.88
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods155
▷ Static methods42.58%
▷ Public methods13285.16%
▷ Protected methods2113.55%
▷ Private methods21.29%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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%