62% mingrana-wp-to-blockchain

Code Review | Mingrana WP to Blockchain

WordPress plugin Mingrana WP to Blockchain scored62%from 54 tests.

About plugin

  • Plugin page: mingrana-wp-to-bl...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.1.1
  • WordPress version: 6.3.1
  • First release: Feb 21, 2019
  • Latest release: May 3, 2019
  • Number of updates: 14
  • Update frequency: every 5.1 days
  • Top authors: enriquemorillo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,912 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.32MB] [CPU: ▼19.52ms] Passed 4 tests

Analyzing server-side resources used by Mingrana WP to Blockchain
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.45 ▼0.0137.58 ▼3.43
Dashboard /wp-admin3.34 ▲0.0349.02 ▼4.36
Posts /wp-admin/edit.php3.31 ▼0.0542.64 ▼7.84
Add New Post /wp-admin/post-new.php4.63 ▼1.2645.01 ▼62.46
Media Library /wp-admin/upload.php3.26 ▲0.0339.33 ▲3.02
Mingrana WP /wp-admin/options-general.php?page=mingrana-wp3.3034.68

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 345 new files
Database: 1 new table, 6 new options
New tables
wp_mingrana
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Mingrana WP to Blockchain
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,905 ▲14413.47 ▼0.888.71 ▲7.2042.84 ▼3.41
Dashboard /wp-admin2,197 ▲175.56 ▼0.1090.36 ▲4.1340.68 ▼3.74
Posts /wp-admin/edit.php2,120 ▲201.98 ▼0.0137.09 ▲0.4235.32 ▼2.59
Add New Post /wp-admin/post-new.php6,236 ▲4,70826.01 ▲2.80948.89 ▲273.1266.60 ▲14.14
Media Library /wp-admin/upload.php1,408 ▲84.12 ▼0.10112.93 ▲5.8648.45 ▲3.13
Mingrana WP /wp-admin/options-general.php?page=mingrana-wp9512.0524.3631.87

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie tables detected upon uninstall: 1 table
    • wp_mingrana
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mingrana-wp
    • > Notice in wp-content/plugins/mingrana-wp-to-blockchain/admin/partials/mingrana-wp-admin-display.php+66
    Trying to access array offset on value of type bool

SRP 0% 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 fix the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/mingrana-wp-to-blockchain/public/partials/mingrana-wp-public-display.php
    • > /wp-content/plugins/mingrana-wp-to-blockchain/admin/lib/dompdf/lib/php-css-parser/tests/quickdump.php
    • > /wp-content/plugins/mingrana-wp-to-blockchain/admin/lib/dompdf/test.php
  • 139× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Renderable' not found in wp-content/plugins/mingrana-wp-to-blockchain/admin/lib/dompdf/lib/php-css-parser/lib/Sabberworm/CSS/Rule/Rule.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\Value' not found in wp-content/plugins/mingrana-wp-to-blockchain/admin/lib/dompdf/lib/php-css-parser/lib/Sabberworm/CSS/Value/PrimitiveValue.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Property\\AtRule' not found in wp-content/plugins/mingrana-wp-to-blockchain/admin/lib/dompdf/lib/php-css-parser/lib/Sabberworm/CSS/Property/Import.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameReflower\\AbstractFrameReflower' not found in wp-content/plugins/mingrana-wp-to-blockchain/admin/lib/dompdf/src/FrameReflower/TableRow.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Renderer\\AbstractRenderer' not found in wp-content/plugins/mingrana-wp-to-blockchain/admin/lib/dompdf/src/Renderer.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Header' not found in wp-content/plugins/mingrana-wp-to-blockchain/admin/lib/dompdf/lib/php-font-lib/src/FontLib/TrueType/Header.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Renderer\\Block' not found in wp-content/plugins/mingrana-wp-to-blockchain/admin/lib/dompdf/src/Renderer/TableCell.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/mingrana-wp-to-blockchain/admin/lib/dompdf/src/FrameDecorator/ListBulletImage.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Property\\AtRule' not found in wp-content/plugins/mingrana-wp-to-blockchain/admin/lib/dompdf/lib/php-css-parser/lib/Sabberworm/CSS/Property/Charset.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\BinaryStream' not found in wp-content/plugins/mingrana-wp-to-blockchain/admin/lib/dompdf/lib/php-font-lib/src/FontLib/Table/DirectoryEntry.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === mingrana-wp-to-blockchain === )
Please take inspiration from this readme.txt

mingrana-wp-to-blockchain/mingrana-wp.php 85% from 13 tests

The entry point to "Mingrana WP to Blockchain" version 1.0.4 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("mingrana-wp-to-blockchain.php" instead of "mingrana-wp.php")

Code Analysis 97% from 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 plugin41,446 lines of code in 266 files:
LanguageFilesBlank linesComment linesLines of code
PHP2088,94616,06539,338
Markdown62550909
CSS3313468650
XML632202
JSON500135
PO File1252671
YAML416363
JavaScript2225461
HTML10017

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 652)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity35.61
▷ Minimum class complexity1.00
▷ Maximum class complexity765.00
Average method complexity4.28
▷ Minimum method complexity1.00
▷ Maximum method complexity652.00
Code structure
Namespaces33
Interfaces5
Traits0
Classes187
▷ Abstract classes126.42%
▷ Concrete classes17593.58%
▷ Final classes00.00%
Methods2,088
▷ Static methods844.02%
▷ Public methods1,78485.44%
▷ Protected methods2049.77%
▷ Private methods1004.79%
Functions21
▷ Named functions628.57%
▷ Anonymous functions1571.43%
Constants179
▷ Global constants2413.41%
▷ Class constants15586.59%
▷ Public constants155100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/lib/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%