68% session-slap

Code Review | Session Slap

WordPress plugin Session Slap scored68%from 54 tests.

About plugin

  • Plugin page: session-slap
  • Plugin version: 1.8.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.5.1
  • WordPress version: 6.3.1
  • First release: Feb 17, 2013
  • Latest release: Jun 21, 2013
  • Number of updates: 5
  • Update frequency: every 24.8 days
  • Top authors: tronhammer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,052 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.88MB] [CPU: ▼32.31ms] Passed 4 tests

This is a short check of server-side resources used by Session Slap
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0435.64 ▼5.37
Dashboard /wp-admin3.06 ▼0.2422.93 ▼28.81
Posts /wp-admin/edit.php3.06 ▼0.2927.25 ▼22.58
Add New Post /wp-admin/post-new.php3.06 ▼2.8222.82 ▼67.98
Media Library /wp-admin/upload.php3.06 ▼0.1723.72 ▼9.87
Session Slap /wp-admin/options-general.php?page=sessionslap_options3.0623.81

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Session Slap
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,909 ▲12313.88 ▼0.647.56 ▲5.5737.55 ▼10.08
Dashboard /wp-admin2,207 ▲335.65 ▲0.1094.04 ▲5.2742.27 ▲3.38
Posts /wp-admin/edit.php2,109 ▲92.02 ▼0.0139.33 ▲3.2938.18 ▲1.09
Add New Post /wp-admin/post-new.php1,539 ▲1323.21 ▼0.06654.42 ▼37.5168.83 ▲14.59
Media Library /wp-admin/upload.php1,409 ▲94.19 ▲0.0594.23 ▼13.1241.32 ▼3.97
Session Slap /wp-admin/options-general.php?page=sessionslap_options8802.0125.3630.61

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/session-slap/sessionslap.php+89
    Undefined variable: sessionslap_options
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=sessionslap_options
    • > Notice in wp-content/plugins/session-slap/sessionslap.php+89
    Undefined variable: sessionslap_options
    • > GET request to /wp-admin/options-general.php?page=sessionslap_options
    • > Warning in wp-content/plugins/session-slap/sessionslap.php+291
    array_merge(): Expected parameter 1 to be an array, bool given
    • > GET request to /wp-admin/options-general.php?page=sessionslap_options
    • > Warning in wp-content/plugins/session-slap/sessionslap.php+96
    array_diff_assoc(): Expected parameter 1 to be an array, null given
    • > GET request to /wp-admin/options-general.php?page=sessionslap_options
    • > Warning in wp-content/plugins/session-slap/sessionslap.php+96
    count(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/options-general.php?page=sessionslap_options
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=sessionslap_options
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=sessionslap_options
    • > Notice in wp-content/plugins/session-slap/sessionslap.php+217
    Trying to access array offset on value of type bool

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
Almost there! Just 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 plugin_dir_path() in wp-content/plugins/session-slap/sessionslap.php:43

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: session, ping, keepalive

session-slap/sessionslap.php 92% from 13 tests

This is the main PHP file of "Session Slap" version 1.8.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("session-slap.php" instead of "sessionslap.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin313 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP338184289
CSS13024

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
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%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There were not PNG files found in your plugin