94% acf-range-field

Code Review | Advanced Custom Fields: Range Field

WordPress plugin Advanced Custom Fields: Range Field scored 94% from 54 tests.

About plugin

  • Plugin page: acf-range-field
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9.2
  • WordPress version: 5.8.1
  • First release: Dec 23, 2013
  • Latest release: Aug 31, 2014
  • Number of updates: 18
  • Update frequency: every 13.9 days
  • Top authors: viriava (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active / 4,814 total downloads

Benchmarks

Plugin footprint Passed 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.00MB] [CPU: ▼152.27ms] Passed 4 tests

Server-side resources used by Advanced Custom Fields: Range Field
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0133.60 ▲9.48
Dashboard /wp-admin3.07 ▲0.0030.93 ▼9.66
Posts /wp-admin/edit.php3.12 ▲0.0128.91 ▼7.62
Add New Post /wp-admin/post-new.php5.43 ▼0.0170.02 ▼592.62
Media Library /wp-admin/upload.php3.01 ▲0.0123.38 ▲0.83

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 25 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Advanced Custom Fields: Range Field: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,666 ▲5415.98 ▲0.326.69 ▲0.9978.82 ▲3.97
Dashboard /wp-admin2,930 ▲346.15 ▼0.00117.79 ▼24.02169.34 ▼7.48
Posts /wp-admin/edit.php2,740 ▲33.24 ▲0.0163.27 ▼0.45137.48 ▼5.04
Add New Post /wp-admin/post-new.php3,735 ▼018.75 ▲1.69458.54 ▲33.61160.67 ▼6.10
Media Library /wp-admin/upload.php1,752 ▼05.50 ▼0.04148.96 ▲5.46186.57 ▲1.21

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

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

Smoke tests 75% from 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/acf-range-field/acf-range.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-range-field/range-v5.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-range-field/range-v4.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: acf, field, range, jquery

acf-range-field/acf-range.php 92% from 13 tests

This is the main PHP file of "Advanced Custom Fields: Range Field" version 1.1.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("acf-range-field.php" instead of "acf-range.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected1,150 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP3296550547
CSS22331493
JavaScript34044110

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity14.00
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods27
▷ Static methods00.00%
▷ Public methods27100.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

All PNG images should be compressed to minimize bandwidth usage for end users
14 PNG files occupy 0.11MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ui-bg_flat_0_aaaaaa_40x100.png0.21KB0.08KB▼ 58.96%
images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%
images/ui-bg_glass_55_fbf9ee_1x400.png0.33KB0.12KB▼ 62.09%
images/ui-bg_flat_75_ffffff_40x100.png0.20KB0.08KB▼ 58.17%
images/ui-bg_highlight-soft_75_cccccc_1x100.png0.27KB0.18KB▼ 35.00%