84% website-password-protection

Code Review | Website Password Protection

WordPress plugin Website Password Protection scored84%from 54 tests.

About plugin

  • Plugin page: website-password-...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.1
  • WordPress version: 6.3.1
  • First release: Jul 10, 2019
  • Latest release: Nov 3, 2022
  • Number of updates: 9
  • Update frequency: every 134.7 days
  • Top authors: alignpx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /562 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 gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.80ms] Passed 4 tests

A check of server-side resources used by Website Password Protection
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0643.76 ▲0.56
Dashboard /wp-admin3.36 ▲0.0550.25 ▼2.27
Posts /wp-admin/edit.php3.47 ▲0.1149.04 ▼2.25
Add New Post /wp-admin/post-new.php5.94 ▲0.0585.53 ▼12.38
Media Library /wp-admin/upload.php3.28 ▲0.0537.07 ▼2.29

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Website Password Protection
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,876 ▲9013.45 ▼1.138.41 ▲6.2544.12 ▲3.00
Dashboard /wp-admin2,195 ▲185.60 ▲0.0185.54 ▼7.6939.32 ▼4.71
Posts /wp-admin/edit.php2,100 ▼01.99 ▼0.0335.06 ▼6.0933.10 ▼7.12
Add New Post /wp-admin/post-new.php1,545 ▲1423.21 ▼0.02638.28 ▼9.8447.19 ▼1.79
Media Library /wp-admin/upload.php1,403 ▼04.21 ▼0.01103.25 ▲0.1645.64 ▲0.46

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
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means 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
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/website-password-protection/public/partials/website-password-protection-public-display.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Password Protected Page), #2 (Admin setting for password protection)
You can look at the official readme.txt

website-password-protection/website-password-protection.php 92% from 13 tests

This is the main PHP file of "Website Password Protection" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

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
Success! There were no dangerous files found in this plugin273 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12138515267
JavaScript26276
CSS2180

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity1.86
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.24
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods25
▷ Static methods28.00%
▷ Public methods2080.00%
▷ Protected methods00.00%
▷ Private methods520.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.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
PNG images were not found in this plugin