83% loginbox-widget

Code Review | LoginBox Widget

WordPress plugin LoginBox Widget scored83%from 54 tests.

About plugin

  • Plugin page: loginbox-widget
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9
  • WordPress version: 6.3.1
  • First release: Aug 30, 2018
  • Latest release: Aug 30, 2018
  • Number of updates: 7
  • Update frequency: N/A
  • Top authors: geosn0w (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /585 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.13ms] Passed 4 tests

This is a short check of server-side resources used by LoginBox Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0245.07 ▲0.24
Dashboard /wp-admin3.32 ▲0.0247.84 ▲1.52
Posts /wp-admin/edit.php3.37 ▲0.0246.93 ▼3.64
Add New Post /wp-admin/post-new.php5.90 ▲0.0288.05 ▼3.95
Media Library /wp-admin/upload.php3.25 ▲0.0236.14 ▼1.15

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_geosn0w_loginboxwidget
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for LoginBox Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▲0.101.81 ▼0.0645.25 ▲0.40
Dashboard /wp-admin2,200 ▲155.82 ▼0.03101.84 ▼1.6537.28 ▼5.75
Posts /wp-admin/edit.php2,089 ▼32.06 ▲0.0634.69 ▼7.1431.41 ▼6.81
Add New Post /wp-admin/post-new.php1,514 ▼2117.48 ▼5.68657.05 ▲14.2353.45 ▲4.98
Media Library /wp-admin/upload.php1,382 ▼64.29 ▲0.13100.31 ▼8.2141.68 ▼0.04

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_geosn0w_loginboxwidget
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% 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)
Even though no errors were found, 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 items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/loginbox-widget/LoginBoxWidget.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% 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:
  • Contributors: Plugin contributors not specified
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The widget when the user is authenticated.), #2 (The widget when the user is not authenticated and did not yet click the authenticate button.), #3 (The widget when the user is not authenticated but clicked the authenticate button.)
The official readme.txt might help

loginbox-widget/LoginBoxWidget.php 77% from 13 tests

The main PHP script in "LoginBox Widget" version 1.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 163 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("loginbox-widget.php" instead of "LoginBoxWidget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin37 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP171137

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Screenshot-2.PNG11.63KB5.83KB▼ 49.89%
Screenshot-3.PNG16.51KB7.69KB▼ 53.41%
Screenshot-1.PNG13.09KB6.25KB▼ 52.22%