77% sms-sender

Code Review | SMS Sender

WordPress plugin SMS Sender scored77%from 54 tests.

About plugin

  • Plugin page: sms-sender
  • Plugin version: 0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.5.2
  • WordPress version: 6.3.1
  • First release: Aug 25, 2015
  • Latest release: Jul 18, 2016
  • Number of updates: 14
  • Update frequency: every 23.5 days
  • Top authors: daif (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /3,112 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by SMS Sender
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.39 ▼1.54
Dashboard /wp-admin3.32 ▲0.0247.11 ▼7.71
Posts /wp-admin/edit.php3.37 ▲0.0147.42 ▼4.52
Add New Post /wp-admin/post-new.php5.90 ▲0.0186.48 ▼11.30
Media Library /wp-admin/upload.php3.24 ▲0.0158.39 ▲23.19

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 36 new files
Database: 4 new tables, 13 new options
New tables
wp_smsgw_contacts
wp_smsgw_messages
wp_smsgw_send
wp_smsgw_groups
New WordPress options
smsgwnet_api_pass
smsgwnet_credit
can_compress_scripts
smsgwnet_db_version
db_upgraded
smsgwnet_api_user
smsgwnet_api_provider
widget_recent-posts
smsgwnet_api_tag
smsgwnet_version
...

Browser metrics Passed 4 tests

An overview of browser requirements for SMS Sender
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲1914.34 ▼0.022.09 ▲0.1841.69 ▼7.77
Dashboard /wp-admin2,208 ▲375.52 ▼0.0881.85 ▼17.3040.61 ▼2.20
Posts /wp-admin/edit.php2,116 ▲161.99 ▲0.0241.48 ▲7.7336.65 ▼0.84
Add New Post /wp-admin/post-new.php1,539 ▲422.91 ▲5.03607.26 ▼36.9556.28 ▼13.31
Media Library /wp-admin/upload.php1,416 ▲164.21 ▼0.05179.90 ▲74.5472.16 ▲29.11

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

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)
Good news, no errors were detected

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 take a closer look at the following
  • 10× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/sms-sender/includes/hooks/uninstall.php
    • > /wp-content/plugins/sms-sender/templates/views/_footer.php
    • > /wp-content/plugins/sms-sender/includes/actions/send.php
    • > /wp-content/plugins/sms-sender/includes/actions/contacts.php
    • > /wp-content/plugins/sms-sender/smsgw.php
    • > /wp-content/plugins/sms-sender/includes/actions/options.php
    • > /wp-content/plugins/sms-sender/includes/actions/messages.php
    • > /wp-content/plugins/sms-sender/includes/hooks/activation.php
    • > /wp-content/plugins/sms-sender/includes/actions/groups.php
    • > /wp-content/plugins/sms-sender/includes/hooks/deactivate.php
  • 12× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/sms-sender/templates/views/groups_index.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/sms-sender/templates/views/options_index.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_script() in wp-content/plugins/sms-sender/templates/views/_header.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/sms-sender/templates/views/messages_index.php:1
    • > PHP Fatal error
      Uncaught Error: Interface 'ProviderInterface' not found in wp-content/plugins/sms-sender/includes/providers/mobilyws_provider.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/sms-sender/templates/views/send_index.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/sms-sender/templates/views/contacts_index.php:1
    • > PHP Fatal error
      Uncaught Error: Interface 'ProviderInterface' not found in wp-content/plugins/sms-sender/includes/providers/ashharsms_provider.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'ProviderInterface' not found in wp-content/plugins/sms-sender/includes/providers/resaltynet_provider.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'ProviderInterface' not found in wp-content/plugins/sms-sender/includes/providers/jawalynet_provider.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === sms-sender === )
You can take inspiration from this readme.txt

sms-sender/smsgw.php 77% from 13 tests

Analyzing the main PHP file in "SMS Sender" version 0.8
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("sms-sender.php" instead of "smsgw.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: The description should be shorter than 140 characters (currently 341 characters long)

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
Good job! No executable or dangerous file extensions detected1,769 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP231212891,611
PO File14554102
JavaScript18143
CSS11013

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity7.12
▷ Minimum class complexity1.00
▷ Maximum class complexity32.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods32
▷ Static methods32100.00%
▷ Public methods32100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions1493.33%
▷ Anonymous functions16.67%
Constants4
▷ Global constants4100.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
8 PNG files occupy 0.26MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png10.00KB3.91KB▼ 60.95%
assets/screenshot-4.png47.33KB18.66KB▼ 60.57%
templates/images/smsgw.png4.77KB2.82KB▼ 40.90%
assets/screenshot-5.png54.12KB21.73KB▼ 59.86%
assets/screenshot-3.png48.28KB18.83KB▼ 61.00%