68% post-password-plugin

Code Review | Post Password Token

WordPress plugin Post Password Token scored68%from 54 tests.

About plugin

  • Plugin page: post-password-plugin
  • Plugin version: 2.0.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.2
  • WordPress version: 6.3.1
  • First release: Sep 8, 2009
  • Latest release: Jul 6, 2023
  • Number of updates: 85
  • Update frequency: every 59.5 days
  • Top authors: shawnparker (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

600+ active /14,206 total downloads

Benchmarks

Plugin footprint 65% 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: ▼1.85MB] [CPU: ▼55.55ms] Passed 4 tests

An overview of server-side resources used by Post Password Token
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.13 ▼1.335.45 ▼37.39
Dashboard /wp-admin2.15 ▼1.157.53 ▼45.29
Posts /wp-admin/edit.php2.15 ▼1.206.49 ▼45.66
Add New Post /wp-admin/post-new.php2.15 ▼3.736.94 ▼93.87
Media Library /wp-admin/upload.php2.15 ▼1.087.77 ▼32.20
Post Password Token /wp-admin/options-general.php?page=post-password-token2.158.49

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 66 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Post Password Token
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.27 ▼0.032.17 ▲0.3743.74 ▼0.32
Dashboard /wp-admin2,202 ▲255.61 ▼0.0187.90 ▼0.1538.19 ▼7.54
Posts /wp-admin/edit.php2,104 ▲72.01 ▼0.0138.77 ▲2.6438.13 ▼1.25
Add New Post /wp-admin/post-new.php1,540 ▲823.45 ▲0.13635.06 ▼30.7752.14 ▼2.39
Media Library /wp-admin/upload.php1,404 ▲134.19 ▼0.0296.49 ▼6.9841.81 ▼3.31
Post Password Token /wp-admin/options-general.php?page=post-password-token1,0812.0627.3146.47

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the post-password-token-sidebar handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=post-password-token
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the post-password-token-sidebar handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=post-password-token
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the post-password-token-sidebar handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

SRP 50% 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
Please take a closer look at the following
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'PPT\\Test\\PPTTestCase' not found in wp-content/plugins/post-password-plugin/test/tests/PPTAdminTest.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/post-password-plugin/templates/meta-box-draft.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/post-password-plugin/templates/meta-box-no-password.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/post-password-plugin/test/tests/PPTTestCase.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PPT\\Test\\PPTTestCase' not found in wp-content/plugins/post-password-plugin/test/tests/PPTRestApiTest.php:8
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/post-password-plugin/templates/meta-box.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'PPT\\Test\\PPTTestCase' not found in wp-content/plugins/post-password-plugin/test/tests/PPTInstallTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PPT\\Test\\PPTTestCase' not found in wp-content/plugins/post-password-plugin/test/tests/PPTCoreTest.php:6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/post-password-plugin/templates/settings.php:8

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: access, password, hidden, protected, post...

post-password-plugin/post-password-token.php 77% from 13 tests

Analyzing the main PHP file in "Post Password Token" version 2.0.3
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 210 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("post-password-plugin.php" instead of "post-password-token.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin2,179 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
PHP354307701,801
JavaScript6335225
CSS20049
JSON30042
XML11033
make16021
Sass1008

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity8.32
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.15
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits3
Classes16
▷ Abstract classes212.50%
▷ Concrete classes1487.50%
▷ Final classes00.00%
Methods124
▷ Static methods1915.32%
▷ Public methods11794.35%
▷ Protected methods43.23%
▷ Private methods32.42%
Functions11
▷ Named functions654.55%
▷ Anonymous functions545.45%
Constants17
▷ Global constants1058.82%
▷ Class constants741.18%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/warning-stripes.png0.38KB0.35KB▼ 7.44%
img/lock.png0.42KB0.39KB▼ 7.60%