78% metaparsedown

Code Review | MetaParsedown

WordPress plugin MetaParsedown scored78%from 54 tests.

About plugin

  • Plugin page: metaparsedown
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.2.1
  • WordPress version: 6.3.1
  • First release: Nov 5, 2019
  • Latest release: Nov 5, 2019
  • Number of updates: 8
  • Update frequency: every 0.1 days
  • Top authors: pagerange (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /504 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 gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼9.44ms] Passed 4 tests

This is a short check of server-side resources used by MetaParsedown
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.46 ▼1.76
Dashboard /wp-admin3.33 ▼0.0148.34 ▼12.90
Posts /wp-admin/edit.php3.44 ▲0.0946.91 ▼2.92
Add New Post /wp-admin/post-new.php5.91 ▲0.0386.35 ▼20.17
Media Library /wp-admin/upload.php3.25 ▲0.0337.08 ▲1.58

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 36 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for MetaParsedown
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.66 ▼0.631.83 ▲0.1343.09 ▲3.00
Dashboard /wp-admin2,209 ▲215.91 ▲1.0199.71 ▼17.4339.54 ▼5.80
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0040.18 ▼1.1333.81 ▼4.70
Add New Post /wp-admin/post-new.php1,514 ▼1417.53 ▼5.67673.22 ▼24.6258.16 ▲1.84
Media Library /wp-admin/upload.php1,382 ▼94.20 ▼0.0296.91 ▼4.5744.25 ▼2.53

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • 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 short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/metaparsedown/autoload.php
    • > /wp-content/plugins/metaparsedown/metaparsedown.php
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'Metaparsedown\\Symfony\\Component\\Yaml\\Exception\\RuntimeException' not found in wp-content/plugins/metaparsedown/Metaparsedown/Symfony/Component/Yaml/Exception/ParseException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Metaparsedown\\Symfony\\Component\\Yaml\\Exception\\RuntimeException' not found in wp-content/plugins/metaparsedown/Metaparsedown/Symfony/Component/Yaml/Exception/DumpException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Metaparsedown\\Parsedown\\ParsedownExtra' not found in wp-content/plugins/metaparsedown/Metaparsedown/Pagerange/Markdown/Parsers/YamlParser.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Metaparsedown\\Parsedown\\Parsedown' not found in wp-content/plugins/metaparsedown/Metaparsedown/Parsedown/ParsedownExtra.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Metaparsedown\\Symfony\\Component\\Console\\Command\\Command' not found in wp-content/plugins/metaparsedown/Metaparsedown/Symfony/Component/Yaml/Command/LintCommand.php:32
    • > PHP Fatal error
      Uncaught Error: Interface 'Metaparsedown\\Pagerange\\Markdown\\Parsers\\ParserInterface' not found in wp-content/plugins/metaparsedown/Metaparsedown/Pagerange/Markdown/MetaParsedown.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Metaparsedown\\Symfony\\Component\\Yaml\\Exception\\ExceptionInterface' not found in wp-content/plugins/metaparsedown/Metaparsedown/Symfony/Component/Yaml/Exception/RuntimeException.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
9 plugin tags: parsedown-extra, bitbucket, gitlab, yaml, github...

metaparsedown/metaparsedown.php Passed 13 tests

"MetaParsedown" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
113 characters long description:
Parse external markdown files and inject HTML into posts and pages, retrieve YAML metadata from them if required.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected3,899 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP241,1241,3793,756
JavaScript22175126
CSS1319
Markdown1408

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 114)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity40.76
▷ Minimum class complexity1.00
▷ Maximum class complexity246.00
Average method complexity5.43
▷ Minimum method complexity1.00
▷ Maximum method complexity114.00
Code structure
Namespaces9
Interfaces2
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes210.53%
Methods196
▷ Static methods4020.41%
▷ Public methods6935.20%
▷ Protected methods8040.82%
▷ Private methods4723.98%
Functions19
▷ Named functions1263.16%
▷ Anonymous functions736.84%
Constants21
▷ Global constants314.29%
▷ Class constants1885.71%
▷ Public constants18100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected