94% frontier-restrict-media

Code Review | Frontier Restrict Media

WordPress plugin Frontier Restrict Media scored 94% from 53 tests.

About plugin

  • Plugin page: frontier-restrict...
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-5.4
  • WordPress version: 5.8.1
  • First release: Jul 13, 2015
  • Latest release: Apr 2, 2020
  • Number of updates: 17
  • Update frequency: every 102.0 days
  • Top authors: finnj (100%)

Code review

53 tests

User reviews

6 reviews

Install metrics

600+ active / 6,667 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

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

A check of server-side resources used by Frontier Restrict Media
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1229.04 ▲8.51
Dashboard /wp-admin3.06 ▲0.0146.84 ▲5.50
Posts /wp-admin/edit.php3.11 ▲0.0144.39 ▲7.17
Add New Post /wp-admin/post-new.php5.43 ▼0.0092.24 ▼1,037.77
Media Library /wp-admin/upload.php3.00 ▼0.0032.87 ▼5.18

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Frontier Restrict Media
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,702 ▲9615.91 ▲0.0810.24 ▲0.6847.59 ▼2.28
Dashboard /wp-admin2,952 ▲1065.92 ▲0.08162.40 ▲18.15108.31 ▲8.23
Posts /wp-admin/edit.php2,706 ▼02.68 ▼0.0165.38 ▼1.9798.50 ▲7.52
Add New Post /wp-admin/post-new.php1,653 ▼20418.81 ▼0.37369.42 ▼8.26104.11 ▼4.35
Media Library /wp-admin/upload.php1,775 ▲625.02 ▲0.05144.56 ▼6.59119.89 ▲0.09

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

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
Everything seems fine, however this is by no means 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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > 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 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes 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.2.0 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
Everything looks great! No dangerous files found in this plugin17 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP121217

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
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 1 test

Image compression Passed 1 test

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin