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

Closes #6329: Deprecate RUCSS Hooks #6342

Merged
merged 247 commits into from
Apr 30, 2024
Merged

Conversation

jeawhanlee
Copy link
Contributor

Description

This PR deprecates the use of RUCSS hooks.

Fixes #6329

Type of change

Is the solution different from the one proposed during the grooming?

Please describe in this section if there is any change to the groomed solution, and why.

Checklists

Generic development checklist

  • My code follows the style guidelines of this project, with adapted comments and without new warnings.
  • I have added unit and integration tests that prove my fix is effective or that my feature works.
  • The CI passes locally with my changes (including unit tests, integration tests, linter).
  • Any dependent changes have been merged and published in downstream modules.
  • If applicable, I have made corresponding changes to the documentation. Provide a link to the documentation.

Test summary

  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I validated all Acceptance Criteria of the related issues. (If applicable, provide proof).
  • I validated all test plan the QA Review asked me to.

If not, detail what you could not test.

Please describe any additional tests you performed.

@jeawhanlee jeawhanlee added type: sub-task Indicates the issue is a sub-task linked to an epics card lcp labels Dec 19, 2023
@jeawhanlee jeawhanlee added this to the 3.16 milestone Dec 19, 2023
@jeawhanlee jeawhanlee self-assigned this Dec 19, 2023
@jeawhanlee jeawhanlee linked an issue Dec 19, 2023 that may be closed by this pull request
@jeawhanlee jeawhanlee marked this pull request as ready for review December 19, 2023 10:48
@jeawhanlee jeawhanlee requested a review from a team December 19, 2023 10:48
@CrochetFeve0251
Copy link
Contributor

CrochetFeve0251 commented Dec 21, 2023

@Tabrisrp when I worked with @jeawhanlee on that seemed like the function was a good but after a while and remembering @piotrbak idea seems like it looked like the moment to create a class for filters and actions.

This would abstract the wiring between the old and new hooks at the level of the business logic and we would be able to add casting directly within the apply_filters method.

The idea is to create a Filter and an Action class.

Then in the deprecated file we reuse that classes to make the link between old and new hooks with something like (This is possible as deprecated logic is loaded after the container is loaded):

$filter->add_deprecated('old_hook', 'new_hook');

And inside the Filter and Action class we add an abstract logic to make the links based on an array and call the deprecated filter function.So inside the main logic we would have:

$result = $this->filter->apply_filter('new_hook', $param);

Concerning the casting issue we could create a method apply_string_filter , apply_int_filter for each base type and a method apply_filter with a callback for validation as second parameter so we would cover each cases.

What do you think @Tabrisrp, @piotrbak ?

@wordpressfan
Copy link
Contributor

@CrochetFeve0251 I like that idea so much, but I believe we need to use those new classes gradually because we have so many apply_filters and do_action in our code base.

@jeawhanlee
Copy link
Contributor Author

List of Deprecated Hooks

  • rocket_last_rucss_job_added_time -> rocket_last_saas_job_added_time
  • rocket_rucss_delete_interval -> rocket_saas_delete_interval
  • rocket_rucss_pending_jobs_cron_interval -> rocket_saas_pending_jobs_cron_interval
  • rocket_remove_rucss_failed_jobs_cron_interval -> rocket_remove_saas_failed_jobs_cron_interval
  • rocket_remove_rucss_on_submit_jobs_cron_interval -> rocket_remove_saas_on_submit_jobs_cron_interval
  • rocket_rucss_deletion_enabled -> rocket_saas_deletion_enabled
  • rocket_rucss_process_pending_jobs_start -> rocket_saas_process_pending_jobs_start
  • rocket_rucss_process_pending_jobs_end -> rocket_saas_process_pending_jobs_end
  • rocket_rucss_check_job_status_end -> rocket_saas_check_job_status_end
  • rocket_rucss_complete_job_status -> rocket_saas_complete_job_status
  • rocket_rucss_process_on_submit_jobs_start -> rocket_saas_process_on_submit_jobs_start
  • rocket_rucss_pending_jobs_cron_rows_count -> rocket_saas_pending_jobs_cron_rows_count
  • rocket_rucss_max_pending_jobs -> rocket_saas_max_pending_jobs
  • rocket_rucss_process_on_submit_jobs_end -> rocket_saas_process_on_submit_jobs_end
  • rocket_delay_remove_rucss_failed_jobs -> rocket_delay_remove_saas_failed_jobs
  • rocket_rucss_retry_table -> rocket_saas_retry_table
  • rocket_rucss_retry_duration -> rocket_saas_retry_duration
  • rocket_rucss_is_home_url -> rocket_saas_is_home_url

@MathieuLamiot
Copy link
Contributor

@piotrbak FYI. Do you need anything from the team about this? I think support and maybe public docs needs to be updated?

Base automatically changed from feature/lcp-above-the-fold-optimization to branch-3.16 April 29, 2024 19:42
@remyperona remyperona changed the base branch from branch-3.16 to develop April 29, 2024 20:00
@remyperona remyperona added this pull request to the merge queue Apr 30, 2024
Merged via the queue into develop with commit b86840b Apr 30, 2024
13 checks passed
@remyperona remyperona deleted the 6329-deprecate-rucss-hooks branch April 30, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: sub-task Indicates the issue is a sub-task linked to an epics card
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate old hooks for RUCSS
8 participants