83% button-block

Code Review | Button Block - Get fully customizable & multi-functional buttons

WordPress plugin Button Block - Get fully customizable & multi-functional buttons scored83%from 54 tests.

About plugin

  • Plugin page: button-block
  • Plugin version: 1.0.8
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 8, 2022
  • Latest release: Oct 3, 2023
  • Number of updates: 26
  • Update frequency: every 18.5 days
  • Top authors: charlescormier (88.46%)abuhayat (15.38%)

Code review

54 tests

User reviews

4 reviews

Install metrics

2,000+ active /14,299 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.14MB] [CPU: ▼1.92ms] Passed 4 tests

Analyzing server-side resources used by Button Block - Get fully customizable & multi-functional buttons
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1440.55 ▼6.11
Dashboard /wp-admin3.49 ▲0.1157.08 ▼11.17
Posts /wp-admin/edit.php3.61 ▲0.2155.04 ▲5.76
Add New Post /wp-admin/post-new.php6.11 ▲0.1896.46 ▲3.83
Media Library /wp-admin/upload.php3.42 ▲0.1546.26 ▲9.06
Button Block /wp-admin/admin.php?page=button-block3.3742.38

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 41 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
btn_free-redirect
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Button Block - Get fully customizable & multi-functional buttons
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /1,528 ▼1,22211.94 ▼2.271.53 ▼0.3132.15 ▼11.21
Dashboard /wp-admin2,192 ▲215.51 ▼0.0890.38 ▼13.0042.17 ▼0.71
Posts /wp-admin/edit.php2,103 ▲31.96 ▲0.0141.80 ▲4.4435.50 ▼2.25
Add New Post /wp-admin/post-new.php6,397 ▲4,86130.11 ▲6.99953.32 ▲265.7642.23 ▼29.11
Media Library /wp-admin/upload.php1,403 ▲64.26 ▲0.0797.97 ▼17.2542.72 ▼7.12
Button Block /wp-admin/admin.php?page=button-block7982.2853.0828.93

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • btn_free-redirect
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'BSDK' not found in wp-content/plugins/button-block/bplugins_sdk/inc/Base/Activate.php:3
    • > PHP Warning
      Use of undefined constant BTN_VERSION - assumed 'BTN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/button-block/dist/editor.asset.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/button-block/inc/block.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Requires at least: Version not formatted correctly
  • Screenshots: No descriptions were found for these screenshots #10, #3, #4, #5, #6, #7, #8, #9 in button-block/assets to your readme.txt
You can take inspiration from this readme.txt

button-block/index.php 92% from 13 tests

The main file in "Button Block - Get fully customizable & multi-functional buttons" v. 1.0.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("button-block.php" instead of "index.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
There were no executable files found in this plugin969 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP1010037446
PO File2135270301
JSON400209
JavaScript40278
CSS5075

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity7.17
▷ Minimum class complexity3.00
▷ Maximum class complexity16.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods35
▷ Static methods38.57%
▷ Public methods3394.29%
▷ Protected methods00.00%
▷ Private methods25.71%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants9
▷ Global constants9100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
bplugins_sdk/dist/assets/images/shield_success.png3.47KB3.61KB0.00%