68% content-protector

Code Review | Passster - Password Protect Pages and Content

WordPress plugin Passster - Password Protect Pages and Content scored68%from 54 tests.

About plugin

  • Plugin page: content-protector
  • Plugin version: 4.2.6
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.4
  • WordPress version: 6.3.1
  • First release: Dec 8, 2013
  • Latest release: Nov 8, 2023
  • Number of updates: 265
  • Update frequency: every 13.7 days
  • Top authors: patrickposner (70.19%)kjvtough (30.19%)

Code review

54 tests

User reviews

51 reviews

Install metrics

10,000+ active /348,506 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲5.87MB] [CPU: ▲24.95ms] 75% from 4 tests

An overview of server-side resources used by Passster - Password Protect Pages and Content
Please have a look at the following items
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.87MB on /wp-admin/admin.php?page=passster-settings)
PageMemory (MB)CPU Time (ms)
Home /9.70 ▲6.2362.56 ▲26.18
Dashboard /wp-admin9.72 ▲6.4178.28 ▲29.31
Posts /wp-admin/edit.php9.72 ▲6.3683.25 ▲33.85
Add New Post /wp-admin/post-new.php10.38 ▲4.48109.85 ▲10.45
Media Library /wp-admin/upload.php9.72 ▲6.4973.11 ▲40.51
Protected Areas /wp-admin/edit.php?post_type=protected_areas9.7260.14
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius9.7257.87
Settings /wp-admin/admin.php?page=passster-settings9.7259.86

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 213 new files
Database: no new tables, 11 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
passster
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
fs_debug_mode
fs_active_plugins
passster_secure_key
...

Browser metrics Passed 4 tests

A check of browser resources used by Passster - Password Protect Pages and Content
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,957 ▲19513.79 ▼0.429.21 ▲7.5827.97 ▼22.11
Dashboard /wp-admin2,265 ▲915.63 ▲0.0191.41 ▼3.5544.23 ▲1.11
Posts /wp-admin/edit.php2,183 ▲832.13 ▲0.1641.42 ▲6.1839.85 ▲5.48
Add New Post /wp-admin/post-new.php6,498 ▲4,97230.12 ▲6.461,037.53 ▲339.6943.55 ▼11.49
Media Library /wp-admin/upload.php1,473 ▲704.22 ▼0.05102.96 ▼0.7444.68 ▼1.18
Protected Areas /wp-admin/edit.php?post_type=protected_areas1,1451.9840.0434.60
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,1121.6726.4330.43
Settings /wp-admin/admin.php?page=passster-settings1,2398.54211.4034.63

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/content-protector/inc/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 10 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • fs_active_plugins
    • widget_recent-posts
    • widget_recent-comments
    • passster_secure_key
    • fs_debug_mode
    • fs_accounts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/content-protector/inc/templates/password-form.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/content-protector/content-protector.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes: You can take inspiration from this readme.txt

content-protector/content-protector.php Passed 13 tests

"Passster - Password Protect Pages and Content" version 4.2.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
106 characters long description:
A simple plugin to password-protect your complete website, some pages/posts or just parts of your content.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected38,450 lines of code in 167 files:
LanguageFilesBlank linesComment linesLines of code
PHP1348,30517,77435,092
JSON3001,515
JavaScript89390887
PO File1422827692
CSS17200118
XML100103
SVG20040
Markdown1203

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity74.79
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.54
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces1
Interfaces1
Traits0
Classes62
▷ Abstract classes23.23%
▷ Concrete classes6096.77%
▷ Final classes00.00%
Methods1,343
▷ Static methods21616.08%
▷ Public methods94370.22%
▷ Protected methods171.27%
▷ Private methods38328.52%
Functions118
▷ Named functions10488.14%
▷ Anonymous functions1411.86%
Constants149
▷ Global constants10268.46%
▷ Class constants4731.54%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
inc/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%