84% woo-badge

Code Review | Woo-Badge

WordPress plugin Woo-Badge scored 84% from 54 tests.

About plugin

  • Plugin page: woo-badge
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-4.9
  • WordPress version: 6.3.1
  • First release: Jul 1, 2018
  • Latest release: Jul 2, 2018
  • Number of updates: 6
  • Update frequency: every 25.5 days
  • Top authors: Annubis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 1,688 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.01MB] [CPU: ▼4.44ms] Passed 4 tests

Server-side resources used by Woo-Badge
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.24 ▼0.74
Dashboard /wp-admin3.31 ▲0.0148.29 ▼3.16
Posts /wp-admin/edit.php3.36 ▲0.0146.13 ▼1.20
Add New Post /wp-admin/post-new.php5.89 ▲0.0184.80 ▼12.67
Media Library /wp-admin/upload.php3.24 ▲0.0135.59 ▲0.79

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Woo-Badge
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.43 ▼0.151.77 ▼0.6043.15 ▼6.44
Dashboard /wp-admin2,203 ▲154.88 ▼0.9198.66 ▼9.9538.34 ▼4.40
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0434.59 ▼1.8334.58 ▼0.68
Add New Post /wp-admin/post-new.php1,542 ▲918.45 ▼4.65652.52 ▲51.7352.73 ▲4.10
Media Library /wp-admin/upload.php1,382 ▼64.21 ▲0.0797.40 ▼1.5343.69 ▼0.47

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just 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/woo-badge/includes/add-js-css.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 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: sold out, badge, out of stock, woocommerce

woo-badge/woocommerce-badge.php 92% from 13 tests

The primary PHP file in "Woo-Badge" version 0.2 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-badge.php" instead of "woocommerce-badge.php")

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
Good job! No executable or dangerous file extensions detected40 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2191425
CSS27415

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
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%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/test.png1.52KB0.40KB▼ 73.45%