78% crypto

Code Review | Crypto

WordPress plugin Crypto scored78%from 54 tests.

About plugin

  • Plugin page: crypto
  • Plugin version: 2.10
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 11, 2022
  • Latest release: Jul 4, 2023
  • Number of updates: 27
  • Update frequency: every 18.9 days
  • Top authors: odude (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /10,883 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.97MB] [CPU: ▲1.30ms] Passed 4 tests

Server-side resources used by Crypto
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.38 ▲0.9257.17 ▲15.99
Dashboard /wp-admin4.31 ▲0.9652.51 ▼11.77
Posts /wp-admin/edit.php4.36 ▲1.0049.90 ▼2.67
Add New Post /wp-admin/post-new.php6.94 ▲1.05105.52 ▲20.64
Media Library /wp-admin/upload.php4.23 ▲1.0041.45 ▲3.65
Settings /wp-admin/admin.php?page=crypto_settings4.1639.24
Dashboard /wp-admin/admin.php?page=crypto4.1737.01

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 118 new files
Database: no new tables, 16 new options
New WordPress options
crypto_marketplace_settings
theysaidso_admin_options
crypto_login_metamask
crypto_general_settings
crypto_price_settings
db_upgraded
widget_recent-comments
can_compress_scripts
crypto_access_other
crypto_access_settings_start
...

Browser metrics Passed 4 tests

An overview of browser requirements for Crypto
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,991 ▲24518.83 ▲4.21134.14 ▲132.3537.84 ▼4.86
Dashboard /wp-admin2,264 ▲765.84 ▲0.9899.82 ▼14.3138.55 ▼5.43
Posts /wp-admin/edit.php2,147 ▲582.03 ▲0.0336.79 ▼0.5036.84 ▲5.54
Add New Post /wp-admin/post-new.php6,267 ▲4,74818.93 ▼4.41907.75 ▲265.3537.84 ▼11.86
Media Library /wp-admin/upload.php1,446 ▲584.26 ▲0.09100.16 ▲5.0941.35 ▼3.17
Settings /wp-admin/admin.php?page=crypto_settings8482.0726.5726.52
Dashboard /wp-admin/admin.php?page=crypto8712.0323.6845.17

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 16 options
    • crypto_general_settings
    • crypto_access_other
    • widget_cryptologin_widget
    • crypto_access_settings_start
    • theysaidso_admin_options
    • widget_recent-comments
    • crypto_price_settings
    • widget_recent-posts
    • crypto_login_metamask
    • widget_theysaidso_widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/crypto/admin/partials/crypto-admin-display.php
    • > /wp-content/plugins/crypto/public/partials/crypto-public-display.php
  • 17× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/crypto/admin/partials/settings.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/crypto/includes/class-crypto-domain-url.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function crypto_get_option() in wp-content/plugins/crypto/includes/class-crypto-price.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function crypto_get_option() in wp-content/plugins/crypto/includes/class-crypto-block.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/crypto/includes/class-crypto-add-token.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/crypto/includes/dashboard/class-crypto-dashboard-intro.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/crypto/includes/class-crypto-json.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/crypto/includes/class-crypto_connect_ajax_register.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/crypto/includes/class-crypto-domain-search.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/crypto/includes/class-crypto-domain-info.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

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
Attributes that need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #4, #5 in crypto/assets to your readme.txt
The official readme.txt is a good inspiration

crypto/crypto.php Passed 13 tests

The entry point to "Crypto" version 2.10 is a PHP file that has certain tags in its header comment area
28 characters long description:
Crypto - everyday use tools.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin35,527 lines of code in 85 files:
LanguageFilesBlank linesComment linesLines of code
JSON110028,495
PHP351,0651,0704,904
JavaScript193439891,935
Sass88076
SVG10160
CSS11128657

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity13.83
▷ Minimum class complexity1.00
▷ Maximum class complexity79.00
Average method complexity2.70
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes23
▷ Abstract classes00.00%
▷ Concrete classes23100.00%
▷ Final classes00.00%
Methods174
▷ Static methods21.15%
▷ Public methods16293.10%
▷ Protected methods00.00%
▷ Private methods126.90%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.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
5 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/yak.png10.67KB4.29KB▼ 59.77%
public/img/warning.png0.47KB0.45KB▼ 4.14%
public/img/success.png0.69KB0.65KB▼ 5.54%
public/img/notice.png0.46KB0.48KB0.00%
public/img/error.png0.70KB0.74KB0.00%