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

Add constant for disabling Action Scheduler loading #7148

Merged
merged 2 commits into from
Sep 5, 2023

Conversation

m1r0
Copy link
Member

@m1r0 m1r0 commented Sep 4, 2023

Resolves #7135

Proposed Changes

  • Introduce a constant (SENSEI_DO_NOT_LOAD_ACTION_SCHEDULER) for disabling the loading of the Action Scheduler library. It's the same one we use in sensei-pro.
  • Don't initialize the Sensei Action_Scheduler class and the Migrations if the Action Scheduler library is not loaded.

Testing Instructions

  1. Add define( 'SENSEI_DO_NOT_LOAD_ACTION_SCHEDULER', true ); to your wp-config.php
  2. Make sure the action scheduler is not loading.

I wasn't able to find a way to add unit tests for this.

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

@m1r0 m1r0 added this to the 4.16.2 milestone Sep 4, 2023
@m1r0 m1r0 self-assigned this Sep 4, 2023
@m1r0 m1r0 requested a review from a team September 4, 2023 18:17
@codecov
Copy link

codecov bot commented Sep 4, 2023

Codecov Report

Merging #7148 (5453444) into trunk (eb0bfa3) will decrease coverage by 0.01%.
Report is 1 commits behind head on trunk.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##              trunk    #7148      +/-   ##
============================================
- Coverage     49.68%   49.68%   -0.01%     
- Complexity    10623    10625       +2     
============================================
  Files           580      580              
  Lines         44876    44877       +1     
  Branches        402      402              
============================================
  Hits          22297    22297              
- Misses        22252    22253       +1     
  Partials        327      327              
Files Changed Coverage Δ
includes/class-sensei.php 22.93% <0.00%> (-0.06%) ⬇️

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 7f1925d...5453444. Read the comment docs.

merkushin
merkushin previously approved these changes Sep 5, 2023
Copy link
Member

@merkushin merkushin left a comment

Choose a reason for hiding this comment

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

Works as expected 👍

@m1r0 m1r0 merged commit 769a167 into trunk Sep 5, 2023
22 of 24 checks passed
@m1r0 m1r0 deleted the add/contant-for-disabling-action-schduler branch September 5, 2023 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Have the ability to avoid loading Action Scheduler
2 participants