83% material-box

Code Review | Material Box

WordPress plugin Material Box scored83%from 54 tests.

About plugin

  • Plugin page: material-box
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2+
  • WordPress version: 6.3.1
  • First release: May 4, 2022
  • Latest release: May 5, 2022
  • Number of updates: 3
  • Update frequency: every 0.7 days
  • Top authors: William Carvalho (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /188 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.91ms] Passed 4 tests

This is a short check of server-side resources used by Material Box
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0543.76 ▲2.11
Dashboard /wp-admin3.36 ▲0.0547.78 ▼6.44
Posts /wp-admin/edit.php3.41 ▲0.0548.42 ▼2.42
Add New Post /wp-admin/post-new.php5.94 ▲0.0597.58 ▼12.46
Media Library /wp-admin/upload.php3.28 ▲0.0536.67 ▲1.70
Material Box /wp-admin/themes.php?page=material-box3.2539.32

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Material Box
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲7413.29 ▼1.072.00 ▲0.0249.63 ▼3.05
Dashboard /wp-admin2,210 ▲225.82 ▼0.08100.28 ▼5.9540.72 ▼6.25
Posts /wp-admin/edit.php2,096 ▲42.03 ▲0.0439.92 ▲1.0934.51 ▲3.70
Add New Post /wp-admin/post-new.php1,536 ▼223.17 ▼0.04665.62 ▲46.1758.46 ▲0.60
Media Library /wp-admin/upload.php1,389 ▼24.21 ▲0.02101.08 ▼1.8341.21 ▼1.98
Material Box /wp-admin/themes.php?page=material-box8742.1723.7831.42

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/material-box/material-box.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/material-box/includes/tpl/helper.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/material-box/includes/tpl/form.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/material-box/includes/tpl/materialbox_main_section.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/material-box/includes/tpl/input.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/material-box/includes/tpl/supplemental.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/material-box/includes/tpl/materialbox_config_section.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/material-box/includes/tpl/select.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Requires at least: Version format is invalid
  • Tested up to: Version format is invalid
Please take inspiration from this readme.txt

material-box/material-box.php 92% from 13 tests

"Material Box" version 1.0.0'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:
  • Requires PHP: Required version does not match the one declared in readme.txt ("7.0" instead of "7.2")

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
Success! There were no dangerous files found in this plugin310 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP93519226
PO File1222364
CSS101219
JavaScript1051

PHP code Passed 2 tests

This is a short overview 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.27
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity2.64
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin