93% jpeg-png-compressor

Code Review | JPEG PNG Compressor

WordPress plugin JPEG PNG Compressor scored 93% from 54 tests.

About plugin

  • Plugin page: jpeg-png-compressor
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.1-5.4
  • WordPress version: 5.8.1
  • First release: Jan 28, 2019
  • Latest release: Apr 20, 2020
  • Number of updates: 13
  • Update frequency: every 34.8 days
  • Top authors: premiumthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,312 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.31MB] [CPU: ▼161.37ms] Passed 4 tests

An overview of server-side resources used by JPEG PNG Compressor
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.14 ▲0.3141.45 ▼2.39
Dashboard /wp-admin3.37 ▲0.3156.92 ▼20.05
Posts /wp-admin/edit.php3.48 ▲0.3768.59 ▼36.46
Add New Post /wp-admin/post-new.php5.73 ▲0.29124.78 ▼573.83
Media Library /wp-admin/upload.php3.31 ▲0.3138.83 ▼15.15
PNG Compressor /wp-admin/options-general.php?page=png-compressor3.2939.81
Bulk Optimization /wp-admin/upload.php?page=pjci-bulk-optimization3.3053.58

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by JPEG PNG Compressor
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,721 ▲14915.96 ▲0.4412.89 ▼2.6968.70 ▲16.34
Dashboard /wp-admin2,986 ▲576.25 ▲0.29195.92 ▼8.71150.75 ▲8.67
Posts /wp-admin/edit.php2,757 ▲182.73 ▲0.0192.94 ▼65.76128.54 ▼33.59
Add New Post /wp-admin/post-new.php1,616 ▲3518.87 ▲1.45398.94 ▼154.52114.64 ▼22.73
Media Library /wp-admin/upload.php1,849 ▲305.12 ▲0.11154.17 ▼34.15120.91 ▼10.54
PNG Compressor /wp-admin/options-general.php?page=png-compressor1,6862.1474.85107.09
Bulk Optimization /wp-admin/upload.php?page=pjci-bulk-optimization1,3172.52159.26125.38

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

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 no errors were found, this is by no means an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/jpeg-png-compressor/admin/pjci_admin_page.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/jpeg-png-compressor/admin/pjci_admin_media.php:12

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 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 32 tag instead of maximum 10
  • Screenshots: Add descriptions for screenshots #0, #0, #0, #0 in jpeg-png-compressor/assets to your readme.txt
You can look at the official readme.txt

jpeg-png-compressor/png-compressor.php 85% from 13 tests

"JPEG PNG Compressor" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 164 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("jpeg-png-compressor.php" instead of "png-compressor.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin5,912 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
SVG2002,672
PHP550422,139
CSS424651
JavaScript24831450

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
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%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/image/api-bg.png10.51KB6.26KB▼ 40.46%