90% simple-restrict-content

Code Review | Simple Restrict Content

WordPress plugin Simple Restrict Content scored90%from 54 tests.

About plugin

  • Plugin page: simple-restrict-c...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.0-5.5.0
  • WordPress version: 6.3.1
  • First release: Oct 13, 2020
  • Latest release: Oct 13, 2020
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: taxarpro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /496 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼9.15ms] Passed 4 tests

A check of server-side resources used by Simple Restrict Content
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0232.96 ▼4.32
Dashboard /wp-admin3.33 ▼0.0244.59 ▼13.65
Posts /wp-admin/edit.php3.38 ▲0.0243.85 ▼2.01
Add New Post /wp-admin/post-new.php5.92 ▲0.0283.44 ▼13.97
Media Library /wp-admin/upload.php3.25 ▲0.0232.16 ▼4.65

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Restrict Content
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▼0.011.56 ▼0.0338.25 ▼2.99
Dashboard /wp-admin2,192 ▲185.52 ▼0.0681.42 ▼4.4438.43 ▼4.84
Posts /wp-admin/edit.php2,100 ▲32.04 ▲0.0935.99 ▼1.0630.64 ▼5.81
Add New Post /wp-admin/post-new.php6,231 ▲4,70318.66 ▼4.15889.48 ▲235.9551.69 ▼15.73
Media Library /wp-admin/upload.php1,394 ▼34.19 ▲0.0396.28 ▼2.1041.82 ▼4.95

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests Passed 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 Passed 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
Looking good! No server-side errors or output on direct access of PHP files

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)
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: woocommerce restrict, roles, restrict content, restrict posts, restrict custom posts...

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

This is the main PHP file of "Simple Restrict Content" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
128 characters long description:
Restrict the content of all WordPress, just select the roles that can access that post, page, custom post type, product ... etc.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin144 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP31817126
PO File11118

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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 are no PNG files in this plugin