{"id":151,"date":"2025-10-14T15:38:20","date_gmt":"2025-10-14T13:38:20","guid":{"rendered":"https:\/\/dhaker-trabelsi.com\/blog\/?p=151"},"modified":"2025-10-14T15:53:58","modified_gmt":"2025-10-14T13:53:58","slug":"%f0%9f%9b%a0%ef%b8%8f-developpement-dun-plugin-wordpress-synchronisation-jetengine-wp-all-import","status":"publish","type":"post","link":"https:\/\/dhaker-trabelsi.com\/blog\/%f0%9f%9b%a0%ef%b8%8f-developpement-dun-plugin-wordpress-synchronisation-jetengine-wp-all-import\/","title":{"rendered":"\ud83d\udee0\ufe0f D\u00e9veloppement d\u2019un plugin WordPress : synchronisation JetEngine + WP All Import"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\ud83c\udfaf Objectif du projet<\/h3>\n\n\n\n<p>Ce projet vise \u00e0 r\u00e9soudre un probl\u00e8me r\u00e9current rencontr\u00e9 lors de l\u2019importation de biens immobiliers via le plugin <strong>WP All Import<\/strong> : les images import\u00e9es ne sont pas correctement attach\u00e9es aux publications (posts), et ne sont pas synchronis\u00e9es avec le champ galerie personnalis\u00e9 de <strong>JetEngine<\/strong> (<code>_photos<\/code> ou un autre nom personnalis\u00e9).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u2699\ufe0f Fonctionnalit\u00e9s du plugin<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Attache automatiquement toutes les images import\u00e9es au post concern\u00e9.<\/li>\n\n\n\n<li>Alimente dynamiquement le champ JetEngine de type galerie avec les ID des images.<\/li>\n\n\n\n<li>Supporte les personnalisations : nom du champ galerie, import ID, type de post.<\/li>\n\n\n\n<li>G\u00e9n\u00e8re des logs d\u00e9taill\u00e9s (avec timestamps et dur\u00e9e des traitements).<\/li>\n\n\n\n<li>Interface admin avec :\n<ul class=\"wp-block-list\">\n<li>Visualisation en temps r\u00e9el des logs.<\/li>\n\n\n\n<li>Champ personnalisable pour la m\u00e9tadonn\u00e9e JetEngine.<\/li>\n\n\n\n<li>Bouton pour vider les logs.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Deux versions disponibles :\n<ul class=\"wp-block-list\">\n<li><strong>Version A<\/strong> : traitement via <code>shutdown<\/code> (batch des posts import\u00e9s).<\/li>\n\n\n\n<li><strong>Version B<\/strong> : traitement imm\u00e9diat sur le hook <code>pmxi_saved_post<\/code>.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\udde9 Stack utilis\u00e9e<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PHP (plugin WordPress)<\/li>\n\n\n\n<li>WP All Import (plugin premium)<\/li>\n\n\n\n<li>JetEngine (Crocoblock)<\/li>\n\n\n\n<li>WordPress AJAX + JS vanilla pour les logs en temps r\u00e9el<\/li>\n\n\n\n<li>CRON + bash pour t\u00e2ches serveur (d\u00e9zippage automatis\u00e9)<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd0d Probl\u00e8mes rencontr\u00e9s et r\u00e9solus<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u274c Probl\u00e8me d\u2019attachement des images dans WP All Import<\/li>\n\n\n\n<li>\u274c WP All Import ne d\u00e9clenche pas les hooks standards de <code>media_handle_upload<\/code><\/li>\n\n\n\n<li>\u2705 Solution : rechercher manuellement les images orphelines, les attacher, et mettre \u00e0 jour la meta<\/li>\n\n\n\n<li>\u274c Logs peu lisibles<\/li>\n\n\n\n<li>\u2705 Refonte compl\u00e8te avec interface claire + filtrage couleur<\/li>\n\n\n\n<li>\u274c Probl\u00e8me de compatibilit\u00e9 multiformat (XML avec balises diff\u00e9rentes)<\/li>\n\n\n\n<li>\u2705 Ajout d\u2019un champ personnalis\u00e9 dans l\u2019interface pour s\u2019adapter \u00e0 chaque XML<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\uddbc\ufe0f Interface admin<\/h3>\n\n\n\n<p>L\u2019interface inclut :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Un champ pour personnaliser le nom du champ galerie.<\/li>\n\n\n\n<li>Un affichage auto-scroll des logs en AJAX.<\/li>\n\n\n\n<li>Un bouton pour purger les logs.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcc2 Code source<\/h3>\n\n\n\n<p>\ud83e\uddd1\u200d\ud83d\udcbb GitHub : <a href=\"https:\/\/github.com\/dtrabelsi\/wpai-gallery-fix\/\">https:\/\/github.com\/dtrabelsi\/wpai-gallery-fix\/<\/a><\/p>\n\n\n\n<p>\ud83d\udcc1 D\u00e9mo ou lien portfolio : <a href=\"https:\/\/dhaker-trabelsi.com\">https:\/\/dhaker-trabelsi.com<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd17 Autres projets &amp; articles<\/h3>\n\n\n\n<p>\ud83d\udc49 Consulte <a href=\"https:\/\/dhaker-trabelsi.com\">mon portfolio ici<\/a> pour voir d&rsquo;autres outils et int\u00e9grations WordPress que j&rsquo;ai d\u00e9velopp\u00e9s.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ud83c\udfaf Objectif du projet Ce projet vise \u00e0 r\u00e9soudre un probl\u00e8me r\u00e9current rencontr\u00e9 lors de l\u2019importation de biens immobiliers via le plugin WP All Import : les images import\u00e9es ne sont pas correctement attach\u00e9es aux publications (posts), et ne sont pas synchronis\u00e9es avec le champ galerie personnalis\u00e9 de JetEngine (_photos ou un autre nom personnalis\u00e9). [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":158,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-151","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-_developpement-web"],"_links":{"self":[{"href":"https:\/\/dhaker-trabelsi.com\/blog\/wp-json\/wp\/v2\/posts\/151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dhaker-trabelsi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dhaker-trabelsi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dhaker-trabelsi.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dhaker-trabelsi.com\/blog\/wp-json\/wp\/v2\/comments?post=151"}],"version-history":[{"count":1,"href":"https:\/\/dhaker-trabelsi.com\/blog\/wp-json\/wp\/v2\/posts\/151\/revisions"}],"predecessor-version":[{"id":152,"href":"https:\/\/dhaker-trabelsi.com\/blog\/wp-json\/wp\/v2\/posts\/151\/revisions\/152"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dhaker-trabelsi.com\/blog\/wp-json\/wp\/v2\/media\/158"}],"wp:attachment":[{"href":"https:\/\/dhaker-trabelsi.com\/blog\/wp-json\/wp\/v2\/media?parent=151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dhaker-trabelsi.com\/blog\/wp-json\/wp\/v2\/categories?post=151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dhaker-trabelsi.com\/blog\/wp-json\/wp\/v2\/tags?post=151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}