84% limit-image-size

Code Review | Limit Image Size

WordPress plugin Limit Image Size scored84%from 54 tests.

About plugin

  • Plugin page: limit-image-size
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7.0-3.4
  • WordPress version: 6.3.1
  • First release: Jun 18, 2012
  • Latest release: Aug 21, 2012
  • Number of updates: 4
  • Update frequency: every 16.0 days
  • Top authors: cantuaria (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /4,085 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 gracefully, with no errors

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

An overview of server-side resources used by Limit Image Size
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.97 ▲1.39
Dashboard /wp-admin3.32 ▲0.0247.27 ▼2.14
Posts /wp-admin/edit.php3.37 ▲0.0149.28 ▼4.29
Add New Post /wp-admin/post-new.php5.90 ▲0.0185.18 ▼18.01
Media Library /wp-admin/upload.php3.24 ▲0.0139.83 ▲3.87

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Limit Image Size
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▲0.011.70 ▲0.0344.93 ▲4.08
Dashboard /wp-admin2,195 ▲185.53 ▼0.0587.08 ▼4.7638.49 ▼1.68
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0239.06 ▲1.8037.76 ▼5.20
Add New Post /wp-admin/post-new.php1,528 ▲223.37 ▲0.39668.13 ▼11.2850.35 ▲1.22
Media Library /wp-admin/upload.php1,403 ▼04.19 ▲0.0198.16 ▲0.4842.54 ▼2.71

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • 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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/limit-image-size/limit-image-size.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Options page for Limit Image Size), #2 (Limit Image Size in Image description)
The official readme.txt is a good inspiration

limit-image-size/limit-image-size.php Passed 13 tests

The main file in "Limit Image Size" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
110 characters long description:
Limit Image Size will save space in disk and bandwith resizing large images when you upload them to WordPress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin402 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP18411257
PO File25858145

PHP code Passed 2 tests

This is a very shot review of 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.22
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%
Functions8
▷ Named functions8100.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
images/unavailable.png1.34KB1.38KB0.00%
images/available.png1.13KB1.17KB0.00%