84% academy-certificates

Code Review | Academy Certificates - Certificate Builder for Academy LMS

WordPress plugin Academy Certificates - Certificate Builder for Academy LMS scored84%from 54 tests.

About plugin

  • Plugin page: academy-certificates
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.2
  • WordPress version: 6.3.1
  • First release: Mar 17, 2022
  • Latest release: Jul 19, 2023
  • Number of updates: 8
  • Update frequency: every 61.2 days
  • Top authors: academylms (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active /4,578 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

Server-side resources used by Academy Certificates - Certificate Builder for Academy LMS
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0138.73 ▼1.60
Dashboard /wp-admin3.32 ▲0.0145.99 ▼1.99
Posts /wp-admin/edit.php3.37 ▲0.0150.00 ▲2.76
Add New Post /wp-admin/post-new.php5.90 ▲0.0185.34 ▼14.15
Media Library /wp-admin/upload.php3.24 ▲0.0135.66 ▲4.52

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 128 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
academyc_required_rewrite_flush
academyc_version
academyc_default_certificate_id
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Academy Certificates - Certificate Builder for Academy LMS
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲6614.45 ▼0.311.84 ▼0.0344.49 ▲0.02
Dashboard /wp-admin2,212 ▲245.83 ▲0.94106.24 ▼0.2540.80 ▼2.02
Posts /wp-admin/edit.php2,100 ▲112.02 ▲0.0339.64 ▼3.3236.51 ▼3.16
Add New Post /wp-admin/post-new.php1,545 ▲823.15 ▲4.70682.99 ▲16.3454.98 ▼2.54
Media Library /wp-admin/upload.php1,437 ▲464.36 ▼0.01101.14 ▼1.2841.20 ▼2.61

Uninstaller [IO: ▲0.07MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 9 options in the database
    • academyc_required_rewrite_flush
    • db_upgraded
    • academyc_version
    • academyc_default_certificate_id
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/academy-certificates/includes/admin/views/meta-settings.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'tFPDF\\PDF' not found in wp-content/plugins/academy-certificates/includes/library/tfpdf/tFPDF/ProtectedPDF.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'tFPDF\\PDF' not found in wp-content/plugins/academy-certificates/includes/library/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)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 17 tag instead of maximum 10
You can look at the official readme.txt

academy-certificates/academy-certificates.php Passed 13 tests

This is the main PHP file of "Academy Certificates - Certificate Builder for Academy LMS" version 1.0.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
64 characters long description:
Award your students with a certificate after finishing a course.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin8,496 lines of code in 73 files:
LanguageFilesBlank linesComment linesLines of code
PHP711,0371,8068,211
CSS126284
JavaScript1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity49.40
▷ Minimum class complexity1.00
▷ Maximum class complexity398.00
Average method complexity4.63
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes15.00%
Methods267
▷ Static methods217.87%
▷ Public methods19271.91%
▷ Protected methods124.49%
▷ Private methods6323.60%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants26
▷ Global constants1246.15%
▷ Class constants1453.85%
▷ Public constants14100.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.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/certificate-nograde.png13.46KB5.54KB▼ 58.82%