83% business-badges

Code Review | Business Badges

WordPress plugin Business Badges scored83%from 54 tests.

About plugin

  • Plugin page: business-badges
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.2
  • WordPress version: 6.3.1
  • First release: Sep 1, 2015
  • Latest release: Nov 3, 2015
  • Number of updates: 18
  • Update frequency: every 3.5 days
  • Top authors: qualisure (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,139 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.59ms] Passed 4 tests

An overview of server-side resources used by Business Badges
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.12 ▼5.85
Dashboard /wp-admin3.31 ▲0.0152.31 ▼3.24
Posts /wp-admin/edit.php3.36 ▲0.0050.83 ▼0.98
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.74 ▼0.27
Media Library /wp-admin/upload.php3.23 ▲0.0042.04 ▲4.08

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Business Badges
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲9314.09 ▼0.3041.16 ▲39.0646.05 ▼5.15
Dashboard /wp-admin2,203 ▲155.79 ▲0.9097.28 ▼19.0939.11 ▼3.80
Posts /wp-admin/edit.php2,089 ▼31.99 ▲0.0336.45 ▼0.0933.96 ▲1.97
Add New Post /wp-admin/post-new.php1,533 ▼123.30 ▲0.18676.57 ▼37.8058.86 ▼0.05
Media Library /wp-admin/upload.php1,391 ▼04.12 ▼0.09109.11 ▲2.1047.45 ▲0.02

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/business-badges/business-badges.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% 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
These attributes need your attention:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
  • Screenshots: Add a description for screenshot #3 in business-badges/assets to your readme.txt
The official readme.txt might help

business-badges/business-badges.php 92% from 13 tests

The primary PHP file in "Business Badges" version 1.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 173 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected290 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP513599287
CSS1003

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity1.75
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.23
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods13
▷ Static methods861.54%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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.21MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png12.45KB6.18KB▼ 50.41%
assets/banner-772x250.png48.59KB17.87KB▼ 63.22%
assets/screenshot-3.png25.79KB9.71KB▼ 62.36%
assets/banner-1544x500.png92.95KB37.25KB▼ 59.92%
assets/screenshot-1.png34.90KB13.55KB▼ 61.18%