72% mycred

Code Review | myCred - Points, Rewards, Gamification, Ranks, Badges & Loyalty Plugin

WordPress plugin myCred - Points, Rewards, Gamification, Ranks, Badges & Loyalty Plugin scored72%from 54 tests.

About plugin

  • Plugin page: mycred
  • Plugin version: 2.6.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: WP 4.8-6.4.1
  • WordPress version: 6.3.1
  • First release: Apr 22, 2013
  • Latest release: Nov 10, 2023
  • Number of updates: 1,337
  • Update frequency: every 2.9 days
  • Top authors: designbymerovingi (78.46%)wpexpertsio (21.62%)

Code review

54 tests

User reviews

441 reviews

Install metrics

10,000+ active /1,018,955 total downloads

Benchmarks

Plugin footprint 64% 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: ▲14.80MB] [CPU: ▲108.20ms] 50% from 4 tests

This is a short check of server-side resources used by myCred - Points, Rewards, Gamification, Ranks, Badges & Loyalty Plugin
Please take the time to fix the following items
  • RAM: The total memory usage must be kept under 10MB (currently 18.04MB on /wp-admin/admin.php?page=mycred-addons)
  • Extra RAM: Extra memory usage should kept under 5MB (currently 14.80MB on /wp-admin/admin.php?page=mycred-addons)
PageMemory (MB)CPU Time (ms)
Home /18.12 ▲14.66140.18 ▲98.19
Dashboard /wp-admin18.18 ▲14.88167.40 ▲118.99
Posts /wp-admin/edit.php18.23 ▲14.87164.98 ▲117.36
Add New Post /wp-admin/post-new.php20.87 ▲14.98198.27 ▲98.27
Media Library /wp-admin/upload.php18.03 ▲14.80162.82 ▲128.99
Email Notifications /wp-admin/edit.php?post_type=mycred_email_notice18.17137.44
Treasures /wp-admin/admin.php?page=mycred-treasures18.03131.77
Coupons /wp-admin/edit.php?post_type=mycred_coupon18.17136.10
Tools /wp-admin/admin.php?page=mycred-tools18.03130.94
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius18.30132.77
License /wp-admin/admin.php?page=mycred-membership18.03131.12
buyCred Gateways /wp-admin/admin.php?page=mycred-gateways18.09132.45
Achievement Types /wp-admin/edit-tags.php?post_type=mycred_badge&taxonomy=mycred_badge_category18.05155.92
cashCred Withdrawal /wp-admin/edit.php?post_type=cashcred_withdrawal18.17137.06
Add-ons /wp-admin/admin.php?page=mycred-addons18.04134.04

Server storage [IO: ▲13.88MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 681 new files
Database: 1 new table, 21 new options
New tables
wp_myCRED_log
New WordPress options
widget_mycred_widget_balance
db_upgraded
widget_mycred_widget_transfer
fs_accounts
mycred_setup_completed
fs_active_plugins
mycred-stats-12cbf76b56e06071a3df21700f0a365b
mycred_pref_hooks
theysaidso_admin_options
widget_recent-comments
...

Browser metrics Passed 4 tests

Checking browser requirements for myCred - Points, Rewards, Gamification, Ranks, Badges & Loyalty Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,322 ▲57515.58 ▲1.236.20 ▲4.5526.60 ▼16.78
Dashboard /wp-admin2,593 ▲4186.58 ▲0.89129.61 ▲20.0046.33 ▲7.51
Posts /wp-admin/edit.php2,404 ▲3013.67 ▲1.6549.70 ▲11.1235.25 ▼0.96
Add New Post /wp-admin/post-new.php1,846 ▲32022.72 ▼0.78645.86 ▼42.4736.71 ▼15.51
Media Library /wp-admin/upload.php1,583 ▲1834.47 ▲0.2889.68 ▼10.5943.61 ▼0.38
Email Notifications /wp-admin/edit.php?post_type=mycred_email_notice1,3623.8653.9453.67
Treasures /wp-admin/admin.php?page=mycred-treasures1,2693.4142.9480.03
Coupons /wp-admin/edit.php?post_type=mycred_coupon1,3763.7351.4833.68
Tools /wp-admin/admin.php?page=mycred-tools1,7343.7370.8451.86
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,3693.3048.2531.06
License /wp-admin/admin.php?page=mycred-membership1,1323.3842.4836.79
buyCred Gateways /wp-admin/admin.php?page=mycred-gateways2,8777.24145.4144.47
Achievement Types /wp-admin/edit-tags.php?post_type=mycred_badge&taxonomy=mycred_badge_category1,5753.5453.6641.47
cashCred Withdrawal /wp-admin/edit.php?post_type=cashcred_withdrawal1,4983.8355.8237.13
Add-ons /wp-admin/admin.php?page=mycred-addons1,4143.5355.2765.59

Uninstaller [IO: ▲0.01MB] [DB: ▲0.02MB] 50% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_myCRED_log
  • The uninstall procedure has failed, leaving 17 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • mycred_pref_hooks
    • mycred_pref_addons
    • theysaidso_admin_options
    • mycred_setup_completed
    • can_compress_scripts
    • mycred_version
    • fs_active_plugins
    • mycred_key
    • ...

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/mycred/addons/buy-creds/templates/buycred-checkout.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'myCRED_Tools' not found in wp-content/plugins/mycred/includes/mycred-tools-bulk-assign.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mycred/includes/mycred-open-badge-settings.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'myCRED_Setup_Import_Export' not found in wp-content/plugins/mycred/includes/mycred-tools-import-export.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mycred/includes/mycred-uninstall.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/mycred/mycred.php:169

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add descriptions for these screenshots #7, #8 in mycred/assets to your readme.txt
The official readme.txt might help

mycred/mycred.php 92% from 13 tests

The primary PHP file in "myCred - Points, Rewards, Gamification, Ranks, Badges & Loyalty Plugin" version 2.6.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Requires at least: Required version number formatted incorrectly (ex. "7.0" instead of "WP 4.8")

Code Analysis 95% from 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
There were no executable files found in this plugin144,527 lines of code in 449 files:
LanguageFilesBlank linesComment linesLines of code
PHP31927,66630,96083,105
PO File1115,15824,20136,054
JavaScript791,52068221,453
CSS37543953,665
Markdown1680214
SVG25036

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 133)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity53.78
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.85
▷ Minimum method complexity1.00
▷ Maximum method complexity133.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes206
▷ Abstract classes94.37%
▷ Concrete classes19795.63%
▷ Final classes31.52%
Methods2,856
▷ Static methods2167.56%
▷ Public methods2,41284.45%
▷ Protected methods592.07%
▷ Private methods38513.48%
Functions553
▷ Named functions55199.64%
▷ Anonymous functions20.36%
Constants258
▷ Global constants21081.40%
▷ Class constants4818.60%
▷ Public constants48100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
57 PNG files occupy 2.22MB with 0.88MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/mycred-icon.png19.38KB9.35KB▼ 51.76%
assets/images/transfer-addon.png34.77KB15.78KB▼ 54.61%
assets/images/default-point-type.png13.41KB5.78KB▼ 56.86%
assets/images/about/badges.png3.99KB2.58KB▼ 35.40%
assets/images/cred-icon16.png0.52KB0.55KB0.00%