90% acf-image-size-select

Code Review | Advanced Custom Fields: Image Size Select Field

WordPress plugin Advanced Custom Fields: Image Size Select Field scored90%from 54 tests.

About plugin

  • Plugin page: acf-image-size-se...
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 30, 2018
  • Latest release: Aug 20, 2023
  • Number of updates: 26
  • Update frequency: every 66.3 days
  • Top authors: jeremyrwross (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /3,012 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.10ms] Passed 4 tests

An overview of server-side resources used by Advanced Custom Fields: Image Size Select Field
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0138.64 ▼5.99
Dashboard /wp-admin3.36 ▲0.0142.54 ▼5.74
Posts /wp-admin/edit.php3.41 ▲0.0148.07 ▲0.66
Add New Post /wp-admin/post-new.php5.94 ▲0.0185.79 ▼9.34
Media Library /wp-admin/upload.php3.28 ▲0.0135.61 ▲1.13

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

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

Browser metrics Passed 4 tests

Advanced Custom Fields: Image Size Select Field: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.17 ▼1.261.70 ▼0.1544.17 ▼6.71
Dashboard /wp-admin2,206 ▲155.91 ▲0.01104.07 ▼9.3240.66 ▼15.66
Posts /wp-admin/edit.php2,092 ▲31.99 ▼0.0540.36 ▲2.0935.79 ▲3.14
Add New Post /wp-admin/post-new.php1,533 ▼223.12 ▲0.02618.98 ▼104.0154.43 ▼1.12
Media Library /wp-admin/upload.php1,388 ▲34.22 ▲0.00100.88 ▼13.4842.88 ▼7.59

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
No output text or server-side errors detected on direct access of PHP files

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed: You can take inspiration from this readme.txt

acf-image-size-select/acf-image-size-select.php Passed 13 tests

This is the main PHP file of "Advanced Custom Fields: Image Size Select Field" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
70 characters long description:
Field to select registered image sizes within the WordPress dashboard.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected161 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP36865161

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity10.50
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png9.13KB6.15KB▼ 32.70%