Skip to content

Dead code: Option storage in Syndication_Logger is unreachable #177

@GaryJones

Description

@GaryJones

Summary

The Syndication_Logger class has an option storage code path (lines 347-377) that is unreachable through the public API.

Background

PR #53 (2015) introduced the logging framework with two storage types:

  • object - stores logs in post meta (implemented and used)
  • option - stores logs in WP options (implemented but unreachable)

The error message at line 300 references a log_option method:

"You need to provide a valid post_id or use log_option instead"

However, log_option() was never implemented. All public methods hardcode storage_type = 'object':

  • log_post_error()log_post()log('object', ...)
  • log_post_success()log_post()log('object', ...)
  • log_post_info()log_post()log('object', ...)

Recommendation

Either:

  1. Remove the dead code - Delete the option storage branch (lines 347-377) and update the error message
  2. Implement the feature - Add log_option_error(), log_option_success(), log_option_info() methods if there's a use case

Option 1 is recommended unless there's a known need for option-based logging.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions