83% forum-badges

Code Review | Forum Badges

WordPress plugin Forum Badges scored83%from 54 tests.

About plugin

  • Plugin page: forum-badges
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.1-4.6.1
  • WordPress version: 6.3.1
  • First release: Nov 2, 2016
  • Latest release: Nov 3, 2016
  • Number of updates: 15
  • Update frequency: every 0.1 days
  • Top authors: Botzev (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /755 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by Forum Badges
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.40 ▼6.06
Dashboard /wp-admin3.32 ▲0.0247.74 ▼4.55
Posts /wp-admin/edit.php3.38 ▲0.0247.23 ▲2.58
Add New Post /wp-admin/post-new.php5.90 ▲0.0283.56 ▼8.46
Media Library /wp-admin/upload.php3.25 ▲0.0240.43 ▲3.14

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Forum Badges
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5613.18 ▼1.191.85 ▼0.0545.57 ▲2.41
Dashboard /wp-admin2,209 ▲185.79 ▲0.76102.95 ▼1.0842.10 ▼1.78
Posts /wp-admin/edit.php2,086 ▼31.99 ▼0.0438.39 ▼1.2634.55 ▲0.04
Add New Post /wp-admin/post-new.php1,533 ▲1623.35 ▲5.75677.49 ▲59.5854.69 ▼4.82
Media Library /wp-admin/upload.php1,388 ▲34.23 ▲0.09107.23 ▼3.6447.29 ▲3.20

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means 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
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/forum-badges/badges.php:17

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 errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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:
  • Screenshots: Screenshot #1 (You can use the shortcode multiple times to display all the badges that you want/need.) image required
Please take inspiration from this readme.txt

forum-badges/badges.php 85% from 13 tests

"Forum Badges" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("forum-badges.php" instead of "badges.php")
  • 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 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected337 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
CSS1270196
PHP1212141

PHP code Passed 2 tests

A short review of 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.22
Average class complexity24.00
▷ Minimum class complexity24.00
▷ Maximum class complexity24.00
Average method complexity8.67
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 PNG file occupies 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png68.10KB30.58KB▼ 55.10%