84% gitblock

Code Review | gitblock — Github Block Plugin

WordPress plugin gitblock — Github Block Plugin scored84%from 54 tests.

About plugin

  • Plugin page: gitblock
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5.1
  • WordPress version: 6.3.1
  • First release: Jun 23, 2019
  • Latest release: Sep 13, 2020
  • Number of updates: 5
  • Update frequency: every 89.8 days
  • Top authors: thrijith (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,304 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
Install script ran successfully

Server metrics [RAM: ▲0.38MB] [CPU: ▲0.76ms] Passed 4 tests

A check of server-side resources used by gitblock — Github Block Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.4143.93 ▲0.48
Dashboard /wp-admin3.72 ▲0.4146.97 ▼2.39
Posts /wp-admin/edit.php3.77 ▲0.4149.96 ▲5.85
Add New Post /wp-admin/post-new.php6.24 ▲0.3593.06 ▲5.13
Media Library /wp-admin/upload.php3.58 ▲0.3437.01 ▼0.20

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 480 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by gitblock — Github Block Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5613.61 ▼0.792.04 ▲0.2243.29 ▼0.43
Dashboard /wp-admin2,206 ▲215.83 ▼0.0398.71 ▼16.1640.43 ▼1.81
Posts /wp-admin/edit.php2,092 ▲32.05 ▲0.0539.10 ▲2.1334.48 ▲1.37
Add New Post /wp-admin/post-new.php6,183 ▲4,66919.79 ▲2.38860.06 ▲189.3062.94 ▲3.94
Media Library /wp-admin/upload.php1,385 ▼34.22 ▲0.1196.97 ▼19.6748.53 ▲0.19

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however 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 fix the following
  • 283× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/gitblock/vendor/clue/stream-filter/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/gitblock/vendor/clue/stream-filter/examples/uppercase.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Github\\Api\\AbstractApi' not found in wp-content/plugins/gitblock/vendor/knplabs/github-api/lib/Github/Api/GitData/Commits.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Github\\Api\\AbstractApi' not found in wp-content/plugins/gitblock/vendor/knplabs/github-api/lib/Github/Api/Enterprise/License.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Discovery\\Exception' not found in wp-content/plugins/gitblock/vendor/php-http/discovery/src/Exception/NotFoundException.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/gitblock/vendor/guzzlehttp/psr7/src/LimitStream.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Client\\Common\\HttpMethodsClientInterface' not found in wp-content/plugins/gitblock/vendor/php-http/client-common/src/HttpMethodsClient.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Message\\StreamFactory' not found in wp-content/plugins/gitblock/vendor/php-http/message/src/StreamFactory/DiactorosStreamFactory.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Discovery\\ClassDiscovery' not found in wp-content/plugins/gitblock/vendor/php-http/discovery/src/Psr18ClientDiscovery.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Client\\Exception' not found in wp-content/plugins/gitblock/vendor/php-http/cache-plugin/src/Exception/RewindStreamException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Github\\Api\\AbstractApi' not found in wp-content/plugins/gitblock/vendor/knplabs/github-api/lib/Github/Api/Authorizations.php:12

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

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: github, github blocks, blocks, gutenberg blocks

gitblock/gitblock.php Passed 13 tests

"gitblock — Github Block Plugin" version 1.1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
50 characters long description:
gitblock — is a plugin for adding Github blocks.

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
No dangerous file extensions were detected44,376 lines of code in 473 files:
LanguageFilesBlank linesComment linesLines of code
PHP4285,25714,61937,819
Markdown191,29803,341
JSON6002,022
Sass5700418
CSS16628381
JavaScript62515216
PO File1405093
XML21037
YAML25227
Dockerfile18010
make1409
Bourne Shell1203

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity7.25
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces67
Interfaces59
Traits16
Classes311
▷ Abstract classes61.93%
▷ Concrete classes30598.07%
▷ Final classes10735.08%
Methods1,846
▷ Static methods1648.88%
▷ Public methods1,59386.29%
▷ Protected methods573.09%
▷ Private methods19610.62%
Functions239
▷ Named functions8635.98%
▷ Anonymous functions15364.02%
Constants171
▷ Global constants4928.65%
▷ Class constants12271.35%
▷ Public constants122100.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
There were not PNG files found in your plugin