90% restrict-media-library-access

Code Review | Restrict Media Library Access

WordPress plugin Restrict Media Library Access scored90%from 54 tests.

About plugin

  • Plugin page: restrict-media-li...
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Aug 11, 2017
  • Latest release: Oct 28, 2023
  • Number of updates: 7
  • Update frequency: every 324.1 days
  • Top authors: mrfoxtalbot (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

2,000+ active /14,917 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.39ms] Passed 4 tests

Server-side resources used by Restrict Media Library Access
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.97 ▼4.61
Dashboard /wp-admin3.31 ▲0.0045.23 ▼3.25
Posts /wp-admin/edit.php3.36 ▲0.0044.86 ▼1.15
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.12 ▼4.54
Media Library /wp-admin/upload.php3.23 ▲0.0036.55 ▲4.10

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Restrict Media Library Access
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.38 ▼0.241.88 ▲0.2744.50 ▲4.53
Dashboard /wp-admin2,195 ▲245.65 ▲0.0890.76 ▲1.8836.68 ▼5.40
Posts /wp-admin/edit.php2,100 ▼02.04 ▲0.0038.27 ▼3.2336.86 ▲7.43
Add New Post /wp-admin/post-new.php1,526 ▼023.85 ▲0.74649.78 ▲35.4565.02 ▲4.12
Media Library /wp-admin/upload.php1,397 ▼04.23 ▲0.0796.51 ▼2.6643.76 ▲3.08

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests Passed 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)
Good news, no errors were detected

SRP Passed 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
Congratulations! This plugin passed the SRP 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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: visibility, users, media library, roles

restrict-media-library-access/restrict-media-library-access.php 92% from 13 tests

The entry point to "Restrict Media Library Access" version 1.4 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

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
No dangerous file extensions were detected26 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP131426

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.91
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.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