Skip to content
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

Show Update notice on every Sensei page #6824

Conversation

fjorgemota
Copy link
Member

@fjorgemota fjorgemota commented Apr 19, 2023

Part of https://github.com/Automattic/senseilms-com-plugins/issues/169

Proposed Changes

  • Add support for passing the list of screens to get_base_plugin_notice;
  • Show update notice on every Sensei page;

Testing Instructions

  1. Change your Sensei Pro OR Sensei LMS (if your plugin folder is called sensei-lms, that is) version to refer to an old version;
  2. Make sure the update notice appears on every page;

Pre-Merge Checklist

  • PR title and description contain sufficient detail and accurately describe the changes
  • Acceptance criteria is met
  • Decisions are publicly documented
  • Adheres to coding standards (PHP, JavaScript, CSS, HTML)
  • All strings are translatable (without concatenation, handles plurals)
  • Follows our naming conventions (P6rkRX-4oA-p2)
  • Hooks (p6rkRX-1uS-p2) and functions are documented
  • New UIs are responsive and use a mobile-first approach
  • New UIs match the designs
  • Different user privileges (admin, teacher, subscriber) are tested as appropriate
  • Code is tested on the minimum supported PHP and WordPress versions
  • User interface changes have been tested on the latest versions of Chrome, Firefox and Safari
  • "Needs Documentation" label is added if this change requires updates to documentation
  • Known issues are created as new GitHub issues

@github-actions
Copy link

github-actions bot commented Apr 19, 2023

WordPress Dependencies Report

The github-action-wordpress-dependencies-report action has detected some script changes between the commit 32b167e and trunk. Please review and confirm the following are correct before merging.

Script Handle Added Dependencies Removed Dependencies Total Size Size Diff
css/senseilms-licensing.js wp-polyfill 24 B +24 B ( +100% 🔼 )

This comment was automatically generated by the github-action-wordpress-dependencies-report action.

@codecov
Copy link

codecov bot commented Apr 19, 2023

Codecov Report

Merging #6824 (32b167e) into feature/reengaging-customers (cb9cede) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@                       Coverage Diff                       @@
##             feature/reengaging-customers    #6824   +/-   ##
===============================================================
  Coverage                           47.27%   47.27%           
- Complexity                          10170    10171    +1     
===============================================================
  Files                                 500      500           
  Lines                               36113    36115    +2     
  Branches                              283      283           
===============================================================
+ Hits                                17071    17073    +2     
  Misses                              18830    18830           
  Partials                              212      212           
Impacted Files Coverage Δ
...s/admin/home/notices/class-sensei-home-notices.php 86.39% <100.00%> (+0.16%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb9cede...32b167e. Read the comment docs.

@fjorgemota fjorgemota requested a review from a team April 20, 2023 00:43
@fjorgemota fjorgemota marked this pull request as ready for review April 20, 2023 00:43
@fjorgemota fjorgemota force-pushed the change/show-update-notice-on-every-sensei-page branch from 2d55b35 to 32b167e Compare April 20, 2023 00:44
@fjorgemota fjorgemota self-assigned this Apr 20, 2023
Copy link
Contributor

@renatho renatho left a comment

Choose a reason for hiding this comment

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

This works well for me!
But I'm wondering if Sensei_Home_Notices is really the best place to keep this feature if we display the notice on all Sensei pages. Maybe we should extract it to a more generic location?

I'm approving it anyway in case you have a strong opinion about keeping it in this class. 😉

@fjorgemota
Copy link
Member Author

But I'm wondering if Sensei_Home_Notices is really the best place to keep this feature if we display the notice on all Sensei pages. Maybe we should extract it to a more generic location?
I'm approving it anyway in case you have a strong opinion about keeping it in this class. wink

Hey there. I totally agree with you, but, as discussed on Slack, this method has a dependency on Sensei_Home_Remote_Data_API, which means that would probably need to change that dependency too if we moved this to another method, which would be a bigger refactoring than what we're looking for to fix this issue, IMHO, and would be quite riskier too (as these classes are shared with Sensei Blocks too, for instance).

With that said, I'm going ahead and I'll merge this PR as is. Thanks very much for your review! 😃

@fjorgemota fjorgemota merged commit f9ef501 into feature/reengaging-customers May 2, 2023
@fjorgemota fjorgemota deleted the change/show-update-notice-on-every-sensei-page branch May 2, 2023 15:08
@aaronfc aaronfc mentioned this pull request May 2, 2023
14 tasks
@Imran92 Imran92 added this to the 4.14.0 milestone May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants