69% safeguard-media

Code Review | SafeGuard Media

WordPress plugin SafeGuard Media scored69%from 54 tests.

About plugin

  • Plugin page: safeguard-media
  • Plugin version: 2.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.4
  • WordPress version: 6.3.1
  • First release: Nov 12, 2023
  • Latest release: Nov 12, 2023
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: ArtistScope (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /11 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.23MB] [CPU: ▼7.47ms] 75% from 4 tests

Analyzing server-side resources used by SafeGuard Media
Please take the time to fix the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,667.18ms on /wp-admin/admin.php?page=wpsafeguard_list)
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3444.24 ▲5.84
Dashboard /wp-admin3.64 ▲0.3051.29 ▼19.89
Posts /wp-admin/edit.php3.76 ▲0.4147.77 ▲3.51
Add New Post /wp-admin/post-new.php5.82 ▼0.0785.05 ▼13.94
Media Library /wp-admin/upload.php3.57 ▲0.3533.56 ▲0.43
List Files /wp-admin/admin.php?page=wpsafeguard_list3.551,667.18
Settings /wp-admin/admin.php?page=wpsafeguard_settings3.5333.78

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 39 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
wpsafeguard_settings

Browser metrics Passed 4 tests

SafeGuard Media: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲7614.25 ▼0.071.67 ▼0.0543.56 ▼0.09
Dashboard /wp-admin2,228 ▲585.58 ▼0.0385.47 ▼28.0440.27 ▼2.61
Posts /wp-admin/edit.php2,419 ▲3193.40 ▲1.4685.09 ▲45.6632.72 ▼4.57
Add New Post /wp-admin/post-new.php1,760 ▲23424.19 ▲1.26655.93 ▲24.6541.17 ▼23.61
Media Library /wp-admin/upload.php1,709 ▲3065.28 ▲1.10110.43 ▲8.3042.45 ▲0.25
List Files /wp-admin/admin.php?page=wpsafeguard_list9022.0425.5632.19
Settings /wp-admin/admin.php?page=wpsafeguard_settings1,0221.7024.7127.12

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/safeguard-media/wp-safeguard-media.php+379
    unlink(wp-content/uploads/safeguard-media/.): Is a directory
  • Uninstaller has failed for this plugin, leaving 39 files (0.19MB) in the plugin directory
    • (new file) css/jquery-ui.min.css
    • (new file) images/artistscope-logo48.png
    • (new file) images/corner_bot_left_clear.gif
    • (new file) images/clr1x10.gif
    • (new file) images/corner_top_left_clear.gif
    • (new file) css/theme.min.css
    • (new file) images/bot_bg.gif
    • (new file) images/corner_bot_right_clear.gif
    • (new file) css/wp-safeguard.css
    • (new file) images/clear.gif
    • ...
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
9 plugin tags: copy protect, protect video, prevent copy, content protection, video protect...

safeguard-media/wp-safeguard-media.php 85% from 13 tests

The principal PHP file in "SafeGuard Media" v. 2.0.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("safeguard-media.php" instead of "wp-safeguard-media.php")

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
Success! There were no dangerous files found in this plugin2,809 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP133521461,929
PO File3171177372
JavaScript28429299
CSS44421209

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
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%
Functions42
▷ Named functions42100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
6 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/help-24-30.png1.52KB1.19KB▼ 21.77%
images/help14.png1.00KB0.81KB▼ 19.57%
images/settings.png1.83KB1.69KB▼ 7.68%
images/safeguardbutton.png1.28KB0.64KB▼ 49.54%
images/artistscope-logo48.png3.10KB1.78KB▼ 42.54%