78% restrict-user-content

Code Review | Restrict User Content

WordPress plugin Restrict User Content scored78%from 54 tests.

About plugin

  • Plugin page: restrict-user-con...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9.1
  • WordPress version: 6.3.1
  • First release: Jul 21, 2014
  • Latest release: Jan 3, 2018
  • Number of updates: 12
  • Update frequency: every 105.2 days
  • Top authors: welcher (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,248 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

Server-side resources used by Restrict User Content
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0433.47 ▼2.80
Dashboard /wp-admin3.34 ▲0.0339.10 ▼6.32
Posts /wp-admin/edit.php3.45 ▲0.1046.36 ▼2.09
Add New Post /wp-admin/post-new.php5.92 ▲0.0376.73 ▼5.19
Media Library /wp-admin/upload.php3.26 ▲0.0333.34 ▼0.44
Restrict User Content /wp-admin/options-general.php?page=restrict_user_content_settings_page3.2628.49

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
restrict_user_content_settings
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Restrict User Content
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3314.74 ▲0.181.52 ▼0.3536.61 ▼11.09
Dashboard /wp-admin2,210 ▲254.84 ▼1.06110.62 ▲4.4942.50 ▼1.20
Posts /wp-admin/edit.php2,096 ▲42.03 ▼0.0237.27 ▼3.8535.22 ▼3.18
Add New Post /wp-admin/post-new.php1,532 ▲323.55 ▲4.97662.91 ▲47.8265.32 ▲13.08
Media Library /wp-admin/upload.php1,392 ▲14.19 ▲0.0193.23 ▼9.2541.92 ▼2.78
Restrict User Content /wp-admin/options-general.php?page=restrict_user_content_settings_page1,0392.2650.8830.70

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=restrict_user_content_settings_page
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=restrict_user_content_settings_page
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/restrict-user-content/restrict-user-content.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/restrict-user-content/_views/additional-users-meta-box.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/restrict-user-content/_views/view-settings-page.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === restrict-user-content === )
The official readme.txt is a good inspiration

restrict-user-content/restrict-user-content.php 92% from 13 tests

"Restrict User Content" version 2.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected265 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP5105174265

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity11.00
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods1995.00%
▷ Protected methods00.00%
▷ Private methods15.00%
Functions0
▷ Named functions00.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