84% sensei-certificates

Code Review | Sensei LMS Certificates

WordPress plugin Sensei LMS Certificates scored84%from 54 tests.

About plugin

  • Plugin page: sensei-certificates
  • Plugin version: 2.5.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.3
  • WordPress version: 6.3.1
  • First release: Apr 27, 2020
  • Latest release: Sep 19, 2023
  • Number of updates: 30
  • Update frequency: every 41.4 days
  • Top authors: donnapep (40%)renathoc (30%)m1r0 (16.67%)alexsanford1 (16.67%)aaronfc (10%)

Code review

54 tests

User reviews

1 review

Install metrics

7,000+ active /98,939 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

An overview of server-side resources used by Sensei LMS Certificates
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.66 ▼3.99
Dashboard /wp-admin3.31 ▲0.0147.75 ▲3.37
Posts /wp-admin/edit.php3.36 ▲0.0147.75 ▲2.53
Add New Post /wp-admin/post-new.php5.89 ▲0.0182.01 ▼8.56
Media Library /wp-admin/upload.php3.23 ▲0.0132.36 ▼1.21

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 150 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Sensei LMS Certificates: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲6613.32 ▼1.434.94 ▲3.0240.79 ▲1.14
Dashboard /wp-admin2,215 ▲305.79 ▲0.7499.17 ▼7.5238.59 ▼12.20
Posts /wp-admin/edit.php2,092 ▲32.04 ▲0.0439.22 ▼1.3634.40 ▼5.05
Add New Post /wp-admin/post-new.php1,514 ▼2917.69 ▼0.59663.49 ▲33.6450.99 ▲0.51
Media Library /wp-admin/upload.php1,388 ▲64.16 ▼0.0897.39 ▼3.0140.56 ▼2.71

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
The following items require your attention
  • The uninstall procedure has failed, 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 | This is a short smoke test looking 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'tFPDF\\PDF' not found in wp-content/plugins/sensei-certificates/lib/tfpdf/tFPDF/ProtectedPDF.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'tFPDF\\PDF' not found in wp-content/plugins/sensei-certificates/lib/tfpdf/tFPDF/PDFBarcode.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: certificates, course certificate, sensei lms

sensei-certificates/woothemes-sensei-certificates.php 92% from 13 tests

The entry point to "Sensei LMS Certificates" version 2.5.1 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("sensei-certificates.php" instead of "woothemes-sensei-certificates.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin11,027 lines of code in 87 files:
LanguageFilesBlank linesComment linesLines of code
PHP781,5923,0659,494
PO File45637281,528
JavaScript3003
CSS2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity58.35
▷ Minimum class complexity1.00
▷ Maximum class complexity397.00
Average method complexity4.07
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods316
▷ Static methods4213.29%
▷ Public methods22169.94%
▷ Protected methods123.80%
▷ Private methods8326.27%
Functions36
▷ Named functions3597.22%
▷ Anonymous functions12.78%
Constants22
▷ Global constants313.64%
▷ Class constants1986.36%
▷ Public constants19100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.99MB with 0.31MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/certificate_template.png999.16KB618.38KB▼ 38.11%
assets/images/certificate.png1.61KB1.65KB0.00%
assets/images/certificate-logo.png2.41KB1.75KB▼ 27.44%
assets/images/sensei_certificate_nograde.png13.46KB5.54KB▼ 58.82%