83% elvez-control-access

Code Review | Elvez Control Access

WordPress plugin Elvez Control Access scored 83% from 54 tests.

About plugin

  • Plugin page: elvez-control-access
  • Plugin version: 1.1.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.8.1
  • WordPress version: 5.8.1
  • First release: Nov 18, 2020
  • Latest release: Oct 7, 2021
  • Number of updates: 12
  • Update frequency: every 26.9 days
  • Top authors: elvezcojp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 223 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

An overview of server-side resources used by Elvez Control Access
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.0641.55 ▲5.52
Dashboard /wp-admin3.13 ▲0.0748.34 ▲1.11
Posts /wp-admin/edit.php3.24 ▲0.1348.19 ▼1.28
Add New Post /wp-admin/post-new.php5.49 ▲0.0692.13 ▼558.35
Media Library /wp-admin/upload.php3.07 ▲0.0638.56 ▼5.67
Control Access /wp-admin/admin.php?page=elvez-control-access3.0432.57

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 37 new files
Database: no new tables, 4 new options
New WordPress options
elvez_control_access_redirect_page
elvez_control_access_subscribe_email
elvez_control_access_subscription_id
elvez_control_access_is_private_woocommerce

Browser metrics Passed 4 tests

Elvez Control Access: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,835 ▲23916.71 ▲1.2111.91 ▲1.3446.34 ▼3.55
Dashboard /wp-admin3,018 ▲876.57 ▲0.48146.04 ▼3.60100.38 ▼4.83
Posts /wp-admin/edit.php2,797 ▲583.00 ▲0.3069.15 ▼1.6581.35 ▼3.27
Add New Post /wp-admin/post-new.php1,692 ▲921.61 ▲2.83279.83 ▼106.40128.58 ▲23.12
Media Library /wp-admin/upload.php1,852 ▲455.41 ▲0.38142.66 ▼17.40115.02 ▼0.00
Control Access /wp-admin/admin.php?page=elvez-control-access1,2923.1779.1081.92

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
  • Zombie WordPress options were found after uninstall: 4 options
    • elvez_control_access_subscribe_email
    • elvez_control_access_is_private_woocommerce
    • elvez_control_access_redirect_page
    • elvez_control_access_subscription_id

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/elvez-control-access/public/partials/elvez-control-access-public-display.php
    • > /wp-content/plugins/elvez-control-access/admin/partials/elvez-control-access-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: Please add an image for screenshot #1 (Settings)
The official readme.txt is a good inspiration

elvez-control-access/elvez-control-access.php 85% from 13 tests

This is the main PHP file of "Elvez Control Access" version 1.1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0" instead of "5.2")
  • Requires PHP: Required version must be the same as the one declared in readme.txt ("7.4" instead of "7.2")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin1,607 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP182731,1771,097
JavaScript41167210
CSS22838204
PO File2303796

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity9.67
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods87
▷ Static methods1921.84%
▷ Public methods8294.25%
▷ Protected methods00.00%
▷ Private methods55.75%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants35
▷ Global constants12.86%
▷ Class constants3497.14%
▷ Public constants34100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin