84% wp-media-overwrite

Code Review | WP Media Overwrite

WordPress plugin WP Media Overwrite scored84%from 54 tests.

About plugin

  • Plugin page: wp-media-overwrite
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.6
  • WordPress version: 6.3.1
  • First release: Dec 25, 2020
  • Latest release: Dec 26, 2020
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: ironikus (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /408 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.07MB] [CPU: ▼2.81ms] Passed 4 tests

Analyzing server-side resources used by WP Media Overwrite
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0742.71 ▲2.76
Dashboard /wp-admin3.38 ▲0.0849.78 ▼1.92
Posts /wp-admin/edit.php3.50 ▲0.1451.79 ▲3.40
Add New Post /wp-admin/post-new.php5.96 ▲0.0788.21 ▼12.90
Media Library /wp-admin/upload.php3.31 ▲0.0740.17 ▲0.83
WP Media Overwrite /wp-admin/upload.php?page=wp-media-overwrite3.2529.66

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for WP Media Overwrite
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.75 ▲0.401.65 ▼0.0742.50 ▲0.45
Dashboard /wp-admin2,202 ▲215.59 ▼0.1187.28 ▼16.4239.13 ▼1.71
Posts /wp-admin/edit.php2,104 ▲42.13 ▲0.1639.63 ▲0.8736.90 ▲2.14
Add New Post /wp-admin/post-new.php1,531 ▲323.26 ▲0.12658.79 ▲34.5454.40 ▼1.03
Media Library /wp-admin/upload.php1,404 ▲134.12 ▼0.0699.44 ▼0.9046.01 ▲1.75
WP Media Overwrite /wp-admin/upload.php?page=wp-media-overwrite8091.9925.8028.18

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

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

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/upload.php?page=wp-media-overwrite
    • > Notice in wp-content/plugins/wp-media-overwrite/core/includes/classes/class-wp-media-overwrite-run.php+217
    Trying to access array offset on value of type bool

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
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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: A description for screenshot #1 is missing in wp-media-overwrite/assets to your readme.txt
  • Tags: No valid plugin tags found
Please take inspiration from this readme.txt

wp-media-overwrite/wp-media-overwrite.php Passed 13 tests

Analyzing the main PHP file in "WP Media Overwrite" version 1.0.0
96 characters long description:
Replaces files automatically which have the same file name and are stored within the same folder

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin284 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP7121408284

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity8.00
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes120.00%
Methods25
▷ Static methods14.00%
▷ Public methods2288.00%
▷ Protected methods00.00%
▷ Private methods312.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin