90% acf-image-aspect-ratio-crop

Code Review | Advanced Custom Fields: Image Aspect Ratio Crop Field

WordPress plugin Advanced Custom Fields: Image Aspect Ratio Crop Field scored 90% from 54 tests.

About plugin

  • Plugin page: acf-image-aspect-...
  • Plugin version: 6.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.9
  • WordPress version: 5.9.2
  • First release: Jul 12, 2018
  • Latest release: Feb 1, 2022
  • Number of updates: 79
  • Update frequency: every 16.5 days
  • Top authors: joppuyo (100%)

Code review

54 tests

User reviews

21 reviews

Install metrics

10,000+ active / 130,483 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼319.49ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Custom Fields: Image Aspect Ratio Crop Field
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0460.61 ▲5.36
Dashboard /wp-admin3.45 ▲0.0537.05 ▲0.40
Posts /wp-admin/edit.php3.68 ▲0.0434.63 ▼0.88
Add New Post /wp-admin/post-new.php6.92 ▼0.0595.96 ▼1,277.98
Media Library /wp-admin/upload.php3.34 ▲0.0425.51 ▲0.51
ACF Image Aspect Ratio Crop /wp-admin/admin.php?page=acf-image-aspect-ratio-crop3.3123.17

Server storage [IO: ▲0.75MB] [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: 25 new files
Database: no new tables, 1 new option
New WordPress options
acf-image-aspect-ratio-crop-version

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Custom Fields: Image Aspect Ratio Crop Field
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,785 ▲6315.98 ▲0.006.83 ▲1.162.29 ▲0.16
Dashboard /wp-admin2,895 ▲376.10 ▼0.03161.99 ▲31.62196.38 ▲27.52
Posts /wp-admin/edit.php2,685 ▲283.24 ▼0.0164.56 ▲2.98210.86 ▲72.25
Add New Post /wp-admin/post-new.php1,717 ▼3521.91 ▲1.08435.51 ▼14.88225.67 ▲31.11
Media Library /wp-admin/upload.php1,698 ▼35.53 ▼0.03146.10 ▲8.50197.89 ▼3.23
ACF Image Aspect Ratio Crop /wp-admin/admin.php?page=acf-image-aspect-ratio-crop1,0302.4257.87177.93

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 1 option in the database
    • acf-image-aspect-ratio-crop-version

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 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
4 plugin tags: crop, acf, field, image

acf-image-aspect-ratio-crop/acf-image-aspect-ratio-crop.php Passed 13 tests

The main PHP file in "Advanced Custom Fields: Image Aspect Ratio Crop Field" ver. 6.0.1 adds more information about the plugin and also serves as the entry point for this plugin
81 characters long description:
ACF field that allows user to crop image to a specific aspect ratio or pixel size

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 plugin3,367 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP23555731,587
JavaScript5161207789
Sass2620544
Markdown21020338
JSON20073
SVG40327
XML1007
CSS1291
INI1021

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity73.00
▷ Minimum class complexity40.00
▷ Maximum class complexity106.00
Average method complexity5.29
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods32
▷ Static methods13.12%
▷ Public methods2990.62%
▷ Protected methods00.00%
▷ Private methods39.38%
Functions17
▷ Named functions00.00%
▷ Anonymous functions17100.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
No PNG files were detected