Skip to content

Fetaure: Add Analytics Admin Page, Navigation & Controls#203

Open
alaca wants to merge 27 commits intofeature/simple-analyticsfrom
feature/analytics-admin-page
Open

Fetaure: Add Analytics Admin Page, Navigation & Controls#203
alaca wants to merge 27 commits intofeature/simple-analyticsfrom
feature/analytics-admin-page

Conversation

@alaca
Copy link
Copy Markdown
Collaborator

@alaca alaca commented Mar 20, 2026

Description of the Change

Adds a new "Analytics" submenu page under the Mailchimp admin menu
Includes date range selector (presets + custom date pickers), list filter dropdown, and a deep link to Mailchimp's audience analytics dashboard
Renames the existing top-level submenu item to "Form Settings" so both pages are clearly distinguished

Closes #197

How to test the Change

Verify "Form Settings" and "Analytics" appear as submenu items under Mailchimp when an account is connected
Verify the Analytics submenu does not appear when no Mailchimp account is connected
Confirm date range dropdown works with all presets and shows resolved date text
Confirm selecting "Custom" reveals from/to date pickers
Confirm that the list filter populates from connected lists and defaults to the currently selected list
Confirm that changing any filter dispatches a refresh event
Verify the deep link opens the Mailchimp dashboard in a new tab
Verify that Chart.js and analytics assets only load on the Analytics page

Changelog Entry

  • Added new "Analytics" submenu page under Mailchimp with date range selector, list filter, and deep link to Mailchimp audience analytics
  • Renamed the default Mailchimp submenu item to "Form Settings"
  • Analytics page only appears when a Mailchimp account is connected
  • Assets (Chart.js, analytics CSS/JS) are conditionally loaded only on the Analytics page

Credits

Props @alaca

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@alaca alaca requested a review from iamdharmesh March 20, 2026 09:55
@github-actions github-actions Bot added this to the 2.1.0 milestone Mar 20, 2026
@github-actions github-actions Bot added the needs:code-review This requires code review. label Mar 20, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “Analytics” admin submenu under the plugin’s Mailchimp menu, providing UI controls for selecting a date range (presets + custom), filtering by list, and linking out to Mailchimp’s audience analytics dashboard. It also renames the existing settings submenu entry to “Form Settings” to distinguish it from the new Analytics page.

Changes:

  • Register a new Analytics admin submenu page and conditionally enqueue its CSS/JS (including Chart.js).
  • Add an Analytics template with date range + list filters and an external deep link to Mailchimp analytics.
  • Attempt to rename the default settings submenu item to “Form Settings”.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
mailchimp.php Bootstraps the new Analytics class during plugin load.
includes/class-mailchimp-analytics.php Registers the Analytics submenu and enqueues Analytics assets + Chart.js.
includes/class-mailchimp-admin.php Adds a submenu entry intended to rename the default “Mailchimp” settings submenu item.
includes/admin/templates/analytics.php New Analytics admin page markup (filters + deep link).
assets/js/analytics.js Implements filter interactions and dispatches a refresh event on changes.
assets/css/analytics.css Styles the Analytics filters/content/deep link layout.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread includes/class-mailchimp-admin.php
Comment thread includes/class-mailchimp-analytics.php Outdated
Comment thread assets/js/analytics.js Outdated
Comment thread assets/js/analytics.js Outdated
Comment thread includes/class-mailchimp-analytics.php
Comment thread includes/class-mailchimp-analytics.php
Comment thread includes/admin/templates/analytics.php Outdated
Comment thread includes/admin/templates/analytics.php Outdated
Comment thread assets/js/analytics.js Outdated
Comment thread includes/class-mailchimp-analytics.php
Copy link
Copy Markdown
Collaborator

@iamdharmesh iamdharmesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, @alaca. This looks good overall. I’ve added a few points for discussion, but otherwise this looks good. There is also some feedback from Copilot, could you please review it and address the valid items? Feel free to ignore anything that isn’t relevant.

Thank you.

Comment thread includes/class-mailchimp-analytics.php Outdated
Comment thread includes/admin/templates/analytics.php Outdated
Comment thread includes/class-mailchimp-admin.php Outdated
Comment thread includes/admin/templates/analytics.php Outdated
Comment thread includes/class-mailchimp-analytics.php Outdated
Comment thread includes/class-mailchimp-analytics.php
@alaca alaca requested a review from iamdharmesh March 24, 2026 11:15
@alaca
Copy link
Copy Markdown
Collaborator Author

alaca commented Mar 24, 2026

@iamdharmesh this is ready for your review.

Copy link
Copy Markdown
Collaborator

@iamdharmesh iamdharmesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes @alaca. Code looks good now. However, have some nitpick notes:

Image
  • It’s better to have a center-aligned section, similar to what we have on the Settings page.
  • The form focus outline, button color, etc., should match the Mailchimp colors (as defined in Figma).
  • The notice is currently shown above the header and should be handled the same way as on the Settings page.
  • The footer note should also follow the Settings page pattern.

Comment thread includes/class-mailchimp-admin.php Outdated
@iamdharmesh iamdharmesh requested a review from Copilot April 6, 2026 05:11
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 11 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/cypress/e2e/settings/analytics.test.js Outdated
Comment thread includes/class-mailchimp-analytics.php
Comment thread includes/class-mailchimp-analytics.php
Comment thread assets/js/analytics.js Outdated
Comment thread assets/js/analytics.js Outdated
Comment thread assets/js/analytics.js
Comment thread assets/js/analytics.js
Comment thread includes/admin/templates/analytics.php
Comment thread assets/css/analytics.css Outdated
iamdharmesh and others added 3 commits April 6, 2026 10:57
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@iamdharmesh
Copy link
Copy Markdown
Collaborator

Hi @alaca, I have made some changes here to address the PR feedback and overall UI improvement and styling to speed up the work here. This looks ready to go now. Please review the changes once you get some time.
cc: @vikrampm1

Copy link
Copy Markdown
Collaborator Author

@alaca alaca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iamdharmesh looks food 👍

iamdharmesh
iamdharmesh previously approved these changes Apr 7, 2026
@ankitguptaindia
Copy link
Copy Markdown
Collaborator

ankitguptaindia commented Apr 24, 2026

QA Status: Needs Feedback ⚠️

Hi @alaca, thanks for working on this—overall it’s working great.

During testing, I noticed a few areas where we could further improve the experience and alignment with design. Sharing them below for your thoughts.

Design Followed: Link

1. Date Format Not Following WordPress Settings

The date format is always displayed as YYYY-MM-DD and does not respect the format configured in WordPress core settings.

Steps to Reproduce

  1. Go to Settings → General
  2. Change the date format
  3. Navigate to the affected UI

Note
If this depends on Mailchimp or is out of scope, please confirm. I can create a separate enhancement ticket if needed.

Recording.1791.mp4

2. Background Color Mismatch

Background color does not match the expected design.

Recording.1792.mp4

3. RTL Issues – Date Picker Broken

Date picker UI breaks in RTL environments (e.g., Arabic language).

Steps to Reproduce

  1. Switch site language to an RTL language (e.g., Arabic)
  2. Open date picker

Attachment RTL Issue


4. Dropdown Text & Icon Separator Issue

In design, we have a separator but missing in dvelopeed page.

Design:

UI Issue

Developed:

Screenshot 2026-04-24 at 5 53 10 PM

Environment

  • WordPress: 7.0-RC2

  • PHP: 8.4.18

  • Server: nginx/1.26.1

  • Database: mysqli (Server: 8.4.0 / Client: mysqlnd 8.4.18)

  • Browser: Chrome 146.0.0.0

  • OS: macOS

  • Theme: Twenty Twenty-Five 1.4

  • Plugins:

    • Mailchimp 2.0.1

@alaca
Copy link
Copy Markdown
Collaborator Author

alaca commented May 5, 2026

@ankitguptaindia I addressed all issues. Can you please check one more time? Thanks

Copy link
Copy Markdown
Collaborator

@iamdharmesh iamdharmesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes @alaca. Code changes looks good to me. However, I noticed that background color not applies to whole background and calendar icon is too big for the control. could you please check once?

Image

@iamdharmesh iamdharmesh changed the base branch from develop to feature/simple-analytics May 6, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:code-review This requires code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Simple Analytics] Add Analytics Admin Page, Navigation & Controls

4 participants