74% login-with-token

Code Review | Plugin Name: Login With Token

WordPress plugin Plugin Name: Login With Token scored74%from 54 tests.

About plugin

  • Plugin page: login-with-token
  • Plugin version: 1.0
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.2-6.0.3
  • WordPress version: 6.3.1
  • First release: Oct 26, 2022
  • Latest release: Oct 26, 2022
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: tschweizer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /199 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼1.63MB] [CPU: ▼48.68ms] Passed 4 tests

Server-side resources used by Plugin Name: Login With Token
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.36 ▼1.116.72 ▼33.25
Dashboard /wp-admin2.38 ▼0.938.04 ▼42.74
Posts /wp-admin/edit.php2.38 ▼0.989.11 ▼36.55
Add New Post /wp-admin/post-new.php2.38 ▼3.518.81 ▼82.17
Media Library /wp-admin/upload.php2.38 ▼0.866.80 ▼26.98
Test Gateway /wp-admin/admin.php?page=test_gateway2.387.09
Instructions /wp-admin/admin.php?page=submenu_settings2.388.20
Settings /wp-admin/admin.php?page=menu_plugin2.389.15
Log /wp-admin/admin.php?page=sms_log2.387.79

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Plugin Name: Login With Token
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,924 ▲18914.04 ▼0.345.74 ▲3.9240.12 ▼10.65
Dashboard /wp-admin2,246 ▲585.88 ▲0.96104.10 ▼9.6840.70 ▼4.59
Posts /wp-admin/edit.php2,129 ▲402.03 ▲0.0040.78 ▼3.4139.24 ▲3.69
Add New Post /wp-admin/post-new.php1,573 ▲5918.27 ▲0.71631.31 ▼76.7245.51 ▼6.88
Media Library /wp-admin/upload.php1,428 ▲434.20 ▲0.0395.03 ▼7.9240.77 ▼3.65
Test Gateway /wp-admin/admin.php?page=test_gateway8241.7227.2427.28
Instructions /wp-admin/admin.php?page=submenu_settings9012.0725.5330.73
Settings /wp-admin/admin.php?page=menu_plugin9841.8325.7628.68
Log /wp-admin/admin.php?page=sms_log7972.0724.4224.46

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sms_log
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sms_log
    • > Notice in wp-content/plugins/login-with-token/ts-access-with-token.php+618
    Undefined index: tsa_token
    • > GET request to /wp-admin/admin.php?page=sms_log
    • > Warning in wp-content/plugins/login-with-token/ts-access-with-token.php+1072
    file_get_contents(wp-content/uploads/token.log): failed to open stream: No such file or directory

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Looking good! No server-side errors or output on direct access of PHP files

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

Optimizations

Plugin configuration 93% 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
Attributes that need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === Plugin Name: Login With Token === )
You can take inspiration from this readme.txt

login-with-token/ts-access-with-token.php 92% from 13 tests

The main PHP file in "Plugin Name: Login With Token" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("login-with-token.php" instead of "ts-access-with-token.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin1,160 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP6260115982
CSS119383
Markdown126057
JavaScript2221138

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity31.33
▷ Minimum class complexity1.00
▷ Maximum class complexity86.00
Average method complexity3.07
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes133.33%
▷ Concrete classes266.67%
▷ Final classes00.00%
Methods47
▷ Static methods00.00%
▷ Public methods4595.74%
▷ Protected methods24.26%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin