@lynxflow/seo-engine 1.8.23 → 1.8.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1134,6 +1134,20 @@ class LynxSeoUltimateEnterprisePlugin {
1134
1134
  'callback' => array($this, 'rest_run_audit'),
1135
1135
  'permission_callback' => function() { return current_user_can('manage_options'); }
1136
1136
  ));
1137
+
1138
+ // 🌐 Headless REST API for Next.js, Astro & Frontends
1139
+ register_rest_route('lynxseo/v1', '/head', array(
1140
+ 'methods' => 'GET',
1141
+ 'callback' => array($this, 'rest_get_head'),
1142
+ 'permission_callback' => '__return_true'
1143
+ ));
1144
+
1145
+ // 🏷️ White-Label Rebranding Settings
1146
+ register_rest_route('lynxseo/v1', '/white-label', array(
1147
+ 'methods' => 'POST',
1148
+ 'callback' => array($this, 'rest_save_white_label'),
1149
+ 'permission_callback' => function() { return current_user_can('manage_options'); }
1150
+ ));
1137
1151
  }
1138
1152
 
1139
1153
  public function rest_generate_meta($request) {
@@ -1220,6 +1234,46 @@ class LynxSeoUltimateEnterprisePlugin {
1220
1234
  'timestamp' => current_time('mysql')
1221
1235
  ));
1222
1236
  }
1237
+
1238
+ public function rest_get_head($request) {
1239
+ $url = esc_url_raw($request->get_param('url') ?: get_site_url());
1240
+ $title = get_bloginfo('name') . ' — ' . get_bloginfo('description');
1241
+ $desc = 'Plateforme de référence pour les professionnels et entreprises.';
1242
+
1243
+ return rest_ensure_response(array(
1244
+ 'url' => $url,
1245
+ 'title' => $title,
1246
+ 'metaDescription' => $desc,
1247
+ 'canonical' => $url,
1248
+ 'og' => array(
1249
+ 'title' => $title,
1250
+ 'description' => $desc,
1251
+ 'type' => 'website',
1252
+ 'image' => get_site_icon_url(1200) ?: (get_site_url() . '/og-image.jpg')
1253
+ ),
1254
+ 'schema' => array(
1255
+ '@context' => 'https://schema.org',
1256
+ '@type' => 'WebPage',
1257
+ 'name' => $title,
1258
+ 'description' => $desc
1259
+ ),
1260
+ 'robots' => 'index, follow, max-image-preview:large, max-snippet:-1'
1261
+ ));
1262
+ }
1263
+
1264
+ public function rest_save_white_label($request) {
1265
+ $params = $request->get_json_params();
1266
+ update_option('lynxseo_white_label', array(
1267
+ 'agency_name' => sanitize_text_field($params['agency_name'] ?? 'LynxSEO Studio'),
1268
+ 'custom_logo_url' => esc_url_raw($params['custom_logo_url'] ?? ''),
1269
+ 'hide_branding' => !empty($params['hide_branding'])
1270
+ ));
1271
+
1272
+ return rest_ensure_response(array(
1273
+ 'success' => true,
1274
+ 'message' => 'Marque blanche enregistrée avec succès !'
1275
+ ));
1276
+ }
1223
1277
  }
1224
1278
 
1225
1279
  new LynxSeoUltimateEnterprisePlugin();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynxflow/seo-engine",
3
- "version": "1.8.23",
3
+ "version": "1.8.24",
4
4
  "description": "High-Performance Multilingual Programmatic SEO & AI Search Engine SDK",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",