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

Set up help center feature #46

Merged
merged 11 commits into from
May 29, 2024
Merged

Set up help center feature #46

merged 11 commits into from
May 29, 2024

Conversation

circlecube
Copy link
Member

Proposed changes

This integrates the features module with the help center. It will allow users to toggle the feature on/off in the plugin settings. The features module changes the way a module is loaded, replacing the module loader/register method with a feature class and instantiate method which kicks the module off. If it is disabled the installation will not run. Integrating with the new feature module is a clean way to only load this module code when it is enabled and wraps everything into a features API that can be used by the plugins (and even other modules).

This also handles the optional loading for onboarding screens.

Upon merge, the idea is that this will be a major version release (2.x) since it changes the way the module is loaded and will need some attention when updating in the plugin. Ideally, we can also add some tests to that release to ensure the feature toggle is functional.

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@circlecube
Copy link
Member Author

See PRESS1-317 & PRESS1-314

composer.json Outdated
},
"autoload": {
"psr-4": {
"NewfoldLabs\\WP\\Module\\HelpCenter\\": "includes"
},
"files": [
"includes/HelpCenterFeature.php",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@circlecube This line is unnecessary since the class will be autoloaded using PSR-4 from the line above.

Suggested change
"includes/HelpCenterFeature.php",

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed, thanks

}

// Do not load if `canAccessHelpCenter` capability is not true
$capability = new SiteCapabilities();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code formatting

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching, should be fixed now.

@circlecube circlecube requested a review from wpscholar May 24, 2024 20:35
@circlecube circlecube requested a review from abhijitb May 28, 2024 14:35
* main:
  updating wp-module-ai to 1.1.9
  updating typesense search params

# Conflicts:
#	composer.json
#	composer.lock
Copy link
Contributor

@abhijitb abhijitb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good ... tested on local too

@circlecube circlecube merged commit da9d0d0 into main May 29, 2024
@circlecube circlecube deleted the feature/help-center-feature branch May 29, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants