90% sensei-media-attachments

Code Review | Sensei LMS Media Attachments

WordPress plugin Sensei LMS Media Attachments scored90%from 54 tests.

About plugin

  • Plugin page: sensei-media-atta...
  • Plugin version: 2.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-5.9
  • WordPress version: 6.3.1
  • First release: May 20, 2020
  • Latest release: Mar 25, 2022
  • Number of updates: 13
  • Update frequency: every 52.3 days
  • Top authors: donnapep (69.23%)renathoc (23.08%)yscik8 (23.08%)

Code review

54 tests

User reviews

2 reviews

Install metrics

6,000+ active /51,152 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.74ms] Passed 4 tests

Server-side resources used by Sensei LMS Media Attachments
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.21 ▼18.39
Dashboard /wp-admin3.31 ▲0.0146.74 ▼4.18
Posts /wp-admin/edit.php3.36 ▲0.0047.49 ▼1.49
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.43 ▼2.89
Media Library /wp-admin/upload.php3.23 ▲0.0038.97 ▲6.17

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Sensei LMS Media Attachments
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲7713.53 ▼0.641.65 ▼0.1841.99 ▼0.88
Dashboard /wp-admin2,215 ▲305.84 ▼0.05100.44 ▼8.9941.78 ▼0.42
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0342.50 ▲6.2435.53 ▼2.96
Add New Post /wp-admin/post-new.php1,533 ▲1923.29 ▲5.80613.62 ▼83.7052.70 ▼0.34
Media Library /wp-admin/upload.php1,382 ▼04.18 ▲0.0195.55 ▲1.3540.45 ▼5.61

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: media, attachments, downloads, sensei lms

sensei-media-attachments/sensei-media-attachments.php Passed 13 tests

The main PHP script in "Sensei LMS Media Attachments" version 2.0.3 is automatically included on every request by WordPress
113 characters long description:
Provide your students with easy access to additional learning materials, from audio files to slideshows and PDFs.

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
Good job! No executable or dangerous file extensions detected393 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP597241282
PO File32268109
CSS1101
JavaScript1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity22.00
▷ Minimum class complexity10.00
▷ Maximum class complexity34.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods23
▷ Static methods939.13%
▷ Public methods1669.57%
▷ Protected methods00.00%
▷ Private methods730.43%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin