83% serwersmspl-widget

Code Review | SerwerSMS.pl

WordPress plugin SerwerSMS.pl scored83%from 54 tests.

About plugin

  • Plugin page: serwersmspl-widget
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-5.8
  • WordPress version: 6.3.1
  • First release: Aug 10, 2016
  • Latest release: Sep 6, 2023
  • Number of updates: 33
  • Update frequency: every 78.6 days
  • Top authors: serwersms (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /987 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.40MB] [CPU: ▼3.06ms] Passed 4 tests

This is a short check of server-side resources used by SerwerSMS.pl
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.3846.69 ▲3.47
Dashboard /wp-admin3.76 ▲0.4556.78 ▲2.46
Posts /wp-admin/edit.php3.81 ▲0.4554.41 ▲1.72
Add New Post /wp-admin/post-new.php6.28 ▲0.3990.53 ▼19.90
Media Library /wp-admin/upload.php3.62 ▲0.3942.02 ▲7.31
Send SMS /wp-admin/admin.php?page=serwersms_message3.1619.39
Payments /wp-admin/admin.php?page=serwersms_payments3.1617.26
Delivery reports /wp-admin/admin.php?page=serwersms_reports3.1620.98
Groups /wp-admin/admin.php?page=serwersms_groups3.1617.43
Received messages /wp-admin/admin.php?page=serwersms_recived3.1620.48
Settings /wp-admin/admin.php?page=serwersms3.5936.96
State of account /wp-admin/admin.php?page=serwersms_account3.1620.19
Contacts /wp-admin/admin.php?page=serwersms_contacts3.1620.81

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 69 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_serwersms_widget

Browser metrics Passed 4 tests

An overview of browser requirements for SerwerSMS.pl
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲16913.85 ▼0.888.53 ▲6.8643.99 ▲3.11
Dashboard /wp-admin2,248 ▲715.59 ▼0.02102.59 ▲8.9681.07 ▲40.73
Posts /wp-admin/edit.php2,150 ▲501.98 ▲0.0039.37 ▲3.0035.39 ▼1.14
Add New Post /wp-admin/post-new.php1,719 ▲19321.93 ▼1.74734.45 ▲42.1855.74 ▼1.92
Media Library /wp-admin/upload.php1,447 ▲504.17 ▼0.05106.53 ▼15.2263.24 ▲16.21
Send SMS /wp-admin/admin.php?page=serwersms_message8572.0025.0329.63
Payments /wp-admin/admin.php?page=serwersms_payments8722.0030.6426.49
Delivery reports /wp-admin/admin.php?page=serwersms_reports8752.0024.3727.14
Groups /wp-admin/admin.php?page=serwersms_groups8542.0024.8023.45
Received messages /wp-admin/admin.php?page=serwersms_recived8722.0026.4629.94
Settings /wp-admin/admin.php?page=serwersms8572.1326.4624.50
State of account /wp-admin/admin.php?page=serwersms_account8752.0023.9627.59
Contacts /wp-admin/admin.php?page=serwersms_contacts8751.9924.1328.06

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
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • widget_serwersms_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 14× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/serwersmspl-widget/api/vendor/serwersms/serwersms-php-client/tests/SendersTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/serwersmspl-widget/api/vendor/serwersms/serwersms-php-client/tests/StatsTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/serwersmspl-widget/api/vendor/serwersms/serwersms-php-client/tests/ErrorTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/serwersmspl-widget/api/vendor/serwersms/serwersms-php-client/tests/ContactsTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/serwersmspl-widget/api/vendor/serwersms/serwersms-php-client/tests/SubaccountsTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/serwersmspl-widget/api/vendor/serwersms/serwersms-php-client/tests/PaymentsTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/serwersmspl-widget/api/vendor/serwersms/serwersms-php-client/tests/PremiumTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/serwersmspl-widget/api/vendor/serwersms/serwersms-php-client/tests/MessagesTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/serwersmspl-widget/api/vendor/serwersms/serwersms-php-client/tests/FilesTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/serwersmspl-widget/api/vendor/serwersms/serwersms-php-client/tests/GroupsTest.php:5

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === serwersmspl-widget === )
The official readme.txt is a good inspiration

serwersmspl-widget/serwersms.php 85% from 13 tests

"SerwerSMS.pl" version 1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("serwersmspl-widget.php" instead of "serwersms.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin4,274 lines of code in 64 files:
LanguageFilesBlank linesComment linesLines of code
PHP557379513,260
PO File1150170339
JavaScript3851247
CSS1211185
Markdown1320162
JSON30081

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity10.17
▷ Minimum class complexity1.00
▷ Maximum class complexity254.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes35
▷ Abstract classes00.00%
▷ Concrete classes35100.00%
▷ Final classes00.00%
Methods205
▷ Static methods3718.05%
▷ Public methods19092.68%
▷ Protected methods146.83%
▷ Private methods10.49%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
3 PNG files occupy 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
image/serwersms_ico.png2.98KB0.20KB▼ 93.44%
image/logo.png3.99KB1.71KB▼ 57.23%
image/loading.png13.06KB0.40KB▼ 96.90%