84% zip-from-media

Code Review | ZIP from Media

WordPress plugin ZIP from Media scored84%from 54 tests.

About plugin

  • Plugin page: zip-from-media
  • Plugin version: 1.06
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: Apr 6, 2020
  • Latest release: Nov 2, 2023
  • Number of updates: 20
  • Update frequency: every 65.3 days
  • Top authors: Katsushi Kawamori (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,079 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.11MB] [CPU: ▼3.90ms] Passed 4 tests

A check of server-side resources used by ZIP from Media
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1343.57 ▲1.21
Dashboard /wp-admin3.43 ▲0.0846.89 ▼12.14
Posts /wp-admin/edit.php3.54 ▲0.1848.93 ▲0.66
Add New Post /wp-admin/post-new.php6.01 ▲0.1286.64 ▼1.24
Media Library /wp-admin/upload.php3.35 ▲0.1235.26 ▼2.88
ZIP from Media /wp-admin/admin.php?page=zipfrommedia3.3232.77
Generate ZIP /wp-admin/admin.php?page=zipfrommedia-generate-zip3.3234.43
Settings /wp-admin/admin.php?page=zipfrommedia-settings3.3230.32

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for ZIP from Media
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲7414.25 ▼0.281.69 ▼0.0944.74 ▲2.74
Dashboard /wp-admin2,229 ▲515.64 ▲0.0787.31 ▼15.4337.80 ▼5.39
Posts /wp-admin/edit.php2,134 ▲372.03 ▼0.0038.47 ▲0.6835.09 ▲0.47
Add New Post /wp-admin/post-new.php1,560 ▲3418.25 ▼4.84619.31 ▼68.4473.86 ▲18.18
Media Library /wp-admin/upload.php1,425 ▲284.15 ▼0.0095.13 ▼13.6554.23 ▲4.56
ZIP from Media /wp-admin/admin.php?page=zipfrommedia8542.0024.1629.09
Generate ZIP /wp-admin/admin.php?page=zipfrommedia-generate-zip8222.0323.2028.32
Settings /wp-admin/admin.php?page=zipfrommedia-settings8642.0024.0827.17

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/zip-from-media/lib/class-zipfrommedia.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_upload_dir() in wp-content/plugins/zip-from-media/lib/class-zipfrommediaadmin.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/zip-from-media/lib/class-zipfrommedia.php:38

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: compress, zip, media, archive

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

"ZIP from Media" version 1.06's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("zip-from-media.php" instead of "zipfrommedia.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected553 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP484185553

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity33.50
▷ Minimum class complexity11.00
▷ Maximum class complexity56.00
Average method complexity5.64
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods1178.57%
▷ Protected methods00.00%
▷ Private methods321.43%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin