84% restrict-user-taxonomies

Code Review | Restrict User Taxonomies

WordPress plugin Restrict User Taxonomies scored 84% from 54 tests.

About plugin

  • Plugin page: restrict-user-tax...
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.8.1
  • WordPress version: 6.3.1
  • First release: Sep 2, 2017
  • Latest release: Sep 2, 2017
  • Number of updates: 8
  • Update frequency: every 0.3 days
  • Top authors: seebeen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 1,254 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▲0.30ms] Passed 4 tests

A check of server-side resources used by Restrict User Taxonomies
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.01 ▼3.68
Dashboard /wp-admin3.39 ▲0.0949.32 ▲1.18
Posts /wp-admin/edit.php3.50 ▲0.1548.90 ▼1.82
Add New Post /wp-admin/post-new.php5.97 ▲0.0997.26 ▲7.42
Media Library /wp-admin/upload.php3.31 ▲0.0937.31 ▲5.53
Restrict Taxonomies /wp-admin/options-general.php?page=sgi-restrict-user-taxonomies3.2531.55

Server storage [IO: ▲0.10MB] [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: 10 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
sgi_rat_ver

Browser metrics Passed 4 tests

This is an overview of browser requirements for Restrict User Taxonomies
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4714.42 ▲0.052.00 ▼0.3048.81 ▲0.26
Dashboard /wp-admin2,207 ▲335.86 ▲0.98110.51 ▼11.5241.88 ▼3.67
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0239.89 ▼1.9436.08 ▼0.33
Add New Post /wp-admin/post-new.php1,538 ▲2422.95 ▲5.40635.68 ▼60.1249.68 ▼16.16
Media Library /wp-admin/upload.php1,395 ▲104.28 ▼0.0299.95 ▼3.7542.21 ▼1.67
Restrict Taxonomies /wp-admin/options-general.php?page=sgi-restrict-user-taxonomies8762.0222.7627.95

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • sgi_rat_ver
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=sgi-restrict-user-taxonomies
    • > Notice in wp-content/plugins/restrict-user-taxonomies/lib/backend/rat-admin-settings.php+219
    Undefined index: include_children

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed: You can look at the official readme.txt

restrict-user-taxonomies/restrict-user-taxonomies.php Passed 13 tests

The main file in "Restrict User Taxonomies" v. 1.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
131 characters long description:
Based on Restrict Categories, this plugin allows you to restrict post adding, viewing and editing based on selected taxonomy terms.

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 detected482 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP628037477
JavaScript2004
CSS1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity11.50
▷ Minimum class complexity4.00
▷ Maximum class complexity22.00
Average method complexity2.86
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods1982.61%
▷ Protected methods00.00%
▷ Private methods417.39%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin