84% jpeg-quality

Code Review | JPEG Quality Settings

WordPress plugin JPEG Quality Settings scored84%from 54 tests.

About plugin

  • Plugin page: jpeg-quality
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Sep 28, 2019
  • Latest release: Sep 28, 2019
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: invisibledragonltd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /568 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.70ms] Passed 4 tests

Analyzing server-side resources used by JPEG Quality Settings
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.73 ▼0.72
Dashboard /wp-admin3.32 ▲0.0247.86 ▲3.17
Posts /wp-admin/edit.php3.38 ▲0.0243.27 ▼2.68
Add New Post /wp-admin/post-new.php5.91 ▲0.0389.35 ▼9.27
Media Library /wp-admin/upload.php3.25 ▲0.0232.99 ▲1.87
JPEG Quality Settings /wp-admin/options-general.php?page=jpeg-quality3.2131.42

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for JPEG Quality Settings
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.67 ▼0.711.73 ▼0.1343.83 ▲1.50
Dashboard /wp-admin2,213 ▲255.85 ▲0.96101.56 ▼1.5536.27 ▼3.97
Posts /wp-admin/edit.php2,093 ▲42.05 ▲0.0136.15 ▼3.3735.22 ▼0.78
Add New Post /wp-admin/post-new.php1,517 ▼1617.73 ▼5.78631.97 ▲50.0151.53 ▼2.40
Media Library /wp-admin/upload.php1,395 ▲74.20 ▼0.0696.34 ▼4.2641.56 ▼1.35
JPEG Quality Settings /wp-admin/options-general.php?page=jpeg-quality8872.0224.2328.73

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

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
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/jpeg-quality/jpeg-quality.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Image_Editor_GD' not found in wp-content/plugins/jpeg-quality/classes.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Requires at least: Version not formatted correctly
The official readme.txt is a good inspiration

jpeg-quality/jpeg-quality.php Passed 13 tests

The entry point to "JPEG Quality Settings" version 1.0.0 is a PHP file that has certain tags in its header comment area
44 characters long description:
Ability to control JPEG quality in Wordpress

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 plugin181 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP24716172
SVG1019

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity10.33
▷ Minimum class complexity5.00
▷ Maximum class complexity13.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods12
▷ Static methods18.33%
▷ Public methods1191.67%
▷ Protected methods00.00%
▷ Private methods18.33%
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

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin