-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Track internal search queries #242
base: develop
Are you sure you want to change the base?
Conversation
Have you discussed about creating an own section for this instead of adding this data to the "views" section? |
I didn't (maybe other parts of the team did). But a dedicated section seems like a good idea and might integrate well into the planned extended evaluation features. Should be removed from the pages view then or maybe just grouped together as "Search". |
Didn’t think about adding an own section, but like the idea, then we also do not need the |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
* @version 1.4.0 | ||
* @since 0.1.0 | ||
* @since 1.4.0 | ||
* @since 2.0.0 Add search queries to `$data` array. |
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.
Is this common to add a "changelog" like this to PHPDoc? And now we also have three @since
and no @version
anymore. 🤔
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 guess we used the @version
wrong, if I am right, it is ment to set versions for APIs and similar (https://docs.phpdoc.org/guide/references/phpdoc/tags/version.html#version), and you can use multiple @since
(https://docs.phpdoc.org/guide/references/phpdoc/tags/since.html#since)
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.
Yep, @since
is commonly used for changelog purposes, mostly changes to method signature or high-level behavior (at least helpful on public API that can be quite helpful to have this information on hand in the IDE)
@version
is meant for semantic changes and the state of the functionality.
Multiple of either one don’t make much sense, because they yield barely any information, just “something was done here“.
Something like this would be more or less meaningful:
@since 1.0 introduced (if this is left empty, the natural assumption would be the same)
@since 1.1 return boolean result instead of void
@since 1.2 make parameter $foo optional with default 42
@version 1.1
I personally often omit the version tags, if there is no real need for that. The since-tags often help even in the same project to see why a method is used in a non-optimal way or similar. In such cases the hint “method was updated in 1.2“ and “we use it since 1.1“ immediately presents a valid reason, so we don’t have to guess what someone may have thought here.
Btw. that is also done in WP core and the changelogs are rendered in the reference articles, e.g.: https://developer.wordpress.org/reference/functions/wp_parse_url/#changelog
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.
"Since" we only use it on some functions and we don't even have a real "public API", would we even mind keeping these @since
version numbers up to date?
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.
Well, a public method is a public method and there are some recommendations out there for things like workarounds or custom triggers that call some of these. Some snippets given by ourselves in the support forums. Documenting API changes enables users of those to potentially migrate their logic without opening another support request, if changes are not self-explaining.
I agree, the majority of our code is designed for internal use and only exposed public for hooks etc.
But as with every project, that’s yet another part of documentation that might get out of sync over time. Though it’s probably one of the easier parts, as old annotations typically never become wrong, so we only have to append another one-liner, if necessary.
<?php for ( $i = 0; $i < $limit; $i++ ) { ?> | ||
<tr class="placeholder"><td colspan="2"> </td></tr> | ||
<?php } ?> |
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.
Do I get this right, that you first create a table with empty <tr>
tags and then fill/replace them using JavaScript? Why not generate the <table>
in JavaScript instead?
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.
OK, you do just the same as with the other tables 🙈
This PR:
Statify_Dashboard::parse_target()
method that is called for the targets list in the widget. It makes sure the search query items are not just displayed as/?s=[…]
Looks like this:
Closes #220