Problem/Motivation
Support owners of current D7 sites in moving off Drupal 7 before final Drupal 7's End-of-Life date. Site audit is first step in migration off D7. Providing results of site audit in web UI will decrease cost of migration for site owners and communication managers. This issues is part of Drupal 7 soft landing initiative
Proposed resolution
Backport UI implemented for D8/9/10 (/admin/reports/site-audit)
The following reports are top priority
- extensions / modules ( contrib / custom / need security updates)
- content types (total number, fields per content type)
- content nodes (total number of nodes by type, dates first and last created/updated)
- blocks (total number, by type - views, from module, drupal basic blocks, beans)
- views
- users
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | site-audit.png | 608.11 KB | irinaz |
Issue fork site_audit-3331602
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
irinaz commentedComment #3
irinaz commentedComment #4
jon pughI agree on keeping 7.x supported for these reasons.
Very nice to hear about the Soft Landing initiative!
I am the new maintainer of the 4.x version which is Drupal 8+, but I'm here to help figure this out.
This is relevant to 4.x because I am adding a Site Audit Server that can receive Site Audit reports from another site and save them.
We will want to ensure the server can also receive reports from a D7 site.
Comment #5
irinaz commentedComment #6
irinaz commentedComment #7
gambryAdding the correct tag for Drupal Global Contribution Weekend 2023.
Comment #8
norman.lolComment #9
avpadernoComment #10
irinaz commentedComment #11
irinaz commentedComment #12
keiserjb commentedInterested in trying to get this working because it would probably help out the other project I work on if I could port a module with a UI.
Comment #13
irinaz commented@keiserjb, let me know if there is anything that will make it easier for you to get started :). Also here is related session on May 12 https://webcamp.stanford.edu/session/site-audit-4-track-your-drupal-site...
Comment #15
irinaz commentedComment #18
keiserjb commentedI left before the end yesterday. How far did you guys actually get and where did the code you were working on go?
Comment #19
devkinetic commentedI have the latest version on my laptop, and will be pushing it up in the morning. We now need a settings page to mirror the options from the drush command and then to rework the check and report classes to work outside of drush.
As of now, it's a full fledged module with the addition of the info file metadata and module file so it shows up under manage extensions, and we have the actual report route showing a list of the reports. Once the classes are refactored we can uncomment the final code and it should work.
I did have an idea on how to easily detect drush execution vs the UI so we can get the existing code to work with minimal effort, and I'm going to be testing that out hopefully tomorrow if not next week.
Comment #20
irinaz commentedThis is fantastic!! Thank you so much!!
Comment #21
cyu commented@devkinetic on the "minimal effort" path, I was wondering how it would look to wrap all of the drush commands that are in use in the module, so building off of how Jon had something like:
We'd also have stuff like:
And then to start we could have something like:
which could probably be altered a bit to pull settings from a configuration page and give a subset of the full audit.
Then for stuff like drush_command_invoke_all_ref(), outside of the drush environment we could wrap that, but not have any logic since it won't be applicable to the web ui.
If that's possible, we may not need to touch much (or anything) outside of the main .module file, which would mean we could be pretty sure of not breaking any of the existing drush generated reports. While this isn't a great solution, it could be a fit for the short term task of adding something to Drupal 7 in order to help get people off of Drupal 7.
Comment #22
avpadernoComment #23
devkinetic commentedI agree that would be the easiest path to get things working.
TODO:
- Add settings page
- Add wrapper functions around drush calls
- Develop a mapping function for usage of settings
- Update readme
- consider adding dependencies to info from composer file
TBD:
- Backporting of functionality from newer versions of the module.
Comment #24
irinaz commented@devkinetic, thank you! I tested this branch and I am ready to update readme for 7.x branch to indicate that now there is a web UI in Reports section to begin with.
Looking forward for other features coming in this UI :)
Comment #25
cyu commentedI had a little time tonight to push a proof of concept for wrapping all of the drush functions. The report page will now generate reports without errors, though a lot of the wrapped drush functions aren't returning values equal to the drush equivalents so those still need improved before the reports can be trusted. I also hit some issues with the best practices report that I didn't have time to solve, so I've excluded that one for now.
Comment #26
irinaz commented@cYu, thank you so much - this is super cool, I can see page now with some data. Yes, I see all the errors as well, but this is already huge progress! thank you!
Comment #27
irinaz commentedI installed the module, and I can see the first results, but it seems that my instance (on Pantheon) returns
drush_get_option('html') == FALSEWhat should I do to make this option TRUE so I can see the correct formatting? Many thanks in advance.
Comment #28
cyu commentedI'm working on this a bit from Drupalcamp Asheville, setting that HTML option improves the readability and I've added a small config page to more easily debug individual reports.
Comment #29
cyu commented@irinaz can you give the latest code a try and report back on which reports are working differently for you in the webui than they do via the drush command? i think there are a few more adjustments needed to the wrapped drush functions.
Comment #30
irinaz commented@cYu, I will work on this today and should have test results by 2 pm Pacific, it would be FANTASTIC to announce it at Drupalcamp Asheville!!!
Comment #31
irinaz commented@cYu, here are my testing results
let me know if this is helpful.
Comment #32
jon pughSite Audit 7.x-2.x is ready for review!
I've pushed many fixes to the Merge Request:
I believe this is ready to merge.
If someone could give it a test to expose anything major I might have missed, please do and set to RTBC!
Thanks to Fibonacci Web Studio for sponsoring this work.
Comment #33
irinaz commentedI have tested this version and it looks very good! @jonpugh, I think that we should merge it
Comment #34
irinaz commentedComment #36
jon pughNice work, everyone.
Comment #37
keiserjb commentedThis is great. I put the release on a D7 site and it's really going to help with the upgrade. Sorry I did not know how to help more.
Comment #38
jon pughFixed.
Please no apologies, @keiserjb!
You are testing the module in real life. You'll likely submit bug reports if you find them. That is incredibly valuable.
Even just showing interest in the module is motivating for developers.
Keep it up!
Comment #39
keiserjb commentedWell, I ran the new branch through the Coder Upgrade module https://backdropcms.org/project/coder_upgrade. I then messed around with it a little and I think it works in Backdrop.
https://github.com/keiserjb/site_audit
We'd need to make it work with Bee instead of Drush. I can loop in our Bee maintainers and it also needs to move into Backdrop Contrib.