83% simple-image-upload

Code Review | Simple Image Upload

WordPress plugin Simple Image Upload scored83%from 54 tests.

About plugin

  • Plugin page: simple-image-upload
  • Plugin version: 1.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: WP 3.0.0-3.5
  • WordPress version: 6.3.1
  • First release: Dec 23, 2012
  • Latest release: May 12, 2013
  • Number of updates: 17
  • Update frequency: every 8.2 days
  • Top authors: Sium (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /4,201 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.78ms] Passed 4 tests

An overview of server-side resources used by Simple Image Upload
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0042.18 ▼2.29
Dashboard /wp-admin3.31 ▲0.0150.78 ▼3.06
Posts /wp-admin/edit.php3.36 ▲0.0047.56 ▼8.27
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.97 ▼21.49
Media Library /wp-admin/upload.php3.23 ▲0.0037.51 ▲1.38

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Simple Image Upload: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲5014.75 ▲0.161.74 ▲0.1642.46 ▲0.01
Dashboard /wp-admin2,220 ▲405.65 ▲0.0087.77 ▼3.4340.65 ▼2.72
Posts /wp-admin/edit.php2,102 ▲21.99 ▼0.0436.27 ▼5.8436.98 ▼0.86
Add New Post /wp-admin/post-new.php1,530 ▲223.15 ▲0.06655.56 ▼37.9762.64 ▲2.56
Media Library /wp-admin/upload.php1,396 ▼44.17 ▼0.0699.71 ▼3.8543.16 ▼1.83

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 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
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-image-upload/postimage.php:25

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 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 15 tag instead of maximum 10
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (When starting new post you see "add image to post" link below textarea), #2 (Click that link, popup will appear where you should select image), #3 (You click "upload it" link, image is uploaded and html code is automatically inserted in post)
Please take inspiration from this readme.txt

simple-image-upload/postimage.php 85% from 13 tests

"Simple Image Upload" version 1.4.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("simple-image-upload.php" instead of "postimage.php")
  • Requires at least: Please use periods and digits for the required version (ex. "7.0" instead of "WP 3.0.0")

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 plugin11 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP141211
JavaScript1010

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods1
▷ Static methods1100.00%
▷ Public methods1100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.09MB with 0.05MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png11.98KB5.54KB▼ 53.77%
screenshot-2.png13.53KB8.10KB▼ 40.14%
screenshot-3.png70.56KB22.11KB▼ 68.66%