74% cardanopress-governance

Code Review | CardanoPress - Governance for Cardano

WordPress plugin CardanoPress - Governance for Cardano scored74%from 54 tests.

About plugin

  • Plugin page: cardanopress-gove...
  • Plugin version: 1.2.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: Jan 18, 2023
  • Latest release: Nov 17, 2023
  • Number of updates: 8
  • Update frequency: every 38.0 days
  • Top authors: pbwebdev (87.5%)gaft (25%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,633 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲3.19MB] [CPU: ▲22.13ms] Passed 4 tests

This is a short check of server-side resources used by CardanoPress - Governance for Cardano
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /6.61 ▲3.1567.65 ▲25.40
Dashboard /wp-admin6.54 ▲3.1972.48 ▲12.83
Posts /wp-admin/edit.php6.59 ▲3.2482.53 ▲38.63
Add New Post /wp-admin/post-new.php9.12 ▲3.23110.59 ▲21.15
Media Library /wp-admin/upload.php6.40 ▲3.1761.66 ▲29.13
Scheduled Actions /wp-admin/tools.php?page=action-scheduler6.5768.37
Add New Proposal /wp-admin/post-new.php?post_type=proposal9.14106.65
Install Plugins /wp-admin/admin.php?page=cardanopress-plugins6.4059.79
Settings /wp-admin/edit.php?post_type=proposal&page=cp-governance6.4560.15
All Proposals /wp-admin/edit.php?post_type=proposal6.4561.77

Server storage [IO: ▲2.59MB] [DB: ▲0.01MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
These are issues you should consider
  • Illegal file modification found: 1 file (0.19KB) outside of "wp-content/plugins/cardanopress-governance/" and "wp-content/uploads/"
    • (new file) wp-content/cardanopress-logs/2023/11/19/installer.log
Filesystem: 529 new files
Database: 4 new tables, 9 new options
New tables
wp_actionscheduler_groups
wp_actionscheduler_claims
wp_actionscheduler_actions
wp_actionscheduler_logs
New WordPress options
widget_recent-posts
schema-ActionScheduler_LoggerSchema
widget_recent-comments
db_upgraded
theysaidso_admin_options
schema-ActionScheduler_StoreSchema
can_compress_scripts
widget_theysaidso_widget
action_scheduler_hybrid_store_demarkation

Browser metrics Passed 4 tests

Checking browser requirements for CardanoPress - Governance for Cardano
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,894 ▲13214.32 ▲0.071.84 ▲0.1344.03 ▼4.73
Dashboard /wp-admin2,296 ▲1195.57 ▼0.0498.02 ▼1.5649.05 ▲6.07
Posts /wp-admin/edit.php2,210 ▲1102.20 ▲0.1835.21 ▼3.5141.89 ▲3.95
Add New Post /wp-admin/post-new.php1,618 ▲9023.02 ▼0.21605.43 ▼10.6549.66 ▼4.03
Media Library /wp-admin/upload.php1,509 ▲1124.23 ▲0.0199.20 ▼1.8548.08 ▲6.61
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,3552.1928.0437.18
Add New Proposal /wp-admin/post-new.php?post_type=proposal6,80919.55901.1937.61
Install Plugins /wp-admin/admin.php?page=cardanopress-plugins1,0792.1925.6131.94
Settings /wp-admin/edit.php?post_type=proposal&page=cp-governance1,7447.25155.3170.63
All Proposals /wp-admin/edit.php?post_type=proposal1,1862.1040.3734.04

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie tables were found after uninstall: 4 tables
    • wp_actionscheduler_groups
    • wp_actionscheduler_actions
    • wp_actionscheduler_logs
    • wp_actionscheduler_claims
  • This plugin does not fully uninstall, leaving 9 options in the database
    • schema-ActionScheduler_LoggerSchema
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • action_scheduler_hybrid_store_demarkation
    • theysaidso_admin_options
    • can_compress_scripts
    • schema-ActionScheduler_StoreSchema
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not 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
  • 262× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_SimpleSchedule' not found in wp-content/plugins/cardanopress-governance/dependencies/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_CanceledSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'CardanoPress\\Dependencies\\GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/cardanopress-governance/dependencies/vendor/cardanopress/framework/dependencies/GuzzleHttp/Exception/InvalidArgumentException.php:5
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/cardanopress-governance/dependencies/vendor/automattic/jetpack-autoloader/src/jetpack-autoloader/class-autoloader.php' (include_path='.:/usr/share/php') in wp-content/plugins/cardanopress-governance/dependencies/vendor/automattic/jetpack-autoloader/src/autoload.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'CardanoPress\\Dependencies\\ThemePlate\\Meta\\BaseMeta' not found in wp-content/plugins/cardanopress-governance/dependencies/vendor/cardanopress/framework/dependencies/ThemePlate/Meta/PostMeta.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'CardanoPress\\Dependencies\\GuzzleHttp\\BodySummarizerInterface' not found in wp-content/plugins/cardanopress-governance/dependencies/vendor/cardanopress/framework/dependencies/GuzzleHttp/BodySummarizer.php:7
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/cardanopress-governance/dependencies/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php on line 4
    • > PHP Fatal error
      Uncaught Error: Interface 'CardanoPress\\Dependencies\\Psr\\Http\\Message\\UriInterface' not found in wp-content/plugins/cardanopress-governance/dependencies/vendor/cardanopress/framework/dependencies/GuzzleHttp/Psr7/Uri.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'CardanoPress\\Dependencies\\Monolog\\Handler\\FingersCrossed\\ActivationStrategyInterface' not found in wp-content/plugins/cardanopress-governance/dependencies/vendor/cardanopress/framework/dependencies/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Action' not found in wp-content/plugins/cardanopress-governance/dependencies/vendor/woocommerce/action-scheduler/classes/actions/ActionScheduler_NullAction.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'CardanoPress\\Dependencies\\GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/cardanopress-governance/dependencies/vendor/cardanopress/framework/dependencies/GuzzleHttp/Promise/FulfilledPromise.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were 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
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Governance configuration screen), #2 (FT & NFT policy ID configuration), #3 (Voting interface example)
The official readme.txt is a good inspiration

cardanopress-governance/cardanopress-governance.php Passed 13 tests

"CardanoPress - Governance for Cardano" version 1.2.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
39 characters long description:
A CardanoPress extension for governance

Code Analysis Passed 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 plugin40,725 lines of code in 520 files:
LanguageFilesBlank linesComment linesLines of code
PHP4859,41420,72035,441
YAML141902,927
JavaScript1626018975
CSS612115624
Markdown62060483
JSON400267
XML2008

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity10.46
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces49
Interfaces54
Traits18
Classes389
▷ Abstract classes4110.54%
▷ Concrete classes34889.46%
▷ Final classes3810.92%
Methods2,815
▷ Static methods30810.94%
▷ Public methods2,10474.74%
▷ Protected methods44515.81%
▷ Private methods2669.45%
Functions189
▷ Named functions5227.51%
▷ Anonymous functions13772.49%
Constants198
▷ Global constants10.51%
▷ Class constants19799.49%
▷ Public constants15980.71%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin