10% salam

Code Review | Salam - OTP Plugin

WordPress plugin Salam - OTP Plugin scored10%from 54 tests.

About plugin

  • Plugin page: salam
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.7
  • WordPress version: 6.3.1
  • First release: Apr 2, 2021
  • Latest release: Apr 2, 2021
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: ehsansattari (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /525 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Parse error in wp-content/plugins/salam/index.php+102
    syntax error, unexpected end of file

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.50ms] Passed 4 tests

A check of server-side resources used by Salam - OTP Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0042.71 ▼3.11
Dashboard /wp-admin3.31 ▲0.0054.41 ▲1.21
Posts /wp-admin/edit.php3.36 ▲0.0051.30 ▼1.50
Add New Post /wp-admin/post-new.php5.89 ▲0.0095.73 ▼3.03
Media Library /wp-admin/upload.php3.23 ▲0.0035.50 ▼2.35

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Salam - OTP Plugin
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.19 ▼0.151.71 ▼0.4742.60 ▼2.94
Dashboard /wp-admin2,198 ▲215.59 ▼0.0892.59 ▼9.4540.36 ▼9.71
Posts /wp-admin/edit.php2,100 ▼01.97 ▲0.0040.55 ▲3.0135.98 ▲2.66
Add New Post /wp-admin/post-new.php1,409 ▼11717.86 ▼5.23640.73 ▼46.5445.77 ▼8.99
Media Library /wp-admin/upload.php1,391 ▼94.15 ▼0.0799.73 ▼6.0244.12 ▼5.61

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: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/salam/template/login-widget.php
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined index: mobile in wp-content/plugins/salam/login-otp.php on line 4
    • > PHP Parse error
      syntax error, unexpected end of file in wp-content/plugins/salam/index.php on line 102
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/salam/login-otp.php:20
    • > PHP Notice
      Undefined index: otpp in wp-content/plugins/salam/login-otp.php on line 12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: Add an image for screenshot #1 (This screen shot description corresponds to screenshot.(png). Note that the screenshot is stored in the / directory.)
You can take inspiration from this readme.txt

salam/index.php 92% from 13 tests

The main PHP script in "Salam - OTP Plugin" version 1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("salam.php" instead of "index.php")

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
There were no executable files found in this plugin231 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP31527202
JavaScript16229

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.22MB with 0.16MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot.png221.25KB59.13KB▼ 73.28%