78% image-compress

Code Review | PBC Image Compress

WordPress plugin PBC Image Compress scored78%from 54 tests.

About plugin

  • Plugin page: image-compress
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.5.3
  • WordPress version: 6.3.1
  • First release: Oct 5, 2016
  • Latest release: Oct 5, 2016
  • Number of updates: 2
  • Update frequency: every 38.0 days
  • Top authors: stewarty (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,331 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼12.17ms] Passed 4 tests

A check of server-side resources used by PBC Image Compress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0150.72 ▲9.38
Dashboard /wp-admin3.31 ▼0.0351.53 ▼13.32
Posts /wp-admin/edit.php3.37 ▲0.0148.44 ▼2.90
Add New Post /wp-admin/post-new.php5.90 ▲0.0185.56 ▼37.53
Media Library /wp-admin/upload.php3.24 ▲0.0140.39 ▲5.07

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 35 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

PBC Image Compress: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.27 ▼0.292.27 ▲0.6643.33 ▲0.58
Dashboard /wp-admin2,195 ▲185.61 ▼0.1087.49 ▼12.4642.00 ▲1.86
Posts /wp-admin/edit.php2,100 ▲182.00 ▲0.0236.18 ▼4.9535.16 ▼2.34
Add New Post /wp-admin/post-new.php1,526 ▼1122.95 ▲4.66676.14 ▲30.5853.33 ▼15.38
Media Library /wp-admin/upload.php1,400 ▲64.18 ▲0.04109.68 ▲8.3448.78 ▲6.75

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: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/image-compress/public/partials/pbc-image-compress-public-display.php
    • > /wp-content/plugins/image-compress/admin/partials/pbc-image-compress-admin-display.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'PHPImageOptim\\PHPImageOptim' not found in wp-content/plugins/image-compress/includes/class-pbc-phpimageoptim.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Image_Editor_Imagick' not found in wp-content/plugins/image-compress/includes/class-wp-image-editor-imagemagik-compress.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Image_Editor_GD' not found in wp-content/plugins/image-compress/includes/class-wp-image-editor-gd-compress.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === image-compress === )
Please take inspiration from this readme.txt

image-compress/pbc-image-compress.php 85% from 13 tests

The main PHP script in "PBC Image Compress" version 1.0.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("image-compress.php" instead of "pbc-image-compress.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin663 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP20232639562
JSON10095
JavaScript24546
CSS2080

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity6.45
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.13
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods53
▷ Static methods35.66%
▷ Public methods4686.79%
▷ Protected methods23.77%
▷ Private methods59.43%
Functions3
▷ Named functions3100.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
No PNG files were detected