72% password-protect-pages

Code Review | Password Protect Pages

WordPress plugin Password Protect Pages scored72%from 54 tests.

About plugin

  • Plugin page: password-protect-...
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8
  • WordPress version: 6.3.1
  • First release: Jun 21, 2019
  • Latest release: Aug 17, 2021
  • Number of updates: 8
  • Update frequency: every 98.6 days
  • Top authors: jessn (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active /5,297 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼7.53ms] Passed 4 tests

A check of server-side resources used by Password Protect Pages
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.35 ▼7.20
Dashboard /wp-admin3.37 ▲0.0646.24 ▼12.08
Posts /wp-admin/edit.php3.48 ▲0.1249.25 ▲1.28
Add New Post /wp-admin/post-new.php5.95 ▲0.0695.42 ▼11.80
Media Library /wp-admin/upload.php3.29 ▲0.0636.91 ▲0.96
Password Protect Pages /wp-admin/options-general.php?page=password_protect_pages3.2332.40

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Password Protect Pages
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.48 ▲0.071.74 ▼0.1545.31 ▼2.31
Dashboard /wp-admin2,210 ▲194.99 ▲0.12111.25 ▲7.7444.80 ▲4.27
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.1740.02 ▲1.0435.38 ▲2.46
Add New Post /wp-admin/post-new.php1,528 ▲1423.31 ▲5.76665.74 ▼12.6557.87 ▼2.37
Media Library /wp-admin/upload.php1,395 ▲104.42 ▲0.1695.31 ▼11.8945.95 ▲0.53
Password Protect Pages /wp-admin/options-general.php?page=password_protect_pages8002.0726.4025.79

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 were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=password_protect_pages
    • > Notice in wp-content/plugins/password-protect-pages/admin/admin-options.php+107
    Trying to access array offset on value of type bool

SRP 0% 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
Please fix the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/password-protect-pages/public/partials/password-protect-pages-public-display.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/password-protect-pages/admin/admin-options.php:11

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === password-protect-pages === )
The official readme.txt might help

password-protect-pages/password-protect-pages.php 92% from 13 tests

The principal PHP file in "Password Protect Pages" v. 1.3.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin273 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP14190455267
JavaScript24546
CSS2080

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.16
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods19
▷ Static methods210.53%
▷ Public methods1473.68%
▷ Protected methods00.00%
▷ Private methods526.32%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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.07MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png34.56KB9.32KB▼ 73.04%
screenshot-2.png34.07KB8.95KB▼ 73.72%