94% advanced-custom-fields-menu-field-add-on

Code Review | Advanced Custom Fields - Menu Field add-on

WordPress plugin Advanced Custom Fields - Menu Field add-on scored 94% from 54 tests.

About plugin

  • Plugin page: advanced-custom-f...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.4
  • WordPress version: 5.9.2
  • First release: Nov 27, 2012
  • Latest release: Nov 27, 2012
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: chriswessels (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

40+ active / 2,139 total downloads

Benchmarks

Plugin footprint Passed 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: ▼301.43ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Custom Fields - Menu Field add-on
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0153.20 ▲1.60
Dashboard /wp-admin3.41 ▲0.0132.20 ▼0.55
Posts /wp-admin/edit.php3.64 ▲0.0136.43 ▼1.48
Add New Post /wp-admin/post-new.php6.88 ▼0.09107.67 ▼1,205.29
Media Library /wp-admin/upload.php3.30 ▲0.0030.93 ▲4.04

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Custom Fields - Menu Field add-on
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,785 ▲3116.18 ▲0.177.12 ▲1.022.09 ▼0.48
Dashboard /wp-admin2,895 ▲376.11 ▼0.11115.84 ▼16.58156.76 ▼4.59
Posts /wp-admin/edit.php2,694 ▲33.24 ▲0.0179.31 ▲14.83143.15 ▼4.18
Add New Post /wp-admin/post-new.php1,661 ▼9716.77 ▼4.61412.44 ▼22.83159.79 ▲2.29
Media Library /wp-admin/upload.php1,695 ▼65.53 ▲0.02149.01 ▲3.92193.67 ▲6.97

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 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)
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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-custom-fields-menu-field-add-on/menu_field.php:190

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Donate link: Invalid URI ("")
You can look at the official readme.txt

advanced-custom-fields-menu-field-add-on/menu_field.php 92% from 13 tests

The main file in "Advanced Custom Fields - Menu Field add-on" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("advanced-custom-fields-menu-field-add-on.php" instead of "menu_field.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin159 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11625159

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity7.00
▷ Minimum class complexity3.00
▷ Maximum class complexity11.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods17.14%
▷ Public methods1285.71%
▷ Protected methods00.00%
▷ Private methods214.29%
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
There are no PNG files in this plugin