84% wp-protect-content

Code Review | WP Protect Content

WordPress plugin WP Protect Content scored 84% from 54 tests.

About plugin

  • Plugin page: wp-protect-content
  • Plugin version: 2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3.1
  • WordPress version: 6.3.1
  • First release: Nov 28, 2016
  • Latest release: Sep 20, 2023
  • Number of updates: 48
  • Update frequency: every 51.9 days
  • Top authors: india-web-developer (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

2,000+ active / 30,919 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

An overview of server-side resources used by WP Protect Content
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0743.85 ▼1.62
Dashboard /wp-admin3.37 ▲0.0648.26 ▼2.16
Posts /wp-admin/edit.php3.42 ▲0.0644.01 ▼1.65
Add New Post /wp-admin/post-new.php5.95 ▲0.0684.94 ▼6.97
Media Library /wp-admin/upload.php3.29 ▲0.0636.39 ▲0.50
WP Protect Content /wp-admin/options-general.php?page=wp_protect_content3.2733.91

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP Protect Content
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲7413.33 ▼1.261.70 ▼0.6143.23 ▼4.09
Dashboard /wp-admin2,227 ▲425.88 ▲0.95103.79 ▲1.1742.81 ▲3.37
Posts /wp-admin/edit.php2,107 ▲182.00 ▲0.0334.58 ▼2.2033.05 ▼1.92
Add New Post /wp-admin/post-new.php1,544 ▲1023.08 ▼0.12659.37 ▼19.2468.05 ▲10.66
Media Library /wp-admin/upload.php1,406 ▲184.26 ▲0.0695.54 ▼17.7641.31 ▼5.62
WP Protect Content /wp-admin/options-general.php?page=wp_protect_content1,1782.1724.6243.52

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/wp-protect-content/lib/settings.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention: The official readme.txt might help

wp-protect-content/wp-protect-content.php Passed 13 tests

Analyzing the main PHP file in "WP Protect Content" version 2.7
75 characters long description:
Most popular plugin that provide an option to protect your website content.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin299 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP33983287
JavaScript10111
CSS1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin