94% private-content

Code Review | Private Content

WordPress plugin Private Content scored 94% from 54 tests.

About plugin

  • Plugin page: private-content
  • Plugin version: 6.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.9
  • WordPress version: 5.9.2
  • First release: Nov 24, 2012
  • Latest release: Mar 5, 2022
  • Number of updates: 65
  • Update frequency: every 52.1 days
  • Top authors: aldolat (100%)

Code review

54 tests

User reviews

26 reviews

Install metrics

10,000+ active / 85,821 total downloads

Benchmarks

Plugin footprint Passed 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: ▲0.07MB] [CPU: ▼296.84ms] Passed 4 tests

This is a short check of server-side resources used by Private Content
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1356.48 ▲8.93
Dashboard /wp-admin3.50 ▲0.1032.30 ▼1.90
Posts /wp-admin/edit.php3.74 ▲0.1036.58 ▼0.73
Add New Post /wp-admin/post-new.php6.98 ▲0.0192.05 ▼1,178.70
Media Library /wp-admin/upload.php3.39 ▲0.0925.02 ▼6.04

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Private Content
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,766 ▲4415.93 ▼0.035.62 ▲0.062.30 ▲0.07
Dashboard /wp-admin2,895 ▲376.13 ▼0.07116.96 ▼20.06154.13 ▼5.94
Posts /wp-admin/edit.php2,688 ▼63.24 ▲0.0162.30 ▲0.73138.98 ▼2.69
Add New Post /wp-admin/post-new.php1,661 ▼9116.40 ▼4.98410.75 ▼42.33153.83 ▲2.86
Media Library /wp-admin/upload.php1,701 ▲35.50 ▼0.03135.52 ▼6.82179.58 ▼6.90

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 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
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/private-content/private-content.php

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: content, private, shortcode

private-content/private-content.php Passed 13 tests

The principal PHP file in "Private Content" v. 6.5.0 is loaded by WordPress automatically on each request
102 characters long description:
Display a portion of a post content only to users of a specific role or to a single or multiple users.

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
No dangerous file extensions were detected782 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP4120435539
Markdown3930243

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity91.00
▷ Minimum class complexity91.00
▷ Maximum class complexity91.00
Average method complexity6.29
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods635.29%
▷ Protected methods529.41%
▷ Private methods635.29%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin