I have 2 different problems but probably with the same cause:
In both cases the API does not seem to provide the expected answer but I can’t figure out the problem. I sometimes get an error message telling the JSON Response is not valid.
Any help would be appreciated.
s
]]>I’m facing an issue with the API REST. I’m trying to use a PUT request to modify the values of my metas (meta title, meta description, og meta title, og meta description, twitter meta title, twitter meta description), and an ACF field. Like the title says, i’m trying to do that for my product categories (I already succeeded doing it for my products).
The thing is, no matter what I use as JSON body, nothing works. I tried something like this (which is the information returned by the GET request) for my ACF field (I already downloaded the “ACF to REST API” plugin) :
{
“yoast_head_json”: {
“title”: “{{ $json.different[‘TITRE SEO’].inputA }}”,
“description”: “{{ $json.different[‘META DESCRIPTION’].inputA }}”,
“og_title”: “{{ $json.different[‘TITRE SEO’].inputA }}”,
“og_description”: “{{ $json.different[‘META DESCRIPTION’].inputA }}”,
“twitter_title”: “{{ $json.different[‘TITRE SEO’].inputA }}”,
“twitter_description”: “{{ $json.different[‘META DESCRIPTION’].inputA }}”
},
“fields”: {
“texte_de_referencement”: “{{ $json.different[‘TXT REF’].inputA }}”,
“titre_h1”: “{{ $json.different[‘H1 REF’].inputA }}”
}
}
For my ACF fields I also tried this :
{
“acf”: {
“titre_h1”: “{{ $json.different[‘H1 REF’].inputA }}”
}
}
(I’m trying with dynamic informations, but it won’t work with static informations either).
The url i’m using is https://www.mywebsite.com/wp-json/wc/v3/products/categories/product_cat_id and of course I have the right credentials (which allowed me to do the same, but successful request for my products “https://www.mywebsite.com/wp-json/wc/v3/products/product_id”).
Am I missing something ?
I also tried something like this, but still won’t work :
{
“meta_data”: [
{
“key”: “h1_title”,
“value”: “Updated H1 Title”
}
]
}
Is it something impossible for now ?
]]>templates/templates/map-global.php
.
This was not the correct fix. The JSON data should not be (directly) in a div
element. Instead it should be in a script
element with type=application/json
. If it is in the correct element type, it does not need escaping (and should not be).
The existence of the data in a display element (regadless of the inline style hack with display: none; visibility: hidden
) causes SEO issues. Search engines regard it as content for the page (they often ignore CSS and style
properties), include it in indexing, and may even include it in a snippet in search results.
This is a bug report. (I don’t know where else to report bugs.)
]]>Is there a fix for this? A setting I’m missing, or is this a bug in the latest version of WP?
Summary:
$l10n
parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script()
function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.) in \wwwroot\wp-includes\functions.php on line 6085″I have 9.3.3 installed.
I have tried saving the existing settings in my permalinks to no avail. I checked both my wordpress URL and site address URL are correct.
No logs were found. Here is the System Status Report
Thanks
### WordPress Environment ###
WordPress address (URL): [Redacted]
Site address (URL): [Redacted]
WC Version: 9.3.3
Legacy REST API Package Version: The Legacy REST API plugin is not installed on this site.
Action Scheduler Version: ✔ 3.8.1
Log Directory Writable: ✔
WP Version: 6.6.2
WP Multisite: –
WP Memory Limit: 256 MB
WP Debug Mode: –
WP Cron: ✔
Language: en_US
External object cache: –
### Server Environment ###
Server Info: Apache
PHP Version: 8.1.30
PHP Post Max Size: 128 MB
PHP Time Limit: 300
PHP Max Input Vars: 1000
cURL Version: 7.61.1
OpenSSL/1.1.1k
SUHOSIN Installed: –
MySQL Version: 8.0.40
Max Upload Size: 128 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ❌ Your server does not have the SoapClient class enabled - some gateway plugins which use SOAP may not work as expected.
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔
### Database ###
[REDACTED]
### Post Type Counts ###
attachment: 47
customize_changeset: 4
elementor_library: 1
nav_menu_item: 13
page: 14
post: 4
revision: 203
sfwd-courses: 3
sfwd-lessons: 24
sfwd-question: 37
sfwd-quiz: 5
sfwd-topic: 33
wp_block: 4
wp_global_styles: 2
wp_navigation: 1
### Security ###
Secure connection (HTTPS): ✔
Hide errors from visitors: ✔
### Active Plugins (5) ###
Kadence Blocks – Gutenberg Blocks for Page Builder Features: by Kadence WP – 3.3.3
LearnDash LMS - Course Grid: by LearnDash – 2.0.9
LearnDash LMS - WooCommerce Integration: by LearnDash – 2.0.0.1
LearnDash LMS: by LearnDash – 4.18.0.1
WooCommerce: by Automattic – 9.3.3
### Inactive Plugins (3) ###
Akismet Anti-spam: Spam Protection: by Automattic - Anti-spam Team – 5.3.3
Hello Dolly: by Matt Mullenweg – 1.7.2
Kadence AI Starter Templates: by Kadence WP – 2.1.3
### Settings ###
Legacy API Enabled: –
Force SSL: –
Currency: AUD ($)
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)
Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)
Connected to WooCommerce.com: –
Enforce Approved Product Download Directories: ✔
HPOS feature enabled: ✔
Order datastore: Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore
HPOS data sync enabled: –
### Logging ###
Enabled: ✔
Handler: Automattic\WooCommerce\Internal\Admin\Logging\LogHandlerFileV2
Retention period: 30 days
Level threshold: –
Log directory size: 13 B
### WC Pages ###
Shop base: ❌ Page ID is set
but the page does not exist
Cart: ❌ Page ID is set
but the page does not exist
Checkout: ❌ Page ID is set
but the page does not exist
My account: ❌ Page ID is set
but the page does not exist
Terms and conditions: ❌ Page not set
### Theme ###
Name: Kadence
Version: 1.2.10
Author URL: https://www.kadencewp.com/
Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme
WooCommerce Support: ✔
### Templates ###
Overrides: –
### Admin ###
Enabled Features: activity-panels
analytics
product-block-editor
coupons
core-profiler
customize-store
customer-effort-score-tracks
import-products-task
experimental-fashion-sample-products
shipping-smart-defaults
shipping-setting-tour
homescreen
marketing
mobile-app-banner
navigation
onboarding
onboarding-tasks
pattern-toolkit-full-composability
product-custom-fields
remote-inbox-notifications
remote-free-extensions
payment-gateway-suggestions
printful
shipping-label-banner
subscriptions
store-alerts
transient-notices
woo-mobile-welcome
wc-pay-promotion
wc-pay-welcome-page
launch-your-store
Disabled Features: experimental-blocks
minified-js
product-pre-publish-modal
settings
async-product-editor-category-field
product-editor-template-system
blueprint
reactify-classic-payments-settings
Daily Cron: ✔ Next scheduled: 2024-11-06 01:30:43 +00:00
Options: ✔
Notes: 60
Onboarding: completed
### Action Scheduler ###
Complete: 16
Oldest: 2024-11-01 01:27:14 +0000
Newest: 2024-11-04 23:50:55 +0000
Failed: 9
Oldest: 2024-11-01 01:28:39 +0000
Newest: 2024-11-05 08:35:24 +0000
Pending: 1
Oldest: 2024-11-06 08:35:24 +0000
Newest: 2024-11-06 08:35:24 +0000
### Status report information ###
Generated at: 2024-11-05 09:09:45 +00:00
]]>Someone can help me?
Thanks,
Philippe
]]>Failed to load resource: the server responded with a status of 404 (Not Found)
for . . .
https://cdn.trustindex.io/companies/26/26c7b0225310geb8/richsnippet.json
How can I fix this please?
Thank you
]]>/products
pages have this issue. I found this error on Google console saying:
Syntax error: value, object or array expected.
And it is coming from the product name, description, high price, and image fields in the schema. I reached out to wordpress to ask what the problem was and they said it was an issue with the AIO SEO plugin. I have not been able to find resources to diagnose this on my own and it has been affecting my website for the last few months.
By the way I am using WooCommerce for the products in the products pages.
Can anybody give some insight into this?
]]>