-
Notifications
You must be signed in to change notification settings - Fork 0
REFACTOR: Update codebase following PSR4 standards #4
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
Conversation
@up1512001 I’ve added clarification comments directly to the original feedback where it was first raised. Kindly review and share your response on the same thread for better context and tracking, instead of opening a new one. Thank you. |
From my understanding, the logo field is a standard part of the shared site data used across OnePress modules. Since this was backported from the OD module, I didn’t remove it as I assumed we were keeping things consistent with the existing pattern. Keeping this field doesn’t affect the UI/UX or any functionality of OneLogs, and it also helps with consistency across modules. That said, if the you prefer to remove it here, I’m absolutely fine with doing so and updating the PR to move things forward. cc: @justlevine |
Elsewhere, the way I suggested balancing this was to keep the data structures in PHP (where array shapes are more temperamental), but leave it out of the frontend UX/UI. I'd argue that makes sense here
Anyways, back to this specific discussion: I defer to @up1512001 (with an internal preference for stripping it out of the UX/UI if doesn't slow us down too much more). Going forward (here and the other One* refactors), if you see functionality in "shared code" that doesn't exist in the specific plugin, get confirmation whether it's a plugin-specific "quirk" or should be backported. |
up1512001
left a comment
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.
@patil-vipul overall looks good to me added few nits.
@justlevine While I understand this is POC work, I prefer we address this now rather than accumulate technical debt. These small issues become harder to fix later when they're embedded in the codebase. If stripping it from the UX doesn't significantly slow us down, let's do it properly from the start as its better to start with clean slate instead of cluttered one. |
Agreed, I'm deferring to you as to whether you think "stripping it" will slow us down here on this PR, since resolved comments aside you're the one with insight as to how much work is needed before we can merge and pass this to QA. Which it sounds like you do, so let's strip it from the js and call it a day 🚀 |
up1512001
left a comment
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.
LGTM
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.
A few final nits, mainly to ensure we're not taking too much unintentional debt with us.
In general, please double-check and remove any now-unnecessary CSS classes (I don't expect you to audit if individual rules are still needed just classes that are no longer in use)
inc/Modules/Settings/Admin.php
Outdated
|
|
||
| $links[] = sprintf( | ||
| '<a href="%s">%s</a>', | ||
| esc_url( admin_url( sprintf( 'admin.php?page=%s', LogsAdmin::SCREEN_ID ) ) ), |
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 don't understand the shifting you did. why wouldnt the shared menu and menu screen be in our shared Admin namespace, instead of coupled specifically to the Logs Dashboard (one submenu screen + related assets).
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 was originally aligned with keeping the shared settings separate. However, based on today’s suggestion from @up1512001 to move this under the Logs admin, I made the shift accordingly.
If the preference is to keep it under the shared admin namespace instead, I’m happy to revert and align.
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.
Not finding that specific suggestion, so I'd assume he made that suggestion because he saw this was using LogsAdmin::SCREEN_ID, but didnt see that's because you moved the admin_menu and a lot of other shared handling to /Logs/Admin.php (which specifically handles the Logs Dashboard screen needs and not anything else).
LMK when you're done with the other files and i'll detangle those two classes.
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.
Here #4 (comment), and discussion over huddle for clarification.
justlevine
left a comment
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.
@up1512001 @patil-vipul PTAL at 1757392 which should hopefully clarify the separation of concerns between the shared Modules/Settings/* namespace and our Modules/Logs/* namespace.

Overview
Major architectural refactoring to align with modern PHP and JavaScript standards, introducing modular design patterns, comprehensive testing infrastructure, and improved developer experience.
Key Changes
Architecture & Code Organization
inc/Modules/with proper namespacing (OneLogs\Modules\Core,OneLogs\Modules\Rest, etc.)Registrableinterface pattern, replacing singleton implementations for better testability and maintainability.Build & Tooling
assets/build/jsto a flatbuild/directory structure.package.jsonwith streamlined build scripts and current tooling.Code Quality & Testing
phpunit.xml.distconfiguration for automated testing.phpstan.neon.distfor type safety and static analysis improvements.Plugin Bootstrap
onelogs.phpto use modern autoloader and constants approach.uninstall.phpwith proper namespacing and function-based structure.Checklist