Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devise a plan for segregating the codebase into logical sections or modules based on functionality. #283

Open
Tracked by #281
patrickmj opened this issue Mar 16, 2024 · 1 comment
Assignees

Comments

@patrickmj
Copy link
Member

No description provided.

@drashti-NEU
Copy link

Based on the provided code file drs-tk.php, we can segregate the codebase into logical sections or modules based on functionality. Here's a proposed plan:

1. Core Functionality:

  • The core functionality of the plugin is provided by various includes (item.php, browse.php, breadcrumb.php, shortcodes.php, etc.). We can group these files together as the core module responsible for handling DRS API requests, rendering content, and defining shortcodes.

2. Templates and Overrides:

  • Template files and their overrides (drstk-browse.php, drstk-item.php, etc.) can be grouped together as the template module responsible for defining the structure and layout of different views.

3. Settings and Configuration:

  • Functions related to plugin settings and configuration, including the registration of settings pages (drs_admin_add_page(), register_drs_settings()), should be grouped together in a settings module.

4. Rewrite Rules and Activation/Deactivation Hooks:

  • Functions related to rewrite rules (drstk_rewrite_rule()), activation, and deactivation hooks (drstk_install(), drstk_deactivation()) can be grouped into a separate module for managing plugin activation and URL rewriting.

5. API URL Building and Authentication:

  • Helper functions for building API URLs (drstk_api_url()) and handling API authentication (drstk_api_auth_enabled(), drstk_drs_auth()) can be grouped into a module responsible for API interactions.

6. TinyMCE Plugin and Integration:

  • Functions related to adding the TinyMCE plugin (add_tinymce_plugin(), mce_plugin()) can be grouped into a module for integrating the plugin with the WordPress editor.

7. Miscellaneous Helper Functions:

  • Other helper functions like drstk_get_pid(), drstk_get_assoc_meta_options(), and drstk_get_facets_to_display() can be grouped into a miscellaneous module for handling various utility tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants