73% filr-protection

Code Review | Filr - Secure document library

WordPress plugin Filr - Secure document library scored73%from 54 tests.

About plugin

  • Plugin page: filr-protection
  • Plugin version: 1.2.3.6
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.4
  • WordPress version: 6.3.1
  • First release: Apr 9, 2020
  • Latest release: Nov 8, 2023
  • Number of updates: 61
  • Update frequency: every 21.4 days
  • Top authors: patrickposner (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

800+ active /14,651 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲6.09MB] [CPU: ▲27.71ms] 75% from 4 tests

Analyzing server-side resources used by Filr - Secure document library
Please fix the following
  • Extra RAM: The extra memory usage must be under 5MB (currently 6.09MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.93 ▲6.4663.42 ▲22.85
Dashboard /wp-admin9.95 ▲6.6480.83 ▲31.83
Posts /wp-admin/edit.php9.95 ▲6.5987.59 ▲39.97
Add New Post /wp-admin/post-new.php10.56 ▲4.66110.88 ▲19.68
Media Library /wp-admin/upload.php9.95 ▲6.7268.10 ▲36.49
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius9.9564.44

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 233 new files
Database: no new tables, 12 new options
New WordPress options
widget_theysaidso_widget
filr_frontend_uploader
theysaidso_admin_options
fs_accounts
widget_recent-comments
filr_status
db_upgraded
can_compress_scripts
fs_active_plugins
fs_debug_mode
...

Browser metrics Passed 4 tests

Filr - Secure document library: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,149 ▲38715.79 ▲1.6319.36 ▲17.6232.53 ▼10.64
Dashboard /wp-admin2,407 ▲2406.50 ▲0.97126.58 ▲8.3245.61 ▼1.83
Posts /wp-admin/edit.php2,339 ▲2393.67 ▲1.6657.87 ▲19.7038.68 ▲1.13
Add New Post /wp-admin/post-new.php1,573 ▲4722.27 ▼0.84581.60 ▼76.8927.18 ▼22.99
Media Library /wp-admin/upload.php1,475 ▲754.40 ▲0.1884.17 ▼11.7643.64 ▲3.02
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,2943.2948.9132.59

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/filr-protection/inc/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 12 options in the database
    • filr_frontend_uploader
    • fs_active_plugins
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • fs_accounts
    • filr_shortcode
    • fs_debug_mode
    • db_upgraded
    • ...

Smoke tests 75% from 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 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/filr-protection/filr-protection.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

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
7 plugin tags: protect uploads, document library, prevent direct access, upload protection, file library...

filr-protection/filr-protection.php 92% from 13 tests

The entry point to "Filr - Secure document library" version 1.2.3.6 is a PHP file that has certain tags in its header comment area
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 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected41,735 lines of code in 179 files:
LanguageFilesBlank linesComment linesLines of code
PHP1368,60218,28836,849
PO File71,5031,5804,028
JavaScript1291148487
CSS184323256
SVG401107
JSON1005
Markdown1203

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity79.40
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.52
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces3
Interfaces1
Traits0
Classes61
▷ Abstract classes23.28%
▷ Concrete classes5996.72%
▷ Final classes00.00%
Methods1,403
▷ Static methods23216.54%
▷ Public methods99170.63%
▷ Protected methods171.21%
▷ Private methods39528.15%
Functions113
▷ Named functions10895.58%
▷ Anonymous functions54.42%
Constants148
▷ Global constants10168.24%
▷ Class constants4731.76%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
inc/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%