89% private-media

Code Review | Private Media

WordPress plugin Private Media scored89%from 54 tests.

About plugin

  • Plugin page: private-media
  • Plugin version: 1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.8-4.9.8
  • WordPress version: 6.3.1
  • First release: Sep 1, 2018
  • Latest release: Jan 22, 2019
  • Number of updates: 7
  • Update frequency: every 21.0 days
  • Top authors: frogerme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /2,054 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼0.29ms] Passed 4 tests

This is a short check of server-side resources used by Private Media
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0842.60 ▲1.24
Dashboard /wp-admin3.35 ▲0.0559.28 ▲8.46
Posts /wp-admin/edit.php3.47 ▲0.1154.54 ▲3.22
Add New Post /wp-admin/post-new.php5.96 ▲0.0791.15 ▼13.27
Media Library /wp-admin/upload.php3.28 ▲0.0543.82 ▲7.64

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

A short overview of filesystem and database impact
It is recommended to fix the following issues
  • You have illegally modified 2 files (2.69KB) outside of "wp-content/plugins/private-media/" and "wp-content/uploads/"
    • (new file) wp-content/mu-plugins/pvtmed-endpoint-optimizer.php
    • (new file) wp-content/pvtmed-uploads/.htaccess
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Private Media
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,903 ▲14213.60 ▼0.767.17 ▲5.2547.29 ▲7.55
Dashboard /wp-admin2,223 ▲205.84 ▲0.96100.25 ▼15.9940.65 ▼1.14
Posts /wp-admin/edit.php2,114 ▲142.07 ▲0.0541.37 ▲1.1834.90 ▼1.17
Add New Post /wp-admin/post-new.php1,537 ▲622.88 ▼0.37601.51 ▼86.2362.93 ▲7.02
Media Library /wp-admin/upload.php1,408 ▲114.29 ▲0.0298.87 ▼4.0144.58 ▼3.47

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: uploads, media, private

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

This is the main PHP file of "Private Media" version 1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected1,328 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP7379941,060
JavaScript6643130
Markdown118071
CSS28166
SVG1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity37.75
▷ Minimum class complexity29.00
▷ Maximum class complexity55.00
Average method complexity3.45
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods60
▷ Static methods1220.00%
▷ Public methods3761.67%
▷ Protected methods2236.67%
▷ Private methods11.67%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants3
▷ Global constants266.67%
▷ Class constants133.33%
▷ Public constants1100.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/forbidden.png16.99KB5.75KB▼ 66.12%