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 scored 78% from 54 tests.

About plugin

  • Plugin page: compresswp-optimi...
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.7
  • WordPress version: 5.8.1
  • First release: Nov 20, 2020
  • Latest release: Jun 27, 2021
  • Number of updates: 13
  • Update frequency: every 16.9 days
  • Top authors: compresswp (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active / 731 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.04MB] [CPU: ▼141.04ms] 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 /2.87 ▲0.0342.53 ▲7.80
Dashboard /wp-admin3.09 ▲0.0449.55 ▲3.20
Posts /wp-admin/edit.php3.15 ▲0.0442.42 ▼3.00
Add New Post /wp-admin/post-new.php5.46 ▲0.0293.39 ▼563.02
Media Library /wp-admin/upload.php3.04 ▲0.0431.49 ▼1.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, 2 new options
New WordPress options
compresswp_licence
compresswp_auto

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 /3,694 ▲9815.98 ▲0.0611.63 ▲1.8146.24 ▼1.64
Dashboard /wp-admin2,982 ▲485.90 ▼0.07150.92 ▼8.56103.18 ▼1.08
Posts /wp-admin/edit.php2,754 ▲152.72 ▲0.0165.55 ▲2.3988.73 ▼2.59
Add New Post /wp-admin/post-new.php1,882 ▲26719.09 ▼2.34403.74 ▲106.26101.85 ▼6.51
Media Library /wp-admin/upload.php1,825 ▲185.02 ▼0.02146.89 ▼7.20114.18 ▲0.60

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: 2 options
    • compresswp_licence
    • compresswp_auto

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: performance, compression, image size, compress images, page speed...

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.2 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%