84% logout-button

Code Review | Logout Button

WordPress plugin Logout Button scored84%from 54 tests.

About plugin

  • Plugin page: logout-button
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-3.6
  • WordPress version: 6.3.1
  • First release: Aug 8, 2013
  • Latest release: Sep 11, 2013
  • Number of updates: 4
  • Update frequency: every 8.5 days
  • Top authors: ben poland (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /6,096 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.01MB] [CPU: ▼11.78ms] Passed 4 tests

A check of server-side resources used by Logout Button
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.23 ▼5.31
Dashboard /wp-admin3.31 ▼0.0343.45 ▼19.56
Posts /wp-admin/edit.php3.36 ▲0.0048.02 ▼0.21
Add New Post /wp-admin/post-new.php5.89 ▲0.0182.64 ▼22.04
Media Library /wp-admin/upload.php3.23 ▲0.0032.86 ▲1.81

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Logout Button
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▼0.101.67 ▼0.1640.16 ▼3.40
Dashboard /wp-admin2,206 ▲185.79 ▲0.8595.87 ▼10.1640.73 ▼6.02
Posts /wp-admin/edit.php2,086 ▼32.14 ▲0.0540.67 ▲1.0736.56 ▲1.15
Add New Post /wp-admin/post-new.php1,533 ▼322.79 ▼0.65613.62 ▼5.3449.47 ▲0.11
Media Library /wp-admin/upload.php1,382 ▼64.19 ▲0.0394.66 ▼5.9240.64 ▼1.19

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

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
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      include(): Failed opening 'ABSPATHwp-includes/pluggable.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/logout-button/display_button.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/logout-button/display_button.php:34
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/logout-button/display_button.php on line 11
    • > PHP Warning
      include(ABSPATHwp-includes/pluggable.php): failed to open stream: No such file or directory in wp-content/plugins/logout-button/display_button.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: redirect, re direct, logout, log, out...

logout-button/display_button.php 92% from 13 tests

The principal PHP file in "Logout Button" v. 1.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("logout-button.php" instead of "display_button.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
No dangerous file extensions were detected24 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP15824

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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