84% access-pages-by-role-for-admin

Code Review | Access Pages by Role for Admin

WordPress plugin Access Pages by Role for Admin scored 84% from 54 tests.

About plugin

  • Plugin page: access-pages-by-r...
  • Plugin version: 1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.4.1
  • WordPress version: 5.8.1
  • First release: May 21, 2020
  • Latest release: May 21, 2020
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: aleksandrx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 316 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▼0.03MB] [CPU: ▼144.13ms] Passed 4 tests

Server-side resources used by Access Pages by Role for Admin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1335.37 ▲1.88
Dashboard /wp-admin3.19 ▲0.1351.68 ▲11.15
Posts /wp-admin/edit.php3.24 ▲0.1346.55 ▼1.00
Add New Post /wp-admin/post-new.php5.01 ▼0.4373.48 ▼580.53
Media Library /wp-admin/upload.php3.04 ▲0.0434.68 ▲3.12
Access Pages Control /wp-admin/options-general.php?page=access-pages-by-role-settings3.0431.31

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 2 new options
New WordPress options
access_pages_by_role_help
access_pages_by_role_general

Browser metrics Passed 4 tests

A check of browser resources used by Access Pages by Role for Admin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,926 ▲33017.58 ▲2.017.96 ▼0.2848.32 ▼4.28
Dashboard /wp-admin3,187 ▲2538.24 ▲2.30151.37 ▲9.50128.91 ▲17.44
Posts /wp-admin/edit.php3,003 ▲2644.35 ▲1.6679.37 ▲15.8191.86 ▲4.77
Add New Post /wp-admin/post-new.php3,710 ▲1,83815.06 ▼4.15416.98 ▲46.32119.04 ▲8.22
Media Library /wp-admin/upload.php1,840 ▲364.89 ▼0.15129.16 ▼10.13116.89 ▲0.95
Access Pages Control /wp-admin/options-general.php?page=access-pages-by-role-settings1,4624.1081.2883.03

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • access_pages_by_role_help

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/access-pages-by-role-for-admin/includes/apbrfa-functions.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'APBRFA_Settings_API' not found in wp-content/plugins/access-pages-by-role-for-admin/includes/apbrfa-settings.php:15

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 97% 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
These attributes need to be fixed: Please take inspiration from this readme.txt

access-pages-by-role-for-admin/access-pages-by-role-for-admin.php Passed 13 tests

The entry point to "Access Pages by Role for Admin" version 1.0 is a PHP file that has certain tags in its header comment area
64 characters long description:
Allows an administrator to control access to pages by user role.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected872 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP4257216769
PO File12930103

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity28.33
▷ Minimum class complexity6.00
▷ Maximum class complexity70.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods40
▷ Static methods12.50%
▷ Public methods40100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions1090.91%
▷ Anonymous functions19.09%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin