83% mycred-credly

Code Review | myCred Credly

WordPress plugin myCred Credly scored83%from 54 tests.

About plugin

  • Plugin page: mycred-credly
  • Plugin version: 1.2.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: WP 4.8-6.2.2
  • WordPress version: 6.3.1
  • First release: Jun 11, 2020
  • Latest release: May 24, 2023
  • Number of updates: 15
  • Update frequency: every 79.9 days
  • Top authors: wpexpertsio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,877 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
This plugin's installer ran successfully

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

Server-side resources used by myCred Credly
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.32 ▲1.01
Dashboard /wp-admin3.33 ▼0.0243.23 ▼19.16
Posts /wp-admin/edit.php3.38 ▲0.0253.92 ▲6.60
Add New Post /wp-admin/post-new.php5.91 ▲0.0287.47 ▼7.73
Media Library /wp-admin/upload.php3.25 ▲0.0235.47 ▲2.85

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for myCred Credly
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.23 ▼1.176.09 ▲4.4142.68 ▼6.45
Dashboard /wp-admin2,206 ▲215.86 ▼0.0596.96 ▼19.7339.71 ▼7.57
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0639.71 ▲3.9235.34 ▼1.84
Add New Post /wp-admin/post-new.php1,533 ▲1423.03 ▼0.24642.89 ▼39.7951.49 ▼5.95
Media Library /wp-admin/upload.php1,388 ▲34.20 ▲0.0293.83 ▼15.6840.07 ▼8.85

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/mycred-credly/mycred-credly.php:100

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Add an image for screenshot #6 (**Earned Badge** - Earned Badge will automatically sent to Credly.)
The official readme.txt might help

mycred-credly/mycred-credly.php 77% from 13 tests

The main PHP script in "myCred Credly" version 1.2.1 is automatically included on every request by WordPress
The following require your attention:
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 187 characters long)
  • Requires at least: Required version number formatted incorrectly (ex. "7.0" instead of "WP 4.8")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin1,129 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP4227128805
JavaScript13914226
CSS1201198

PHP code Passed 2 tests

A short review 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.35
Average class complexity34.33
▷ Minimum class complexity9.00
▷ Maximum class complexity81.00
Average method complexity3.56
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods39
▷ Static methods12.56%
▷ Public methods3692.31%
▷ Protected methods00.00%
▷ Private methods37.69%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/default-badge.png18.92KB7.49KB▼ 60.41%