89% content-protection

Code Review | Content Protection

WordPress plugin Content Protection scored 89% from 54 tests.

About plugin

  • Plugin page: content-protection
  • Plugin version: 1.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.6
  • WordPress version: 5.8.1
  • First release: Feb 9, 2021
  • Latest release: Feb 9, 2021
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: themexa (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 165 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼142.97ms] Passed 4 tests

This is a short check of server-side resources used by Content Protection
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.1834.78 ▲12.33
Dashboard /wp-admin3.12 ▲0.0745.33 ▲1.10
Posts /wp-admin/edit.php3.23 ▲0.1346.06 ▼1.59
Add New Post /wp-admin/post-new.php5.48 ▲0.0591.01 ▼570.17
Media Library /wp-admin/upload.php3.06 ▲0.0633.71 ▼1.23

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Content Protection
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,694 ▲9815.94 ▲0.349.73 ▼4.7448.68 ▼0.72
Dashboard /wp-admin2,985 ▲545.91 ▼0.27147.17 ▼19.69115.35 ▲9.98
Posts /wp-admin/edit.php2,754 ▲152.70 ▼0.1464.61 ▼3.5987.87 ▼1.99
Add New Post /wp-admin/post-new.php1,693 ▲1018.75 ▲0.01395.33 ▼15.44107.05 ▲2.09
Media Library /wp-admin/upload.php1,822 ▲125.03 ▲0.03150.23 ▼10.92115.91 ▲0.13

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
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-includes/class-wp-hook.php+303
    call_user_func_array() expects parameter 1 to be a valid callback, class 'SamplePlugin' not found

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Screenshot #1 (Content Protection Options) image missing
You can look at the official readme.txt

content-protection/ContentProtection.php 92% from 13 tests

The main PHP script in "Content Protection" version 1.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("content-protection.php" instead of "ContentProtection.php")

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 plugin29,486 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
CSS110,62013929,095
PHP55780391

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.70
Average class complexity11.40
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity2.87
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods16
▷ Static methods212.50%
▷ Public methods1593.75%
▷ Protected methods16.25%
▷ Private methods00.00%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.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
1 PNG file occupies 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/banner.png61.04KB21.83KB▼ 64.24%