84% buy-now-button

Code Review | Buy Now Button

WordPress plugin Buy Now Button scored84%from 54 tests.

About plugin

  • Plugin page: buy-now-button
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.6
  • WordPress version: 6.3.1
  • First release: Feb 9, 2017
  • Latest release: Feb 9, 2017
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: seosbg (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,195 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

An overview of server-side resources used by Buy Now Button
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0243.92 ▲4.89
Dashboard /wp-admin3.34 ▼0.0048.12 ▼11.96
Posts /wp-admin/edit.php3.46 ▲0.1151.49 ▲7.17
Add New Post /wp-admin/post-new.php5.92 ▲0.0493.90 ▼6.06
Media Library /wp-admin/upload.php3.25 ▲0.0235.33 ▼0.99

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Buy Now Button
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,062 ▲31615.04 ▲0.855.60 ▲3.8456.48 ▲16.62
Dashboard /wp-admin2,347 ▲1566.37 ▲0.50134.93 ▲33.6383.98 ▲46.20
Posts /wp-admin/edit.php2,268 ▲1763.47 ▲1.4355.06 ▲19.4169.90 ▲34.85
Add New Post /wp-admin/post-new.php1,536 ▲323.21 ▼0.11613.30 ▼77.5337.03 ▼17.14
Media Library /wp-admin/upload.php1,410 ▲254.15 ▼0.0281.65 ▼26.0472.88 ▲26.87

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/buy-now-button/buy-now-button.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 17 tag instead of maximum 10
  • Screenshots: Screenshot #1 (Admin Panel view of submitted form data.) image required
The official readme.txt is a good inspiration

buy-now-button/buy-now-button.php Passed 13 tests

The primary PHP file in "Buy Now Button" version 1.0 is used by WordPress to initiate all plugin functionality
39 characters long description:
Simple WordPress Buy Now Button Plugin.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin203 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
CSS2277131
PHP1453072

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/remove.png1.80KB1.48KB▼ 17.60%
images/find-img.png28.58KB10.85KB▼ 62.03%
images/icon.png1.58KB1.43KB▼ 9.69%
images/logo.png11.25KB4.39KB▼ 60.99%
screenshot-1.png8.29KB4.42KB▼ 46.73%