84% login-logout-shortcode

Code Review | Login Logout Shortcode

WordPress plugin Login Logout Shortcode scored84%from 54 tests.

About plugin

  • Plugin page: login-logout-shor...
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.6
  • WordPress version: 6.3.1
  • First release: Jun 10, 2016
  • Latest release: Jun 19, 2018
  • Number of updates: 9
  • Update frequency: every 82.1 days
  • Top authors: prontotools (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /8,976 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

Analyzing server-side resources used by Login Logout Shortcode
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.12 ▲2.10
Dashboard /wp-admin3.31 ▲0.0145.95 ▼2.28
Posts /wp-admin/edit.php3.36 ▲0.0144.97 ▼4.32
Add New Post /wp-admin/post-new.php5.89 ▲0.0190.56 ▲0.91
Media Library /wp-admin/upload.php3.23 ▲0.0132.62 ▼2.53

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Login Logout Shortcode
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.47 ▲0.161.68 ▼0.1444.85 ▲4.21
Dashboard /wp-admin2,206 ▲185.91 ▲1.01112.32 ▼8.7843.07 ▼1.70
Posts /wp-admin/edit.php2,089 ▼32.01 ▲0.0135.84 ▼2.6335.89 ▲1.46
Add New Post /wp-admin/post-new.php1,525 ▲623.33 ▲0.23607.22 ▼88.4649.51 ▼12.89
Media Library /wp-admin/upload.php1,388 ▼04.31 ▲0.1397.34 ▼10.4141.24 ▼4.94

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

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

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
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/login-logout-shortcode/tests/bootstrap.php on line 6
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/login-logout-shortcode/tests/bootstrap.php on line 6
    • > PHP Fatal error
      require_once(): Failed opening required 'login-logout-shortcode.php' (include_path='.:/usr/share/php') in wp-content/plugins/login-logout-shortcode/tests/test-login-logout-shortcode.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/login-logout-shortcode/login-logout-shortcode.php:48
    • > PHP Warning
      require_once(login-logout-shortcode.php): failed to open stream: No such file or directory in wp-content/plugins/login-logout-shortcode/tests/test-login-logout-shortcode.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 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
3 plugin tags: logout, shortcode, login

login-logout-shortcode/login-logout-shortcode.php Passed 13 tests

The primary PHP file in "Login Logout Shortcode" version 1.1.0 is used by WordPress to initiate all plugin functionality
76 characters long description:
A single shortcode you can place anywhere to allow visitors to login/logout.

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
There were no executable files found in this plugin553 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
Bourne Shell34114197
PHP35410135
Dockerfile1234119
Bourne Again Shell27171
Markdown111017
XML10014

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.05
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png20.38KB9.19KB▼ 54.92%
assets/icon-256x256.png8.62KB4.03KB▼ 53.18%