84% guest-user

Code Review | Guest User

WordPress plugin Guest User scored84%from 54 tests.

About plugin

  • Plugin page: guest-user
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.2
  • WordPress version: 6.3.1
  • First release: Apr 25, 2022
  • Latest release: Apr 25, 2022
  • Number of updates: 4
  • Update frequency: every 12.3 days
  • Top authors: EdwardBock (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /244 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼3.79ms] Passed 4 tests

Server-side resources used by Guest User
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1138.90 ▼3.41
Dashboard /wp-admin3.41 ▲0.1043.49 ▼7.58
Posts /wp-admin/edit.php3.52 ▲0.1646.91 ▼0.60
Add New Post /wp-admin/post-new.php5.99 ▲0.1089.90 ▼3.58
Media Library /wp-admin/upload.php3.33 ▲0.1035.22 ▼0.27

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Guest User
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.45 ▼0.221.92 ▲0.0842.88 ▼4.19
Dashboard /wp-admin2,209 ▲245.90 ▲1.0096.19 ▼26.3542.68 ▼12.08
Posts /wp-admin/edit.php2,089 ▲32.00 ▲0.0239.93 ▲2.8034.86 ▲0.07
Add New Post /wp-admin/post-new.php1,528 ▲818.16 ▼4.88610.45 ▼71.9665.36 ▲17.30
Media Library /wp-admin/upload.php1,382 ▼64.28 ▲0.0694.16 ▼6.0940.58 ▼4.80

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Palasthotel\\WordPress\\GuestUser\\Components\\plugin_dir_path() in wp-content/plugins/guest-user/classes/Components/Plugin.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Palasthotel\\WordPress\\GuestUser\\Components\\Component' not found in wp-content/plugins/guest-user/classes/Security.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Palasthotel\\WordPress\\GuestUser\\Components\\Component' not found in wp-content/plugins/guest-user/classes/AdminView.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: security, user, authors

guest-user/guest-user.php Passed 13 tests

The principal PHP file in "Guest User" v. 1.0.0 is loaded by WordPress automatically on each request
46 characters long description:
Label accounts as guests and prevent the login

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin795 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP16200442752
PO File17738
JSON1005

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.45
Average class complexity11.90
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes10
▷ Abstract classes220.00%
▷ Concrete classes880.00%
▷ Final classes00.00%
Methods63
▷ Static methods1930.16%
▷ Public methods5993.65%
▷ Protected methods00.00%
▷ Private methods46.35%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.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
There are no PNG files in this plugin