93% imagecare

Code Review | ImageCare

WordPress plugin ImageCare scored 93% from 54 tests.

About plugin

  • Plugin page: imagecare
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.5.3
  • WordPress version: 5.8.1
  • First release: Jul 4, 2016
  • Latest release: Aug 23, 2016
  • Number of updates: 7
  • Update frequency: every 97.0 days
  • Top authors: albinvlc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 591 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼139.46ms] Passed 4 tests

Analyzing server-side resources used by ImageCare
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.1628.75 ▲5.92
Dashboard /wp-admin3.11 ▲0.0545.35 ▲2.14
Posts /wp-admin/edit.php3.16 ▲0.0542.27 ▼2.64
Add New Post /wp-admin/post-new.php5.47 ▲0.0387.70 ▼560.38
Media Library /wp-admin/upload.php3.05 ▲0.0529.82 ▲3.03
ImageCare /wp-admin/tools.php?page=imagecare3.0328.46

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for ImageCare
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11215.96 ▲0.388.99 ▲0.3449.06 ▲6.81
Dashboard /wp-admin2,978 ▲445.89 ▼0.23137.22 ▼9.07113.91 ▼4.88
Posts /wp-admin/edit.php2,744 ▲52.70 ▼0.0164.68 ▼3.3885.63 ▼8.01
Add New Post /wp-admin/post-new.php1,675 ▼118.84 ▼0.00377.79 ▼13.54105.95 ▼3.07
Media Library /wp-admin/upload.php1,812 ▼15.04 ▲0.01143.10 ▲0.58112.49 ▼10.37
ImageCare /wp-admin/tools.php?page=imagecare1,1372.1058.7375.43

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/imagecare/imagecare.php:242
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/imagecare/inc-iface-maxres.php:10
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/imagecare/inc-func-backup.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/imagecare/inc-iface-cleanregen.php:11
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/imagecare/inc-iface-bup.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/imagecare/inc-iface-ini.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/imagecare/inc-iface-regensizes.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/imagecare/inc-iface-common.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/imagecare/inc-func-regensizes.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/imagecare/inc-func-cleanregen.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Invalid URI found ("")
  • Screenshots: Screenshot #1 (Welcome section with large explanations about what to do and why to do it) image required
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === imagecare === )
Please take inspiration from this readme.txt

imagecare/imagecare.php Passed 13 tests

The entry point to "ImageCare" version 1.0 is a PHP file that has certain tags in its header comment area
50 characters long description:
It takes care about the space taken by the images.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected927 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP1111044913
SVG10014

PHP code Passed 2 tests

This is a short overview 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.36
Average class complexity37.00
▷ Minimum class complexity37.00
▷ Maximum class complexity37.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods947.37%
▷ Protected methods00.00%
▷ Private methods1052.63%
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

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png71.69KB32.34KB▼ 54.89%