62% protected-page

Code Review | The best plugin for restrict content, support all Custom Post Types and Elementor - Password Protected

WordPress plugin The best plugin for restrict content, support all Custom Post Types and Elementor - Password Protected scored 62% from 54 tests.

About plugin

  • Plugin page: protected-page
  • Plugin version: 1.0.16
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.8
  • WordPress version: 5.9.2
  • First release: Jul 31, 2019
  • Latest release: Jul 25, 2021
  • Number of updates: 18
  • Update frequency: every 40.3 days
  • Top authors: giladtakoni (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

90+ active / 2,106 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
Installer ran successfully

Server metrics [RAM: ▲4.46MB] [CPU: ▼277.38ms] Passed 4 tests

This is a short check of server-side resources used by The best plugin for restrict content, support all Custom Post Types and Elementor - Password Protected
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /8.36 ▲4.8579.24 ▲29.83
Dashboard /wp-admin8.38 ▲4.9755.53 ▲20.61
Posts /wp-admin/edit.php8.38 ▲4.7464.50 ▲28.42
Add New Post /wp-admin/post-new.php10.22 ▲3.25111.66 ▼1,178.13
Media Library /wp-admin/upload.php8.38 ▲5.0944.36 ▲19.58
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php9.6379.36
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius8.3845.87

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 394 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
fs_gdpr
widget_recent-comments
fs_debug_mode
fs_active_plugins
fs_accounts

Browser metrics Passed 4 tests

The best plugin for restrict content, support all Custom Post Types and Elementor - Password Protected: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,895 ▲14116.45 ▲0.878.00 ▲2.173.10 ▲0.50
Dashboard /wp-admin2,973 ▲1126.61 ▲0.39117.18 ▼15.97180.42 ▲11.37
Posts /wp-admin/edit.php2,739 ▲513.55 ▲0.3166.19 ▼0.58158.66 ▲0.96
Add New Post /wp-admin/post-new.php1,676 ▼8222.25 ▲0.73381.39 ▼36.16146.12 ▼11.57
Media Library /wp-admin/upload.php1,777 ▲765.97 ▲0.48126.46 ▼16.98215.11 ▲30.52
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php9,12319.11552.65201.97
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius1,4812.9055.56114.32

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/protected-page/libs/fs-sdk/includes/class-freemius.php+8552
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • fs_active_plugins
    • widget_recent-comments
    • fs_accounts
    • fs_debug_mode
    • fs_gdpr

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Notice in wp-includes/class-wp-customize-nav-menus.php+1152
    Trying to get property 'title' of non-object

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/protected-page/libs/fs-sdk/templates/ajax-loader.php
    • > /wp-content/plugins/protected-page/libs/fs-sdk/old-version/templates/ajax-loader.php
  • 22× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Use of undefined constant PASSWORD_CHARACTERS - assumed 'PASSWORD_CHARACTERS' (this will throw an Error in a future version of PHP) in wp-content/plugins/protected-page/templates/generate-password-forms.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/protected-page/libs/fs-sdk/old-version/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/protected-page/libs/fs-sdk/old-version/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/protected-page/libs/fs-sdk/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/protected-page/libs/fs-sdk/old-version/templates/account/partials/addon.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_rtl() in wp-content/plugins/protected-page/templates/generate-password-forms.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/protected-page/templates/protected-form.php:64
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/protected-page/libs/fs-sdk/templates/account/partials/addon.php:9
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/protected-page/libs/fs-sdk/old-version/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/protected-page/libs/fs-sdk/old-version/templates/partials/network-activation.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
These attributes need to be fixed:
  • Screenshots: Please describe screenshot #5 in protected-page/assets to your readme.txt
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt might help

protected-page/protected-page.php 92% from 13 tests

The main PHP file in "The best plugin for restrict content, support all Custom Post Types and Elementor - Password Protected" ver. 1.0.16 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Requires at least: Required version must match the one declared in readme.txt ("4.7" instead of "5.3")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected73,367 lines of code in 242 files:
LanguageFilesBlank linesComment linesLines of code
PHP17613,69429,96157,051
PO File115,7777,00512,685
JavaScript214261992,225
CSS251166648
Sass5745383
Markdown2880273
HTML11075
JSON10027

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,907)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity84.43
▷ Minimum class complexity1.00
▷ Maximum class complexity2,907.00
Average method complexity4.58
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes94
▷ Abstract classes44.26%
▷ Concrete classes9095.74%
▷ Final classes00.00%
Methods2,257
▷ Static methods34815.42%
▷ Public methods1,56969.52%
▷ Protected methods301.33%
▷ Private methods65829.15%
Functions189
▷ Named functions189100.00%
▷ Anonymous functions00.00%
Constants246
▷ Global constants19880.49%
▷ Class constants4819.51%
▷ Public constants48100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/protected-page-admin-icon.png1.45KB0.65KB▼ 55.16%
libs/fs-sdk/old-version/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
libs/fs-sdk/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
libs/fs-sdk/old-version/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/images/protected-page-logo-white.png16.00KB6.14KB▼ 61.61%