84% simple-restrict

Code Review | Simple Restrict

WordPress plugin Simple Restrict scored 84% from 54 tests.

About plugin

  • Plugin page: simple-restrict
  • Plugin version: 1.2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.2.2
  • WordPress version: 6.3.1
  • First release: Apr 6, 2016
  • Latest release: Jul 24, 2019
  • Number of updates: 64
  • Update frequency: every 18.8 days
  • Top authors: awakensolutions (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

1,000+ active / 24,404 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.51ms] Passed 4 tests

Server-side resources used by Simple Restrict
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0538.05 ▼5.33
Dashboard /wp-admin3.35 ▲0.0544.55 ▼1.59
Posts /wp-admin/edit.php3.40 ▲0.0547.58 ▲0.32
Add New Post /wp-admin/post-new.php5.99 ▲0.1087.53 ▼10.23
Media Library /wp-admin/upload.php3.27 ▲0.0532.60 ▼0.88
Permissions /wp-admin/edit-tags.php?taxonomy=simple-restrict-permission&post_type=page3.2732.44
Simple Restrict /wp-admin/options-general.php?page=simple_restrict_plugin3.3036.13

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Restrict
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲13813.62 ▼0.604.86 ▲2.9241.31 ▼1.23
Dashboard /wp-admin2,218 ▲304.86 ▼0.25107.22 ▼7.2037.92 ▼9.39
Posts /wp-admin/edit.php2,101 ▲122.01 ▲0.0238.92 ▼0.2734.66 ▼1.64
Add New Post /wp-admin/post-new.php1,524 ▼917.64 ▼5.57682.65 ▲27.7860.52 ▲1.94
Media Library /wp-admin/upload.php1,400 ▲154.21 ▼0.1094.58 ▼5.8542.92 ▼1.58
Permissions /wp-admin/edit-tags.php?taxonomy=simple-restrict-permission&post_type=page1,2712.1427.3827.29
Simple Restrict /wp-admin/options-general.php?page=simple_restrict_plugin1,4476.44117.2059.26

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/simple-restrict/admin/partials/simple-restrict-admin-display.php
    • > /wp-content/plugins/simple-restrict/public/partials/simple-restrict-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

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
Please fix the following attributes:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

simple-restrict/simple-restrict.php Passed 13 tests

This is the main PHP file of "Simple Restrict" version 1.2.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
83 characters long description:
Restrict pages based on permissions assigned to pages and granted in user profiles.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin463 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12178622442
CSS22815
JavaScript24546

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity5.29
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity1.70
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods43
▷ Static methods24.65%
▷ Public methods3888.37%
▷ Protected methods00.00%
▷ Private methods511.63%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected