78% spreebie-barter

Code Review | Spreebie Barter - Ethereum Payments and Donations

WordPress plugin Spreebie Barter - Ethereum Payments and Donations scored78%from 54 tests.

About plugin

  • Plugin page: spreebie-barter
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.9
  • WordPress version: 6.3.1
  • First release: May 1, 2018
  • Latest release: May 2, 2018
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: Thabo David Klass (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /770 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▲0.08ms] Passed 4 tests

Analyzing server-side resources used by Spreebie Barter - Ethereum Payments and Donations
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2845.89 ▼0.06
Dashboard /wp-admin3.57 ▲0.2251.99 ▼4.37
Posts /wp-admin/edit.php3.68 ▲0.3349.26 ▲2.21
Add New Post /wp-admin/post-new.php6.17 ▲0.2893.38 ▲2.55
Media Library /wp-admin/upload.php3.49 ▲0.2641.63 ▲3.14
SB Payments and Donations Categories /wp-admin/edit-tags.php?taxonomy=sb_p_and_d_category&post_type=sb_p_and_d3.5040.90
SB Payments and Donations Error Stages /wp-admin/edit-tags.php?taxonomy=spreebie_barter_error_stage&post_type=sb_p_and_d3.5042.36
View SB Payments and Donations /wp-admin/edit.php?post_type=sb_p_and_d3.5441.78

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 25 new files
Database: no new tables, 11 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
spreebie_barter_error_stage_children
sb_p_and_d_category_children
widget_spreebie_barter
spreebie_barter_widget_text
can_compress_scripts
spreebie_barter_ethereum_address
...

Browser metrics Passed 4 tests

Checking browser requirements for Spreebie Barter - Ethereum Payments and Donations
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,970 ▲22414.68 ▲0.407.91 ▲5.5942.49 ▼10.94
Dashboard /wp-admin2,265 ▲856.52 ▲0.91125.60 ▲35.6241.71 ▲3.47
Posts /wp-admin/edit.php2,173 ▲733.62 ▲1.6351.62 ▲15.3432.26 ▼4.35
Add New Post /wp-admin/post-new.php1,422 ▼10418.15 ▼5.45576.39 ▼98.0230.11 ▼21.13
Media Library /wp-admin/upload.php1,476 ▲736.01 ▲1.84113.37 ▼0.5642.51 ▼4.23
SB Payments and Donations Categories /wp-admin/edit-tags.php?taxonomy=sb_p_and_d_category&post_type=sb_p_and_d1,5243.7360.5733.85
SB Payments and Donations Error Stages /wp-admin/edit-tags.php?taxonomy=spreebie_barter_error_stage&post_type=sb_p_and_d1,5483.0844.7733.71
View SB Payments and Donations /wp-admin/edit.php?post_type=sb_p_and_d1,1273.2251.1228.90

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_spreebie_barter
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • sb_p_and_d_category_children

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/spreebie-barter/spreebie-barter.php:24

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=sb_p_and_d
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Web3 is not defined" "ReferenceError: Web3 is not defined\n at loadWeb3 (/wp-content/plugins/spreebie-barter/js/spreebie-barter-admin-ajax.js:330:13)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/spreebie-barter/js/spreebie-barter-admin-ajax.js:343:5)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=sb_p_and_d
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/spreebie-barter/js/radiotax.js:5:90)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=sb_p_and_d
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught ReferenceError: Web3 is not defined
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=sb_p_and_d
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
5 plugin tags: crypto, ethereum, donations, payments, metamask

spreebie-barter/spreebie-barter.php 92% from 13 tests

The entry point to "Spreebie Barter - Ethereum Payments and Donations" version 1.0.1 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 423 characters long)

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
There were no executable files found in this plugin3,933 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript76291,0802,225
PHP42734581,069
CSS311379639

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity28.67
▷ Minimum class complexity21.00
▷ Maximum class complexity40.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods37
▷ Static methods12.70%
▷ Public methods37100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 1.52MB with 1.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png302.96KB87.06KB▼ 71.26%
screenshot-4.png301.65KB85.00KB▼ 71.82%
screenshot-5.png324.45KB93.88KB▼ 71.07%
screenshot-3.png340.18KB100.32KB▼ 70.51%
screenshot-1.png286.25KB80.40KB▼ 71.91%