84% imsanity

Code Review | Imsanity

WordPress plugin Imsanity scored84%from 54 tests.

About plugin

  • Plugin page: imsanity
  • Plugin version: 2.8.3
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.3
  • WordPress version: 6.3.1
  • First release: Jul 22, 2011
  • Latest release: Sep 20, 2023
  • Number of updates: 95
  • Update frequency: every 46.8 days
  • Top authors: verysimple (64.21%)nosilver4u (36.84%)

Code review

54 tests

User reviews

273 reviews

Install metrics

300,000+ active /3,518,308 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼0.09MB] [CPU: ▼15.89ms] Passed 4 tests

An overview of server-side resources used by Imsanity
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▼0.0144.30 ▼14.98
Dashboard /wp-admin3.35 ▲0.0461.17 ▲1.88
Posts /wp-admin/edit.php3.40 ▼0.4551.02 ▼14.27
Add New Post /wp-admin/post-new.php5.93 ▲0.04102.40 ▼27.24
Media Library /wp-admin/upload.php3.27 ▲0.0441.59 ▼7.07
Imsanity /wp-admin/options-general.php?page=imsanity/imsanity.php3.2738.03

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: 18 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
imsanity_version
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Imsanity
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.33 ▲0.152.53 ▲0.5446.05 ▼6.40
Dashboard /wp-admin2,202 ▲285.69 ▲0.0093.93 ▼2.1343.28 ▼3.34
Posts /wp-admin/edit.php2,107 ▲42.01 ▼0.0143.57 ▼2.2740.35 ▼1.91
Add New Post /wp-admin/post-new.php1,529 ▼15021.58 ▼0.24686.05 ▼70.7951.81 ▼19.95
Media Library /wp-admin/upload.php1,415 ▲154.23 ▲0.09108.88 ▼16.5949.92 ▼9.68
Imsanity /wp-admin/options-general.php?page=imsanity/imsanity.php1,0722.2033.8341.99

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • imsanity_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
  • 2× 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/imsanity/ajax.php:8
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_blog_prefix() on null in wp-content/plugins/imsanity/settings.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: scale, upload, space saver, quality, image...

imsanity/imsanity.php Passed 13 tests

The main PHP script in "Imsanity" version 2.8.3 is automatically included on every request by WordPress
42 characters long description:
Imsanity stops insanely huge image uploads

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 plugin1,945 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP61984311,501
PO File28894266
JavaScript11220133
XML15023
YAML18022

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity13.00
▷ Minimum method complexity13.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods1
▷ Static methods00.00%
▷ Public methods1100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions45
▷ Named functions45100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin