90% aam-protected-media-files

Code Review | AAM Protected Media Files

WordPress plugin AAM Protected Media Files scored90%from 54 tests.

About plugin

  • Plugin page: aam-protected-med...
  • Plugin version: 1.2.2
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Nov 27, 2019
  • Latest release: Sep 12, 2023
  • Number of updates: 16
  • Update frequency: every 86.6 days
  • Top authors: vasyltech (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

600+ active /8,754 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

Server-side resources used by AAM Protected Media Files
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0037.78 ▼8.82
Dashboard /wp-admin3.31 ▲0.0145.15 ▼8.18
Posts /wp-admin/edit.php3.36 ▲0.0046.20 ▼8.21
Add New Post /wp-admin/post-new.php5.89 ▲0.0098.29 ▲2.40
Media Library /wp-admin/upload.php3.23 ▲0.0035.98 ▲0.82

Server storage [IO: ▲0.06MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

AAM Protected Media Files: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▼0.011.53 ▼0.1144.51 ▲1.43
Dashboard /wp-admin2,195 ▲245.52 ▼0.1482.81 ▼15.1237.77 ▼7.00
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0340.49 ▲3.2733.82 ▼3.37
Add New Post /wp-admin/post-new.php1,528 ▼023.06 ▼0.02619.86 ▼32.5852.25 ▲0.10
Media Library /wp-admin/upload.php1,400 ▲64.25 ▼0.0296.59 ▼3.5339.98 ▼5.53

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: files, protected videos, media library, protected media, documents

aam-protected-media-files/bootstrap.php 92% from 13 tests

The main PHP file in "AAM Protected Media Files" ver. 1.2.2 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("aam-protected-media-files.php" instead of "bootstrap.php")

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
Good job! No executable or dangerous file extensions detected245 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP269282245

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity16.00
▷ Minimum class complexity7.00
▷ Maximum class complexity25.00
Average method complexity2.93
▷ Minimum method complexity2.00
▷ Maximum method complexity6.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods426.67%
▷ Public methods640.00%
▷ Protected methods640.00%
▷ Private methods320.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin