78% simple-badges

Code Review | Simple Badges

WordPress plugin Simple Badges scored 78% from 54 tests.

About plugin

  • Plugin page: simple-badges
  • Plugin version: 0.1-alpha20120703...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.4
  • WordPress version: 5.9.2
  • First release: Jul 3, 2012
  • Latest release: Jul 3, 2012
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: ryanimel (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active / 3,791 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
Installer ran successfully

Server metrics [RAM: ▼1.14MB] [CPU: ▼317.01ms] Passed 4 tests

Analyzing server-side resources used by Simple Badges
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1360.16 ▲4.71
Dashboard /wp-admin3.19 ▼0.2218.39 ▼29.50
Posts /wp-admin/edit.php3.19 ▼0.4550.76 ▲12.55
Add New Post /wp-admin/post-new.php3.19 ▼3.7818.54 ▼1,235.42
Media Library /wp-admin/upload.php3.19 ▼0.1117.43 ▼7.83
Badges /wp-admin/edit.php?post_type=simplebadges_badge3.1935.26

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Simple Badges: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,800 ▲4616.29 ▲0.766.12 ▲0.152.91 ▼0.11
Dashboard /wp-admin2,897 ▲366.14 ▼0.08117.88 ▼26.61244.87 ▲78.10
Posts /wp-admin/edit.php2,693 ▲53.24 ▼0.0067.24 ▲1.64145.66 ▼14.45
Add New Post /wp-admin/post-new.php1,669 ▼5020.51 ▼1.79425.15 ▼11.79199.40 ▲39.93
Media Library /wp-admin/upload.php1,700 ▲25.47 ▼0.04148.69 ▲5.38195.37 ▲5.22
Badges /wp-admin/edit.php?post_type=simplebadges_badge1,3952.9261.98119.77

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
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/simple-badges/simple-badges.php+163
    Undefined property: SimpleBadges::$metabox_fields

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=simplebadges_badge
    • > Notice in wp-content/plugins/simple-badges/simple-badges.php+163
    Undefined property: SimpleBadges::$metabox_fields
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=simplebadges_badge
    • > Notice in wp-content/plugins/simple-badges/simple-badges.php+163
    Trying to access array offset on value of type null

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 take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/simple-badges/simple-badges.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: awards, gamification, badges, achievements

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

"Simple Badges" version 0.1-alpha20120703...'s primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Version: Use only periods and digits for the version number (ex. "1.0.3" instead of "0.1-alpha20120703...")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected362 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1147101270
PO File1273069
JavaScript18723

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity45.00
▷ Minimum class complexity45.00
▷ Maximum class complexity45.00
Average method complexity5.40
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods110.00%
▷ Public methods990.00%
▷ Protected methods00.00%
▷ Private methods110.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected