78% cardanopress

Code Review | CardanoPress - Cardano Blockchain Integration for WordPress

WordPress plugin CardanoPress - Cardano Blockchain Integration for WordPress scored78%from 54 tests.

About plugin

  • Plugin page: cardanopress
  • Plugin version: 1.7.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: Jan 12, 2023
  • Latest release: Oct 30, 2023
  • Number of updates: 29
  • Update frequency: every 10.1 days
  • Top authors: pbwebdev (93.1%)gaft (10.34%)

Code review

54 tests

User reviews

13 reviews

Install metrics

100+ active /2,297 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
Installer ran successfully

Server metrics [RAM: ▲2.33MB] [CPU: ▲11.73ms] Passed 4 tests

A check of server-side resources used by CardanoPress - Cardano Blockchain Integration for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.82 ▲2.3554.11 ▲13.14
Dashboard /wp-admin5.63 ▲2.3258.86 ▲8.53
Posts /wp-admin/edit.php5.68 ▲2.3271.89 ▲22.70
Add New Post /wp-admin/post-new.php8.22 ▲2.3397.71 ▲2.53
Media Library /wp-admin/upload.php5.56 ▲2.3259.79 ▲23.31
CardanoPress /wp-admin/admin.php?page=cardanopress5.4854.33
Install Plugins /wp-admin/admin.php?page=cardanopress-plugins5.5444.10

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

Analyzing filesystem and database footprints of this plugin
These are issues you should consider
  • There were 1 file (0.11KB) illegally modified outside of "wp-content/plugins/cardanopress/" and "wp-content/uploads/"
    • (new file) wp-content/cardanopress-logs/2023/10/31/installer.log
Filesystem: 486 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
cardanopress
theysaidso_admin_options
cardanopress_version
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

CardanoPress - Cardano Blockchain Integration for WordPress: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,328 ▲56715.66 ▲1.3117.82 ▲16.0637.70 ▼8.72
Dashboard /wp-admin2,291 ▲1175.57 ▲0.0197.29 ▲8.8247.15 ▲2.69
Posts /wp-admin/edit.php2,205 ▲1022.15 ▲0.1641.31 ▲0.1139.98 ▲3.07
Add New Post /wp-admin/post-new.php1,609 ▲7323.66 ▲0.39693.94 ▲18.2853.09 ▲1.95
Media Library /wp-admin/upload.php1,504 ▲1044.25 ▲0.0398.80 ▼9.9147.09 ▼0.40
CardanoPress /wp-admin/admin.php?page=cardanopress2,0824.43121.6443.72
Install Plugins /wp-admin/admin.php?page=cardanopress-plugins1,0632.2127.7229.61

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 8 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • cardanopress_version
    • cardanopress
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
  • 9× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/cardanopress/templates/part/payment-address.php
    • > /wp-content/plugins/cardanopress/templates/part/payment-lovelace.php
    • > /wp-content/plugins/cardanopress/templates/part/payment-recaptcha.php
    • > /wp-content/plugins/cardanopress/templates/part/payment-output.php
    • > /wp-content/plugins/cardanopress/templates/part/payment-quantity.php
    • > /wp-content/plugins/cardanopress/templates/part/modal-header.php
    • > /wp-content/plugins/cardanopress/templates/part/payment-toggle.php
    • > /wp-content/plugins/cardanopress/templates/part/notice-item.php
    • > /wp-content/plugins/cardanopress/templates/part/modal-content.php
  • 235× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CardanoPress\\Dependencies\\Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/cardanopress/dependencies/vendor/cardanopress/framework/dependencies/Monolog/Handler/AmqpHandler.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'CardanoPress\\Dependencies\\Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/cardanopress/dependencies/vendor/cardanopress/framework/dependencies/Monolog/Handler/ChromePHPHandler.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'CardanoPress\\Dependencies\\Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/cardanopress/dependencies/vendor/cardanopress/framework/dependencies/Monolog/Handler/SqsHandler.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'CardanoPress\\Dependencies\\Monolog\\Formatter\ormalizerFormatter' not found in wp-content/plugins/cardanopress/dependencies/vendor/cardanopress/framework/dependencies/Monolog/Formatter/JsonFormatter.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'CardanoPress\\Dependencies\\ThemePlate\\Core\\Form' not found in wp-content/plugins/cardanopress/dependencies/vendor/cardanopress/framework/dependencies/ThemePlate/Settings/OptionBox.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'CardanoPress\\Dependencies\\GuzzleHttp\\BodySummarizerInterface' not found in wp-content/plugins/cardanopress/dependencies/vendor/cardanopress/framework/dependencies/GuzzleHttp/BodySummarizer.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'CardanoPress\\Dependencies\\Monolog\\Formatter\\FormatterInterface' not found in wp-content/plugins/cardanopress/dependencies/vendor/cardanopress/framework/dependencies/Monolog/Formatter/ChromePHPFormatter.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'CardanoPress\\Dependencies\\ThemePlate\\Core\\Form' not found in wp-content/plugins/cardanopress/dependencies/vendor/cardanopress/framework/dependencies/ThemePlate/Meta/BaseMeta.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cardanoPress() in wp-content/plugins/cardanopress/templates/page/Delegation.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'CardanoPress\\Dependencies\\Monolog\\Processor\\ProcessorInterface' not found in wp-content/plugins/cardanopress/dependencies/vendor/cardanopress/framework/dependencies/Monolog/Processor/IntrospectionProcessor.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (CardanoPress configuration screen), #2 (NFT Configuration), #3 (Example wallet connector)
You can look at the official readme.txt

cardanopress/cardanopress.php Passed 13 tests

"CardanoPress - Cardano Blockchain Integration for WordPress" version 1.7.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
49 characters long description:
Core plugin for the suite of CardanoPress plugins

Code Analysis Passed 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 detected36,030 lines of code in 475 files:
LanguageFilesBlank linesComment linesLines of code
PHP4337,97515,74729,986
YAML140902,905
JavaScript28396131,644
CSS51219954
Markdown41640379
JSON300156
XML1216

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity10.49
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity2.70
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces47
Interfaces50
Traits18
Classes312
▷ Abstract classes258.01%
▷ Concrete classes28791.99%
▷ Final classes3813.24%
Methods2,225
▷ Static methods25111.28%
▷ Public methods1,69075.96%
▷ Protected methods29213.12%
▷ Private methods24310.92%
Functions159
▷ Named functions3421.38%
▷ Anonymous functions12578.62%
Constants164
▷ Global constants10.61%
▷ Class constants16399.39%
▷ Public constants12576.69%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 2.88MB with 2.40MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Screenshot-1.png1,154.41KB222.41KB▼ 80.73%
Screenshot-3.png648.89KB67.72KB▼ 89.56%
Screenshot-2.png1,144.81KB236.08KB▼ 79.38%