83% elvez-control-access

Code Review | Elvez Control Access

WordPress plugin Elvez Control Access scored83%from 54 tests.

About plugin

  • Plugin page: elvez-control-access
  • Plugin version: 1.1.4
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.8.2
  • WordPress version: 6.3.1
  • First release: Nov 18, 2020
  • Latest release: Dec 6, 2021
  • Number of updates: 14
  • Update frequency: every 27.4 days
  • Top authors: elvezcojp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /559 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.25MB] [CPU: ▼5.84ms] 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 /3.70 ▲0.2346.84 ▲6.43
Dashboard /wp-admin3.61 ▲0.2642.02 ▼19.53
Posts /wp-admin/edit.php3.66 ▲0.3049.36 ▲6.63
Add New Post /wp-admin/post-new.php6.15 ▲0.2695.14 ▼13.04
Media Library /wp-admin/upload.php3.47 ▲0.2436.33 ▲2.77
Control Access /wp-admin/admin.php?page=elvez-control-access3.4532.55

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, 10 new options
New WordPress options
elvez_control_access_is_private_woocommerce
widget_recent-comments
elvez_control_access_redirect_page
db_upgraded
theysaidso_admin_options
can_compress_scripts
elvez_control_access_subscribe_email
widget_recent-posts
widget_theysaidso_widget
elvez_control_access_subscription_id

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 /2,942 ▲19613.62 ▼0.548.64 ▲6.9236.97 ▼8.91
Dashboard /wp-admin2,241 ▲704.98 ▼0.58101.83 ▲13.3441.44 ▲2.89
Posts /wp-admin/edit.php2,158 ▲582.49 ▲0.5138.52 ▼2.3532.52 ▼3.82
Add New Post /wp-admin/post-new.php6,259 ▲4,72226.35 ▲8.25836.19 ▲212.2933.76 ▼28.29
Media Library /wp-admin/upload.php1,440 ▲404.50 ▲0.2999.33 ▼8.4641.88 ▼0.72
Control Access /wp-admin/admin.php?page=elvez-control-access1,0342.5244.1329.33

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: 10 options
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • elvez_control_access_is_private_woocommerce
    • elvez_control_access_redirect_page
    • widget_theysaidso_widget
    • elvez_control_access_subscribe_email
    • widget_recent-posts
    • 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.4, 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 PHP: Required version must be the same as the one declared in readme.txt ("7.4" instead of "7.2")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0" instead of "5.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,610 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP182741,1771,100
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