10% block-ads-to-bitcoin

Code Review | Block Ads to Bitcoin

WordPress plugin Block Ads to Bitcoin scored10%from 54 tests.

About plugin

  • Plugin page: block-ads-to-bitcoin
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.4
  • WordPress version: 6.3.1
  • First release: Jan 1, 2016
  • Latest release: Jan 2, 2016
  • Number of updates: 9
  • Update frequency: every 0.3 days
  • Top authors: owocki (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,761 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/block-ads-to-bitcoin/settings.php+223
    Undefined index: a2b_wpnonce

Server metrics [RAM: ▲0.03MB] [CPU: ▼8.58ms] Passed 4 tests

Analyzing server-side resources used by Block Ads to Bitcoin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.45 ▼0.0125.51 ▼17.90
Dashboard /wp-admin3.36 ▲0.0548.94 ▼0.71
Posts /wp-admin/edit.php3.47 ▲0.1146.91 ▼4.87
Add New Post /wp-admin/post-new.php5.94 ▲0.0586.92 ▼10.83
Media Library /wp-admin/upload.php3.28 ▲0.0539.47 ▲2.41
Block Ads to Bitcoin /wp-admin/options-general.php?page=a2b-setting-admin3.2233.77

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Block Ads to Bitcoin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,022 ▲26114.64 ▲0.4620.58 ▲18.9544.16 ▲3.33
Dashboard /wp-admin2,228 ▲224.85 ▼1.05105.38 ▲3.2837.03 ▼6.93
Posts /wp-admin/edit.php2,101 ▼22.00 ▼0.0135.89 ▼4.9534.48 ▼0.54
Add New Post /wp-admin/post-new.php1,548 ▲1722.74 ▼0.48662.39 ▲9.3055.48 ▼5.91
Media Library /wp-admin/upload.php1,404 ▲44.24 ▲0.00106.02 ▼7.0144.81 ▼3.27
Block Ads to Bitcoin /wp-admin/options-general.php?page=a2b-setting-admin8472.0522.2029.98

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=a2b-setting-admin
    • > Notice in wp-content/plugins/block-ads-to-bitcoin/helpers.php+15
    Trying to access array offset on value of type bool

SRP 50% 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× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/block-ads-to-bitcoin/adblock-to-bitcoin.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/block-ads-to-bitcoin/settings.php:219

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Please a description for screenshot #4 in block-ads-to-bitcoin/assets to your readme.txt
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === block-ads-to-bitcoin === )
You can take inspiration from this readme.txt

block-ads-to-bitcoin/adblock-to-bitcoin.php 85% from 13 tests

The primary PHP file in "Block Ads to Bitcoin" version 0.2 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 161 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("block-ads-to-bitcoin.php" instead of "adblock-to-bitcoin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected10,264 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript61,8581,9557,617
CSS214171,415
SVG100655
PHP36354295
HTML1387220
JSON17035
Markdown114027

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 2.53MB with 1.89MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png1,204.63KB312.95KB▼ 74.02%
screenshot-1.png331.28KB74.38KB▼ 77.55%
screenshot-4.png171.03KB49.37KB▼ 71.13%
screenshot-2.png884.31KB212.47KB▼ 75.97%