74% wp-native-php-sessions

Code Review | WordPress Native PHP Sessions

WordPress plugin WordPress Native PHP Sessions scored74%from 54 tests.

About plugin

Code review

54 tests

User reviews

16 reviews

Install metrics

20,000+ active /812,877 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼5.62ms] Passed 4 tests

An overview of server-side resources used by WordPress Native PHP Sessions
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1636.30 ▼5.79
Dashboard /wp-admin3.49 ▲0.1849.74 ▼1.53
Posts /wp-admin/edit.php3.60 ▲0.2449.47 ▲0.54
Add New Post /wp-admin/post-new.php6.09 ▲0.2084.46 ▼15.70
Media Library /wp-admin/upload.php3.41 ▲0.1838.09 ▲1.96
Sessions /wp-admin/tools.php?page=pantheon-sessions3.4038.05

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 9 new files
Database: 1 new table, 7 new options
New tables
wp_pantheon_sessions
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
pantheon_session_version

Browser metrics Passed 4 tests

An overview of browser requirements for WordPress Native PHP Sessions
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3414.35 ▲0.031.64 ▼0.0739.49 ▼4.57
Dashboard /wp-admin2,201 ▲215.60 ▼0.0687.51 ▼4.0242.44 ▲2.72
Posts /wp-admin/edit.php2,106 ▲62.00 ▼0.0043.85 ▼1.1336.90 ▲2.69
Add New Post /wp-admin/post-new.php1,531 ▲522.98 ▼0.53618.00 ▲10.7056.62 ▲8.58
Media Library /wp-admin/upload.php1,403 ▲64.27 ▲0.0598.38 ▼5.8044.74 ▲1.65
Sessions /wp-admin/tools.php?page=pantheon-sessions9112.0325.4226.02

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
Please fix the following items
  • Zombie tables detected upon uninstall: 1 table
    • wp_pantheon_sessions
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • pantheon_session_version
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Almost there! Just fix the following items
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/wp-native-php-sessions/inc/class-cli-command.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/wp-native-php-sessions/inc/class-list-table.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-native-php-sessions/pantheon-sessions.php:744

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
2 plugin tags: sessions, comments

wp-native-php-sessions/pantheon-sessions.php 92% from 13 tests

The primary PHP file in "WordPress Native PHP Sessions" version 1.4.3 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-native-php-sessions.php" instead of "pantheon-sessions.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
Everything looks great! No dangerous files found in this plugin848 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP6238461837
JavaScript10011

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity21.00
▷ Minimum class complexity5.00
▷ Maximum class complexity69.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods56
▷ Static methods1221.43%
▷ Public methods4478.57%
▷ Protected methods11.79%
▷ Private methods1119.64%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants240.00%
▷ Class constants360.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
No PNG images were found in this plugin