Parsely / Parsely/wp-parsely

Review Utils::get_page_on_front() returns bool

Open
#2,880 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

wp-parsely
Dominant language
PHP
Stars
66
Forks
36
Avg merge
2d 2h
Merged PRs (30d)
16

Description

Is your request related to a problem?

We have this Utils::get_page_on_front() function, which is used by our Metadata->construct_metadata() function.

The Utils::get_page_on_front() name gives the impression that it could return a string (e.g. a page URL or slug) or an int (e.g. page ID). However, this function actually returns a bool. As such, it is either named inappropriately, or there is a better way to do things.

Describe the solution you'd like

Investigate if anything needs to be changed there.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing Utils::get_page_on_front() and its use in Metadata->construct_metadata(), then inspect other callers and any related tests. Determine whether the current boolean behavior or the function name should change; done means the required change, if any, is clearly scoped and covered by appropriate tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.