10% wp-database-session-handler

Code Review | WP Database Session Handler

WordPress plugin WP Database Session Handler scored10%from 54 tests.

About plugin

  • Plugin page: wp-database-sessi...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4.2
  • WordPress version: 6.3.1
  • First release: Mar 20, 2018
  • Latest release: Jun 22, 2020
  • Number of updates: 12
  • Update frequency: every 68.8 days
  • Top authors: stefanocanziani (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,099 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/wp-database-session-handler/session_handler.php+42
    Non-static method SC\WPSH\SC_MySqlSessionHandler::setDbTable() should not be called statically

Server metrics [RAM: ▼1.97MB] [CPU: ▼60.12ms] Passed 4 tests

Analyzing server-side resources used by WP Database Session Handler
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.445.60 ▼36.29
Dashboard /wp-admin2.05 ▼1.307.58 ▼62.47
Posts /wp-admin/edit.php2.05 ▼1.317.82 ▼44.02
Add New Post /wp-admin/post-new.php2.05 ▼3.846.81 ▼97.69
Media Library /wp-admin/upload.php2.05 ▼1.186.81 ▼28.84
DB Session Handler /wp-admin/options-general.php?page=sc_mysqlsessionadmin2.056.65

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 13 new files
Database: 1 new table, 6 new options
New tables
wp_sc_session_handler
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by WP Database Session Handler
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,844 ▲9813.29 ▼1.131.89 ▲0.0941.63 ▲0.12
Dashboard /wp-admin2,228 ▲255.85 ▲0.99100.02 ▼2.0540.15 ▼1.84
Posts /wp-admin/edit.php2,107 ▲71.97 ▼0.0340.07 ▲2.3436.56 ▲4.16
Add New Post /wp-admin/post-new.php1,529 ▲317.47 ▼0.09654.55 ▼23.2679.58 ▲26.91
Media Library /wp-admin/upload.php1,404 ▲44.22 ▼0.01114.36 ▲7.2746.76 ▲1.44
DB Session Handler /wp-admin/options-general.php?page=sc_mysqlsessionadmin9732.0524.2023.89

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/wp-database-session-handler/session_handler.php+42
    Non-static method SC\WPSH\SC_MySqlSessionHandler::setDbTable() should not be called statically
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=sc_mysqlsessionadmin
    • > Deprecated in wp-content/plugins/wp-database-session-handler/session_handler.php+42
    Non-static method SC\WPSH\SC_MySqlSessionHandler::setDbTable() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=sc_mysqlsessionadmin
    • > Notice in wp-content/plugins/wp-database-session-handler/admin.php+17
    Undefined index: update_options
    • > GET request to /wp-admin/options-general.php?page=sc_mysqlsessionadmin
    • > Notice in wp-content/plugins/wp-database-session-handler/admin.php+31
    Undefined index: clean_all
    • > GET request to /wp-admin/options-general.php?page=sc_mysqlsessionadmin
    • > Notice in wp-content/plugins/wp-database-session-handler/admin.php+39
    Undefined index: view_all

SRP 0% from 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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-database-session-handler/sc-session-handler.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-database-session-handler/inc/admin_page.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (Settings page) image missing
The official readme.txt is a good inspiration

wp-database-session-handler/sc-session-handler.php 85% from 13 tests

The main file in "WP Database Session Handler" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 225 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-database-session-handler.php" instead of "sc-session-handler.php")

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
Success! There were no dangerous files found in this plugin525 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP5118132345
PO File25454180

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity8.67
▷ Minimum class complexity2.00
▷ Maximum class complexity13.00
Average method complexity2.05
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods22
▷ Static methods1463.64%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants3
▷ Global constants3100.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
1 PNG file occupies 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png38.65KB15.23KB▼ 60.58%