84% media-from-zip

Code Review | Media from ZIP

WordPress plugin Media from ZIP scored84%from 54 tests.

About plugin

  • Plugin page: media-from-zip
  • Plugin version: 1.19
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: Mar 6, 2020
  • Latest release: Oct 29, 2023
  • Number of updates: 52
  • Update frequency: every 25.6 days
  • Top authors: Katsushi Kawamori (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /5,700 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.19MB] [CPU: ▼2.08ms] Passed 4 tests

Server-side resources used by Media from ZIP
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1940.29 ▼0.97
Dashboard /wp-admin3.49 ▲0.1944.62 ▼3.66
Posts /wp-admin/edit.php3.61 ▲0.2549.92 ▲6.20
Add New Post /wp-admin/post-new.php6.08 ▲0.1991.63 ▼5.61
Media Library /wp-admin/upload.php3.42 ▲0.1938.63 ▲1.91
Register by upload /wp-admin/admin.php?page=mediafromzip-upload-register3.3832.63
Settings /wp-admin/admin.php?page=mediafromzip-settings3.3932.09
Register on server /wp-admin/admin.php?page=mediafromzip-server-register3.3929.25
Media from ZIP /wp-admin/admin.php?page=mediafromzip3.3832.32

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Media from ZIP
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6314.24 ▲0.021.68 ▼0.0640.93 ▼3.01
Dashboard /wp-admin2,230 ▲535.62 ▲0.0290.71 ▼4.0142.42 ▼2.13
Posts /wp-admin/edit.php2,138 ▲381.98 ▼0.0038.98 ▼4.0036.34 ▼0.55
Add New Post /wp-admin/post-new.php1,563 ▲2818.12 ▲0.05659.82 ▲27.9580.50 ▲19.59
Media Library /wp-admin/upload.php1,432 ▲324.16 ▲0.07105.96 ▼2.8848.07 ▲6.00
Register by upload /wp-admin/admin.php?page=mediafromzip-upload-register8422.0024.0731.08
Settings /wp-admin/admin.php?page=mediafromzip-settings1,4152.3036.3728.37
Register on server /wp-admin/admin.php?page=mediafromzip-server-register8341.9225.4625.68
Media from ZIP /wp-admin/admin.php?page=mediafromzip8612.0024.2629.99

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 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 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
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_upload_dir() in wp-content/plugins/media-from-zip/lib/class-mediafromzipadmin.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/media-from-zip/lib/class-mediafromzip.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/media-from-zip/lib/class-mediafromzip.php:38

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
4 plugin tags: extract, media, archive, zip

media-from-zip/mediafromzip.php 92% from 13 tests

The main PHP script in "Media from ZIP" version 1.19 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("media-from-zip.php" instead of "mediafromzip.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected2,516 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2183601,278
PHP4130251918
CSS281320

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity76.00
▷ Minimum class complexity57.00
▷ Maximum class complexity95.00
Average method complexity7.65
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods1466.67%
▷ Protected methods00.00%
▷ Private methods733.33%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin