89% niftybuybutton

Code Review | NiftyBuyButton

WordPress plugin NiftyBuyButton scored89%from 54 tests.

About plugin

  • Plugin page: niftybuybutton
  • Plugin version: 3.5.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.6
  • WordPress version: 6.3.1
  • First release: Aug 1, 2016
  • Latest release: Dec 31, 2020
  • Number of updates: 18
  • Update frequency: every 89.9 days
  • Top authors: nick@mauinick.com (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /711 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼1.36ms] Passed 4 tests

Analyzing server-side resources used by NiftyBuyButton
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.79 ▼1.26
Dashboard /wp-admin3.33 ▲0.0250.89 ▼3.16
Posts /wp-admin/edit.php3.38 ▲0.0251.79 ▲1.65
Add New Post /wp-admin/post-new.php5.92 ▲0.0392.63 ▼2.67
Media Library /wp-admin/upload.php3.25 ▲0.0244.61 ▲9.44
Generate Shortcode /wp-admin/admin.php?page=nifty-buy-button-sg3.2133.94
Settings /wp-admin/admin.php?page=nifty-buy-button3.2129.91

Server storage [IO: ▲0.12MB] [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: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by NiftyBuyButton
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.68 ▼1.011.90 ▲0.1140.26 ▼3.97
Dashboard /wp-admin2,233 ▲455.00 ▲0.11140.99 ▲17.8341.72 ▼1.98
Posts /wp-admin/edit.php2,116 ▲272.24 ▲0.2338.75 ▼3.0434.81 ▼1.22
Add New Post /wp-admin/post-new.php1,539 ▲1023.21 ▲4.76632.32 ▼39.9959.52 ▲0.02
Media Library /wp-admin/upload.php1,412 ▲244.32 ▲0.11102.01 ▲2.7346.52 ▲2.52
Generate Shortcode /wp-admin/admin.php?page=nifty-buy-button-sg7921.7922.8122.96
Settings /wp-admin/admin.php?page=nifty-buy-button8331.8725.1926.01

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

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 90% 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
2 plugin tags: niftycart, niftybuybutton

niftybuybutton/nifty-buy-button.php 77% from 13 tests

This is the main PHP file of "NiftyBuyButton" version 3.5.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("niftybuybutton.php" instead of "nifty-buy-button.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 235 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
There were no executable files found in this plugin1,120 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
CSS212919701
PHP295218375
JavaScript3103144

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity12.00
▷ Minimum class complexity1.00
▷ Maximum class complexity34.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods2295.65%
▷ Protected methods00.00%
▷ Private methods14.35%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants675.00%
▷ Class constants225.00%
▷ 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
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/select2/select2x2.png0.83KB0.77KB▼ 6.15%
assets/images/nbb-logo.png1.03KB0.84KB▼ 18.16%
assets/css/select2/select2.png0.60KB0.99KB0.00%