84% compress-then-upload

Code Review | Compress Then Upload

WordPress plugin Compress Then Upload scored84%from 54 tests.

About plugin

  • Plugin page: compress-then-upload
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2
  • WordPress version: 6.3.1
  • First release: Jul 16, 2022
  • Latest release: Apr 30, 2023
  • Number of updates: 6
  • Update frequency: every 48.2 days
  • Top authors: eliehanna (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /487 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

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

Server-side resources used by Compress Then Upload
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.82 ▼5.65
Dashboard /wp-admin3.31 ▲0.0144.29 ▼3.11
Posts /wp-admin/edit.php3.36 ▲0.0145.90 ▲0.39
Add New Post /wp-admin/post-new.php5.90 ▲0.0283.32 ▼1.40
Media Library /wp-admin/upload.php3.24 ▲0.0133.27 ▼2.75
Compress Then Upload /wp-admin/upload.php?page=wpctu3.2030.17

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 40 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

A check of browser resources used by Compress Then Upload
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.33 ▼1.051.60 ▼0.1138.69 ▼5.72
Dashboard /wp-admin2,213 ▲224.86 ▼0.08108.16 ▲6.6441.68 ▲2.37
Posts /wp-admin/edit.php2,093 ▲42.01 ▲0.0238.32 ▲2.0034.72 ▲2.26
Add New Post /wp-admin/post-new.php1,537 ▲923.06 ▼0.27639.83 ▼43.2850.53 ▼2.42
Media Library /wp-admin/upload.php1,395 ▲74.23 ▲0.03103.11 ▲4.5444.95 ▼2.38
Compress Then Upload /wp-admin/upload.php?page=wpctu1,1464.1378.8559.65

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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 take a closer look at 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 plugin_dir_url() in wp-content/plugins/compress-then-upload/compress-then-upload.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found


Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: image-compression, media

compress-then-upload/compress-then-upload.php Passed 13 tests

"Compress Then Upload" version 1.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
77 characters long description:
An image uploader that resizes and compresses images before getting uploaded.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin40,376 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
▷ Static methods26.90%
▷ Public methods1758.62%
▷ Protected methods00.00%
▷ Private methods1241.38%
▷ Named functions150.00%
▷ Anonymous functions150.00%
▷ Global constants3100.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