88% wp-private-area

Code Review | Private Area for WordPress

WordPress plugin Private Area for WordPress scored 88% from 54 tests.

About plugin

  • Plugin page: wp-private-area
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.5
  • WordPress version: 5.8.1
  • First release: Mar 25, 2020
  • Latest release: Sep 4, 2020
  • Number of updates: 8
  • Update frequency: every 20.4 days
  • Top authors: evolvesnc (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active / 929 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.23MB] [CPU: ▼143.56ms] Passed 4 tests

A check of server-side resources used by Private Area for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.03 ▲0.1934.46 ▼0.66
Dashboard /wp-admin3.33 ▲0.2859.39 ▲9.26
Posts /wp-admin/edit.php3.38 ▲0.2752.52 ▼4.18
Add New Post /wp-admin/post-new.php5.63 ▲0.1999.50 ▼576.40
Media Library /wp-admin/upload.php3.27 ▲0.2740.21 ▲7.00
Private area /wp-admin/options-general.php?page=private-area-settings3.2735.81

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 29 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Private Area for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,713 ▲11715.80 ▲0.319.14 ▲2.6248.78 ▼0.89
Dashboard /wp-admin3,007 ▲766.14 ▲0.21166.61 ▲14.71111.11 ▼18.04
Posts /wp-admin/edit.php2,776 ▲372.70 ▲0.0070.20 ▼1.3794.33 ▲0.12
Add New Post /wp-admin/post-new.php1,706 ▲2318.70 ▼0.05388.50 ▼11.29116.14 ▲1.78
Media Library /wp-admin/upload.php1,783 ▼245.00 ▼0.01163.70 ▲5.14118.14 ▼5.62
Private area /wp-admin/options-general.php?page=private-area-settings1,1162.5261.7870.27

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 8× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-private-area/src/AccessController.php
    • > /wp-content/plugins/wp-private-area/src/Controllers/RoleController.php
    • > /wp-content/plugins/wp-private-area/src/Settings.php
    • > /wp-content/plugins/wp-private-area/admin/settings.php
    • > /wp-content/plugins/wp-private-area/src/AccessHandler.php
    • > /wp-content/plugins/wp-private-area/src/Core.php
    • > /wp-content/plugins/wp-private-area/src/Controller.php
    • > /wp-content/plugins/wp-private-area/index.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-private-area/admin/settings.php:61

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: private, memberships, area, users, members

wp-private-area/index.php 92% from 13 tests

The principal PHP file in "Private Area for WordPress" v. 1.0.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-private-area.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin1,387 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP173308021,175
CSS3281167
JavaScript4143644
JSON1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity11.73
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes11
▷ Abstract classes19.09%
▷ Concrete classes1090.91%
▷ Final classes00.00%
Methods93
▷ Static methods1415.05%
▷ Public methods8187.10%
▷ Protected methods11.08%
▷ Private methods1111.83%
Functions18
▷ Named functions316.67%
▷ Anonymous functions1583.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin