83% mycred-badgr-achievement-badge

Code Review | myCred Badgr Integration

WordPress plugin myCred Badgr Integration scored83%from 54 tests.

About plugin

  • Plugin page: mycred-badgr-achi...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: WP 4.8-6.3.2
  • WordPress version: 6.3.1
  • First release: Sep 13, 2021
  • Latest release: Nov 7, 2023
  • Number of updates: 11
  • Update frequency: every 71.6 days
  • Top authors: wpexpertsio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,289 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.35ms] Passed 4 tests

This is a short check of server-side resources used by myCred Badgr Integration
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0248.78 ▲11.10
Dashboard /wp-admin3.32 ▼0.0247.86 ▼15.74
Posts /wp-admin/edit.php3.37 ▲0.0247.17 ▼1.99
Add New Post /wp-admin/post-new.php5.92 ▲0.0387.69 ▼14.22
Media Library /wp-admin/upload.php3.24 ▲0.0135.19 ▼1.44

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for myCred Badgr Integration
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,876 ▲12913.33 ▼0.958.71 ▲6.9743.18 ▲0.96
Dashboard /wp-admin2,200 ▲255.63 ▼0.0690.30 ▼22.5840.41 ▼5.28
Posts /wp-admin/edit.php2,105 ▲52.00 ▲0.0541.62 ▲1.7034.35 ▼4.96
Add New Post /wp-admin/post-new.php1,531 ▲223.40 ▼0.04697.29 ▼12.0065.58 ▼4.37
Media Library /wp-admin/upload.php1,402 ▲24.20 ▼0.00101.66 ▼0.2743.63 ▲0.51

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

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 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 take a closer look at the following
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_current_user_id() in wp-content/plugins/mycred-badgr-achievement-badge/includes/classes/mycred_badgr_user.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/mycred-badgr-achievement-badge/mycred-badgr.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/mycred-badgr-achievement-badge/includes/shortcodes/mycred-badgr-login.php:59
    • > PHP Fatal error
      Uncaught Error: Class 'myCRED_Module' not found in wp-content/plugins/mycred-badgr-achievement-badge/includes/badgr-settings.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: mycred, badgr, achievement, open badges, badges

mycred-badgr-achievement-badge/mycred-badgr.php 69% from 13 tests

Analyzing the main PHP file in "myCred Badgr Integration" version 1.0.2
The following require your attention:
  • Requires at least: Required version number should only contain digits separated by dots (ex. "7.0" instead of "WP 4.8")
  • Domain Path: The domain path points to an invalid folder, "/lang" does not exist
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("mycred-badgr-achievement-badge.php" instead of "mycred-badgr.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin820 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP7216322636
JavaScript2405184

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity11.80
▷ Minimum class complexity2.00
▷ Maximum class complexity29.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods39
▷ Static methods923.08%
▷ Public methods39100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
PNG images were not found in this plugin