78% ajax-file-upload

Code Review | AJAX File Upload

WordPress plugin AJAX File Upload scored78%from 54 tests.

About plugin

  • Plugin page: ajax-file-upload
  • Plugin version: 0.1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.5.2
  • WordPress version: 6.3.1
  • First release: May 25, 2016
  • Latest release: May 25, 2016
  • Number of updates: 9
  • Update frequency: N/A
  • Top authors: elhardoum (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active /5,568 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

This is a short check of server-side resources used by AJAX File Upload
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.90 ▼2.40
Dashboard /wp-admin3.33 ▼0.0251.75 ▼16.25
Posts /wp-admin/edit.php3.44 ▲0.0845.51 ▼3.71
Add New Post /wp-admin/post-new.php5.91 ▲0.0284.63 ▼8.72
Media Library /wp-admin/upload.php3.25 ▲0.0235.73 ▼4.15
AJAX file upload /wp-admin/options-general.php?page=ajax-file-upload3.2230.61
/wp-admin/admin.php?page=afu-about3.2734.66

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 23 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
afu_0.1_about_rdr
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for AJAX File Upload
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,908 ▲13713.42 ▼1.158.88 ▲6.9443.78 ▲0.23
Dashboard /wp-admin2,202 ▲225.62 ▼0.0384.79 ▼18.9539.26 ▼4.98
Posts /wp-admin/edit.php2,104 ▲42.01 ▼0.0035.39 ▼3.9433.18 ▼3.20
Add New Post /wp-admin/post-new.php1,529 ▼823.09 ▲4.66658.81 ▼5.7256.59 ▼7.39
Media Library /wp-admin/upload.php1,401 ▼24.15 ▼0.06112.66 ▲10.3847.42 ▲2.61
AJAX file upload /wp-admin/options-general.php?page=ajax-file-upload9742.0022.3031.09
/wp-admin/admin.php?page=afu-about1,3312.0424.1299.29

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • afu_0.1_about_rdr
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/ajax-file-upload/includes/afu-about.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'AJAX_file_upload' not found in wp-content/plugins/ajax-file-upload/includes/admin.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/ajax-file-upload/ajax-file-upload.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% 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
Please fix the following attributes:
  • Tags: There are too many tags (17 tag instead of maximum 10)
You can take inspiration from this readme.txt

ajax-file-upload/ajax-file-upload.php Passed 13 tests

The main PHP file in "AJAX File Upload" ver. 0.1.1.1 adds more information about the plugin and also serves as the entry point for this plugin
82 characters long description:
AJAX File Upload - fast and easy front-end WordPress file uploader with shortcodes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin1,403 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP428342660
HTML1110301
JavaScript16023212
CSS72753181
JSON10034
SVG13015

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity42.00
▷ Minimum class complexity20.00
▷ Maximum class complexity64.00
Average method complexity4.28
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods25
▷ Static methods416.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin