94% acf-image-crop-add-on

Code Review | Advanced Custom Fields: Image Crop Add-on

WordPress plugin Advanced Custom Fields: Image Crop Add-on scored 94% from 54 tests.

About plugin

  • Plugin page: acf-image-crop-ad...
  • Plugin version: 1.4.12
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.6
  • WordPress version: 5.8.1
  • First release: Feb 1, 2014
  • Latest release: Jul 28, 2017
  • Number of updates: 110
  • Update frequency: every 11.6 days
  • Top authors: andersthorborg (100%)

Code review

54 tests

User reviews

33 reviews

Install metrics

20,000+ active / 130,912 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼147.18ms] Passed 4 tests

An overview of server-side resources used by Advanced Custom Fields: Image Crop Add-on
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.0125.59 ▼1.17
Dashboard /wp-admin3.07 ▲0.0036.97 ▼3.71
Posts /wp-admin/edit.php3.12 ▲0.0133.47 ▼6.67
Add New Post /wp-admin/post-new.php5.43 ▼0.0172.30 ▼577.17
Media Library /wp-admin/upload.php3.01 ▲0.0125.09 ▲0.02

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Custom Fields: Image Crop Add-on
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,666 ▲6515.97 ▲0.338.95 ▲3.7371.75 ▼16.58
Dashboard /wp-admin2,930 ▲346.10 ▼0.05113.66 ▼19.35162.26 ▼8.33
Posts /wp-admin/edit.php2,743 ▲33.23 ▲0.0164.37 ▲0.94134.84 ▲4.75
Add New Post /wp-admin/post-new.php3,815 ▼119.68 ▲0.78446.80 ▲29.72163.67 ▼3.06
Media Library /wp-admin/upload.php1,749 ▼65.50 ▼0.03153.06 ▲13.27188.28 ▲4.36

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not 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
The following issues need your attention
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field_image' not found in wp-content/plugins/acf-image-crop-add-on/acf-image-crop-v4.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_Field' not found in wp-content/plugins/acf-image-crop-add-on/image_crop-v3.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/acf-image-crop-add-on/acf-image-crop.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field_image' not found in wp-content/plugins/acf-image-crop-add-on/acf-image-crop-v5.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% 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
5 plugin tags: crop, afc, advanced custom fields, image, image crop

acf-image-crop-add-on/acf-image-crop.php 92% from 13 tests

The primary PHP file in "Advanced Custom Fields: Image Crop Add-on" version 1.4.12 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("acf-image-crop-add-on.php" instead of "acf-image-crop.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin2,571 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP44818441,297
JavaScript53962831,049
PO File162163143
CSS251479
Markdown1203

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity33.33
▷ Minimum class complexity3.00
▷ Maximum class complexity51.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods56
▷ Static methods00.00%
▷ Public methods56100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.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
PNG images were not found in this plugin