78% magic-meta-box

Code Review | Magic Meta Box

WordPress plugin Magic Meta Box scored78%from 54 tests.

About plugin

  • Plugin page: magic-meta-box
  • Plugin version: 2.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 6.3.1
  • First release: Apr 23, 2015
  • Latest release: Aug 8, 2021
  • Number of updates: 27
  • Update frequency: every 85.2 days
  • Top authors: elgreatly (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /5,577 total downloads

Benchmarks

Plugin footprint 83% 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.05MB] [CPU: ▼9.46ms] Passed 4 tests

Analyzing server-side resources used by Magic Meta Box
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0539.57 ▼1.54
Dashboard /wp-admin3.35 ▲0.0550.12 ▼7.33
Posts /wp-admin/edit.php3.41 ▲0.0550.62 ▼2.00
Add New Post /wp-admin/post-new.php5.94 ▲0.0587.53 ▼26.27
Media Library /wp-admin/upload.php3.28 ▲0.0535.60 ▼2.23

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 118 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Magic Meta Box: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.72 ▲0.442.32 ▲0.6948.37 ▲2.61
Dashboard /wp-admin2,192 ▲125.63 ▼0.0383.05 ▼17.0838.89 ▼7.96
Posts /wp-admin/edit.php2,103 ▲31.95 ▼0.0639.27 ▲3.4337.23 ▼3.46
Add New Post /wp-admin/post-new.php1,537 ▼018.32 ▲0.30639.37 ▼44.1268.99 ▼19.79
Media Library /wp-admin/upload.php1,397 ▼34.29 ▲0.08102.34 ▼15.6841.19 ▼6.54

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 fix the following
  • 18× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/magic-meta-box/includes/repeated-fields/color.php
    • > /wp-content/plugins/magic-meta-box/includes/repeated-fields/multicheckbox.php
    • > /wp-content/plugins/magic-meta-box/includes/repeated-fields/gallery.php
    • > /wp-content/plugins/magic-meta-box/includes/repeated-fields/date.php
    • > /wp-content/plugins/magic-meta-box/includes/fields/time.php
    • > /wp-content/plugins/magic-meta-box/includes/fields/gallery.php
    • > /wp-content/plugins/magic-meta-box/includes/repeated-fields/time.php
    • > /wp-content/plugins/magic-meta-box/includes/fields/color.php
    • > /wp-content/plugins/magic-meta-box/includes/repeated-fields/editor.php
    • > /wp-content/plugins/magic-meta-box/includes/fields/editor.php
  • 395× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/magic-meta-box/includes/fields/gallery.php on line 16
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/magic-meta-box/includes/repeated-fields/email.php on line 3
    • > PHP Notice
      Undefined variable: opt in wp-content/plugins/magic-meta-box/includes/repeated-fields/radio.php on line 6
    • > PHP Notice
      Undefined variable: time_zone in wp-content/plugins/magic-meta-box/includes/fields/time.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/magic-meta-box/includes/fields/url.php:1
    • > PHP Notice
      Undefined variable: opt in wp-content/plugins/magic-meta-box/includes/repeated-fields/time.php on line 7
    • > PHP Notice
      Undefined variable: value_field in wp-content/plugins/magic-meta-box/includes/repeated-fields/file.php on line 11
    • > PHP Notice
      Undefined variable: min in wp-content/plugins/magic-meta-box/includes/repeated-fields/slider.php on line 10
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/magic-meta-box/includes/fields/image.php on line 7
    • > PHP Notice
      Undefined variable: field_id in wp-content/plugins/magic-meta-box/includes/repeated-fields/embed.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (register magic metabox), #2 (repeat Fields), #3 (tabs)
You can take inspiration from this readme.txt

magic-meta-box/magic-metabox.php 92% from 13 tests

The primary PHP file in "Magic Meta Box" version 2.4.2 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("magic-meta-box.php" instead of "magic-metabox.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin4,834 lines of code in 69 files:
LanguageFilesBlank linesComment linesLines of code
CSS8671831,589
PHP4948271,301
JavaScript11671341,170
SVG100774

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code1.06
Average class complexity46.00
▷ Minimum class complexity46.00
▷ Maximum class complexity46.00
Average method complexity6.00
▷ Minimum method complexity2.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods333.33%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
44 PNG files occupy 0.46MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_ef8c08_256x240.png4.49KB4.18KB▼ 6.89%
images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%
images/ui-bg_glass_75_e6e6e6_1x400.png0.26KB0.15KB▼ 42.37%
images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
css/images/ui-bg_fine-grain_15_ffffff_60x60.png3.63KB1.56KB▼ 56.97%