88% admin-form-framework

Code Review | Admin Form Framework

WordPress plugin Admin Form Framework scored 88% from 54 tests.

About plugin

  • Plugin page: admin-form-framework
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.3.1
  • WordPress version: 5.9.2
  • First release: Jan 7, 2014
  • Latest release: Sep 29, 2015
  • Number of updates: 6
  • Update frequency: every 110.3 days
  • Top authors: de-ce (83.33%)Dream Production (33.33%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,060 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.01MB] [CPU: ▼315.57ms] Passed 4 tests

An overview of server-side resources used by Admin Form Framework
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1153.30 ▲3.14
Dashboard /wp-admin3.44 ▲0.0438.04 ▲3.68
Posts /wp-admin/edit.php3.68 ▲0.0442.12 ▲2.08
Add New Post /wp-admin/post-new.php6.91 ▼0.0593.91 ▼1,265.74
Media Library /wp-admin/upload.php3.33 ▲0.0424.26 ▼1.75

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Admin Form Framework
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,749 ▼515.24 ▼0.346.16 ▼0.842.28 ▼1.02
Dashboard /wp-admin2,871 ▲106.11 ▼0.08122.07 ▼15.79154.06 ▼11.28
Posts /wp-admin/edit.php2,685 ▼63.23 ▼0.0164.30 ▼1.02146.38 ▼0.77
Add New Post /wp-admin/post-new.php1,661 ▼016.43 ▲0.02445.64 ▲5.11165.03 ▲4.15
Media Library /wp-admin/upload.php1,698 ▼35.54 ▲0.08149.46 ▲2.10192.62 ▲6.11

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
This plugin's uninstaller ran successfully

Smoke tests 50% 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 0% 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 take a closer look at the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/admin-form-framework/views/select.php
    • > /wp-content/plugins/admin-form-framework/views/description.php
  • 21× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/admin-form-framework/examples/my_options.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/admin-form-framework/views/options-page.php:11
    • > PHP Notice
      Undefined variable: field_name in wp-content/plugins/admin-form-framework/views/select.php on line 10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/admin-form-framework/views/select.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/admin-form-framework/views/text.php:10
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/admin-form-framework/views/radio.php on line 10
    • > PHP Notice
      Undefined variable: field_name in wp-content/plugins/admin-form-framework/views/textarea.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_textarea() in wp-content/plugins/admin-form-framework/views/textarea.php:10
    • > PHP Notice
      Undefined variable: extra in wp-content/plugins/admin-form-framework/views/radio.php on line 10
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/admin-form-framework/views/select.php on line 11

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: options, settings, custom, development, admin

admin-form-framework/class-aff.php 85% from 13 tests

The principal PHP file in "Admin Form Framework" v. 1.2.3 is loaded by WordPress automatically on each request
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 ("admin-form-framework.php" instead of "class-aff.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 196 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected595 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP1198261423
JavaScript1413172

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity38.00
▷ Minimum class complexity38.00
▷ Maximum class complexity38.00
Average method complexity2.48
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin