68% custom-field-suite

Code Review | Custom Field Suite

WordPress plugin Custom Field Suite scored68%from 54 tests.

About plugin

  • Plugin page: custom-field-suite
  • Plugin version: 2.6.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Oct 1, 2011
  • Latest release: Jun 26, 2023
  • Number of updates: 334
  • Update frequency: every 12.8 days
  • Top authors: logikal16 (67.66%)mgibbs189 (32.63%)

Code review

54 tests

User reviews

140 reviews

Install metrics

50,000+ active /569,450 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.58MB] [CPU: ▲2.71ms] Passed 4 tests

An overview of server-side resources used by Custom Field Suite
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.05 ▲0.5945.98 ▲6.29
Dashboard /wp-admin3.89 ▲0.5846.50 ▼0.71
Posts /wp-admin/edit.php3.94 ▲0.5848.94 ▲2.52
Add New Post /wp-admin/post-new.php6.47 ▲0.5994.44 ▲13.42
Media Library /wp-admin/upload.php3.81 ▲0.5837.74 ▲2.75
Custom Field Suite /wp-admin/edit.php?post_type=cfs3.8536.91
CFS Tools /wp-admin/tools.php?page=cfs-tools3.7232.85

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 83 new files
Database: 2 new tables, 8 new options
New tables
wp_cfs_values
wp_cfs_sessions
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
cfs_version
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
cfs_next_field_id

Browser metrics Passed 4 tests

Custom Field Suite: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲7113.31 ▼0.984.72 ▲2.5742.32 ▼3.95
Dashboard /wp-admin2,220 ▲354.84 ▼0.0098.58 ▼8.4439.13 ▼5.52
Posts /wp-admin/edit.php2,106 ▲172.04 ▼0.0140.38 ▼0.7235.12 ▼1.17
Add New Post /wp-admin/post-new.php1,544 ▲1123.21 ▼0.04663.05 ▼16.2158.97 ▼9.47
Media Library /wp-admin/upload.php1,399 ▲174.18 ▼0.0595.88 ▼5.4039.35 ▼7.43
Custom Field Suite /wp-admin/edit.php?post_type=cfs1,0751.9733.0526.82
CFS Tools /wp-admin/tools.php?page=cfs-tools8621.7625.7037.87

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_cfs_sessions
    • wp_cfs_values
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_theysaidso_widget
    • cfs_next_field_id
    • db_upgraded
    • widget_recent-comments
    • cfs_version
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/custom-field-suite/templates/credits.php
  • 32× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'cfs_field' not found in wp-content/plugins/custom-field-suite/includes/fields/term.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'cfs_field' not found in wp-content/plugins/custom-field-suite/includes/fields/color/color.php:3
    • > PHP Notice
      Trying to get property 'post_type' of non-object in wp-content/plugins/custom-field-suite/templates/admin_head.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'cfs_field' not found in wp-content/plugins/custom-field-suite/includes/fields/true_false.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'cfs_field' not found in wp-content/plugins/custom-field-suite/includes/fields/wysiwyg.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'cfs_field' not found in wp-content/plugins/custom-field-suite/includes/fields/text.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'cfs_field' not found in wp-content/plugins/custom-field-suite/includes/fields/loop.php:3
    • > PHP Notice
      Undefined variable: screen in wp-content/plugins/custom-field-suite/templates/admin_head.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-field-suite/includes/init.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'cfs_field' not found in wp-content/plugins/custom-field-suite/includes/fields/relationship.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed: The official readme.txt might help

custom-field-suite/cfs.php 85% from 13 tests

The main PHP file in "Custom Field Suite" ver. 2.6.4 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("custom-field-suite.php" instead of "cfs.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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 plugin11,088 lines of code in 63 files:
LanguageFilesBlank linesComment linesLines of code
PHP339015494,004
PO File151,7692,6013,457
CSS63001001,888
JavaScript71481391,713
JSON10021
Markdown1205

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity15.68
▷ Minimum class complexity1.00
▷ Maximum class complexity121.00
Average method complexity3.32
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes25
▷ Abstract classes00.00%
▷ Concrete classes25100.00%
▷ Final classes00.00%
Methods158
▷ Static methods10.63%
▷ Public methods15396.84%
▷ Protected methods00.00%
▷ Private methods53.16%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/js/select2/select2.png0.60KB0.99KB0.00%
assets/images/icon-calendar.png0.22KB0.17KB▼ 24.35%
assets/js/select2/select2x2.png0.83KB0.77KB▼ 6.15%