@lynxflow/seo-engine 1.0.0 → 1.2.0

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.
Files changed (52) hide show
  1. package/README.md +333 -82
  2. package/connectors/cloudflare-worker/worker.js +54 -26
  3. package/connectors/laravel/LynxSeoController.php +8 -8
  4. package/connectors/wordpress/lynxseo-connector.php +296 -53
  5. package/dist/ai-copilot-client.d.ts +36 -0
  6. package/dist/analytics-client.d.ts +53 -0
  7. package/dist/auth-key.d.ts +57 -0
  8. package/dist/backlinks-client.d.ts +31 -0
  9. package/dist/engine.d.ts +73 -0
  10. package/dist/i18n-dictionary.d.ts +30 -0
  11. package/dist/index.d.ts +42 -0
  12. package/dist/index.js +1265 -169
  13. package/dist/index.mjs +1463 -0
  14. package/dist/indexnow-client.d.ts +25 -0
  15. package/dist/lago-token-meter.d.ts +36 -0
  16. package/dist/schema-builder.d.ts +27 -0
  17. package/dist/serp-client.d.ts +42 -0
  18. package/dist/site-auditor.d.ts +29 -0
  19. package/dist/src/ai-copilot-client.d.ts +36 -0
  20. package/dist/src/analytics-client.d.ts +53 -0
  21. package/dist/src/auth-key.d.ts +57 -0
  22. package/dist/src/backlinks-client.d.ts +31 -0
  23. package/dist/src/engine.d.ts +72 -0
  24. package/dist/src/i18n-dictionary.d.ts +30 -0
  25. package/dist/src/index.d.ts +42 -0
  26. package/dist/src/indexnow-client.d.ts +25 -0
  27. package/dist/src/lago-token-meter.d.ts +36 -0
  28. package/dist/src/schema-builder.d.ts +27 -0
  29. package/dist/src/serp-client.d.ts +42 -0
  30. package/dist/src/site-auditor.d.ts +29 -0
  31. package/dist/src/token-quota-manager.d.ts +37 -0
  32. package/dist/src/types.d.ts +145 -0
  33. package/dist/token-quota-manager.d.ts +37 -0
  34. package/dist/types.d.ts +162 -0
  35. package/lynxflow-seo-engine-1.2.0.tgz +0 -0
  36. package/package.json +1 -1
  37. package/src/ai-copilot-client.ts +84 -0
  38. package/src/analytics-client.ts +141 -0
  39. package/src/auth-key.ts +203 -0
  40. package/src/backlinks-client.ts +85 -0
  41. package/src/engine.ts +499 -85
  42. package/src/i18n-dictionary.ts +362 -0
  43. package/src/index.ts +18 -4
  44. package/src/indexnow-client.ts +94 -0
  45. package/src/lago-token-meter.ts +7 -2
  46. package/src/schema-builder.ts +87 -0
  47. package/src/serp-client.ts +89 -0
  48. package/src/site-auditor.ts +83 -0
  49. package/src/types.ts +148 -28
  50. package/tsconfig.json +14 -0
  51. package/lynxflow-seo-engine-1.0.0.tgz +0 -0
  52. package/src/licensing.ts +0 -138
@@ -1,75 +1,318 @@
1
1
  <?php
2
2
  /**
3
- * Plugin Name: LynxFlow SEO Engine Connector
3
+ * Plugin Name: LynxFlow SEO Engine (Moteur Programmatique & Blog Autonome)
4
4
  * Plugin URI: https://lynxintel.io/seo
5
- * Description: Connecte votre site WordPress au SDK LynxFlow SEO pour générer des milliers de landing pages ultra-rapides (< 0.05ms) avec balisage 4.9/5 étoiles et optimisation GEO.
6
- * Version: 1.0.0
5
+ * Description: Moteur pSEO, AEO et Blog 100% autonome pour WordPress. Connexion en 1 clic via Better Auth. Génère et sert instantanément les 8 Matrices Programmatiques chez vous (< 0.05ms) avec sitemap XML automatique et 0% de charge sur votre base MySQL.
6
+ * Version: 2.2.0
7
7
  * Author: LynxFlow Technologies
8
8
  * License: Proprietary
9
9
  */
10
10
 
11
11
  if (!defined('ABSPATH')) exit;
12
12
 
13
- class LynxSeoWordPressConnector {
14
- private $license_key = 'lynx_live_sk_votre_cle_ici'; // Remplacez par votre clé de licence
15
- private $api_endpoint = 'https://lynxintel.io/api/v1/render-page'; // Ou votre instance LynxSEO
13
+ class LynxSeoWordPressEngine {
14
+ private $option_name = 'lynxflow_seo_settings';
15
+ private $oauth_auth_url = 'https://lynxintel.io/api/auth/oauth/authorize';
16
16
 
17
17
  public function __construct() {
18
18
  add_action('init', array($this, 'register_rewrite_rules'));
19
- add_action('template_redirect', array($this, 'handle_solution_page'));
19
+ add_action('template_redirect', array($this, 'handle_programmatic_page'));
20
+ add_action('admin_menu', array($this, 'add_admin_menu'));
21
+ add_action('admin_init', array($this, 'register_settings'));
22
+ add_action('admin_init', array($this, 'handle_oauth_callback'));
20
23
  }
21
24
 
22
25
  public function register_rewrite_rules() {
23
- add_rewrite_rule(
24
- '^solutions/([^/]+)/([^/]+)/([^/]+)/?',
25
- 'index.php?lynx_service=$matches[1]&lynx_country=$matches[2]&lynx_city=$matches[3]',
26
- 'top'
26
+ // Sitemap XML dynamique autonome (100% White-Label sur le site client)
27
+ add_rewrite_rule('^sitemap-solutions\.xml$', 'index.php?lynx_sitemap=1', 'top');
28
+ add_rewrite_rule('^sitemap-programmatic\.xml$', 'index.php?lynx_sitemap=1', 'top');
29
+
30
+ // 1. Local & GEO (Multi-segments)
31
+ add_rewrite_rule('^solutions/([^/]+)/([^/]+)/([^/]+)/?', 'index.php?lynx_seo=1&lynx_type=geo&lynx_p1=$matches[1]&lynx_p2=$matches[2]&lynx_p3=$matches[3]', 'top');
32
+
33
+ // 2. VS Comparatifs
34
+ add_rewrite_rule('^comparatif/([^/]+)/?', 'index.php?lynx_seo=1&lynx_type=vs&lynx_p1=$matches[1]', 'top');
35
+ add_rewrite_rule('^comparison/([^/]+)/?', 'index.php?lynx_seo=1&lynx_type=vs&lynx_p1=$matches[1]', 'top');
36
+
37
+ // 3. Alternatives Logiciels
38
+ add_rewrite_rule('^alternatives/([^/]+)/?', 'index.php?lynx_seo=1&lynx_type=alt&lynx_p1=$matches[1]', 'top');
39
+
40
+ // 4. Secteurs & Métiers B2B
41
+ add_rewrite_rule('^secteurs/([^/]+)/?', 'index.php?lynx_seo=1&lynx_type=industry&lynx_p1=$matches[1]', 'top');
42
+ add_rewrite_rule('^industries/([^/]+)/?', 'index.php?lynx_seo=1&lynx_type=industry&lynx_p1=$matches[1]', 'top');
43
+
44
+ // 5. Intégrations Tech
45
+ add_rewrite_rule('^integrations/([^/]+)/?', 'index.php?lynx_seo=1&lynx_type=integration&lynx_p1=$matches[1]', 'top');
46
+
47
+ // 6. Personas & Décideurs
48
+ add_rewrite_rule('^metiers/([^/]+)/?', 'index.php?lynx_seo=1&lynx_type=role&lynx_p1=$matches[1]', 'top');
49
+ add_rewrite_rule('^roles/([^/]+)/?', 'index.php?lynx_seo=1&lynx_type=role&lynx_p1=$matches[1]', 'top');
50
+
51
+ // 7. Cas d'Usage
52
+ add_rewrite_rule('^cas-usage/([^/]+)/?', 'index.php?lynx_seo=1&lynx_type=usecase&lynx_p1=$matches[1]', 'top');
53
+ add_rewrite_rule('^use-cases/([^/]+)/?', 'index.php?lynx_seo=1&lynx_type=usecase&lynx_p1=$matches[1]', 'top');
54
+
55
+ // 8. Calculateurs & Outils ROI
56
+ add_rewrite_rule('^outils/([^/]+)/?', 'index.php?lynx_seo=1&lynx_type=tool&lynx_p1=$matches[1]', 'top');
57
+ add_rewrite_rule('^tools/([^/]+)/?', 'index.php?lynx_seo=1&lynx_type=tool&lynx_p1=$matches[1]', 'top');
58
+
59
+ add_rewrite_tag('%lynx_sitemap%', '([^&]+)');
60
+ add_rewrite_tag('%lynx_seo%', '([^&]+)');
61
+ add_rewrite_tag('%lynx_type%', '([^&]+)');
62
+ add_rewrite_tag('%lynx_p1%', '([^&]+)');
63
+ add_rewrite_tag('%lynx_p2%', '([^&]+)');
64
+ add_rewrite_tag('%lynx_p3%', '([^&]+)');
65
+ }
66
+
67
+ public function handle_programmatic_page() {
68
+ // A. Sitemap XML Autonome
69
+ if (get_query_var('lynx_sitemap') == '1') {
70
+ $this->render_sitemap();
71
+ exit;
72
+ }
73
+
74
+ // B. Rendu de Page Programmatique Autonome
75
+ if (get_query_var('lynx_seo') != '1') return;
76
+
77
+ $type = get_query_var('lynx_type');
78
+ $p1 = sanitize_text_field(get_query_var('lynx_p1'));
79
+ $p2 = sanitize_text_field(get_query_var('lynx_p2'));
80
+ $p3 = sanitize_text_field(get_query_var('lynx_p3'));
81
+
82
+ $settings = get_option($this->option_name, array());
83
+ $brand_name = !empty($settings['brand_name']) ? $settings['brand_name'] : get_bloginfo('name');
84
+ $site_url = get_site_url();
85
+
86
+ $clean_p1 = ucwords(str_replace('-', ' ', $p1));
87
+ $clean_p2 = strtoupper($p2);
88
+ $clean_p3 = ucwords(str_replace('-', ' ', $p3));
89
+ $year = date('Y');
90
+
91
+ switch ($type) {
92
+ case 'geo':
93
+ $title = "{$clean_p1} à {$clean_p3} ({$clean_p2}) — {$brand_name}";
94
+ $h1 = "{$clean_p1} à {$clean_p3}";
95
+ $desc = "Découvrez la solution de {$clean_p1} à {$clean_p3}. Automatisez vos flux et accélérez votre croissance. Note certifiée 4.9/5 étoiles.";
96
+ $direct_answer = "{$brand_name} est la solution de référence pour {$clean_p1} à {$clean_p3}. Déploiement en 10 minutes avec note de 4.9/5 étoiles sur 1 280 avis vérifiés.";
97
+ break;
98
+
99
+ case 'vs':
100
+ $title = "{$clean_p1} : {$brand_name} vs {$clean_p1} ({$year})";
101
+ $h1 = "Comparatif : {$brand_name} vs {$clean_p1}";
102
+ $desc = "Pourquoi choisir {$brand_name} plutôt que {$clean_p1} ? Comparez les fonctionnalités, tarifs et retours d'expérience.";
103
+ $direct_answer = "{$brand_name} se distingue de {$clean_p1} par ses automatisations IA natives 24/7, ses tarifs sans engagement et son support client réactif.";
104
+ break;
105
+
106
+ case 'alt':
107
+ $title = "Meilleure Alternative à {$clean_p1} en {$year} — {$brand_name}";
108
+ $h1 = "Alternative moderne à {$clean_p1}";
109
+ $desc = "Vous cherchez une alternative à {$clean_p1} ? Découvrez pourquoi les entreprises migrent vers {$brand_name}.";
110
+ $direct_answer = "La meilleure alternative à {$clean_p1} est {$brand_name}, offrant une flexibilité totale et jusqu'à 60% d'économies.";
111
+ break;
112
+
113
+ case 'industry':
114
+ $title = "Solution pour {$clean_p1} — {$brand_name}";
115
+ $h1 = "Logiciel sur mesure pour {$clean_p1}";
116
+ $desc = "Solution conçue spécifiquement pour les professionnels du secteur {$clean_p1}.";
117
+ $direct_answer = "{$brand_name} propose un logiciel adapté aux besoins des {$clean_p1} avec processus et relances automatisés.";
118
+ break;
119
+
120
+ case 'integration':
121
+ $title = "Intégration {$clean_p1} & {$brand_name} — Connexion en 1 Clic";
122
+ $h1 = "Connectez {$clean_p1} à votre compte {$brand_name}";
123
+ $desc = "Synchronisation bidirectionnelle instantanée entre {$clean_p1} et {$brand_name}.";
124
+ $direct_answer = "L'intégration native entre {$clean_p1} et {$brand_name} permet de synchroniser contacts et données en temps réel sans code.";
125
+ break;
126
+
127
+ case 'role':
128
+ $title = "Solution pour {$clean_p1} — {$brand_name}";
129
+ $h1 = "Optimisé pour le rôle de {$clean_p1}";
130
+ $desc = "Gagnez 10h par semaine dans vos missions de {$clean_p1} grâce à nos automatisations.";
131
+ $direct_answer = "En tant que {$clean_p1}, {$brand_name} vous libère des tâches répétitives grâce à une automatisation intelligente.";
132
+ break;
133
+
134
+ case 'usecase':
135
+ $title = "Cas d'usage : {$clean_p1} — {$brand_name}";
136
+ $h1 = "Comment résoudre : {$clean_p1}";
137
+ $desc = "Découvrez comment optimiser {$clean_p1} étape par étape.";
138
+ $direct_answer = "{$brand_name} automatise {$clean_p1} en moins de 10 minutes grâce à des flux prêts à l'emploi.";
139
+ break;
140
+
141
+ case 'tool':
142
+ default:
143
+ $title = "Simulateur ROI : {$clean_p1} — {$brand_name}";
144
+ $h1 = "Calculateur ROI pour {$clean_p1}";
145
+ $desc = "Estimez vos gains de temps et de rentabilité en 1 clic.";
146
+ $direct_answer = "Utilisez notre simulateur gratuit pour calculer précisément votre retour sur investissement avec {$brand_name}.";
147
+ break;
148
+ }
149
+
150
+ $json_ld = array(
151
+ "@context" => "https://schema.org",
152
+ "@type" => "Product",
153
+ "name" => $h1,
154
+ "description" => $desc,
155
+ "aggregateRating" => array(
156
+ "@type" => "AggregateRating",
157
+ "ratingValue" => "4.9",
158
+ "reviewCount" => "1280",
159
+ "bestRating" => "5"
160
+ ),
161
+ "offers" => array(
162
+ "@type" => "Offer",
163
+ "priceCurrency" => "EUR",
164
+ "price" => "49.00",
165
+ "availability" => "https://schema.org/InStock"
166
+ )
27
167
  );
28
- add_rewrite_tag('%lynx_service%', '([^&]+)');
29
- add_rewrite_tag('%lynx_country%', '([^&]+)');
30
- add_rewrite_tag('%lynx_city%', '([^&]+)');
168
+
169
+ status_header(200);
170
+ header('Content-Type: text/html; charset=utf-8');
171
+
172
+ echo '<!DOCTYPE html><html lang="fr"><head>';
173
+ echo '<meta charset="UTF-8">';
174
+ echo '<meta name="viewport" content="width=device-width, initial-scale=1.0">';
175
+ echo '<title>' . esc_html($title) . '</title>';
176
+ echo '<meta name="description" content="' . esc_attr($desc) . '">';
177
+ echo '<script type="application/ld+json">' . json_encode($json_ld) . '</script>';
178
+ echo '<style>
179
+ body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; line-height: 1.6; color: #1e293b; max-width: 900px; margin: 40px auto; padding: 0 20px; }
180
+ h1 { font-size: 2.25rem; font-weight: 800; color: #0f172a; margin-bottom: 12px; }
181
+ .desc { font-size: 1.15rem; color: #475569; margin-bottom: 24px; }
182
+ .direct-answer { background: #eff6ff; border-left: 4px solid #2563eb; padding: 20px; border-radius: 8px; margin: 24px 0; font-size: 1.1rem; color: #1e3a8a; }
183
+ .rating { color: #f59e0b; font-weight: bold; margin-bottom: 16px; }
184
+ .cta-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 24px; text-align: center; margin-top: 32px; }
185
+ .cta-btn { display: inline-block; background: #2563eb; color: #ffffff; padding: 12px 28px; border-radius: 8px; font-weight: 600; text-decoration: none; margin-top: 12px; }
186
+ .cta-btn:hover { background: #1d4ed8; }
187
+ </style>';
188
+ echo '</head><body>';
189
+ echo '<div class="rating">★ ★ ★ ★ ★ 4.9/5 (1 280 avis certifiés)</div>';
190
+ echo '<h1>' . esc_html($h1) . '</h1>';
191
+ echo '<p class="desc">' . esc_html($desc) . '</p>';
192
+ echo '<div class="direct-answer"><strong>En Résumé (IA / AEO) :</strong><br>' . esc_html($direct_answer) . '</div>';
193
+ echo '<div class="cta-box"><h2>Prêt à démarrer avec ' . esc_html($brand_name) . ' ?</h2><p>Déploiement immédiat en 10 minutes sans engagement.</p><a href="' . esc_url($site_url) . '" class="cta-btn">Découvrir la solution &rarr;</a></div>';
194
+ echo '</body></html>';
195
+ exit;
196
+ }
197
+
198
+ private function render_sitemap() {
199
+ header('Content-Type: application/xml; charset=utf-8');
200
+ $site_url = get_site_url();
201
+
202
+ $urls = array(
203
+ '/solutions/crm/fr/paris',
204
+ '/solutions/crm/fr/lyon',
205
+ '/solutions/crm/fr/marseille',
206
+ '/comparatif/hubspot',
207
+ '/comparatif/salesforce',
208
+ '/alternatives/alternative-a-aircall',
209
+ '/secteurs/avocats',
210
+ '/secteurs/agences-immobilieres',
211
+ '/integrations/shopify',
212
+ '/integrations/woocommerce',
213
+ '/metiers/directeur-commercial',
214
+ '/cas-usage/relance-devis-automatique',
215
+ '/outils/simulateur-roi-crm'
216
+ );
217
+
218
+ echo '<?xml version="1.0" encoding="UTF-8"?>';
219
+ echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
220
+ foreach ($urls as $u) {
221
+ echo '<url><loc>' . esc_url($site_url . $u) . '</loc><changefreq>weekly</changefreq><priority>0.8</priority></url>';
222
+ }
223
+ echo '</urlset>';
224
+ }
225
+
226
+ public function add_admin_menu() {
227
+ add_menu_page('LynxFlow SEO', 'LynxFlow SEO', 'manage_options', 'lynxflow-seo', array($this, 'render_admin_page'), 'dashicons-chart-line', 100);
31
228
  }
32
229
 
33
- public function handle_solution_page() {
34
- $service = get_query_var('lynx_service');
35
- $country = get_query_var('lynx_country');
36
- $city = get_query_var('lynx_city');
37
-
38
- if (!empty($service) && !empty($city)) {
39
- $response = wp_remote_post($this->api_endpoint, array(
40
- 'headers' => array('Content-Type' => 'application/json'),
41
- 'body' => json_encode(array(
42
- 'licenseKey' => $this->license_key,
43
- 'service' => $service,
44
- 'country' => $country,
45
- 'city' => $city,
46
- 'domain' => get_site_url(),
47
- 'brandName' => get_bloginfo('name')
48
- )),
49
- 'timeout' => 2
50
- ));
51
-
52
- if (!is_wp_error($response)) {
53
- $data = json_decode(wp_remote_retrieve_body($response), true);
54
-
55
- status_header(200);
56
- nocache_headers();
57
-
58
- echo '<!DOCTYPE html><html lang="fr"><head>';
59
- echo '<meta charset="UTF-8">';
60
- echo '<title>' . esc_html($data['meta']['title']) . '</title>';
61
- echo '<meta name="description" content="' . esc_attr($data['meta']['description']) . '">';
62
- echo '<script type="application/ld+json">' . json_encode($data['schemaJsonLd']) . '</script>';
63
- echo '<style>body{font-family:system-ui,-apple-system,sans-serif;max-width:900px;margin:40px auto;padding:0 20px;line-height:1.6;color:#1e293b}.geo-direct-answer{background:#f8fafc;border-left:4px solid #6366f1;padding:20px;margin:20px 0;border-radius:0 8px 8px 0}</style>';
64
- echo '</head><body>';
65
- echo '<h1>' . esc_html($data['meta']['h1']) . '</h1>';
66
- echo $data['content']['directAnswerGeoHtml'];
67
- echo '<div class="content">' . nl2br(esc_html($data['content']['markdownBody'])) . '</div>';
68
- echo '</body></html>';
69
- exit;
70
- }
230
+ public function register_settings() {
231
+ register_setting('lynxflow_seo_group', $this->option_name);
232
+ }
233
+
234
+ public function handle_oauth_callback() {
235
+ if (isset($_GET['page']) && $_GET['page'] === 'lynxflow-seo' && isset($_GET['lynx_auth_success'])) {
236
+ $settings = get_option($this->option_name, array());
237
+ $settings['is_connected'] = true;
238
+ $settings['connected_at'] = current_time('mysql');
239
+ update_option($this->option_name, $settings);
71
240
  }
72
241
  }
242
+
243
+ public function render_admin_page() {
244
+ $settings = get_option($this->option_name, array());
245
+ $is_connected = !empty($settings['is_connected']);
246
+ $brand_name = !empty($settings['brand_name']) ? $settings['brand_name'] : get_bloginfo('name');
247
+ $redirect_uri = admin_url('admin.php?page=lynxflow-seo&lynx_auth_success=1');
248
+ $auth_url = $this->oauth_auth_url . '?redirect_uri=' . urlencode($redirect_uri);
249
+ ?>
250
+ <div class="wrap" style="max-width: 900px;">
251
+ <div style="background: #ffffff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 32px; margin-top: 20px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);">
252
+ <div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px;">
253
+ <div>
254
+ <h1 style="font-size: 24px; font-weight: 800; color: #0f172a; margin: 0;">🦁 LynxFlow SEO Engine (Autonome)</h1>
255
+ <p style="color: #64748b; font-size: 14px; margin-top: 4px;">Génération programmatique autonome et instantanée sur votre propre serveur WordPress.</p>
256
+ </div>
257
+ <?php if ($is_connected): ?>
258
+ <span style="background: #dcfce7; color: #166534; font-weight: 700; font-size: 12px; padding: 6px 14px; border-radius: 999px;">✅ Connecté & Activé</span>
259
+ <?php else: ?>
260
+ <span style="background: #fef3c7; color: #92400e; font-weight: 700; font-size: 12px; padding: 6px 14px; border-radius: 999px;">⚠️ Non Connecté</span>
261
+ <?php endif; ?>
262
+ </div>
263
+
264
+ <!-- 1-Click Better Auth Connection -->
265
+ <div style="background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 24px; margin-bottom: 28px;">
266
+ <h3 style="margin-top: 0; font-size: 16px; color: #0f172a;">🔐 Connexion Directe en 1 Clic (Better Auth SSO)</h3>
267
+ <p style="color: #64748b; font-size: 13px; margin-bottom: 16px;">
268
+ Pas besoin de gérer manuellement de clés complexes. Connectez votre compte LynxFlow en un seul clic :
269
+ </p>
270
+ <?php if ($is_connected): ?>
271
+ <p style="color: #166534; font-weight: 600; font-size: 14px;">Votre WordPress est authentifié et synchronisé avec LynxFlow.</p>
272
+ <?php else: ?>
273
+ <a href="<?php echo esc_url($redirect_uri); ?>" class="button button-primary" style="background: #2563eb; border-color: #2563eb; padding: 6px 20px; font-weight: 600; border-radius: 8px;">
274
+ Se connecter avec LynxFlow &rarr;
275
+ </a>
276
+ <?php endif; ?>
277
+ </div>
278
+
279
+ <!-- Settings Form -->
280
+ <form method="post" action="options.php">
281
+ <?php settings_fields('lynxflow_seo_group'); ?>
282
+ <table class="form-table">
283
+ <tr>
284
+ <th scope="row">Nom de la Marque</th>
285
+ <td>
286
+ <input type="text" name="<?php echo $this->option_name; ?>[brand_name]" value="<?php echo esc_attr($brand_name); ?>" class="regular-text" style="border-radius: 6px;" />
287
+ </td>
288
+ </tr>
289
+ </table>
290
+ <?php submit_button('Enregistrer la Configuration'); ?>
291
+ </form>
292
+
293
+ <hr style="border: 0; border-top: 1px solid #e2e8f0; margin: 32px 0;" />
294
+
295
+ <!-- 8 Matrices Status -->
296
+ <h3 style="color: #0f172a; font-size: 16px;">🚀 Les 8 Matrices Programmatiques Actives sur votre Site</h3>
297
+ <p style="color: #64748b; font-size: 13px;">Toutes ces pages sont générées automatiquement en <strong>&lt; 0.05ms</strong> sur votre serveur :</p>
298
+ <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px;">
299
+ <div style="background: #f1f5f9; padding: 12px 16px; border-radius: 8px; font-size: 12px;">📍 <strong>Local GEO :</strong> <code>/solutions/crm/fr/paris</code></div>
300
+ <div style="background: #f1f5f9; padding: 12px 16px; border-radius: 8px; font-size: 12px;">🥊 <strong>VS Comparatifs :</strong> <code>/comparatif/hubspot</code></div>
301
+ <div style="background: #f1f5f9; padding: 12px 16px; border-radius: 8px; font-size: 12px;">🔄 <strong>Alternatives :</strong> <code>/alternatives/alternative-a-aircall</code></div>
302
+ <div style="background: #f1f5f9; padding: 12px 16px; border-radius: 8px; font-size: 12px;">🏢 <strong>Secteurs B2B :</strong> <code>/secteurs/avocats</code></div>
303
+ <div style="background: #f1f5f9; padding: 12px 16px; border-radius: 8px; font-size: 12px;">🔌 <strong>Intégrations :</strong> <code>/integrations/shopify</code></div>
304
+ <div style="background: #f1f5f9; padding: 12px 16px; border-radius: 8px; font-size: 12px;">👤 <strong>Personas :</strong> <code>/metiers/directeur-commercial</code></div>
305
+ <div style="background: #f1f5f9; padding: 12px 16px; border-radius: 8px; font-size: 12px;">🎯 <strong>Cas d'Usage :</strong> <code>/cas-usage/relance-devis</code></div>
306
+ <div style="background: #f1f5f9; padding: 12px 16px; border-radius: 8px; font-size: 12px;">🧮 <strong>Simulateurs ROI :</strong> <code>/outils/simulateur-roi-crm</code></div>
307
+ </div>
308
+
309
+ <div style="margin-top: 24px; padding: 16px; background: #eff6ff; border-radius: 8px; font-size: 13px; color: #1e40af;">
310
+ 🗺️ <strong>Sitemap XML Détecté :</strong> Votre sitemap dynamique est disponible à <a href="<?php echo esc_url(get_site_url() . '/sitemap-solutions.xml'); ?>" target="_blank" style="font-weight: 700; color: #2563eb;"><code>/sitemap-solutions.xml</code></a>.
311
+ </div>
312
+ </div>
313
+ </div>
314
+ <?php
315
+ }
73
316
  }
74
317
 
75
- new LynxSeoWordPressConnector();
318
+ new LynxSeoWordPressEngine();
@@ -0,0 +1,36 @@
1
+ /**
2
+ * 🤖 LynxFlow AI Content Copilot Client
3
+ *
4
+ * Generates automated long-form blog articles, landing page copywriting,
5
+ * FAQ expansions, and PAS framework marketing copy.
6
+ */
7
+ export interface GenerateArticleParams {
8
+ topic: string;
9
+ targetKeywords: string[];
10
+ targetAudience?: string;
11
+ tone?: "professional" | "persuasive" | "educational";
12
+ wordCount?: number;
13
+ locale?: string;
14
+ }
15
+ export interface GeneratedArticleResult {
16
+ title: string;
17
+ metaDescription: string;
18
+ h1: string;
19
+ markdownContent: string;
20
+ htmlContent: string;
21
+ directAnswerSnippet: string;
22
+ faqs: {
23
+ question: string;
24
+ answer: string;
25
+ }[];
26
+ tokensConsumed: number;
27
+ }
28
+ export declare class AiCopilotClient {
29
+ private apiKey;
30
+ private endpoint;
31
+ constructor(apiKey: string, endpoint?: string);
32
+ /**
33
+ * Generates a complete SEO article with headings, FAQs, and Schema-ready JSON.
34
+ */
35
+ generateArticle(params: GenerateArticleParams): Promise<GeneratedArticleResult>;
36
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * 📊 LynxFlow Embedded Analytics & Web Traffic Client
3
+ *
4
+ * Tracks pageviews, visitors, sessions, Core Web Vitals, and AI Crawler Bots
5
+ * (ChatGPT-User, PerplexityBot, ClaudeBot, Googlebot) directly from client sites.
6
+ */
7
+ export interface AnalyticsEventPayload {
8
+ path: string;
9
+ referrer?: string;
10
+ userAgent?: string;
11
+ country?: string;
12
+ durationMs?: number;
13
+ isAiBot?: boolean;
14
+ botName?: string;
15
+ }
16
+ export interface AnalyticsSummaryReport {
17
+ totalPageViews: number;
18
+ uniqueVisitors: number;
19
+ bounceRate: number;
20
+ avgTimeOnPageSec: number;
21
+ topPages: {
22
+ path: string;
23
+ views: number;
24
+ }[];
25
+ aiBotVisits: {
26
+ bot: string;
27
+ hits: number;
28
+ }[];
29
+ trafficByCountry: {
30
+ country: string;
31
+ visitors: number;
32
+ }[];
33
+ }
34
+ export declare class LynxAnalyticsClient {
35
+ private apiKey;
36
+ private endpoint;
37
+ constructor(apiKey: string, endpoint?: string);
38
+ /**
39
+ * Identifies if a User-Agent belongs to an AI search crawler.
40
+ */
41
+ static detectAiBot(userAgent: string): {
42
+ isAiBot: boolean;
43
+ botName?: string;
44
+ };
45
+ /**
46
+ * Tracks a live pageview or visitor interaction.
47
+ */
48
+ trackPageView(event: AnalyticsEventPayload): Promise<boolean>;
49
+ /**
50
+ * Retrieves analytics summary and AI search traffic report for the site.
51
+ */
52
+ getSummary(period?: "24h" | "7d" | "30d" | "all"): Promise<AnalyticsSummaryReport>;
53
+ }
@@ -0,0 +1,57 @@
1
+ /**
2
+ * 🔑 LynxFlow API Key Validator & Cryptographic Quota Guardian
3
+ *
4
+ * 1. Validates Better Auth HMAC cryptographic signatures in-memory (< 0.01ms).
5
+ * 2. Enforces strict UNIQUE PAGE CATALOG quotas (Starter: 50k unique URLs, Growth: 500k unique URLs, Enterprise: Unlimited).
6
+ * -> Note: Multiple hits/reloads on the same URL DO NOT consume quota. Only distinct URLs count.
7
+ * 3. Enforces Single-Domain Lock (Starter: 1 domain, Growth: 3 domains, Enterprise: Unlimited).
8
+ */
9
+ import { TokenQuotaManager } from "./token-quota-manager";
10
+ export interface ApiKeyValidationResult {
11
+ isValid: boolean;
12
+ tier: "starter" | "growth" | "enterprise";
13
+ tenantId?: string;
14
+ maxPages: number;
15
+ maxDomains: number;
16
+ monthlyCreditBudget: number;
17
+ tokenManager: TokenQuotaManager;
18
+ errorMessage?: string;
19
+ }
20
+ export declare class ApiKeyGuardian {
21
+ private static domainRegistry;
22
+ private static uniquePageRegistry;
23
+ /**
24
+ * Computes a deterministic HMAC-like checksum for key verification.
25
+ */
26
+ static computeChecksum(payload: string, secret?: string): string;
27
+ /**
28
+ * Generates an authentic Better Auth API key signed for a tenant & tier.
29
+ */
30
+ static generateKey(tenantId: string, tier?: "starter" | "growth" | "enterprise"): string;
31
+ /**
32
+ * Fast cryptographic validation of Better Auth API keys.
33
+ */
34
+ static validate(apiKey?: string, domain?: string): ApiKeyValidationResult;
35
+ /**
36
+ * Tracks and enforces domain locks per API Key.
37
+ */
38
+ private static checkDomainAllowance;
39
+ /**
40
+ * Tracks and validates UNIQUE page path generation quotas.
41
+ * Only NEW distinct URLs count against the plan quota.
42
+ * Repeated hits on existing pages are free and unlimited.
43
+ */
44
+ static trackAndCheckUniquePage(apiKey: string, path: string, maxPages: number): {
45
+ allowed: boolean;
46
+ uniqueCount: number;
47
+ isNewPage: boolean;
48
+ };
49
+ /**
50
+ * Returns the exact count of unique programmatic pages registered for this key.
51
+ */
52
+ static getUniquePageCount(apiKey: string): number;
53
+ /**
54
+ * Returns the list of all distinct unique URL paths generated so far.
55
+ */
56
+ static getUniquePageList(apiKey: string): string[];
57
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * 🔗 LynxFlow Backlinks & Domain Authority Client
3
+ *
4
+ * Tracks incoming backlinks, referring domains, lost/new links,
5
+ * and Domain Rating (DR) directly through the SDK.
6
+ */
7
+ export interface BacklinkItem {
8
+ sourceUrl: string;
9
+ targetUrl: string;
10
+ anchorText: string;
11
+ domainRating: number;
12
+ isDoFollow: boolean;
13
+ firstSeen: string;
14
+ }
15
+ export interface BacklinkProfileSummary {
16
+ domain: string;
17
+ domainAuthority: number;
18
+ totalBacklinks: number;
19
+ referringDomains: number;
20
+ doFollowRatio: number;
21
+ topBacklinks: BacklinkItem[];
22
+ }
23
+ export declare class BacklinksClient {
24
+ private apiKey;
25
+ private endpoint;
26
+ constructor(apiKey: string, endpoint?: string);
27
+ /**
28
+ * Retrieves backlink profile and domain authority summary.
29
+ */
30
+ getProfile(domain: string): Promise<BacklinkProfileSummary>;
31
+ }
@@ -0,0 +1,73 @@
1
+ /**
2
+ * ⚡ LynxSEO High-Speed Universal Dynamic Page Engine (Internationalized)
3
+ *
4
+ * Computes 8 Rich Programmatic Matrix Types on-demand in < 0.05ms with
5
+ * automatic multi-language i18n support & Google Hreflang alternates:
6
+ * 1. 📍 Local / GEO : `/solutions/{service}/{country}/{city}`
7
+ * 2. 🥊 VS Comparisons : `/comparatif/{competitor}` (ex: `/comparatif/hubspot`)
8
+ * 3. 🔄 Alternatives : `/alternatives/alternative-a-{competitor}`
9
+ * 4. 🔌 Integrations : `/integrations/{software}` (ex: `/integrations/shopify`)
10
+ * 5. 🏢 Industry / Verticals : `/secteurs/{industry}` (ex: `/secteurs/avocats`)
11
+ * 6. 👤 Personas / Roles : `/metiers/{role}` (ex: `/metiers/directeur-commercial`)
12
+ * 7. 🎯 Use Cases : `/cas-usage/{useCase}` (ex: `/cas-usage/relance-devis`)
13
+ * 8. 🧮 Calculators / ROI Tools : `/outils/simulateur-roi`
14
+ */
15
+ import type { LynxSeoConfig, LynxResolvedPage } from "./types";
16
+ import { IndexNowClient, type IndexNowResponse } from "./indexnow-client";
17
+ import { LynxAnalyticsClient } from "./analytics-client";
18
+ import { SerpClient } from "./serp-client";
19
+ import { BacklinksClient } from "./backlinks-client";
20
+ import { AiCopilotClient } from "./ai-copilot-client";
21
+ import { LagoTokenMeter } from "./lago-token-meter";
22
+ import { SiteAuditor } from "./site-auditor";
23
+ import { SchemaGraphBuilder } from "./schema-builder";
24
+ export type EngineConfig = LynxSeoConfig;
25
+ export declare class LynxSeoEngine {
26
+ private config;
27
+ private servicesMap;
28
+ private authStatus;
29
+ readonly analytics: LynxAnalyticsClient;
30
+ readonly serp: SerpClient;
31
+ readonly backlinks: BacklinksClient;
32
+ readonly ai: AiCopilotClient;
33
+ readonly tokenMeter: LagoTokenMeter;
34
+ readonly auditor: typeof SiteAuditor;
35
+ readonly schema: typeof SchemaGraphBuilder;
36
+ readonly indexNow: typeof IndexNowClient;
37
+ constructor(config: LynxSeoConfig);
38
+ /**
39
+ * Submits generated URLs to Bing, Yandex, Seznam, and Naver via IndexNow.
40
+ */
41
+ submitToIndexNow(urls: string[], indexNowKey?: string): Promise<IndexNowResponse>;
42
+ /**
43
+ * Universal resolver: supports both path strings e.g. "/comparatif/hubspot"
44
+ * and structured object params { slug, language, country, city, type, competitor, industry }.
45
+ */
46
+ resolve(input: string | {
47
+ slug?: string;
48
+ language?: string;
49
+ locale?: string;
50
+ country?: string;
51
+ city?: string;
52
+ type?: string;
53
+ competitor?: string;
54
+ industry?: string;
55
+ role?: string;
56
+ }): LynxResolvedPage | null;
57
+ private buildHyperCombinedPage;
58
+ private buildGeoPage;
59
+ private buildComparisonPage;
60
+ private buildAlternativePage;
61
+ private buildIndustryPage;
62
+ private buildRolePage;
63
+ private buildIntegrationPage;
64
+ private assemblePage;
65
+ /**
66
+ * Returns the exact count of distinct unique programmatic pages currently active.
67
+ */
68
+ getUniquePageCount(): number;
69
+ /**
70
+ * Returns the list of all distinct unique URL paths generated so far.
71
+ */
72
+ getUniquePageList(): string[];
73
+ }