79% wp-mermaid

Code Review | WP Mermaid

WordPress plugin WP Mermaid scored79%from 54 tests.

About plugin

  • Plugin page: wp-mermaid
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.3.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2.2
  • WordPress version: 6.3.1
  • First release: May 15, 2020
  • Latest release: May 23, 2023
  • Number of updates: 9
  • Update frequency: every 122.7 days
  • Top authors: terrylin (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /4,824 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by WP Mermaid
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.21 ▼6.46
Dashboard /wp-admin3.36 ▲0.0150.51 ▼18.71
Posts /wp-admin/edit.php3.41 ▲0.0553.24 ▲6.13
Add New Post /wp-admin/post-new.php5.96 ▲0.0793.00 ▼10.40
Media Library /wp-admin/upload.php3.28 ▲0.0539.35 ▲3.58

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for WP Mermaid
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5422.22 ▲7.541.86 ▼0.0337.38 ▼8.40
Dashboard /wp-admin2,207 ▲1913.06 ▲8.20412.03 ▲295.4442.87 ▼1.36
Posts /wp-admin/edit.php2,104 ▲159.32 ▲7.2985.17 ▲49.5133.32 ▼4.07
Add New Post /wp-admin/post-new.php6,200 ▲4,67927.89 ▲4.80930.91 ▲269.2848.74 ▼1.92
Media Library /wp-admin/upload.php1,398 ▲1011.54 ▲7.38145.72 ▲38.4841.74 ▼1.68
WP Mermaid /wp-admin/wp-mermaid.php260.440.1313.86

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

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% 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
Please take a closer look at the following
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mermaid/inc/block.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mermaid/inc/shortcode.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mermaid/inc/smart-loader.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wp-mermaid/inc/admin/register.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mermaid/inc/admin/menu.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mermaid/inc/admin/setting.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mermaid/inc/mermaid-js.php:11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/wp-mermaid.php
    • > Network (severe)
    wp-admin/wp-mermaid.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 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
5 plugin tags: flowchat, sequence, mermaid, diagram, markdown

wp-mermaid/wp-mermaid.php Passed 13 tests

The main PHP file in "WP Mermaid" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
99 characters long description:
Generation of diagrams and flowcharts from text in a similar manner as markdown by using mermaid.js

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin1,717 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript22142661,195
PHP873209305
PO File36972202
CSS14815

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
2 PNG files occupy 0.11MB with 0.07MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/example-gutenberg-block-1.png53.28KB20.01KB▼ 62.44%
assets/example-gutenberg-block-2.png59.95KB21.28KB▼ 64.50%