83% simple-image-uploader

Code Review | Simple Image Uploader

WordPress plugin Simple Image Uploader scored83%from 54 tests.

About plugin

  • Plugin page: simple-image-uplo...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.3-5.2.2
  • WordPress version: 6.3.1
  • First release: Jul 31, 2019
  • Latest release: Oct 26, 2022
  • Number of updates: 4
  • Update frequency: every 295.8 days
  • Top authors: pctricks.ir (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /558 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼7.53ms] Passed 4 tests

This is a short check of server-side resources used by Simple Image Uploader
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.63 ▲1.23
Dashboard /wp-admin3.31 ▼0.0443.76 ▼13.64
Posts /wp-admin/edit.php3.36 ▲0.0046.66 ▲3.93
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.93 ▼18.12
Media Library /wp-admin/upload.php3.23 ▲0.0038.12 ▲0.41

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Simple Image Uploader
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.74 ▲0.361.86 ▲0.3442.67 ▲2.00
Dashboard /wp-admin2,206 ▲144.85 ▼0.05113.00 ▲7.7038.70 ▼4.22
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0640.57 ▲4.8536.69 ▲3.89
Add New Post /wp-admin/post-new.php1,542 ▲2818.49 ▲0.78721.88 ▲57.0454.53 ▼8.63
Media Library /wp-admin/upload.php1,385 ▼34.13 ▲0.0098.58 ▼17.6446.98 ▼1.40

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/simple-image-uploader/SimpleImageUploader.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === simple-image-uploader === )
The official readme.txt is a good inspiration

simple-image-uploader/SimpleImageUploader.php 85% from 13 tests

The main file in "Simple Image Uploader" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("simple-image-uploader.php" instead of "SimpleImageUploader.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected73 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1231773

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.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%
Methods2
▷ Static methods2100.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin