10% ir-sms

Code Review | Hostiran SMS Plugin

WordPress plugin Hostiran SMS Plugin scored 10% from 54 tests.

About plugin

  • Plugin page: ir-sms
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.5
  • WordPress version: 5.8.1
  • First release: Jan 1, 2013
  • Latest release: Jan 1, 2013
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: mostafa.s1990 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,188 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5505
    load_plugin_textdomain was called with an argument that is deprecated since version 2.7.0 with no alternative available.

Server metrics [RAM: ▼1.71MB] [CPU: ▼217.97ms] Passed 4 tests

Analyzing server-side resources used by Hostiran SMS Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /1.93 ▼0.806.25 ▼17.55
Dashboard /wp-admin1.95 ▼1.116.85 ▼28.07
Posts /wp-admin/edit.php1.95 ▼1.177.16 ▼39.60
Add New Post /wp-admin/post-new.php1.95 ▼3.495.85 ▼775.76
Media Library /wp-admin/upload.php1.95 ▼1.069.23 ▼28.44
SMS Setting /wp-admin/admin.php?page=ir-sms/ir-sms.php1.957.52
Archives SMS /wp-admin/admin.php?page=ir-sms/archives1.956.47
Members Newsletter /wp-admin/admin.php?page=ir-sms/subscribe1.956.59
About Plugin /wp-admin/admin.php?page=ir-sms/about1.958.10
Send SMS /wp-admin/admin.php?page=ir-sms/send1.959.12

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 43 new files
Database: 2 new tables, 2 new options
New tables
wp_sms_archives
wp_sms_subscribes
New WordPress options
recovery_mode_email_last_sent
wp_sms_db_version

Browser metrics Passed 4 tests

A check of browser resources used by Hostiran SMS Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,744 ▲14816.15 ▲0.677.34 ▼1.2749.81 ▲0.73
Dashboard /wp-admin3,022 ▲865.95 ▼0.04145.32 ▼8.47144.02 ▲26.99
Posts /wp-admin/edit.php2,784 ▲452.60 ▼0.1065.79 ▼1.7392.17 ▲0.66
Add New Post /wp-admin/post-new.php1,724 ▲4118.49 ▼0.35415.84 ▲8.21117.64 ▲10.55
Media Library /wp-admin/upload.php1,810 ▼155.02 ▲0.02133.67 ▼36.27157.44 ▲32.14
SMS Setting /wp-admin/admin.php?page=ir-sms/ir-sms.php1,1062.1238.39152.52
Archives SMS /wp-admin/admin.php?page=ir-sms/archives1,2142.1058.3377.47
Members Newsletter /wp-admin/admin.php?page=ir-sms/subscribe1,3112.2362.6793.53
About Plugin /wp-admin/admin.php?page=ir-sms/about1,0992.0858.6083.60
Send SMS /wp-admin/admin.php?page=ir-sms/send9522.1341.2158.71

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5505
    load_plugin_textdomain was called with an argument that is deprecated since version 2.7.0 with no alternative available.
  • Zombie tables were found after uninstall: 2 tables
    • wp_sms_archives
    • wp_sms_subscribes
  • Zombie WordPress options detected upon uninstall: 2 options
    • wp_sms_db_version
    • recovery_mode_email_last_sent

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ir-sms/send
    • > User deprecated in wp-includes/functions.php+5505
    load_plugin_textdomain was called with an argument that is deprecated since version 2.7.0 with no alternative available.
    • > GET request to /wp-admin/admin.php?page=ir-sms/ir-sms.php
    • > Error in wp-content/plugins/ir-sms/inc/hostiran.class.php+47
    Uncaught Error: Class 'SoapClient' not found in wp-content/plugins/ir-sms/inc/hostiran.class.php:47
    Stack trace:
    #0 wp-content/plugins/ir-sms/setting/setting.php(78): hostiran->get_credit()
    #1 wp-content/plugins/ir-sms/ir-sms.php(312): include_once('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(303): wp_sms_setting_page()
    #3 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(470): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 {main}
    thrown
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ir-sms/subscribe
    • > Notice in wp-content/plugins/ir-sms/ir-sms.php+394
    Undefined index: doaction
    • > GET request to /wp-admin/admin.php?page=ir-sms/subscribe
    • > Notice in wp-content/plugins/ir-sms/ir-sms.php+430
    Undefined index: wp_subscribe_name
    • > GET request to /wp-admin/admin.php?page=ir-sms/subscribe
    • > Notice in wp-content/plugins/ir-sms/ir-sms.php+431
    Undefined index: wp_subscribe_mobile
    • > GET request to /wp-admin/admin.php?page=ir-sms/subscribe
    • > Notice in wp-content/plugins/ir-sms/setting/subscribes.php+93
    Undefined index: action
    • > GET request to /wp-admin/admin.php?page=ir-sms/send
    • > Error in wp-content/plugins/ir-sms/inc/hostiran.class.php+47
    Uncaught Error: Class 'SoapClient' not found in wp-content/plugins/ir-sms/inc/hostiran.class.php:47
    Stack trace:
    #0 wp-content/plugins/ir-sms/setting/send-sms.php(49): hostiran->get_credit()
    #1 wp-content/plugins/ir-sms/ir-sms.php(357): include_once('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(303): wp_send_sms_page()
    #3 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(470): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 {main}
    thrown

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
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/ir-sms/newsletter/newsletter.php
    • > /wp-content/plugins/ir-sms/newsletter/activation.php
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/ir-sms/setting/setting.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/ir-sms/tell-a-freind.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ir-sms/setting/subscribes.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ir-sms/setting/archives.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ir-sms/setting/about.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ir-sms/widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bloginfo() in wp-content/plugins/ir-sms/newsletter/form.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/ir-sms/ir-sms.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bloginfo() in wp-content/plugins/ir-sms/setting/send-sms.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ir-sms/setting/meta-box.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=ir-sms/send
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1 1:31592 "jQuery.Deferred exception: Cannot read properties of null (reading 'value')" "TypeError: Cannot read properties of null (reading 'value')\n at checkSMSLength (/wp-content/plugins/ir-sms/js/functions.js:99:49)\n at charLeft2 (/wp-admin/admin.php?page=ir-sms%2Fsend:150:4)\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=ir-sms%2Fsend:169:4)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1:2:30340)" undefined
    • > GET request to /wp-admin/admin.php?page=ir-sms/send
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1 1:31702 Uncaught TypeError: Cannot read properties of null (reading 'value')

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (Screen shot (screenshot-1.png) in SMS Setting page.), #2 (Screen shot (screenshot-2.png) in Send SMS page.), #3 (Screen shot (screenshot-3.png) in Archives sms page.), #4 (Screen shot (screenshot-4.png) in Subscribes list page.)
Please take inspiration from this readme.txt

ir-sms/ir-sms.php Passed 13 tests

The main PHP file in "Hostiran SMS Plugin" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
23 characters long description:
Send SMS Via Wordoress.

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 plugin1,774 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP13210211,025
JavaScript39572425
PO File1157410279
CSS28045

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
21 PNG files occupy 0.38MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screen-shot-3.png36.00KB17.24KB▼ 52.10%
screenshot-2.png33.13KB15.57KB▼ 53.01%
screen-shot-2.png33.13KB15.57KB▼ 53.01%
screenshot-3.png36.00KB17.24KB▼ 52.10%
screen-shot-4.png39.36KB18.06KB▼ 54.11%