84% harrix-markdownfile

Code Review | Harrix MarkdownFile

WordPress plugin Harrix MarkdownFile scored84%from 54 tests.

About plugin

  • Plugin page: harrix-markdownfile
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.4
  • WordPress version: 6.3.1
  • First release: Dec 20, 2015
  • Latest release: Dec 21, 2015
  • Number of updates: 17
  • Update frequency: every 0.3 days
  • Top authors: Harrix (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /825 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.14MB] [CPU: ▲2.43ms] Passed 4 tests

Analyzing server-side resources used by Harrix MarkdownFile
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1543.11 ▲1.38
Dashboard /wp-admin3.45 ▲0.1450.23 ▲2.48
Posts /wp-admin/edit.php3.56 ▲0.2051.29 ▲3.44
Add New Post /wp-admin/post-new.php6.03 ▲0.1497.43 ▲3.78
Media Library /wp-admin/upload.php3.37 ▲0.1436.32 ▲2.42

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 80 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Harrix MarkdownFile
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲7213.37 ▼0.997.11 ▲5.2439.13 ▼8.19
Dashboard /wp-admin2,206 ▲185.91 ▲1.00105.15 ▼10.8142.06 ▼2.37
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0338.96 ▲3.7935.36 ▲2.12
Add New Post /wp-admin/post-new.php1,549 ▲1618.34 ▼4.92597.21 ▼81.2168.36 ▲15.88
Media Library /wp-admin/upload.php1,388 ▼34.19 ▼0.0194.74 ▼3.8841.93 ▼2.71

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Interface 'Michelf\\MarkdownInterface' not found in wp-content/plugins/harrix-markdownfile/Michelf/Markdown.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Michelf\\Markdown' not found in wp-content/plugins/harrix-markdownfile/Michelf/MarkdownExtra.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/harrix-markdownfile/harrix-markdownfile.php:14

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Donate link: Invalid URI ("")
You can take inspiration from this readme.txt

harrix-markdownfile/harrix-markdownfile.php Passed 13 tests

Analyzing the main PHP file in "Harrix MarkdownFile" version 1.2
96 characters long description:
Harrix MarkdownFile is a plugin to display Markdown files with syntax highlighting in Wordpress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin6,990 lines of code in 74 files:
LanguageFilesBlank linesComment linesLines of code
CSS657714533,837
PHP87939503,151
JavaScript1012

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity87.25
▷ Minimum class complexity1.00
▷ Maximum class complexity159.00
Average method complexity3.43
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces1
Interfaces1
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods144
▷ Static methods32.08%
▷ Public methods139.03%
▷ Protected methods13190.97%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
styles/brown-papersq.png17.77KB9.92KB▼ 44.16%
styles/school-book.png0.47KB0.34KB▼ 27.37%