10% stay-alive

Code Review | Stay Alive

WordPress plugin Stay Alive scored10%from 54 tests.

About plugin

  • Plugin page: stay-alive
  • Plugin version: 2.4.8
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.4.8-2.4.8
  • WordPress version: 6.3.1
  • First release: Jul 10, 2018
  • Latest release: Jul 10, 2018
  • Number of updates: 20
  • Update frequency: N/A
  • Top authors: rajulmondal5 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /708 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/stay-alive/stay-alive-widget.php+65
    Function create_function() is deprecated

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

An overview of server-side resources used by Stay Alive
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.12 ▼37.36
Dashboard /wp-admin2.05 ▼1.306.07 ▼56.51
Posts /wp-admin/edit.php2.05 ▼1.315.83 ▼40.70
Add New Post /wp-admin/post-new.php2.05 ▼3.846.27 ▼90.84
Media Library /wp-admin/upload.php2.05 ▼1.184.88 ▼28.56
Stay Alive /wp-admin/options-general.php?page=stay-alive-admin2.055.07

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 34 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments
widget_stayalivewidget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Stay Alive
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲4813.60 ▼0.755.28 ▲3.4440.71 ▲3.19
Dashboard /wp-admin2,208 ▲315.85 ▲0.2585.68 ▼0.5837.82 ▼6.21
Posts /wp-admin/edit.php2,110 ▲102.29 ▲0.3234.33 ▲0.1230.10 ▼7.96
Add New Post /wp-admin/post-new.php1,538 ▼1123.25 ▲5.14707.92 ▲93.4835.67 ▼32.04
Media Library /wp-admin/upload.php1,413 ▲164.42 ▲0.1497.10 ▼18.8142.37 ▼5.04
Stay Alive /wp-admin/options-general.php?page=stay-alive-admin8341.8925.1927.11

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/stay-alive/stay-alive-widget.php+65
    Function create_function() is deprecated
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_stayalivewidget
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=stay-alive-admin
    • > Deprecated in wp-content/plugins/stay-alive/stay-alive-widget.php+65
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=stay-alive-admin
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in StayAliveWidget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=stay-alive-admin
    • > User deprecated in wp-includes/functions.php+5737
    Function WP_User->id was called with an argument that is deprecated since version 2.1.0! Use WP_User->ID instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/stay-alive/vendor/psr/log/Psr/Log/AbstractLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/stay-alive/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/stay-alive/stay-alive-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/stay-alive/vendor/psr/log/Psr/Log/NullLogger.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerAwareInterface' not found in wp-content/plugins/stay-alive/vendor/pusher/pusher-php-server/src/Pusher.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=stay-alive-admin
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: users, live, login, chat, active...

stay-alive/stay-alive.php Passed 13 tests

The main PHP script in "Stay Alive" version 2.4.8 is automatically included on every request by WordPress
61 characters long description:
Stay Alive: wordpress plugin to check logged in user's status

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin1,528 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP213208101,203
JSON400169
Markdown262095
JavaScript115058
CSS1003

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.39
▷ Minimum class complexity1.00
▷ Maximum class complexity69.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces2
Traits2
Classes14
▷ Abstract classes214.29%
▷ Concrete classes1285.71%
▷ Final classes00.00%
Methods107
▷ Static methods65.61%
▷ Public methods9790.65%
▷ Protected methods00.00%
▷ Private methods109.35%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin