84% multiple-cropped-images

Code Review | Multiple Cropped Images

WordPress plugin Multiple Cropped Images scored84%from 54 tests.

About plugin

  • Plugin page: multiple-cropped-...
  • Plugin version: 1.1.7
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Oct 27, 2017
  • Latest release: Jun 14, 2018
  • Number of updates: 68
  • Update frequency: every 3.4 days
  • Top authors: webtimal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /906 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼2.25ms] Passed 4 tests

A check of server-side resources used by Multiple Cropped Images
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.72 ▼0.03
Dashboard /wp-admin3.34 ▲0.0448.68 ▼2.67
Posts /wp-admin/edit.php3.40 ▲0.0450.27 ▼3.04
Add New Post /wp-admin/post-new.php5.95 ▲0.0694.70 ▼3.26
Media Library /wp-admin/upload.php3.27 ▲0.0436.02 ▲2.23

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Multiple Cropped Images
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲4814.29 ▼0.071.84 ▲0.1144.01 ▼0.10
Dashboard /wp-admin2,215 ▲385.67 ▼0.0194.17 ▲5.2340.62 ▲0.37
Posts /wp-admin/edit.php2,120 ▲172.02 ▲0.0134.84 ▲0.5631.51 ▼5.81
Add New Post /wp-admin/post-new.php1,543 ▲1522.91 ▼0.18668.05 ▲44.6765.47 ▲10.58
Media Library /wp-admin/upload.php1,420 ▲264.27 ▲0.1196.62 ▼17.0541.59 ▼5.47

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/multiple-cropped-images/dist/templates/mci-size.php:4
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/multiple-cropped-images/dist/templates/mci-meta.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/multiple-cropped-images/dist/templates/mci-meta.php:20
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/multiple-cropped-images/dist/templates/mci-meta.php on line 19
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/multiple-cropped-images/dist/templates/mci-meta.php on line 18
    • > PHP Notice
      Undefined variable: classes in wp-content/plugins/multiple-cropped-images/dist/templates/mci-size.php on line 1
    • > PHP Notice
      Undefined variable: icon in wp-content/plugins/multiple-cropped-images/dist/templates/mci-meta.php on line 13
    • > PHP Notice
      Undefined variable: classes in wp-content/plugins/multiple-cropped-images/dist/templates/mci-meta.php on line 1
    • > PHP Notice
      Undefined variable: cropped in wp-content/plugins/multiple-cropped-images/dist/templates/mci-meta.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Contributors: Contributors not specified
The official readme.txt might help

multiple-cropped-images/mci.php 92% from 13 tests

The main PHP script in "Multiple Cropped Images" version 1.1.7 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("multiple-cropped-images.php" instead of "mci.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin1,187 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP1022894793
JavaScript86430257
SVG1024106
JSON10027
CSS41114

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity20.25
▷ Minimum class complexity8.00
▷ Maximum class complexity33.00
Average method complexity2.55
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods50
▷ Static methods2958.00%
▷ Public methods4794.00%
▷ Protected methods00.00%
▷ Private methods36.00%
Functions10
▷ Named functions330.00%
▷ Anonymous functions770.00%
Constants16
▷ Global constants16100.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 images were found in this plugin