78% gitdown

Code Review | Gitdown: Git Repository to WordPress Blog Posts

WordPress plugin Gitdown: Git Repository to WordPress Blog Posts scored78%from 54 tests.

About plugin

  • Plugin page: gitdown
  • Plugin version: 1.6.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1.0-6.2.0
  • WordPress version: 6.3.1
  • First release: Mar 4, 2023
  • Latest release: Aug 26, 2023
  • Number of updates: 40
  • Update frequency: every 4.4 days
  • Top authors: maximmaeder (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /960 total downloads

Benchmarks

Plugin footprint 82% 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.38MB] [CPU: ▼16.04ms] Passed 4 tests

This is a short check of server-side resources used by Gitdown: Git Repository to WordPress Blog Posts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3140.75 ▼0.36
Dashboard /wp-admin3.64 ▲0.3452.90 ▲2.13
Posts /wp-admin/edit.php4.96 ▲1.611,091.59 ▲1,036.79
Add New Post /wp-admin/post-new.php3.45 ▼2.4336.66 ▼69.42
Media Library /wp-admin/upload.php3.50 ▲0.2741.32 ▲3.48

Server storage [IO: ▲2.06MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
Please fix the following
  • You have illegally modified 2 files (4.00KB) outside of "wp-content/plugins/gitdown/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_-/.empty
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 489 new files
Database: no new tables, 10 new options
New WordPress options
db_upgraded
mgd_repo_setting
mgd_resolver_setting
can_compress_scripts
widget_recent-comments
mgd_glob_setting
mgd_cron_setting
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Gitdown: Git Repository to WordPress Blog Posts: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲13413.61 ▼0.781.55 ▼0.2440.94 ▼0.84
Dashboard /wp-admin2,295 ▲895.41 ▼0.49143.64 ▲41.3544.56 ▲2.18
Posts /wp-admin/edit.php2,195 ▲952.65 ▲0.6639.53 ▼3.8050.11 ▲13.69
Add New Post /wp-admin/post-new.php1,701 ▲15622.77 ▼0.38653.08 ▼38.1731.88 ▼20.45
Media Library /wp-admin/upload.php1,481 ▲814.72 ▲0.54106.56 ▲1.8942.32 ▼4.31

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/gitdown/templates/settings/head.php
    • > /wp-content/plugins/gitdown/gitdown.php
  • 269× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'League\\CommonMark\ode\\Inline\\AbstractStringContainer' not found in wp-content/plugins/gitdown/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/Code.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\EventDispatcher\\StoppableEventInterface' not found in wp-content/plugins/gitdown/vendor/league/commonmark/src/Event/AbstractEvent.php:30
    • > PHP Fatal error
      Trait 'Nette\\SmartObject' not found in wp-content/plugins/gitdown/vendor/nette/utils/src/Utils/ArrayList.php on line 19
    • > PHP Fatal error
      Uncaught Error: Interface 'Stringable' not found in wp-content/plugins/gitdown/vendor/league/commonmark/src/Output/RenderedContentInterface.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\CommonMark\\Delimiter\\Processor\\DelimiterProcessorInterface' not found in wp-content/plugins/gitdown/vendor/league/commonmark/src/Extension/Strikethrough/StrikethroughDelimiterProcessor.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\CommonMark\\Reference\\ReferenceInterface' not found in wp-content/plugins/gitdown/vendor/league/commonmark/src/Reference/Reference.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\CommonMark\\Extension\\ConfigurableExtensionInterface' not found in wp-content/plugins/gitdown/vendor/league/commonmark/src/Extension/InlinesOnly/InlinesOnlyExtension.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/gitdown/templates/articles.php:4
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\CommonMark\\Renderer\\DocumentRendererInterface' not found in wp-content/plugins/gitdown/vendor/league/commonmark/src/Renderer/HtmlRenderer.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\CommonMark\\Renderer\odeRendererInterface' not found in wp-content/plugins/gitdown/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/LinkRenderer.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Add a description for screenshot #5 in gitdown/assets to your readme.txt
You can look at the official readme.txt

gitdown/gitdown.php Passed 13 tests

The principal PHP file in "Gitdown: Git Repository to WordPress Blog Posts" v. 1.6.0 is loaded by WordPress automatically on each request
101 characters long description:
Use this Plugin to create, update, delete and manage markdown articles hosted on a remote repository.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin37,553 lines of code in 468 files:
LanguageFilesBlank linesComment linesLines of code
PHP4326,5529,37920,879
JavaScript41561,97914,288
Markdown1846601,274
JSON100899
SVG40175
CSS28054
YAML411054
XML12316
make13012
INI1002

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 130)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity8.08
▷ Minimum class complexity1.00
▷ Maximum class complexity299.00
Average method complexity2.86
▷ Minimum method complexity1.00
▷ Maximum method complexity130.00
Code structure
Namespaces98
Interfaces63
Traits3
Classes344
▷ Abstract classes72.03%
▷ Concrete classes33797.97%
▷ Final classes23469.44%
Methods1,650
▷ Static methods34320.79%
▷ Public methods1,46888.97%
▷ Protected methods110.67%
▷ Private methods17110.36%
Functions101
▷ Named functions3534.65%
▷ Anonymous functions6665.35%
Constants185
▷ Global constants63.24%
▷ Class constants17996.76%
▷ Public constants15284.92%

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.26MB with 0.16MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
templates/how_to/managing.png164.53KB64.60KB▼ 60.73%
templates/how_to/github-copy-repo-url.png102.02KB35.50KB▼ 65.20%