78% custom-password-protected-text

Code Review | Custom Password Protected Text

WordPress plugin Custom Password Protected Text scored78%from 54 tests.

About plugin

  • Plugin page: custom-password-p...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.4
  • WordPress version: 6.3.1
  • First release: Sep 25, 2012
  • Latest release: Sep 25, 2012
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: marcello.scacchetti (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active /4,978 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
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼0.09ms] Passed 4 tests

Analyzing server-side resources used by Custom Password Protected Text
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.05 ▼1.58
Dashboard /wp-admin3.32 ▲0.0152.04 ▼0.76
Posts /wp-admin/edit.php3.37 ▲0.0149.98 ▼2.51
Add New Post /wp-admin/post-new.php5.90 ▲0.01114.10 ▲11.64
Media Library /wp-admin/upload.php3.24 ▲0.0141.78 ▲4.51
Custom Password Protected Text /wp-admin/options-general.php?page=custom-password-protected-text/cppt.php3.2330.31

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Custom Password Protected Text
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.20 ▼0.221.90 ▲0.2140.46 ▼6.35
Dashboard /wp-admin2,202 ▲225.57 ▼0.1088.11 ▼16.2939.19 ▼5.01
Posts /wp-admin/edit.php2,104 ▲42.04 ▲0.0540.33 ▲4.0339.59 ▲0.60
Add New Post /wp-admin/post-new.php1,536 ▲822.97 ▼0.11665.85 ▼5.5351.97 ▼11.03
Media Library /wp-admin/upload.php1,398 ▼54.23 ▲0.02109.80 ▲4.4646.54 ▲1.87
Custom Password Protected Text /wp-admin/options-general.php?page=custom-password-protected-text/cppt.php1,3636.39113.5053.01

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=custom-password-protected-text/cppt.php
    • > Notice in wp-content/plugins/custom-password-protected-text/cppt.php+77
    Trying to access array offset on value of type bool

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 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 plugin_dir_url() in wp-content/plugins/custom-password-protected-text/cppt.php:32

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 96% from 29 tests

readme.txt Passed 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
5 plugin tags: cppt, text, password, protected, pages

custom-password-protected-text/cppt.php 92% from 13 tests

The main PHP script in "Custom Password Protected Text" version 1.0.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("custom-password-protected-text.php" instead of "cppt.php")

Code Analysis Passed 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
Good job! No executable or dangerous file extensions detected56 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1132956

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin