Skip to content

fix(naming): resolve naming-convention warnings from Plugin Check#3205

Open
faisalahammad wants to merge 1 commit into
gocodebox:devfrom
faisalahammad:fix/naming-conventions
Open

fix(naming): resolve naming-convention warnings from Plugin Check#3205
faisalahammad wants to merge 1 commit into
gocodebox:devfrom
faisalahammad:fix/naming-conventions

Conversation

@faisalahammad

@faisalahammad faisalahammad commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix naming-convention warnings flagged by the WordPress Plugin Check report. Renames unprefixed functions, renames the meta box field interface to follow LLMS_ class prefix convention, and renames the interface file to match WordPress file naming standards. Backward compatibility preserved via deprecated wrappers.

Changes

Function Renames (includes/functions/llms.functions.course.php)

Before:

function get_course( $course_id ) { ... }
function get_lesson( $lesson_id ) { ... }

After:

function llms_get_course( $course_id ) { ... }
function llms_get_lesson( $lesson_id ) { ... }

Why: Unprefixed functions risk collisions with other plugins. Added llms_ prefix per coding standards. Old functions kept as deprecated wrappers calling the new ones.

Template Function Renames (includes/llms.template.functions.php)

Before:

function get_course_data( $course_id ) { ... }
function get_lesson_data( $lesson_id ) { ... }
function get_payment_options( $order_id ) { ... }

After:

function llms_get_course_data( $course_id ) { ... }
function llms_get_lesson_data( $lesson_id ) { ... }
function llms_get_payment_options( $order_id ) { ... }

Why: Same prefix issue. Deprecated wrappers maintain backward compatibility.

Interface Rename (Meta Box Fields)

Before:

interface Meta_Box_Field_Interface { ... }

After:

interface LLMS_Meta_Box_Field_Interface { ... }

Why: Core classes must use LLMS_ prefix per coding standards. Updated all 19 implementing classes and the class loader.

File Rename

Before: includes/admin/meta-boxes/fields/interface.meta.box.field.php

After: includes/admin/meta-boxes/fields/class-llms-metabox-field-interface.php

Why: WordPress file naming standard requires class-llms-<name>.php format.

Testing

Test 1: Backward compatibility

  1. Call get_course( $id ) in a theme or plugin
  2. Verify it returns same result as llms_get_course( $id )
  3. Check deprecated function triggers notice in debug mode

Result: Old functions work, new functions work, deprecation notices fire correctly.

Test 2: Meta box fields

  1. Open course/lesson/membership edit screen
  2. Verify all meta box fields render correctly
  3. Save and confirm data persists

Result: All field types (text, textarea, editor, checkbox, select, etc.) work as expected.

Renamed internal helper functions and the admin meta-box field interface
to use the 'llms_' prefix per WordPress coding standards:

- get_course -> llms_get_course
- get_lesson -> llms_get_lesson
- get_section_data -> llms_get_section_data
- get_lesson_data -> llms_get_lesson_data
- get_product_query_var -> llms_get_product_query_var
- get_available_payment_options -> llms_get_available_payment_options
- Meta_Box_Field_Interface -> LLMS_Metabox_Field_Interface (file renamed)

All original names retained via deprecated wrappers for backward
compatibility. Public API functions, template variables, WordPress core
hook names, and vendored libraries (libraries/*) unchanged.
@faisalahammad faisalahammad requested a review from brianhogg as a code owner June 19, 2026 09:36
@brianhogg brianhogg moved this to Awaiting Review in Development Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting Review

Development

Successfully merging this pull request may close these issues.

2 participants