68% any-custom-field

Code Review | Any Custom Fields

WordPress plugin Any Custom Fields scored 68% from 54 tests.

About plugin

  • Plugin page: any-custom-field
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.6.1
  • WordPress version: 5.9.2
  • First release: Jun 23, 2016
  • Latest release: Dec 1, 2016
  • Number of updates: 12
  • Update frequency: every 19.1 days
  • Top authors: darshancp23081994 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 725 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼1.23MB] [CPU: ▼325.48ms] Passed 4 tests

Analyzing server-side resources used by Any Custom Fields
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0154.20 ▲1.39
Dashboard /wp-admin3.10 ▼0.3116.73 ▼19.33
Posts /wp-admin/edit.php3.10 ▼0.5416.19 ▼20.19
Add New Post /wp-admin/post-new.php3.10 ▼3.8717.42 ▼1,252.25
Media Library /wp-admin/upload.php3.10 ▼0.2014.74 ▼10.16
Any Custom Fields /wp-admin/options-general.php?page=any_custom_field3.1017.12

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 13 new files
Database: 1 new table, no new options
New tables
wp_anc_fields

Browser metrics Passed 4 tests

This is an overview of browser requirements for Any Custom Fields
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,768 ▲1416.25 ▲0.135.95 ▼1.292.46 ▲0.07
Dashboard /wp-admin2,893 ▲326.20 ▲0.05116.63 ▼16.23155.62 ▼8.68
Posts /wp-admin/edit.php2,693 ▼13.23 ▼0.0161.41 ▲1.44139.24 ▼0.79
Add New Post /wp-admin/post-new.php1,671 ▼8018.05 ▼3.02393.97 ▼44.58159.48 ▼3.48
Media Library /wp-admin/upload.php1,700 ▲25.49 ▼0.03134.27 ▼8.45184.54 ▲0.05
Any Custom Fields /wp-admin/options-general.php?page=any_custom_field1,6612.9959.9798.25

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5600
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie tables were found after uninstall: 1 table
    • wp_anc_fields

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=any_custom_field
    • > User deprecated in wp-includes/functions.php+5600
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=any_custom_field
    • > Notice in wp-content/plugins/any-custom-field/form.php+18
    Undefined index: anc_hidden
    • > GET request to /wp-admin/options-general.php?page=any_custom_field
    • > Notice in wp-content/plugins/any-custom-field/form.php+165
    Undefined variable: _SESSION
    • > GET request to /wp-admin/options-general.php?page=any_custom_field
    • > Notice in wp-content/plugins/any-custom-field/form.php+242
    Undefined variable: anc_cname

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/any-custom-field/index.php:12
    • > PHP Fatal error
      Uncaught Error: Call to a member function query() on null in wp-content/plugins/any-custom-field/functions.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Any custom fields general options page), #2 (Adding new Custom Fields to a page by click on button link and remove it), #3 (short code to add it on front side pages or admin pages.)
The official readme.txt is a good inspiration

any-custom-field/index.php 92% from 13 tests

The primary PHP file in "Any Custom Fields" version 1.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("any-custom-field.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected478 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP412526389
JavaScript222783
CSS1206

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity7.50
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.32MB with 0.21MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png120.91KB37.80KB▼ 68.73%
acf.png3.51KB1.56KB▼ 55.69%
screenshot-1.png103.68KB32.75KB▼ 68.41%
screenshot-2.png99.53KB29.81KB▼ 70.05%