78% complex-meta-fields

Code Review | Complex Meta Fields

WordPress plugin Complex Meta Fields scored78%from 54 tests.

About plugin

  • Plugin page: complex-meta-fields
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.0
  • WordPress version: 6.3.1
  • First release: Dec 4, 2014
  • Latest release: Jan 31, 2019
  • Number of updates: 21
  • Update frequency: every 72.3 days
  • Top authors: Anton Korotkoff (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,421 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.12MB] [CPU: ▼4.02ms] Passed 4 tests

An overview of server-side resources used by Complex Meta Fields
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1138.78 ▼4.08
Dashboard /wp-admin3.42 ▲0.1145.61 ▼0.09
Posts /wp-admin/edit.php3.53 ▲0.1752.58 ▲4.06
Add New Post /wp-admin/post-new.php6.02 ▲0.1384.77 ▼15.97
Media Library /wp-admin/upload.php3.34 ▲0.1142.02 ▲6.70
Welcome /wp-admin/admin.php?page=wp_cmf3.3131.68
Manage /wp-admin/admin.php?page=wp_cmf_manage3.3834.31

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 42 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Complex Meta Fields: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,873 ▲11613.44 ▼0.951.81 ▼0.3042.15 ▼8.58
Dashboard /wp-admin2,242 ▲545.16 ▼0.73104.16 ▲6.0774.98 ▲30.81
Posts /wp-admin/edit.php2,137 ▲482.36 ▲0.3640.28 ▲5.1637.12 ▲1.79
Add New Post /wp-admin/post-new.php1,711 ▲19722.55 ▲4.94595.65 ▼113.3130.28 ▼27.25
Media Library /wp-admin/upload.php1,427 ▲394.56 ▲0.3598.39 ▼4.4479.22 ▲31.90
Welcome /wp-admin/admin.php?page=wp_cmf9022.1226.0942.84
Manage /wp-admin/admin.php?page=wp_cmf_manage1,6042.9960.3035.86

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% 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)
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 11× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/complex-meta-fields/includes/templates/form/image.php
    • > /wp-content/plugins/complex-meta-fields/includes/templates/form/number.php
    • > /wp-content/plugins/complex-meta-fields/includes/templates/form/radio.php
    • > /wp-content/plugins/complex-meta-fields/includes/templates/form/email.php
    • > /wp-content/plugins/complex-meta-fields/includes/templates/form/checkbox.php
    • > /wp-content/plugins/complex-meta-fields/includes/templates/form/select.php
    • > /wp-content/plugins/complex-meta-fields/includes/templates/form/text.php
    • > /wp-content/plugins/complex-meta-fields/includes/templates/form/date.php
    • > /wp-content/plugins/complex-meta-fields/includes/templates/form/richtext.php
    • > /wp-content/plugins/complex-meta-fields/includes/templates/form/url.php
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: return in wp-content/plugins/complex-meta-fields/includes/templates/metabox.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/complex-meta-fields/includes/templates/metabox.php on line 8
    • > PHP Notice
      Undefined variable: metabox in wp-content/plugins/complex-meta-fields/includes/templates/metabox.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/complex-meta-fields/includes/templates/root-page.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_types() in wp-content/plugins/complex-meta-fields/includes/templates/manage-page.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/complex-meta-fields/complex_meta_fields.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/complex-meta-fields/includes/templates/metabox.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: multiple, post type, repeat, meta, custom fields...

complex-meta-fields/complex_meta_fields.php 85% from 13 tests

"Complex Meta Fields" version 1.0.7's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("complex-meta-fields.php" instead of "complex_meta_fields.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected2,027 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript6125272745
PHP20288312711
PO File18491301
LESS1367121
CSS2110113
JSON10026
Markdown55010

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity12.00
▷ Minimum class complexity2.00
▷ Maximum class complexity21.00
Average method complexity3.32
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces2
Interfaces0
Traits1
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods19
▷ Static methods421.05%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/icon.png1.61KB0.81KB▼ 49.76%