73% pmpro-courses

Code Review | Premium Courses & eLearning with Paid Memberships Pro for LearnDash, LifterLMS, Sensei LMS & TutorLMS

WordPress plugin Premium Courses & eLearning with Paid Memberships Pro for LearnDash, LifterLMS, Sensei LMS & TutorLMS scored73%from 54 tests.

About plugin

  • Plugin page: pmpro-courses
  • Plugin version: 1.2.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.3
  • WordPress version: 6.3.1
  • First release: Jul 8, 2021
  • Latest release: Aug 4, 2023
  • Number of updates: 27
  • Update frequency: every 28.1 days
  • Top authors: andrewza (51.85%)strangerstudios (51.85%)

Code review

54 tests

User reviews

1 review

Install metrics

3,000+ active /35,780 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.43MB] [CPU: ▼1.32ms] Passed 4 tests

Server-side resources used by Premium Courses & eLearning with Paid Memberships Pro for LearnDash, LifterLMS, Sensei LMS & TutorLMS
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4543.62 ▲2.86
Dashboard /wp-admin3.76 ▲0.4150.63 ▼9.32
Posts /wp-admin/edit.php3.81 ▲0.4548.67 ▲5.42
Add New Post /wp-admin/post-new.php6.49 ▲0.6089.97 ▼0.83
Media Library /wp-admin/upload.php3.62 ▲0.3937.20 ▲2.02
Course Settings /wp-admin/admin.php?page=pmpro-courses-settings3.6034.62

Server storage [IO: ▲0.32MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 36 new files
Database: no new tables, 9 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
pmpro_courses_modules
widget_recent-posts
db_upgraded
can_compress_scripts
recovery_mode_email_last_sent
pmpro_courses_db_version
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Premium Courses & eLearning with Paid Memberships Pro for LearnDash, LifterLMS, Sensei LMS & TutorLMS
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲9314.25 ▼0.131.72 ▲0.0746.28 ▲8.33
Dashboard /wp-admin2,237 ▲605.67 ▼0.0396.50 ▲8.9745.30 ▲2.56
Posts /wp-admin/edit.php2,145 ▲451.97 ▼0.0335.33 ▲0.3332.30 ▼4.83
Add New Post /wp-admin/post-new.php1,565 ▲3723.69 ▲0.67678.60 ▼0.9453.46 ▲4.19
Media Library /wp-admin/upload.php1,442 ▲454.21 ▲0.0697.82 ▼1.5544.10 ▼0.04
Course Settings /wp-admin/admin.php?page=pmpro-courses-settings7281.628.9220.86

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • pmpro_courses_modules
    • db_upgraded
    • pmpro_courses_db_version
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=pmpro-courses-settings
    • > Warning in wp-content/plugins/pmpro-courses/includes/adminpages/settings.php+2
    Use of undefined constant PMPRO_DIR - assumed 'PMPRO_DIR' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/admin.php?page=pmpro-courses-settings
    • > Warning in wp-content/plugins/pmpro-courses/includes/adminpages/settings.php+2
    require_once(PMPRO_DIR/adminpages/admin_header.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/admin.php?page=pmpro-courses-settings
    • > Compile error in wp-content/plugins/pmpro-courses/includes/adminpages/settings.php+2
    require_once(): Failed opening required 'PMPRO_DIR/adminpages/admin_header.php' (include_path='.:/usr/share/php')

SRP 0% 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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/pmpro-courses/pmpro-courses.php
  • 17× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      require_once(PMPRO_DIR/adminpages/admin_header.php): failed to open stream: No such file or directory in wp-content/plugins/pmpro-courses/includes/adminpages/settings.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'PMPro_Courses_Module' not found in wp-content/plugins/pmpro-courses/includes/modules/lifterlms.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pmpro-courses/includes/post-types/lessons.php:65
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/pmpro-courses/includes/shortcodes/my-courses.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pmpro-courses/includes/settings.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pmpro-courses/includes/post-types/courses.php:76
    • > PHP Warning
      Use of undefined constant PMPRO_DIR - assumed 'PMPRO_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/pmpro-courses/includes/adminpages/settings.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'PMPRO_DIR/adminpages/admin_header.php' (include_path='.:/usr/share/php') in wp-content/plugins/pmpro-courses/includes/adminpages/settings.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/pmpro-courses/includes/admin.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PMPro_Courses_Module' not found in wp-content/plugins/pmpro-courses/includes/modules/learndash.php:2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: pmpro, course, lms, membership, elearning...

pmpro-courses/pmpro-courses.php Passed 13 tests

The primary PHP file in "Premium Courses & eLearning with Paid Memberships Pro for LearnDash, LifterLMS, Sensei LMS & TutorLMS" version 1.2.5 is used by WordPress to initiate all plugin functionality
89 characters long description:
Create courses and lessons for members. Integrates LMS plugins with Paid Memberships Pro.

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
There were no executable files found in this plugin8,119 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript61,1523075,360
PHP203676371,744
CSS4689714
PO File1118228259
JSON20042

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity24.00
▷ Minimum class complexity6.00
▷ Maximum class complexity34.00
Average method complexity3.35
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods49
▷ Static methods3571.43%
▷ Public methods4897.96%
▷ Protected methods00.00%
▷ Private methods12.04%
Functions59
▷ Named functions59100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin