93% acf-dynamic-year-select-field

Code Review | ACF: Dynamic Year Select Field

WordPress plugin ACF: Dynamic Year Select Field scored 93% from 54 tests.

About plugin

  • Plugin page: acf-dynamic-year-...
  • Plugin version: 0.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.1-5.4
  • WordPress version: 5.9.2
  • First release: Nov 1, 2016
  • Latest release: Apr 7, 2020
  • Number of updates: 9
  • Update frequency: every 139.2 days
  • Top authors: italianst4 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active / 2,227 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by ACF: Dynamic Year Select Field
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0154.76 ▲0.67
Dashboard /wp-admin3.43 ▲0.0234.41 ▲0.51
Posts /wp-admin/edit.php3.65 ▲0.0145.91 ▲8.56
Add New Post /wp-admin/post-new.php6.90 ▼0.0897.91 ▼1,174.39
Media Library /wp-admin/upload.php3.30 ▼0.0023.29 ▼9.14

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for ACF: Dynamic Year Select Field
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲4115.91 ▼0.106.28 ▼0.302.21 ▼0.19
Dashboard /wp-admin2,892 ▲376.11 ▼0.10116.29 ▼16.61155.31 ▼13.33
Posts /wp-admin/edit.php2,691 ▼03.36 ▼0.0164.50 ▲1.86140.65 ▼7.36
Add New Post /wp-admin/post-new.php1,661 ▼716.66 ▼1.42408.13 ▲7.76155.58 ▼1.87
Media Library /wp-admin/upload.php1,698 ▼05.50 ▼0.01139.60 ▲7.65193.21 ▲6.90

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-dynamic-year-select-field/acf-dynamic-year-select-v4.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/acf-dynamic-year-select-field/acf-dynamic_year_select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-dynamic-year-select-field/acf-dynamic-year-select-v5.php:4

User-side errors Passed 1 test

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


Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === acf-dynamic-year-select-field === )
Please take inspiration from this readme.txt

acf-dynamic-year-select-field/acf-dynamic_year_select.php 85% from 13 tests

The main PHP file in "ACF: Dynamic Year Select Field" ver. 0.2.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("acf-dynamic-year-select-field.php" instead of "acf-dynamic_year_select.php")

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
Success! There were no dangerous files found in this plugin618 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity17.00
▷ Minimum class complexity13.00
▷ Maximum class complexity21.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions00.00%
▷ Anonymous functions2100.00%
▷ 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
1 PNG file occupies 0.39MB with 0.26MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png404.32KB136.49KB▼ 66.24%