84% achievement-shortcode-for-badgeos

Code Review | Achievement Shortcode Add-On for BadgeOS

WordPress plugin Achievement Shortcode Add-On for BadgeOS scored84%from 54 tests.

About plugin

  • Plugin page: achievement-short...
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.5.9+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-5.5.3
  • WordPress version: 6.3.1
  • First release: Jun 2, 2016
  • Latest release: Nov 26, 2020
  • Number of updates: 25
  • Update frequency: every 65.5 days
  • Top authors: konnektiv (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,870 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by Achievement Shortcode Add-On for BadgeOS
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.0044.59 ▼3.68
Dashboard /wp-admin3.57 ▼0.0753.17 ▼13.12
Posts /wp-admin/edit.php3.68 ▲0.0050.51 ▼3.97
Add New Post /wp-admin/post-new.php6.15 ▲0.0091.82 ▼19.65
Media Library /wp-admin/upload.php3.49 ▲0.0039.86 ▼1.78

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Achievement Shortcode Add-On for BadgeOS
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲4914.37 ▲0.161.79 ▼0.1045.05 ▼0.76
Dashboard /wp-admin2,198 ▲215.65 ▼0.0289.69 ▼3.3138.72 ▼3.40
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0235.51 ▼1.3732.22 ▼5.82
Add New Post /wp-admin/post-new.php1,558 ▲2723.12 ▲0.15674.60 ▼1.9554.87 ▲0.51
Media Library /wp-admin/upload.php1,400 ▲34.15 ▼0.09109.59 ▼6.6446.56 ▼1.67

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • 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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/achievement-shortcode-for-badgeos/badgeos-achievement-shortcode.php:36

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: You are using too many tags: 23 tag instead of maximum 10
You can take inspiration from this readme.txt

achievement-shortcode-for-badgeos/badgeos-achievement-shortcode.php 92% from 13 tests

The main PHP script in "Achievement Shortcode Add-On for BadgeOS" version 1.1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("achievement-shortcode-for-badgeos.php" instead of "badgeos-achievement-shortcode.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin440 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript25428330
PHP12750100
JSON10010

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity18.00
▷ Minimum class complexity18.00
▷ Maximum class complexity18.00
Average method complexity3.43
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.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
No PNG files were detected