84% advanced-custom-fields-menu-field

Code Review | Advanced Custom Fields: Menu Field

WordPress plugin Advanced Custom Fields: Menu Field scored84%from 54 tests.

About plugin

  • Plugin page: advanced-custom-f...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.4
  • WordPress version: 6.3.1
  • First release: Nov 5, 2013
  • Latest release: Nov 6, 2013
  • Number of updates: 3
  • Update frequency: every 1.0 days
  • Top authors: danieledenobili (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,135 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

An overview of server-side resources used by Advanced Custom Fields: Menu Field
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.31 ▼2.16
Dashboard /wp-admin3.32 ▲0.0146.02 ▼4.19
Posts /wp-admin/edit.php3.37 ▲0.0147.68 ▲1.71
Add New Post /wp-admin/post-new.php5.90 ▲0.0199.08 ▼0.46
Media Library /wp-admin/upload.php3.24 ▲0.0133.25 ▲0.50

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Custom Fields: Menu Field
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.21 ▼1.091.84 ▼0.1941.75 ▼6.04
Dashboard /wp-admin2,203 ▲155.85 ▲0.9997.54 ▼20.1241.17 ▼2.82
Posts /wp-admin/edit.php2,092 ▲31.99 ▼0.0339.15 ▲1.2135.59 ▲3.23
Add New Post /wp-admin/post-new.php1,533 ▲1323.44 ▲0.34585.85 ▼65.5553.33 ▲1.05
Media Library /wp-admin/upload.php1,382 ▼64.20 ▲0.0197.75 ▼6.5141.84 ▼5.66

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-custom-fields-menu-field/acf-menu.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-custom-fields-menu-field/menu-v4.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_Field' not found in wp-content/plugins/advanced-custom-fields-menu-field/menu-v3.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: menu, advanced custom fields, acf

advanced-custom-fields-menu-field/acf-menu.php 92% from 13 tests

"Advanced Custom Fields: Menu Field" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("advanced-custom-fields-menu-field.php" instead of "acf-menu.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
Success! There were no dangerous files found in this plugin88 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP3166164
Markdown118024

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity2.67
▷ Minimum class complexity2.00
▷ Maximum class complexity3.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.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
PNG images were not found in this plugin