89% rbam-media

Code Review | Role Based Access Manager: Media Protector

WordPress plugin Role Based Access Manager: Media Protector scored89%from 54 tests.

About plugin

  • Plugin page: rbam-media
  • Plugin version: 1.1.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.7
  • WordPress version: 6.3.1
  • First release: Jul 24, 2020
  • Latest release: Jun 17, 2021
  • Number of updates: 10
  • Update frequency: every 32.9 days
  • Top authors: muisit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /587 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Role Based Access Manager: Media Protector
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.58 ▲0.55
Dashboard /wp-admin3.31 ▲0.0143.49 ▼3.72
Posts /wp-admin/edit.php3.36 ▲0.0144.01 ▼2.14
Add New Post /wp-admin/post-new.php5.90 ▲0.0178.68 ▼8.41
Media Library /wp-admin/upload.php3.23 ▲0.0132.51 ▼1.76

Server storage [IO: ▲0.06MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
These are issues you should consider
  • You have illegally modified 1 file (0.79KB) outside of "wp-content/plugins/rbam-media/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Role Based Access Manager: Media Protector
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.51 ▼1.054.33 ▲2.5241.89 ▼3.07
Dashboard /wp-admin2,206 ▲185.08 ▼0.79107.16 ▲6.1537.99 ▼5.33
Posts /wp-admin/edit.php2,086 ▼32.00 ▲0.0139.72 ▼1.6235.35 ▼2.35
Add New Post /wp-admin/post-new.php1,519 ▼023.12 ▼0.25624.85 ▼58.7357.04 ▼1.75
Media Library /wp-admin/upload.php1,388 ▼34.19 ▼0.0596.47 ▼5.6743.81 ▼4.15

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Congratulations! This plugin passed the SRP test

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 96% from 29 tests

readme.txt Passed 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
4 plugin tags: security, media, attachments, roles

rbam-media/rbam-media.php 92% from 13 tests

The main PHP script in "Role Based Access Manager: Media Protector" version 1.1.3 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin471 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP481148403
JavaScript114568

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity22.67
▷ Minimum class complexity15.00
▷ Maximum class complexity28.00
Average method complexity4.61
▷ Minimum method complexity2.00
▷ Maximum method complexity10.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods735.00%
▷ Protected methods00.00%
▷ Private methods1365.00%
Functions9
▷ Named functions777.78%
▷ Anonymous functions222.22%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin