78% manual-image-crop

Code Review | Manual Image Crop

WordPress plugin Manual Image Crop scored78%from 54 tests.

About plugin

  • Plugin page: manual-image-crop
  • Plugin version: 1.12
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.3
  • WordPress version: 6.3.1
  • First release: Oct 2, 2013
  • Latest release: Sep 2, 2015
  • Number of updates: 56
  • Update frequency: every 12.5 days
  • Top authors: tomasz.sita (100%)

Code review

54 tests

User reviews

55 reviews

Install metrics

10,000+ active /176,958 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.10MB] [CPU: ▼2.76ms] Passed 4 tests

Analyzing server-side resources used by Manual Image Crop
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0340.79 ▼3.04
Dashboard /wp-admin3.42 ▲0.1150.17 ▼1.40
Posts /wp-admin/edit.php3.53 ▲0.1752.88 ▲3.49
Add New Post /wp-admin/post-new.php6.02 ▲0.1387.56 ▼10.07
Media Library /wp-admin/upload.php3.34 ▲0.1155.10 ▲17.13
Manual Image Crop /wp-admin/options-general.php?page=Mic-setting-admin3.2958.03

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 30 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
mic_make2x

Browser metrics Passed 4 tests

A check of browser resources used by Manual Image Crop
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲6814.45 ▲0.071.97 ▲0.2844.74 ▲0.29
Dashboard /wp-admin2,210 ▲335.61 ▼0.0984.55 ▼13.8943.80 ▲1.87
Posts /wp-admin/edit.php2,126 ▲262.23 ▲0.2336.12 ▼2.4536.94 ▲1.29
Add New Post /wp-admin/post-new.php1,547 ▲1523.43 ▲0.06706.66 ▲12.4856.83 ▼0.12
Media Library /wp-admin/upload.php1,429 ▲294.34 ▲0.05143.05 ▲35.6371.63 ▲23.29
Manual Image Crop /wp-admin/options-general.php?page=Mic-setting-admin9302.1336.1636.33

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • widget_recent-comments
    • mic_make2x
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=Mic-setting-admin
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=Mic-setting-admin
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=Mic-setting-admin
    • > Notice in wp-content/plugins/manual-image-crop/lib/ManualImageCropSettingsPage.php+183
    Undefined index: thumbnail
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=Mic-setting-admin
    • > Notice in wp-content/plugins/manual-image-crop/lib/ManualImageCropSettingsPage.php+183
    Trying to access array offset on value of type null

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 fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/manual-image-crop/lib/ManualImageCropSettingsPage.php:191
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/manual-image-crop/lib/ManualImageCropSettingsPage.php:191

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: featured image, image, image area, picture, images...

manual-image-crop/manual-image-crop.php 85% from 13 tests

Analyzing the main PHP file in "Manual Image Crop" version 1.12
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 244 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected2,388 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PO File9330450847
PHP4135118694
JavaScript37351628
CSS2461219

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity30.67
▷ Minimum class complexity19.00
▷ Maximum class complexity40.00
Average method complexity5.24
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods21
▷ Static methods314.29%
▷ Public methods1885.71%
▷ Protected methods00.00%
▷ Private methods314.29%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There were not PNG files found in your plugin