67% edd-courses

Code Review | Easy Digital Downloads - Courses

WordPress plugin Easy Digital Downloads - Courses scored67%from 54 tests.

About plugin

  • Plugin page: edd-courses
  • Plugin version: 0.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.9.3
  • WordPress version: 6.3.1
  • First release: Oct 28, 2018
  • Latest release: Apr 17, 2022
  • Number of updates: 3
  • Update frequency: every 422.3 days
  • Top authors: ibenic (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /793 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲5.02MB] [CPU: ▲25.76ms] 75% from 4 tests

Server-side resources used by Easy Digital Downloads - Courses
Please take the time to fix the following items
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.02MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.75 ▲5.2961.34 ▲19.13
Dashboard /wp-admin8.77 ▲5.4772.41 ▲28.71
Posts /wp-admin/edit.php8.77 ▲5.4174.49 ▲26.88
Add New Post /wp-admin/post-new.php9.80 ▲3.92121.71 ▲32.88
Media Library /wp-admin/upload.php8.77 ▲5.5461.89 ▲28.30
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.7755.22

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 224 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
fs_active_plugins
fs_gdpr
db_upgraded
fs_debug_mode
widget_recent-posts
fs_accounts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Easy Digital Downloads - Courses: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,876 ▲11915.11 ▲0.5222.86 ▲20.7029.94 ▼19.18
Dashboard /wp-admin2,251 ▲655.84 ▲0.93113.76 ▼2.3047.09 ▼0.89
Posts /wp-admin/edit.php2,134 ▲422.02 ▲0.0541.28 ▲0.1739.10 ▼0.41
Add New Post /wp-admin/post-new.php1,544 ▲1022.08 ▼0.90688.31 ▲85.2954.01 ▲5.48
Media Library /wp-admin/upload.php1,430 ▲484.20 ▼0.06102.22 ▼0.4546.78 ▲3.70
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,0741.7224.1228.45

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/edd-courses/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 10 options
    • widget_theysaidso_widget
    • fs_accounts
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • fs_debug_mode
    • fs_gdpr
    • fs_active_plugins
    • db_upgraded

Smoke tests 50% 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 everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/edd-courses/includes/admin/views/metaboxes/courses/lessons.php
  • 16× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/edd-courses/includes/admin/views/metaboxes/courses/lessons.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'EDDC_Metabox' not found in wp-content/plugins/edd-courses/includes/admin/courses/class-eddc-courses-metabox.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function edd_get_option() in wp-content/plugins/edd-courses/templates/course-template.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function selected() in wp-content/plugins/edd-courses/includes/admin/views/metaboxes/courses/download.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/edd-courses/templates/student-courses.php:11
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/edd-courses/includes/admin/views/metaboxes/courses/lessons.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/edd-courses/includes/admin/views/metaboxes/courses/lessons.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/edd-courses/includes/admin/courses/class-eddc-courses-ajax.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'EDDC_Metabox' not found in wp-content/plugins/edd-courses/includes/admin/lessons/class-eddc-lessons-metabox.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/edd-courses/templates/course-header.php:2

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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:
  • Screenshots: Please add images for these screenshots: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from), #2 (This is the second screen shot)
The official readme.txt might help

edd-courses/edd-courses.php 85% from 13 tests

The primary PHP file in "Easy Digital Downloads - Courses" version 0.1.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Domain Path: Use only dashes and lowercase characters for the domain path ("languages")
  • Domain Path: The domain path should be prefixed with a forward slash character ("/languages")

Code Analysis 97% from 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 plugin33,974 lines of code in 181 files:
LanguageFilesBlank linesComment linesLines of code
PHP1437,71917,08832,349
JavaScript12178179944
Sass10660429
Markdown1680214
YAML22022
CSS130016

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 2,911)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity66.37
▷ Minimum class complexity1.00
▷ Maximum class complexity2,911.00
Average method complexity4.45
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes65
▷ Abstract classes46.15%
▷ Concrete classes6193.85%
▷ Final classes11.64%
Methods1,265
▷ Static methods17914.15%
▷ Public methods91772.49%
▷ Protected methods151.19%
▷ Private methods33326.32%
Functions116
▷ Named functions116100.00%
▷ Anonymous functions00.00%
Constants127
▷ Global constants10280.31%
▷ Class constants2519.69%
▷ Public constants25100.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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%