72% materialize-accordions

Code Review | Materialize Accordions

WordPress plugin Materialize Accordions scored72%from 54 tests.

About plugin

  • Plugin page: materialize-accor...
  • Plugin version: 1.5.10
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Mar 22, 2020
  • Latest release: Aug 10, 2023
  • Number of updates: 31
  • Update frequency: every 39.9 days
  • Top authors: mhimed (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

40+ active /1,574 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼6.74ms] Passed 4 tests

Analyzing server-side resources used by Materialize Accordions
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0543.76 ▲3.38
Dashboard /wp-admin3.36 ▲0.0248.56 ▼16.46
Posts /wp-admin/edit.php3.40 ▲0.0553.13 ▲4.52
Add New Post /wp-admin/post-new.php5.96 ▲0.0787.13 ▼15.48
Media Library /wp-admin/upload.php3.29 ▲0.0646.54 ▲1.61
All Accordions /wp-admin/edit.php?post_type=material_accordion3.3337.46
Add New /wp-admin/post-new.php?post_type=material_accordion3.4141.88

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Materialize Accordions
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,861 ▲11515.51 ▲1.161.86 ▲0.3742.62 ▲2.44
Dashboard /wp-admin2,271 ▲946.65 ▲1.03112.91 ▲22.9137.92 ▼6.43
Posts /wp-admin/edit.php2,332 ▲2294.32 ▲2.3262.51 ▲22.7434.22 ▼3.19
Add New Post /wp-admin/post-new.php1,742 ▲20627.23 ▲9.10693.92 ▲25.9636.71 ▼33.87
Media Library /wp-admin/upload.php1,625 ▲2286.14 ▲1.96118.08 ▲12.9242.67 ▼4.93
All Accordions /wp-admin/edit.php?post_type=material_accordion1,2934.2749.9727.79
Add New /wp-admin/post-new.php?post_type=material_accordion3,1867.87299.88162.20

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 25% 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
    • > GET request to /wp-admin/post-new.php?post_type=material_accordion
    • > Notice in wp-content/plugins/materialize-accordions/admin/settings.php+46
    Undefined variable: hide_icon
    • > GET request to /wp-admin/post-new.php?post_type=material_accordion
    • > Notice in wp-content/plugins/materialize-accordions/admin/settings.php+56
    Undefined variable: move_icon_checkbox
    • > GET request to /wp-admin/post-new.php?post_type=material_accordion
    • > Notice in wp-content/plugins/materialize-accordions/admin/settings.php+67
    Undefined variable: slower_tabs
    • > GET request to /wp-admin/post-new.php?post_type=material_accordion
    • > Notice in wp-content/plugins/materialize-accordions/admin/settings.php+77
    Undefined variable: show_hide_links
    • > GET request to /wp-admin/post-new.php?post_type=material_accordion
    • > Notice in wp-content/plugins/materialize-accordions/admin/settings.php+112
    Undefined variable: title_size
    • > GET request to /wp-admin/post-new.php?post_type=material_accordion
    • > Notice in wp-content/plugins/materialize-accordions/admin/settings.php+121
    Undefined variable: title_border
    • > GET request to /wp-admin/post-new.php?post_type=material_accordion
    • > Notice in wp-content/plugins/materialize-accordions/admin/settings.php+130
    Undefined variable: desc_size
    • > GET request to /wp-admin/post-new.php?post_type=material_accordion
    • > Notice in wp-content/plugins/materialize-accordions/admin/settings.php+139
    Undefined variable: desc_border
    • > GET request to /wp-admin/post-new.php?post_type=material_accordion
    • > Notice in wp-content/plugins/materialize-accordions/admin/settings.php+147
    Undefined variable: icon_font_clr
    • > GET request to /wp-admin/post-new.php?post_type=material_accordion
    • > Notice in wp-content/plugins/materialize-accordions/admin/settings.php+153
    Undefined variable: show_hide_clr
    • > GET request to /wp-admin/post-new.php?post_type=material_accordion
    • > Notice in wp-content/plugins/materialize-accordions/admin/settings.php+159
    Undefined variable: show_hide_font_clr

SRP 0% 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
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/materialize-accordions/admin/partials/materialize_sections.php
    • > /wp-content/plugins/materialize-accordions/admin/settings.php
  • 18× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: slower_tabs in wp-content/plugins/materialize-accordions/admin/settings.php on line 67
    • > PHP Notice
      Undefined variable: hide_icon in wp-content/plugins/materialize-accordions/admin/settings.php on line 46
    • > PHP Notice
      Undefined variable: _title_font_clr in wp-content/plugins/materialize-accordions/admin/settings.php on line 28
    • > PHP Notice
      Undefined variable: title_size in wp-content/plugins/materialize-accordions/admin/settings.php on line 112
    • > PHP Notice
      Undefined variable: _desc_bg_clr in wp-content/plugins/materialize-accordions/admin/settings.php on line 33
    • > PHP Notice
      Undefined variable: move_icon_checkbox in wp-content/plugins/materialize-accordions/admin/settings.php on line 56
    • > PHP Notice
      Undefined variable: _title_bg_clr in wp-content/plugins/materialize-accordions/admin/settings.php on line 23
    • > PHP Notice
      Undefined variable: _desc_font_clr in wp-content/plugins/materialize-accordions/admin/settings.php on line 38
    • > PHP Notice
      Undefined variable: show_hide_links in wp-content/plugins/materialize-accordions/admin/settings.php on line 77
    • > PHP Notice
      Undefined variable: show_hide_font_clr in wp-content/plugins/materialize-accordions/admin/settings.php on line 159

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 errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
7 plugin tags: faq, tabs, deep linking, collapisbile, accordion...

materialize-accordions/materialize_accordions.php 77% from 13 tests

The main PHP file in "Materialize Accordions" ver. 1.5.10 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("materialize-accordions.php" instead of "materialize_accordions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected1,531 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP12402566945
CSS222483
JavaScript1216103

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity11.71
▷ Minimum class complexity1.00
▷ Maximum class complexity59.00
Average method complexity3.03
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods38
▷ Static methods25.26%
▷ Public methods3386.84%
▷ Protected methods00.00%
▷ Private methods513.16%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/img/icons.png20.69KB5.32KB▼ 74.28%