90% wp-original-media-path

Code Review | WP Original Media Path

WordPress plugin WP Original Media Path scored90%from 54 tests.

About plugin

  • Plugin page: wp-original-media...
  • Plugin version: 2.4.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.2
  • WordPress version: 6.3.1
  • First release: Dec 29, 2012
  • Latest release: Mar 30, 2023
  • Number of updates: 124
  • Update frequency: every 30.2 days
  • Top authors: rvola (93.55%)NicoR (7.26%)

Code review

54 tests

User reviews

38 reviews

Install metrics

8,000+ active /124,902 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼2.29ms] Passed 4 tests

A check of server-side resources used by WP Original Media Path
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0633.22 ▼9.89
Dashboard /wp-admin3.39 ▲0.0844.70 ▼1.68
Posts /wp-admin/edit.php3.50 ▲0.1447.58 ▲4.85
Add New Post /wp-admin/post-new.php5.97 ▲0.0792.57 ▼2.44
Media Library /wp-admin/upload.php3.31 ▲0.0841.04 ▲8.30
WP Original Media Path /wp-admin/options-general.php?page=wpomp-options3.2830.47

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WP Original Media Path
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.17 ▼1.381.47 ▼0.5042.47 ▼2.21
Dashboard /wp-admin2,210 ▲195.03 ▼0.86100.70 ▼6.9239.56 ▼4.30
Posts /wp-admin/edit.php2,096 ▲72.01 ▲0.0339.98 ▲2.1635.62 ▲0.48
Add New Post /wp-admin/post-new.php1,549 ▲2918.16 ▼5.24604.97 ▼76.7365.44 ▲8.80
Media Library /wp-admin/upload.php1,392 ▲44.24 ▲0.0494.68 ▲0.0740.24 ▼4.14
WP Original Media Path /wp-admin/options-general.php?page=wpomp-options8232.0826.1630.77

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: media, subdomain, path, upload

wp-original-media-path/wp_original_media_path.php 92% from 13 tests

The main PHP file in "WP Original Media Path" ver. 2.4.2 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-original-media-path.php" instead of "wp_original_media_path.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected315 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP37319290
JavaScript15018
CSS1107

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity1.84
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods19
▷ Static methods631.58%
▷ Public methods1894.74%
▷ Protected methods00.00%
▷ Private methods15.26%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.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
PNG images were not found in this plugin