77% admin-form

Code Review | ADFO – Custom data in admin dashboard

WordPress plugin ADFO – Custom data in admin dashboard scored77%from 54 tests.

About plugin

  • Plugin page: admin-form
  • Plugin version: 1.8.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.2
  • WordPress version: 6.3.1
  • First release: Nov 11, 2022
  • Latest release: Apr 15, 2023
  • Number of updates: 28
  • Update frequency: every 5.5 days
  • Top authors: giuliopanda (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /1,289 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲2.50MB] [CPU: ▲16.90ms] Passed 4 tests

A check of server-side resources used by ADFO – Custom data in admin dashboard
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.59 ▲2.1363.69 ▲24.05
Dashboard /wp-admin6.01 ▲2.7063.73 ▲14.38
Posts /wp-admin/edit.php6.01 ▲2.6569.03 ▲17.82
Add New Post /wp-admin/post-new.php8.42 ▲2.54111.40 ▲11.33
Media Library /wp-admin/upload.php6.01 ▲2.7864.67 ▲27.52
Database /wp-admin/admin.php?page=database_presentation6.0152.50
Documentation /wp-admin/admin.php?page=admin_form_docs6.9267.02
Admin Form /wp-admin/admin.php?page=admin_form6.9356.04

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for ADFO – Custom data in admin dashboard
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,852 ▲9114.76 ▲0.412.14 ▲0.3036.44 ▼8.52
Dashboard /wp-admin2,226 ▲465.62 ▼0.0688.32 ▲0.5639.29 ▼2.00
Posts /wp-admin/edit.php2,131 ▲311.95 ▼0.0839.24 ▲3.5136.74 ▼2.92
Add New Post /wp-admin/post-new.php1,551 ▲2521.05 ▼1.84663.75 ▲15.4461.49 ▲11.42
Media Library /wp-admin/upload.php1,434 ▲314.18 ▼0.0897.55 ▼4.0949.41 ▲4.15
Database /wp-admin/admin.php?page=database_presentation8981.9822.8330.06
Documentation /wp-admin/admin.php?page=admin_form_docs1,2232.2833.6333.19
Admin Form /wp-admin/admin.php?page=admin_form1,2695.8098.1530.64

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=admin_form_docs
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 19× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: key in wp-content/plugins/admin-form/admin/partials/af-content-list-form-classic-container.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/admin-form/includes/documentation/pages_it_IT/pinacode.php:2
    • > PHP Notice
      Undefined variable: key in wp-content/plugins/admin-form/admin/partials/af-content-list-form-post-container.php on line 16
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/admin-form/admin/partials/af-content-list-form-metadata-container.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_form\\add_action() in wp-content/plugins/admin-form/includes/af-loader.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_form\\add_action() in wp-content/plugins/admin-form/includes/af-list-loader.php:11
    • > PHP Notice
      Undefined variable: table in wp-content/plugins/admin-form/admin/partials/af-content-list-form-metadata-container.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_form\\add_shortcode() in wp-content/plugins/admin-form/includes/af-shortcode.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_form\\_e() in wp-content/plugins/admin-form/admin/partials/af-content-list-form-post-container.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'admin_form\\ADFO_data_structures' not found in wp-content/plugins/admin-form/data-structures/af-form-setting.php:13

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 86% 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
Please fix the following attributes:
  • Screenshots: These screenshots need descriptions #1, #2, #3, #4, #5, #6, #7 in admin-form/assets to your readme.txt
You can look at the official readme.txt

admin-form/admin-form.php 77% from 13 tests

The principal PHP file in "ADFO – Custom data in admin dashboard" v. 1.8.3 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Requires PHP: Required version does not match the one declared in readme.txt ("7.3" instead of "7.2")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected29,309 lines of code in 121 files:
LanguageFilesBlank linesComment linesLines of code
PHP1092,3774,35721,830
JavaScript105876115,121
CSS2413272,358

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 121)
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity95.51
▷ Minimum class complexity1.00
▷ Maximum class complexity451.00
Average method complexity9.01
▷ Minimum method complexity1.00
▷ Maximum method complexity121.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes35
▷ Abstract classes12.86%
▷ Concrete classes3497.14%
▷ Final classes00.00%
Methods404
▷ Static methods17944.31%
▷ Public methods34585.40%
▷ Protected methods00.00%
▷ Private methods5914.60%
Functions142
▷ Named functions12890.14%
▷ Anonymous functions149.86%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
22 PNG files occupy 1.11MB with 0.67MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/documentation/assets/tutorial_02_02.png56.78KB21.66KB▼ 61.85%
includes/documentation/assets/tutorial_02_01.png46.22KB19.36KB▼ 58.12%
includes/documentation/assets/tutorial_03_01_new.png61.08KB23.45KB▼ 61.61%
includes/documentation/assets/tutorial_03_01.png48.61KB18.59KB▼ 61.75%
includes/documentation/assets/tutorial_01_04.png11.94KB4.96KB▼ 58.51%