78% wp-image-uploader

Code Review | WP Image Uploader

WordPress plugin WP Image Uploader scored 78% from 53 tests.

About plugin

  • Plugin page: wp-image-uploader
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.5.2
  • WordPress version: 5.8.1
  • First release: Jul 21, 2013
  • Latest release: Jul 22, 2013
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: filipmedia (100%)

Code review

53 tests

User reviews

2 reviews

Install metrics

50+ active / 4,893 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▼0.61MB] [CPU: ▼297.74ms] Passed 4 tests

Server-side resources used by WP Image Uploader
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.08 ▲0.2535.56 ▼0.79
Dashboard /wp-admin3.04 ▼0.0118.93 ▼31.17
Posts /wp-admin/edit.php3.04 ▼0.0721.04 ▼20.86
Add New Post /wp-admin/post-new.php3.04 ▼2.3921.66 ▼1,123.77
Media Library /wp-admin/upload.php3.04 ▲0.0321.91 ▼15.16

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for WP Image Uploader
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,801 ▲21916.87 ▲1.299.96 ▲0.5553.05 ▲5.99
Dashboard /wp-admin2,963 ▲1136.54 ▲0.53131.29 ▼5.10134.57 ▲23.30
Posts /wp-admin/edit.php2,764 ▲582.75 ▲0.0567.38 ▲2.51113.13 ▲15.21
Add New Post /wp-admin/post-new.php1,681 ▲20018.83 ▲0.35364.32 ▲8.81124.01 ▲14.60
Media Library /wp-admin/upload.php1,753 ▲405.16 ▲0.21126.88 ▼38.69129.89 ▲10.27

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5495
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 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
The following issues need your attention
  • 5× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-image-uploader/templates/show_uploaded_images_tpl.php
    • > /wp-content/plugins/wp-image-uploader/templates/folder_tree_admin_tpl.php
    • > /wp-content/plugins/wp-image-uploader/templates/buy_premium_tpl.php
    • > /wp-content/plugins/wp-image-uploader/templates/admin_home_tpl.php
    • > /wp-content/plugins/wp-image-uploader/templates/upload_form_tpl.php
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: my_site_url in wp-content/plugins/wp-image-uploader/templates/upload_form_tpl.php on line 16
    • > PHP Notice
      Undefined variable: images in wp-content/plugins/wp-image-uploader/templates/show_uploaded_images_tpl.php on line 2
    • > PHP Notice
      Undefined variable: all_files in wp-content/plugins/wp-image-uploader/templates/admin_home_tpl.php on line 28
    • > PHP Notice
      Undefined variable: myFolder in wp-content/plugins/wp-image-uploader/templates/admin_home_tpl.php on line 14
    • > PHP Notice
      Undefined variable: my_site_url in wp-content/plugins/wp-image-uploader/templates/upload_form_tpl.php on line 10
    • > PHP Notice
      Undefined variable: FolderTree in wp-content/plugins/wp-image-uploader/templates/folder_tree_admin_tpl.php on line 3
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-image-uploader/templates/show_uploaded_images_tpl.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-image-uploader/index.php:19

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 on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Donate link: Please fix this invalid URI: ""
You can take inspiration from this readme.txt

wp-image-uploader/index.php 85% from 13 tests

The primary PHP file in "WP Image Uploader" version 1.0.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 160 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-image-uploader.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin1,716 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP156012,0981,295
CSS1190177
JavaScript31026176
Markdown125068

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity47.25
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity4.30
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods112
▷ Static methods1412.50%
▷ Public methods8071.43%
▷ Protected methods3228.57%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants55
▷ Global constants4683.64%
▷ Class constants916.36%
▷ Public constants9100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/pics_1.png1.78KB1.41KB▼ 20.95%