Closed jmaas-onoffice closed 1 year ago
Modifications:
Additions:
@jmaas-onoffice When the user selects "Fill out", dismiss the warning and change setting to "Do not modify", then them select "Fill out" again. Should the warning be displayed again?
@LongTrong-exe Good question! I think it's best to show the warning again. They can still dismiss it. I've updated the requirements. 👍
Thanks!
@jmaas-onoffice have you any feedback for this task ?
@hungnc89 Yes, I'm reviewing the PRs in order of priority, that's why it's taking some time... But I just reviewed the corresponding PR.
Userstory
As a website visitor I want to share an estate with a friend. I want the link preview in Facebook to work.
Current state
Only the
<title>
tag is set.Even when the detail page is not indexed by search engines, the description is still important for showing link previews on e.g. Facebook.
Desired state
1. Modes
These options are placed in the plugin settings. The existing heading "Google Bot" (see current screenshot) is renamed to "SEO" and the new options are added below that labeled "Title and Description".
There are two radio buttons, one for each option, with explanations. In the description of the compatibility mode there is a
<details>
element which contains more information on the custom fields. The<details>
is opened in the screenshot so that you can see its content, but it should be closed by default. (The content of the<details>
is from a previous version. The current text is below.)Text:
2. Fill out
<title>
and<meta name="description">
tags containing the estate's title and description. The title is the full-length content of the fieldobjekttitel
. The description is the full-length content of the fieldobjektbeschreibung
.3. SEO plugin check
If the option "Fill out" is active, the plugin checks if popular SEO plugins are active. It should check for the plugins Yoast SEO, Rank Math SEO, and wpSEO. One way to check for this is
count(array_intersect( ["wordpress-seo/wp-seo.php", "seo-by-rank-math/rank-math.php", "wpseo/wpseo.php"], get_option("active_plugins"))) > 0
. If one of these plugins is found to be active, we consider it to be a "conflict".If a conflict was detected, our plugin displays a warning using
admin_notice
(https://developer.wordpress.org/reference/hooks/admin_notices/) in the stylenotice-warning
containing the name of the conflicting SEO plugin and a link to the detail page settings.Text:
The warning should be displayed as soon as possible (e.g. directly after a SEO plugin was activated). It should be shown as long as the conflict persists (until the SEO plugin is deactivated or our plugin configured to not change the title and description) or until the user dismisses the warning by clicking on the "x". If the user dismissed the warning and now changes the setting to "Do not modify" and then back to "Fill out", the warning should appear again.
The warning should be shown on all pages of the admin, so that the user cannot miss it. The only exception is that in the plugin settings, the warning is displayed near the new option.
Text for warning on settings:
4. Do not modify
<title>
and<meta name="description">
tags, in order to prevent conflicts with SEO plugins. Instead, it registers custom fields so that those SEO plugins have access to the information of the current estate. There is a hook available that allows to provide these custom fields on demand calledget_post_metadata
(https://developer.wordpress.org/reference/hooks/get_meta_type_metadata/).onoffice_
prefix. Foronoffice_objekttitel
it isobjekttitel
and foronoffice_objektnr_extern
it isobjektnr_extern
.Additionally, there is a need to restrict the length of some fields. For example, most SEO tools warn when the description is over 150 characters (including the ellipsis). Therefore, the custom field name should be able to contain a parameter for restricting the length, e.g.
onoffice_ellipsis150_objektbeschreibung
.onoffice[_ellipsis<characters>]_<fieldname>
. Soonoffice_objektbeschreibung
returns the full description,onoffice_ellipsis1000_objektbeschreibung
would limit the description to 1000 characters, andonoffice_ellipsis5_objekttitel
returns the title limited to 5 characters including the ellipsis, e.g. "I am…", since…
is a single character.