58% any-custom-field

Code Review | Any Custom Fields

WordPress plugin Any Custom Fields scored58%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: 6.3.1
  • 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

10+ active /982 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.94MB] [CPU: ▼32.16ms] Passed 4 tests

A check of server-side resources used by Any Custom Fields
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.57 ▲4.47
Dashboard /wp-admin3.00 ▼0.3021.00 ▼23.63
Posts /wp-admin/edit.php3.00 ▼0.3522.71 ▼21.50
Add New Post /wp-admin/post-new.php3.00 ▼2.8822.88 ▼73.06
Media Library /wp-admin/upload.php3.00 ▼0.2220.84 ▼10.46
Any Custom Fields /wp-admin/options-general.php?page=any_custom_field3.0022.00

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: 1 new table, 6 new options
New tables
wp_anc_fields
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded

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 /2,793 ▲3214.36 ▲0.001.79 ▲0.2444.53 ▲1.54
Dashboard /wp-admin2,202 ▲285.52 ▼0.1193.87 ▲5.2249.48 ▲6.24
Posts /wp-admin/edit.php2,101 ▼21.96 ▼0.0539.72 ▲0.6034.99 ▼0.48
Add New Post /wp-admin/post-new.php1,541 ▲1223.06 ▼0.75681.83 ▲17.6855.42 ▲6.05
Media Library /wp-admin/upload.php1,404 ▲44.17 ▼0.1199.41 ▲1.4040.73 ▼0.58
Any Custom Fields /wp-admin/options-general.php?page=any_custom_field1,2822.2032.8324.66

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 25% 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
  • This plugin cannot be uninstalled
    • > User deprecated in wp-includes/functions.php+5737
    Function 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 detected upon uninstall: 1 table
    • wp_anc_fields
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 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+5737
    Function 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to a member function query() on null in wp-content/plugins/any-custom-field/functions.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/any-custom-field/index.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

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
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #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.)
Please take inspiration from this readme.txt

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

This is the main PHP file of "Any Custom Fields" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Name the main plugin file the same 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 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
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

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.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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%
screenshot-2.png99.53KB29.81KB▼ 70.05%
acf.png3.51KB1.56KB▼ 55.69%
screenshot-1.png103.68KB32.75KB▼ 68.41%