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 scored90%from 54 tests.

About plugin

  • Plugin page: acf-image-aspect-...
  • Plugin version: 6.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3
  • WordPress version: 6.3.1
  • First release: Jul 12, 2018
  • Latest release: Aug 17, 2023
  • Number of updates: 81
  • Update frequency: every 23.0 days
  • Top authors: joppuyo (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

20,000+ active /198,599 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.62ms] Passed 4 tests

A check of server-side resources used by Advanced Custom Fields: Image Aspect Ratio Crop Field
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0442.88 ▼2.97
Dashboard /wp-admin3.34 ▼0.0048.64 ▼17.11
Posts /wp-admin/edit.php3.39 ▲0.0452.48 ▼3.89
Add New Post /wp-admin/post-new.php5.93 ▲0.05112.73 ▲19.92
Media Library /wp-admin/upload.php3.26 ▲0.0438.96 ▲1.50
ACF Image Aspect Ratio Crop /wp-admin/options-general.php?page=acf-image-aspect-ratio-crop3.2329.49

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 25 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
acf-image-aspect-ratio-crop-version
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Custom Fields: Image Aspect Ratio Crop Field
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.26 ▼1.061.78 ▼0.3240.53 ▼4.34
Dashboard /wp-admin2,210 ▲195.87 ▲0.97100.34 ▼8.8840.60 ▼1.62
Posts /wp-admin/edit.php2,093 ▲42.02 ▲0.0038.47 ▼1.6435.33 ▼1.37
Add New Post /wp-admin/post-new.php1,545 ▲318.37 ▲0.35646.46 ▲26.6655.51 ▲3.00
Media Library /wp-admin/upload.php1,392 ▲44.18 ▲0.0096.54 ▼8.7044.39 ▼2.75
ACF Image Aspect Ratio Crop /wp-admin/options-general.php?page=acf-image-aspect-ratio-crop8262.0423.1729.63

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • acf-image-aspect-ratio-crop-version

Smoke tests Passed 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 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
The SRP test was a success

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: image, acf, crop, field

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

The main PHP script in "Advanced Custom Fields: Image Aspect Ratio Crop Field" version 6.0.3 is automatically included on every request by WordPress
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 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected3,374 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP23555731,590
JavaScript5161207789
Sass2620544
Markdown21020341
JSON20074
SVG40327
XML1007
CSS1291
INI1021

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity74.00
▷ Minimum class complexity40.00
▷ Maximum class complexity108.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 images were found in this plugin