84% wp-image-compress

Code Review | WP Image Compress

WordPress plugin WP Image Compress scored84%from 54 tests.

About plugin

  • Plugin page: wp-image-compress
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.8.3
  • WordPress version: 6.3.1
  • First release: Nov 17, 2017
  • Latest release: Nov 17, 2017
  • Number of updates: 18
  • Update frequency: every 0.1 days
  • Top authors: kumbhdesign (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /739 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by WP Image Compress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.66 ▼1.74
Dashboard /wp-admin3.32 ▲0.0144.81 ▼6.67
Posts /wp-admin/edit.php3.37 ▲0.0147.59 ▼0.80
Add New Post /wp-admin/post-new.php5.90 ▲0.0185.47 ▼33.16
Media Library /wp-admin/upload.php3.24 ▲0.0137.71 ▲1.98

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for WP Image Compress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.31 ▼1.321.75 ▼0.6043.85 ▼5.55
Dashboard /wp-admin2,203 ▲125.81 ▼0.0999.16 ▼14.3339.73 ▼2.28
Posts /wp-admin/edit.php2,092 ▲32.06 ▲0.0543.49 ▲6.6035.08 ▲1.62
Add New Post /wp-admin/post-new.php1,536 ▲123.32 ▲0.21653.95 ▼33.9255.57 ▲2.10
Media Library /wp-admin/upload.php1,388 ▲34.26 ▼0.0596.86 ▼7.5642.69 ▼3.80

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-image-compress/wp_image_compress.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Requires php: The plugin version is formatted incorrectly
The official readme.txt is a good inspiration

wp-image-compress/wp_image_compress.php 92% from 13 tests

"WP Image Compress" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-image-compress.php" instead of "wp_image_compress.php")

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 plugin29 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1141429

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin