83% fields-framework

Code Review | Fields Framework

WordPress plugin Fields Framework scored 83% from 54 tests.

About plugin

  • Plugin page: fields-framework
  • Plugin version: 2.2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.5.3
  • WordPress version: 5.8.1
  • First release: Jul 24, 2013
  • Latest release: Dec 7, 2020
  • Number of updates: 119
  • Update frequency: every 22.6 days
  • Top authors: naifamoodi (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

100+ active / 6,913 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.31MB] [CPU: ▼136.47ms] Passed 4 tests

Server-side resources used by Fields Framework
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.16 ▲0.4437.10 ▲15.59
Dashboard /wp-admin3.38 ▲0.3344.81 ▲1.20
Posts /wp-admin/edit.php3.43 ▲0.3345.84 ▲2.21
Add New Post /wp-admin/post-new.php5.68 ▲0.2596.89 ▼550.09
Media Library /wp-admin/upload.php3.33 ▲0.3333.87 ▲0.79

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 76 new files
Database: no new tables, 1 new option
New WordPress options
widget_ff_wp_widget

Browser metrics Passed 4 tests

Checking browser requirements for Fields Framework
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,718 ▲12216.04 ▲0.0911.04 ▲1.6548.75 ▲0.15
Dashboard /wp-admin2,982 ▲515.86 ▼0.06134.68 ▼10.51115.72 ▼4.79
Posts /wp-admin/edit.php2,760 ▲242.75 ▲0.0471.92 ▲8.0896.25 ▲10.48
Add New Post /wp-admin/post-new.php1,681 ▲919.15 ▲0.37364.53 ▼1.50109.50 ▲2.08
Media Library /wp-admin/upload.php1,822 ▲155.06 ▲0.02128.08 ▼18.32114.71 ▼8.77

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_ff_wp_widget

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)
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fields-framework/index.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ff_create_section() in wp-content/plugins/fields-framework/php/field-testing.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ff_create_section() in wp-content/plugins/fields-framework/php/demo-fields.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fields-framework/php/admin-menu.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/fields-framework/php/classes.php:475

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (An Administration Menu), #2 (An Administration Sub Menu), #3 (Repeatable Field Groups and Nested Field Groups), #4 (A section assigned to a page with a page template named 'Showcase Page'), #5 (A Repeatable Field Group with two fields), #6 (A dump of values from a particular section), #7 (A custom post type named 'Slide' with a section associated to it), #8 (A custom post type named 'Service' with a section associated to it), #9 (A custom post type named 'Member' with a section associated to it), #10 (A custom post type named 'Testimonial' with a section associated to it), #11 (An Administration Sub Menu with a bunch of fields), #12 (A section assigned to posts using the audio post format), #13 (A section assigned to posts using the video post format), #14 (A section assigned to posts using the gallery post format), #15 (A section assigned to posts using the image post format), #16 (A section assigned to a page with a page template named 'About Page'), #17 (Two individual fields), #18 (A section assigned to a page with a page template named 'Contact Page'), #19 (DateTime field), #20 (ColorPicker field), #21 (A demo of all fields), #22 (An example of a Fields Widget with a Section selection drop down), #23 (A fields widget rendering fields of section associated to it.), #24 (Front end dump of a widget section), #25 (Builder - Sections), #26 (Builder - Fields), #27 (Builder - Fields By Sections)
  • Tags: There are too many tags (36 tag instead of maximum 10)
You can take inspiration from this readme.txt

fields-framework/index.php 92% from 13 tests

This is the main PHP file of "Fields Framework" version 2.2.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("fields-framework.php" instead of "index.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
There were no executable files found in this plugin8,915 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript88529875,763
PHP65381031,509
CSS596571,480
PO File17474163

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity8.56
▷ Minimum class complexity1.00
▷ Maximum class complexity70.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes26
▷ Abstract classes415.38%
▷ Concrete classes2284.62%
▷ Final classes00.00%
Methods69
▷ Static methods11.45%
▷ Public methods69100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
53 PNG files occupy 1.70MB with 0.79MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/jquery-ui/ui-bg_highlight-soft_75_ffe45c_1x100.png0.32KB0.18KB▼ 42.38%
images/jquery-ui/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
images/jquery-ui/ui-bg_flat_10_000000_40x100.png0.20KB0.08KB▼ 57.56%
screenshot-19.png14.40KB6.82KB▼ 52.59%
screenshot-17.png5.34KB3.16KB▼ 40.84%