73% hashcash

Code Review | Hashcash

WordPress plugin Hashcash scored 73% from 54 tests.

About plugin

  • Plugin page: hashcash
  • Plugin version: 1.0.14
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-4.9.1
  • WordPress version: 5.9.2
  • First release: Jul 1, 2014
  • Latest release: Jan 13, 2018
  • Number of updates: 15
  • Update frequency: every 86.1 days
  • Top authors: pkaroukin (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

40+ active / 4,497 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼1.14MB] [CPU: ▼322.38ms] Passed 4 tests

An overview of server-side resources used by Hashcash
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0354.06 ▲3.07
Dashboard /wp-admin3.18 ▼0.2218.05 ▼15.40
Posts /wp-admin/edit.php3.18 ▼0.4619.74 ▼16.42
Add New Post /wp-admin/post-new.php3.18 ▼3.7918.19 ▼1,247.82
Media Library /wp-admin/upload.php3.18 ▼0.1115.50 ▼9.86
Hashcash.IO /wp-admin/options-general.php?page=wp-hashcash3.1817.92

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 18 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Hashcash
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,904 ▲15015.22 ▼0.619.56 ▲3.142.63 ▲0.13
Dashboard /wp-admin2,897 ▲366.12 ▼0.04113.28 ▼19.04155.57 ▼7.55
Posts /wp-admin/edit.php2,696 ▲393.23 ▼0.0162.43 ▼2.18138.64 ▼0.25
Add New Post /wp-admin/post-new.php1,664 ▲316.73 ▲0.56404.71 ▼4.70155.14 ▲1.26
Media Library /wp-admin/upload.php1,703 ▲55.51 ▲0.00135.90 ▼5.83183.04 ▲1.00
Hashcash.IO /wp-admin/options-general.php?page=wp-hashcash1,1912.5657.05151.87

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
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/hashcash/admin/class-wp-hashcash-admin.php+169
    Trying to access array offset on value of type bool

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-hashcash
    • > Notice in wp-content/plugins/hashcash/admin/class-wp-hashcash-admin.php+240
    Trying to access array offset on value of type bool

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
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hashcash/includes/contactform7.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/hashcash/admin/views/admin.php:15

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=wp-hashcash
    • > Network (severe)
    https://hashcash.io/js/libs/pow/pow.client.min.js - Failed to load resource: net::ERR_CERT_DATE_INVALID

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Submit button disabled. User need to unlock it before proceeding.), #2 (Widget updates both visually and via WAI-ARIA to inform user about progress.), #3 (Submit button unlocked.), #4 (If user tries to click on submit button before unlocking, information popup will show up.)
The official readme.txt is a good inspiration

hashcash/hashcash.php Passed 13 tests

The main file in "Hashcash" v. 1.0.14 serves as a complement to information provided in readme.txt and as the entry point to the plugin
23 characters long description:
Hashcash.IO Integration

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin766 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP5177244506
Bourne Shell12831105
JavaScript317782
CSS319173

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity20.00
▷ Minimum class complexity14.00
▷ Maximum class complexity26.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods26
▷ Static methods27.69%
▷ Public methods2388.46%
▷ Protected methods00.00%
▷ Private methods311.54%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png15.64KB7.15KB▼ 54.29%
screenshot-1.png15.31KB6.49KB▼ 57.61%
screenshot-4.png16.67KB7.05KB▼ 57.72%
screenshot-2.png15.38KB6.60KB▼ 57.10%