88% materializer

Code Review | Materializer WP

WordPress plugin Materializer WP scored 88% from 54 tests.

About plugin

  • Plugin page: materializer
  • Plugin version: 0.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.3.1
  • WordPress version: 5.9.2
  • First release: Oct 22, 2015
  • Latest release: Oct 30, 2015
  • Number of updates: 3
  • Update frequency: every 2.7 days
  • Top authors: CodyReichert (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 3,517 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.10MB] [CPU: ▼311.17ms] Passed 4 tests

An overview of server-side resources used by Materializer WP
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.1959.91 ▲5.93
Dashboard /wp-admin3.54 ▲0.1346.04 ▲9.01
Posts /wp-admin/edit.php3.77 ▲0.1341.81 ▲1.44
Add New Post /wp-admin/post-new.php7.01 ▲0.04101.15 ▼1,254.02
Media Library /wp-admin/upload.php3.42 ▲0.1229.80 ▲1.99

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 83 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Materializer WP
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,890 ▲13617.14 ▲1.2721.39 ▲15.222.58 ▼0.52
Dashboard /wp-admin2,907 ▲236.44 ▼0.06131.32 ▼13.63156.04 ▼8.00
Posts /wp-admin/edit.php2,694 ▲33.43 ▲0.0064.53 ▲2.60144.16 ▲4.43
Add New Post /wp-admin/post-new.php1,616 ▼7319.70 ▼1.55419.73 ▼1.56158.77 ▼21.95
Media Library /wp-admin/upload.php1,698 ▼05.72 ▼0.00137.67 ▲0.39189.00 ▼0.52

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/materializer/lib/colors.php
  • 15× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'MaterializerShortcodes' not found in wp-content/plugins/materializer/components/sidenav.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'MaterializerShortcodes' not found in wp-content/plugins/materializer/components/tabs.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'MaterializerShortcodes' not found in wp-content/plugins/materializer/components/cards.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'MaterializerShortcodes' not found in wp-content/plugins/materializer/components/preloader.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'MaterializerShortcodes' not found in wp-content/plugins/materializer/components/pagination.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/materializer/materializer.php:54
    • > PHP Fatal error
      Uncaught Error: Class 'MaterializerShortcodes' not found in wp-content/plugins/materializer/components/footer.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'MaterializerShortcodes' not found in wp-content/plugins/materializer/components/collections.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'MaterializerShortcodes' not found in wp-content/plugins/materializer/components/dropdown.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'MaterializerShortcodes' not found in wp-content/plugins/materializer/components/tables.php:9

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 Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: material components, google, design, material ui, ui...

materializer/materializer.php Passed 13 tests

The main PHP file in "Materializer WP" ver. 0.2.0 adds more information about the plugin and also serves as the entry point for this plugin
44 characters long description:
The Material Design components for WordPress

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
Everything looks great! No dangerous files found in this plugin16,275 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript31,9122,2747,653
CSS1244405,740
PHP172263181,130
Markdown23520948
SVG100751
JSON10032
Sass18021

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 code0.33
Average class complexity8.38
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity4.11
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods38
▷ Static methods25.26%
▷ Public methods38100.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 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
34 PNG files occupy 2.39MB with 1.51MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
docs/screenshots/materializer-logo.png24.52KB9.25KB▼ 62.28%
docs/screenshots/materializer-card-reveal-outer.png300.75KB83.64KB▼ 72.19%
docs/screenshots/materializer-image-box.png1,185.56KB420.80KB▼ 64.51%
docs/screenshots/materializer-dropdown-closed.png3.64KB2.00KB▼ 44.88%
docs/screenshots/materializer-collection-links.png5.20KB1.43KB▼ 72.50%