wp-rocket icon indicating copy to clipboard operation
wp-rocket copied to clipboard

The hook `rocket_saas_is_home_url` is confusing

Open CrochetFeve0251 opened this issue 5 months ago • 0 comments

Before submitting an issue please check that you’ve completed the following steps:

  • Made sure you’re on the latest version
  • Used the search feature to ensure that the bug hasn’t been reported before

Describe the bug The hook rocket_saas_is_home_url is confusing.

I was expecting it to return a boolean, but it expects a string instead.

I am opening the issue as @mostafa-hisham also got confused with this when doing the code review.

I think we need a boolean here which would give more freedom for users and developers and also fix this confusing behavior.

In the same way the method rocket_apply_filter_and_deprecated comes to mess on top of the confusion here passing the arguments inside an array where would expect them to be in the same syntax as for the apply_filters.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

Acceptance Criteria (for WP Media team use only) Clear instructions for developers, to be added before the grooming

CrochetFeve0251 avatar Aug 29 '24 14:08 CrochetFeve0251