84% academy-certificates

Code Review | Academy Certificates - Certificate Addon for Academy LMS

WordPress plugin Academy Certificates - Certificate Addon for Academy LMS scored 84% from 54 tests.

About plugin

  • Plugin page: academy-certificates
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.9
  • WordPress version: 5.9.2
  • First release: Mar 17, 2022
  • Latest release: Mar 17, 2022
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: academylms (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 35 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼308.03ms] Passed 4 tests

An overview of server-side resources used by Academy Certificates - Certificate Addon for Academy LMS
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.0954.10 ▲3.67
Dashboard /wp-admin3.46 ▲0.0532.54 ▼0.76
Posts /wp-admin/edit.php3.68 ▲0.0439.21 ▲4.01
Add New Post /wp-admin/post-new.php6.93 ▼0.0595.15 ▼1,229.92
Media Library /wp-admin/upload.php3.33 ▲0.0325.98 ▼5.10

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 128 new files
Database: no new tables, 3 new options
New WordPress options
academyc_required_rewrite_flush
academyc_default_certificate_id
academyc_version

Browser metrics Passed 4 tests

Academy Certificates - Certificate Addon for Academy LMS: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,781 ▲5915.65 ▼0.055.64 ▼0.132.19 ▼0.09
Dashboard /wp-admin2,913 ▲596.16 ▼0.08123.85 ▼20.94154.50 ▼10.21
Posts /wp-admin/edit.php2,701 ▲103.24 ▲0.0063.54 ▲1.63139.14 ▼3.89
Add New Post /wp-admin/post-new.php1,785 ▲6821.91 ▲0.81437.71 ▼8.14150.98 ▼8.46
Media Library /wp-admin/upload.php1,748 ▲505.59 ▲0.06146.84 ▲5.57167.58 ▼21.85

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 3 options in the database
    • academyc_required_rewrite_flush
    • academyc_version
    • academyc_default_certificate_id

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 | 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 items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'tFPDF\\PDF' not found in wp-content/plugins/academy-certificates/includes/library/tfpdf/tFPDF/PDFBarcode.php:12
    • > 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

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 17 tag instead of maximum 10
You can take inspiration from this readme.txt

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

The primary PHP file in "Academy Certificates - Certificate Addon for Academy LMS" version 1.0.1 is used by WordPress to initiate all plugin functionality
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
Success! There were no dangerous files found in this plugin8,487 lines of code in 73 files:
LanguageFilesBlank linesComment linesLines of code
PHP711,0381,8068,202
CSS126284
JavaScript1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity49.00
▷ Minimum class complexity1.00
▷ Maximum class complexity397.00
Average method complexity4.60
▷ 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

Using a strong compression for your PNG files is a great way to speed-up your plugin
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%