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

Integrate with Simple History #114

Open
5 of 6 tasks
JoryHogeveen opened this issue Sep 17, 2020 · 6 comments
Open
5 of 6 tasks

Integrate with Simple History #114

JoryHogeveen opened this issue Sep 17, 2020 · 6 comments

Comments

@JoryHogeveen
Copy link
Owner

JoryHogeveen commented Sep 17, 2020

Request: https://wordpress.org/support/topic/simple-history-integration/
https://wordpress.org/plugins/simple-history/

Requirements:

  • Proper hooks to trigger changes in views (1.8.x)
    • vaa_view_admin_as_update_view: c1c2ebd
    • vaa_view_admin_as_reset_view: 6df0f83
    • vaa_view_admin_as_cleanup_views: c3b9166
    • vaa_view_admin_as_reset_all_views: 98cfb0f
  • Either integrate within View Admin As or create a PR for Simple History

Example addon: https://github.com/bonny/WordPress-Simple-History/blob/master/loggers/PluginUserSwitchingLogger.php

Required PR: bonny/WordPress-Simple-History#227

@JoryHogeveen
Copy link
Owner Author

@bonny

Viewing the above, what do you think about me adding an integration addon as a PR to your plugin?
I'll make sure it's all based on WP actions so it doesn't have to rely on classnames etc.

Also, just an idea. What do you think about (optionally) adding a "switched from" status to other logs when a user does things while switched to another user?

Cheers, Jory

@bonny
Copy link

bonny commented Sep 17, 2020

Hi @JoryHogeveen ! A PR would definitely be nice, support for View Admin As would benefit users that use both our plugins.

The "swithed from" is a nice idea, I never though of that when I added support for User Switching. Not sure right now how that would be displayed however. If you have any ideas let me know.

@JoryHogeveen
Copy link
Owner Author

Awesome, I'll think about the "switched from" implementation and do some testing. Cheers!

@JoryHogeveen
Copy link
Owner Author

@bonny

I also think these type of loggers should be opt-in, agreed?
Related: bonny/WordPress-Simple-History#204

Especially the "switched from" part. I can imagine both pro and con's for these type of logs.

@JoryHogeveen
Copy link
Owner Author

@bonny

Found a bottleneck while testing. View Admin As makes all changes really early in WP load time (first prio on plugins_loaded). At that point the loggers aren't available yet.
Any suggestions to how I could get around that?

Cheers, Jory

@JoryHogeveen
Copy link
Owner Author

@bonny

I've tried several ways without modifying your plugin but it's currently impossible to make our plugins compatible.
View Admin As hangles view changes very early-on in the WP hooks and it directly returns AJAX data after that.
Because of this the after_setup_theme hook is never fired and this the loggers aren't loaded.
There will be some changes required to your plugin as well to make this compatible. I'll make a PR for you to review.

Cheers, Jory

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