78% compresswp-optimize-and-compress-jpeg-and-png-images

Code Review | CompressWP - optimize and compress JPEG and PNG images

WordPress plugin CompressWP - optimize and compress JPEG and PNG images scored78%from 54 tests.

About plugin

  • Plugin page: compresswp-optimi...
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-6.2
  • WordPress version: 6.3.1
  • First release: Nov 20, 2020
  • Latest release: Jul 21, 2023
  • Number of updates: 14
  • Update frequency: every 69.6 days
  • Top authors: compresswp (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active /1,878 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
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by CompressWP - optimize and compress JPEG and PNG images
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.54 ▼0.77
Dashboard /wp-admin3.31 ▲0.0148.99 ▲0.90
Posts /wp-admin/edit.php3.37 ▲0.0142.83 ▼5.28
Add New Post /wp-admin/post-new.php5.89 ▲0.0182.06 ▼8.40
Media Library /wp-admin/upload.php3.24 ▲0.0135.65 ▲0.33

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
compresswp_auto
compresswp_licence
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for CompressWP - optimize and compress JPEG and PNG images
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲1514.26 ▼0.001.77 ▼0.0541.69 ▲2.13
Dashboard /wp-admin2,204 ▲235.55 ▼0.1884.02 ▼26.6138.33 ▼3.28
Posts /wp-admin/edit.php2,109 ▲92.04 ▲0.0135.46 ▼4.6633.08 ▼4.79
Add New Post /wp-admin/post-new.php1,538 ▲1023.35 ▲0.04668.08 ▲17.8749.90 ▼4.05
Media Library /wp-admin/upload.php1,409 ▲64.20 ▼0.04100.61 ▼0.8744.40 ▼1.19

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 detected upon uninstall: 8 options
    • widget_recent-comments
    • db_upgraded
    • compresswp_auto
    • can_compress_scripts
    • compresswp_licence
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/compresswp-optimize-and-compress-jpeg-and-png-images/views/modal.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/compresswp-optimize-and-compress-jpeg-and-png-images/views/bulk-compress.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function menu_page_url() in wp-content/plugins/compresswp-optimize-and-compress-jpeg-and-png-images/views/main.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: page speed, image size, optimize images, compress images, performance...

compresswp-optimize-and-compress-jpeg-and-png-images/compress.php 92% from 13 tests

The main file in "CompressWP - optimize and compress JPEG and PNG images" v. 1.0.3 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:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("compresswp-optimize-and-compress-jpeg-and-png-images.php" instead of "compress.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
Success! There were no dangerous files found in this plugin605 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP614065454
JavaScript3322077
CSS216673
Markdown1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/fi.png0.47KB0.54KB0.00%
assets/img/nl.png0.43KB0.43KB0.23%