-
Notifications
You must be signed in to change notification settings - Fork 116
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
Introduce advanced Exclude tab to replace Connectors tab #251 #278
Conversation
* @param string Current class name | ||
* @return bool | ||
*/ | ||
return apply_filters( 'wp_stream_record_log', $bool, $user, get_called_class() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@faishal nice! even including hook docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@faishal Unless we have this filter somewhere else with the same name, and receiving same input, we should change the filter name to reflect what it really does.
It'd also be great if we can change the description to something like Filter to exclude actions of a specific user from being logged or something.
Nice work man! /five!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@faishal Also wanted to leave a /five for this!
Conflicts: includes/connectors.php
@westonruter Thanks for your suggestion, I have fixed all the issues that you mention in comments. Also fix issues ocure after merging |
@@ -31,6 +31,9 @@ public static function register() { | |||
if ( ! self::is_logging_enabled_for_user() ) { | |||
return; | |||
} | |||
if ( ! self::is_logging_enabled_for_ip() ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding checks in the base class of all connector will cause it to be executed by all connectors while they try to register themselves, which is something we probably don't need. We probably need to move those checks ( including is_logging_enabled_for_user
by @jonathanbardo ) to includes/connectors.php
so it is done once on plugin load.
@fjarrett @jonathanbardo What do you think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think it would be more efficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@faishal If you agree as well on this, please carry on with moving any redundant checks ( IP / User exclusion ) to the WP_Stream_Connectors
class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shadyvb I am also agree with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shadyvb should i move functions is_logging_enabled_for_user
& is_logging_enabled_for_ip
into WP_Stream_Settings
because it is a part of settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer putting them in the same class that'll use them, just to make it easier for people dealing with the same functionality later. Unless other classes would be using them, which is a far aim in this scenario.
$labels | ||
), $old_options [ 'connectors_active_connectors' ] | ||
); | ||
unset( self::$options[ 'connectors_active_connectors' ] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@faishal Also, the space usage within brackets is incorrect throughout the code in this PR, according to WP coding standards.
self::$options['connectors_active_connectors']
"When referring to array items, only include a space around the index if it is a variable"
cf. http://make.wordpress.org/core/handbook/coding-standards/php/#space-usage
With all the CS comments from @fjarrett , i'm curios to know if @faishal did setup pre-commit hook with dependencies ( phpcs / jslint etc.. ). Would make it way easier for @faishal to correct stuff like that. |
@shadyvb I use I also checked it by run command manually on terminal before pushing it to master, but i not found any error in that also.
|
We do have a Also i'm not sure if this would be helpful to you, but we do have a configuration template for phpstorm that should make it easier to follow WPCS as well, check it out. |
@shadyvb The |
@faishal There seem to be some conflicts with Great work! |
Conflicts: includes/install.php
@shadyvb Thanks, I just fixed that conflicts and other issues |
@faishal I've been testing this, and it's working quite nicely! There are only two issues that I can find that need to be resolved before we merge this feature:
|
@faishal Do let me know if you have any questions regarding the two issues I mentioned above. |
@fjarrett Sorry for delay, I just started looking in to it. |
@faishal You're right about the Role, doesn't look like we'll be able to easily omit records based on that. However, the others (author, context, action, IP) we should be able to completely hide from the Stream, correct? Regarding my second point, please disregard it. I believe my testing was flawed here, I must have been tired 😄 |
Conflicts: includes/install.php ui/admin.css
Absolutely correct @fjarrett. |
@fjarrett, is anything else left to be done in here? |
@faishal I'm going to fully test this here in a few hours and I'll let you know. |
Resolved #251