84% frontier-restrict-media

Code Review | Frontier Restrict Media

WordPress plugin Frontier Restrict Media scored84%from 54 tests.

About plugin

  • Plugin page: frontier-restrict...
  • Plugin version: 1.6.2
  • PHP compatiblity: 7.4.33+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.2
  • WordPress version: 6.3.1
  • First release: Jul 13, 2015
  • Latest release: Apr 13, 2023
  • Number of updates: 24
  • Update frequency: every 118.3 days
  • Top authors: finnj (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

600+ active /9,041 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

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

An overview of server-side resources used by Frontier Restrict Media
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.73 ▲1.02
Dashboard /wp-admin3.31 ▼0.0341.55 ▼17.62
Posts /wp-admin/edit.php3.36 ▲0.0144.60 ▼2.79
Add New Post /wp-admin/post-new.php5.89 ▲0.0177.99 ▼21.27
Media Library /wp-admin/upload.php3.23 ▲0.0034.25 ▼0.57

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Frontier Restrict Media
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.73 ▲0.491.66 ▼0.0243.36 ▼0.33
Dashboard /wp-admin2,195 ▲155.62 ▼0.0593.96 ▲5.2041.78 ▲2.11
Posts /wp-admin/edit.php2,097 ▼32.02 ▲0.0440.64 ▲4.2234.97 ▲0.92
Add New Post /wp-admin/post-new.php1,526 ▼023.47 ▲0.43646.72 ▼48.0945.93 ▼8.68
Media Library /wp-admin/upload.php1,400 ▼04.22 ▲0.0594.25 ▼7.4239.94 ▼4.97

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/frontier-restrict-media/frontier-restrict-media.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Please fix this invalid URI: ""
The official readme.txt might help

frontier-restrict-media/frontier-restrict-media.php Passed 13 tests

The main PHP file in "Frontier Restrict Media" ver. 1.6.2 adds more information about the plugin and also serves as the entry point for this plugin
51 characters long description:
Restrict users to only access their own media files

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected17 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP121217

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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