66% just-custom-fields

Code Review | Just Custom Fields

WordPress plugin Just Custom Fields scored 66% from 54 tests.

About plugin

  • Plugin page: just-custom-fields
  • Plugin version: 3.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.5
  • WordPress version: 5.8.1
  • First release: Jul 3, 2011
  • Latest release: Aug 14, 2020
  • Number of updates: 80
  • Update frequency: every 41.6 days
  • Top authors: aprokopenko (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

2,000+ active / 48,652 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼137.03ms] Passed 4 tests

Server-side resources used by Just Custom Fields
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.97 ▲0.2534.62 ▲12.54
Dashboard /wp-admin3.25 ▲0.2048.03 ▲0.44
Posts /wp-admin/edit.php3.29 ▲0.1947.13 ▲0.39
Add New Post /wp-admin/post-new.php5.61 ▲0.1895.81 ▼548.62
Media Library /wp-admin/upload.php3.19 ▲0.1933.68 ▼0.31
Settings /wp-admin/admin.php?page=jcf_settings3.1830.80
Fields /wp-admin/admin.php?page=jcf_fieldset_index3.0831.01
Import/Export /wp-admin/admin.php?page=jcf_import_export3.2931.75
Just Custom Fields /wp-admin/options-general.php?page=jcf_admin3.2131.81

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 122 new files
Database: no new tables, 1 new option
New WordPress options
jcf_storage_version

Browser metrics Passed 4 tests

An overview of browser requirements for Just Custom Fields
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,713 ▲11716.00 ▲0.488.09 ▼2.1855.10 ▲4.39
Dashboard /wp-admin2,983 ▲526.06 ▲0.16133.77 ▼6.69112.55 ▼4.58
Posts /wp-admin/edit.php2,749 ▲102.71 ▼0.0171.40 ▲5.9694.55 ▲0.08
Add New Post /wp-admin/post-new.php1,641 ▼3122.16 ▲3.34274.07 ▼93.54108.00 ▼0.58
Media Library /wp-admin/upload.php1,817 ▲75.03 ▼0.01144.92 ▼1.19115.16 ▲5.80
Settings /wp-admin/admin.php?page=jcf_settings1,1962.9972.5589.50
Fields /wp-admin/admin.php?page=jcf_fieldset_index1,1612.9866.6691.60
Import/Export /wp-admin/admin.php?page=jcf_import_export1,2272.9960.0193.97
Just Custom Fields /wp-admin/options-general.php?page=jcf_admin1,2652.7464.2298.79

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 1 option
    • jcf_storage_version

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=jcf_fieldset_index
    • > Notice in wp-content/plugins/just-custom-fields/controllers/FieldsetController.php+49
    Undefined index: pt
    • > GET request to /wp-admin/admin.php?page=jcf_fieldset_index
    • > Notice in wp-content/plugins/just-custom-fields/controllers/FieldsetController.php+75
    Undefined index:
    • > GET request to /wp-admin/admin.php?page=jcf_fieldset_index
    • > Notice in wp-content/plugins/just-custom-fields/views/fieldsets/index.php+16
    Trying to get property 'label' of non-object

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 perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/just-custom-fields/views/fieldsets/_taxonomy_meta_box.php
    • > /wp-content/plugins/just-custom-fields/views/_footer.php
  • 82× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: post_type_fieldsets in wp-content/plugins/just-custom-fields/views/import_export/_fields.php on line 6
    • > PHP Warning
      include(JCF_ROOT/views/_header.php): failed to open stream: No such file or directory in wp-content/plugins/just-custom-fields/views/settings/index.php on line 8
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/just-custom-fields/views/import_export/_fields.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'jcf\\core\\Migration' not found in wp-content/plugins/just-custom-fields/migrations/m3x100.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'jcf\\core\\Model' not found in wp-content/plugins/just-custom-fields/models/Migrate.php:8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/just-custom-fields/views/import_export/import.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'jcf\\core\\Controller' not found in wp-content/plugins/just-custom-fields/controllers/TaxonomyController.php:9
    • > PHP Warning
      include(): Failed opening 'JCF_ROOT/views/_header.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/just-custom-fields/views/settings/index.php on line 8
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/just-custom-fields/views/fields/form.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/just-custom-fields/views/fieldsets/index.php:15

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=jcf_admin
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-form,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable&ver=5.8.1 1:31592 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at initImportExportCheckboxes (/wp-content/plugins/just-custom-fields/assets/just_custom_fields.js?ver=5.8.1:559:103)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/just-custom-fields/assets/just_custom_fields.js?ver=5.8.1:10:3)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-form,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-form,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable&ver=5.8.1:2:30340)" undefined
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=jcf_admin
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-form,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable&ver=5.8.1 1:31592 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at initCollectionFields (/wp-content/plugins/just-custom-fields/components/collection/assets/collection.js?ver=5.8.1:11:46)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/just-custom-fields/components/collection/assets/collection.js?ver=5.8.1:2:3)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-form,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-form,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable&ver=5.8.1:2:30340)" undefined
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=jcf_admin
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-form,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable&ver=5.8.1 1:31702 Uncaught TypeError: jQuery(...).live is not a function
    • > GET request to /wp-admin/admin.php?page=jcf_fieldset_index
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-form,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable&ver=5.8.1 1:31592 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at initFieldsetsEdit (/wp-content/plugins/just-custom-fields/assets/just_custom_fields.js?ver=5.8.1:95:73)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/just-custom-fields/assets/just_custom_fields.js?ver=5.8.1:4:5)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-form,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-form,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable&ver=5.8.1:2:30340)" undefined

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Plugin settings page where you can manage custom fields), #2 (The edit post page meta box with fields created on the settings page)
You can look at the official readme.txt

just-custom-fields/just-custom-fields.php 92% from 13 tests

"Just Custom Fields" version 3.3.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 142 characters long)

Code Analysis Passed 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 detected8,928 lines of code in 89 files:
LanguageFilesBlank linesComment linesLines of code
PHP671,2221,8615,855
CSS10751261,646
JavaScript122632621,427

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity15.78
▷ Minimum class complexity1.00
▷ Maximum class complexity52.00
Average method complexity2.94
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces15
Interfaces0
Traits0
Classes41
▷ Abstract classes24.88%
▷ Concrete classes3995.12%
▷ Final classes00.00%
Methods321
▷ Static methods175.30%
▷ Public methods27585.67%
▷ Protected methods4413.71%
▷ Private methods20.62%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants40
▷ Global constants25.00%
▷ Class constants3895.00%
▷ Public constants38100.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
30 PNG files occupy 0.11MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
components/relatedcontent/assets/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
components/datepicker/ui-theme-smoothness/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
screenshot-2.png35.35KB17.28KB▼ 51.12%
components/datepicker/ui-theme-smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
components/relatedcontent/assets/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%