10% sms4wp

Code Review | SMS for WordPress

WordPress plugin SMS for WordPress scored10%from 54 tests.

About plugin

  • Plugin page: sms4wp
  • Plugin version: 1.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.3
  • WordPress version: 6.3.1
  • First release: Nov 25, 2014
  • Latest release: Nov 18, 2019
  • Number of updates: 132
  • Update frequency: every 13.8 days
  • Top authors: StanleyChoi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /58,406 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/sms4wp/includes/controls/sms4wp.lib.php+424
    The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence

Server metrics [RAM: ▼1.17MB] [CPU: ▼47.09ms] Passed 4 tests

A check of server-side resources used by SMS for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.79 ▼0.6714.46 ▼32.44
Dashboard /wp-admin2.85 ▼0.4517.82 ▼34.94
Posts /wp-admin/edit.php2.85 ▼0.5016.28 ▼35.58
Add New Post /wp-admin/post-new.php2.85 ▼3.0417.06 ▼85.41
Media Library /wp-admin/upload.php2.85 ▼0.3814.79 ▼26.83
설정 /wp-admin/admin.php?page=sms4wp-configure2.8518.29
메시지 보내기 /wp-admin/admin.php?page=sms4wp-send2.8525.39
템플릿 관리 /wp-admin/admin.php?page=sms4wp-template2.8517.39
전송 내역 /wp-admin/admin.php?page=sms4wp-send-list2.8517.73
수신자 관리 /wp-admin/admin.php?page=sms4wp-receivers2.8516.54
가져오기 /wp-admin/admin.php?page=sms4wp-book-file2.8516.78
수신자 그룹관리 /wp-admin/admin.php?page=sms4wp-group2.8515.73

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 69 new files
Database: 5 new tables, 6 new options
New tables
wp_sms4wp_options
wp_sms4wp_sends
wp_sms4wp_templates
wp_sms4wp_groups
wp_sms4wp_receivers
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for SMS for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲7514.36 ▼0.372.29 ▲0.3943.40 ▼2.48
Dashboard /wp-admin2,245 ▲655.59 ▼0.0384.06 ▼9.8344.58 ▲3.00
Posts /wp-admin/edit.php2,144 ▲442.01 ▲0.0435.19 ▼5.2447.50 ▲9.71
Add New Post /wp-admin/post-new.php1,564 ▲3822.97 ▼0.61664.82 ▼18.5250.83 ▼0.82
Media Library /wp-admin/upload.php1,441 ▲444.11 ▼0.1098.73 ▼14.3650.87 ▲1.75
설정 /wp-admin/admin.php?page=sms4wp-configure1,0671.6924.9259.45
메시지 보내기 /wp-admin/admin.php?page=sms4wp-send1,5483.5050.6667.21
템플릿 관리 /wp-admin/admin.php?page=sms4wp-template9952.0225.4845.23
전송 내역 /wp-admin/admin.php?page=sms4wp-send-list1,0351.6925.6050.19
수신자 관리 /wp-admin/admin.php?page=sms4wp-receivers1,0401.6525.7047.28
가져오기 /wp-admin/admin.php?page=sms4wp-book-file9092.0425.1857.59
수신자 그룹관리 /wp-admin/admin.php?page=sms4wp-group1,1042.0523.4646.53

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/sms4wp/includes/core/sms4wp.init.php+29
    Undefined index: sms4wp_charge_notice_checker
  • Zombie tables were found after uninstall: 5 tables
    • wp_sms4wp_templates
    • wp_sms4wp_options
    • wp_sms4wp_sends
    • wp_sms4wp_groups
    • wp_sms4wp_receivers
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% 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)
Smoke test failed, please fix the following
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sms4wp-group
    • > Notice in wp-content/plugins/sms4wp/includes/core/sms4wp.init.php+29
    Undefined index: sms4wp_charge_notice_checker
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sms4wp-configure
    • > Warning in wp-content/plugins/sms4wp/includes/models/sms4wp.lib.php+35
    Division by zero
    • > GET request to /wp-admin/admin.php?page=sms4wp-configure
    • > Notice in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_configure.php+33
    Undefined index: sms4wp_plugin
    • > GET request to /wp-admin/admin.php?page=sms4wp-configure
    • > Warning in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_configure.php+33
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=sms4wp-configure
    • > Notice in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_configure.php+65
    Undefined index: sms4wp_auth_signature
    • > GET request to /wp-admin/admin.php?page=sms4wp-configure
    • > Notice in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_configure.php+85
    Undefined index: sms4wp_charge_notice_count
    • > GET request to /wp-admin/admin.php?page=sms4wp-configure
    • > Notice in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_configure.php+86
    Undefined index: sms4wp_charge_notice_to
    • > GET request to /wp-admin/admin.php?page=sms4wp-configure
    • > Notice in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_configure.php+87
    Undefined index: sms4wp_charge_notice_from
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sms4wp-send
    • > Notice in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_sms_form.php+33
    Undefined index: sms4wp_reply_number
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sms4wp-group
    • > Warning in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_group.php+93
    count(): Parameter must be an array or an object that implements Countable
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sms4wp-receivers
    • > Notice in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_receivers.php+21
    Undefined index: paged
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sms4wp-group
    • > Notice in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_group.php+15
    Undefined index: sf
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sms4wp-receivers
    • > Notice in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_receivers.php+23
    Undefined index: ss
    • > GET request to /wp-admin/admin.php?page=sms4wp-template
    • > Notice in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_template.php+59
    Undefined index: template
    • > GET request to /wp-admin/admin.php?page=sms4wp-send-list
    • > Notice in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_send_list.php+74
    Undefined index: send
    • > GET request to /wp-admin/admin.php?page=sms4wp-receivers
    • > Notice in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_receivers.php+20
    Undefined index: s
    • > GET request to /wp-admin/admin.php?page=sms4wp-receivers
    • > Notice in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_receivers.php+77
    Undefined index: receivers
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sms4wp-group
    • > Notice in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_group.php+170
    Undefined variable: paged
    • > GET request to /wp-admin/admin.php?page=sms4wp-group
    • > Notice in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_group.php+90
    Undefined index: group

SRP 50% 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
The following issues need your attention
  • 24× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant SMS4WP_INC_VIEW_CSS_URL - assumed 'SMS4WP_INC_VIEW_CSS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_sms_form.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'class.ole_pps_root.php' (include_path='.:/usr/share/php') in wp-content/plugins/sms4wp/includes/models/Excel/php_writeexcel/class.writeexcel_workbookbig.inc.php on line 28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_template_form.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_book_file.php:5
    • > PHP Warning
      Use of undefined constant SMS4WP_INC_VIEW_CSS_URL - assumed 'SMS4WP_INC_VIEW_CSS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_template.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_receivers.php:5
    • > PHP Notice
      Undefined index: sf in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_group.php on line 15
    • > PHP Warning
      Use of undefined constant SMS4WP_INC_VIEW_CSS_URL - assumed 'SMS4WP_INC_VIEW_CSS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_group_form.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_receiver_form.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/sms4wp/includes/views/templates/sms4wp_group.php:34

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
10 plugin tags: sms panel, register, sms, sms subscribe, notification...

sms4wp/sms4wp.php Passed 13 tests

Analyzing the main PHP file in "SMS for WordPress" version 1.1.8
33 characters long description:
Send SMS messages from WordPress!

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected11,823 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
PHP402,4933,30210,152
JavaScript43241701,327
CSS23814231
Markdown1400113

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity42.23
▷ Minimum class complexity1.00
▷ Maximum class complexity213.00
Average method complexity3.80
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods324
▷ Static methods51.54%
▷ Public methods32399.69%
▷ Protected methods00.00%
▷ Private methods10.31%
Functions88
▷ Named functions8798.86%
▷ Anonymous functions11.14%
Constants107
▷ Global constants107100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
10 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/views/img/btn_down.png1.05KB0.22KB▼ 78.94%
includes/views/img/error.png0.34KB0.28KB▼ 19.55%
includes/views/img/file-upload-tick.png0.47KB0.41KB▼ 12.76%
includes/views/img/btn_up.png1.03KB0.21KB▼ 79.71%
includes/views/img/help-icon.png0.65KB0.56KB▼ 15.07%