À travers des exemples concrets, nous illustrerons comment l’usage d’AJAX, de JSON et de WP_query peuvent améliorer la gestion et le filtrage (ex: multiples catégories) de listes d’information dynamiques dans un environnement WordPress.
Préalables: Bonne connaissance du HTML, du PHP et du Javascript. Idéalement une connaissance de AJAX. Comprendre le code généré par WordPress (“the loop”). Compréhension des “custom post type”.
Note: Cette conférence s’adresse principalement à des personnes avec des connaissances en programmation.
One of the most effective way to automate your API testing using Postman, this presentation dives deep into Postman Client, CLI and Jenkins Integration to automate the Integration Testing
This document discusses integrating Postman API tests into a Continuous Integration (CI) flow using Jenkins. It describes exporting Postman collections and environment variables to files and pushing them to source control. It then provides steps to install prerequisites like Node.js, NPM, and Newman on the Jenkins server and configure a Jenkins job to run Newman after deployment to execute the Postman tests as part of the CI process.
This document provides an overview of IntelliJ IDEA. It discusses what IntelliJ IDEA is, why it is useful, and how to optimize performance. Key features covered include code completion, navigation aids, refactoring tools, version control integration, support for frameworks like Maven and Hibernate, and plugins like JRebel for live editing. Performance tips include using solid state drives, allocating more memory, disabling unused plugins and antivirus scanning of workspaces.
This document discusses test-driven development (TDD), a software development technique where test cases are written before implementation code. TDD involves writing a failing test case, then code to pass the test, and refactoring code as needed. Key principles are writing tests first, running tests frequently, and making code changes in small iterative steps. TDD aims to increase code quality and reduce bugs by fully testing code in short cycles.
This document provides an overview of unit testing and isolation frameworks. It defines key concepts like units, unit tests, stubs, mocks and isolation frameworks. It explains that the goal of unit tests is to test individual units of code in isolation by replacing dependencies with stubs or mocks. It also discusses different isolation frameworks like Rhino Mocks and Moq that make it easier to dynamically create stubs and mocks without writing implementation code. The document covers different styles of isolation like record-and-replay and arrange-act-assert. It emphasizes best practices like having one mock per test and using stubs for other dependencies being tested.
One of the most effective way to automate your API testing using Postman, this presentation dives deep into Postman Client, CLI and Jenkins Integration to automate the Integration Testing
This document discusses integrating Postman API tests into a Continuous Integration (CI) flow using Jenkins. It describes exporting Postman collections and environment variables to files and pushing them to source control. It then provides steps to install prerequisites like Node.js, NPM, and Newman on the Jenkins server and configure a Jenkins job to run Newman after deployment to execute the Postman tests as part of the CI process.
This document provides an overview of IntelliJ IDEA. It discusses what IntelliJ IDEA is, why it is useful, and how to optimize performance. Key features covered include code completion, navigation aids, refactoring tools, version control integration, support for frameworks like Maven and Hibernate, and plugins like JRebel for live editing. Performance tips include using solid state drives, allocating more memory, disabling unused plugins and antivirus scanning of workspaces.
This document discusses test-driven development (TDD), a software development technique where test cases are written before implementation code. TDD involves writing a failing test case, then code to pass the test, and refactoring code as needed. Key principles are writing tests first, running tests frequently, and making code changes in small iterative steps. TDD aims to increase code quality and reduce bugs by fully testing code in short cycles.
This document provides an overview of unit testing and isolation frameworks. It defines key concepts like units, unit tests, stubs, mocks and isolation frameworks. It explains that the goal of unit tests is to test individual units of code in isolation by replacing dependencies with stubs or mocks. It also discusses different isolation frameworks like Rhino Mocks and Moq that make it easier to dynamically create stubs and mocks without writing implementation code. The document covers different styles of isolation like record-and-replay and arrange-act-assert. It emphasizes best practices like having one mock per test and using stubs for other dependencies being tested.
Ben McCormick gave a presentation on how to save time by testing with Jest. He began with an introduction and explained that Jest is a JavaScript testing framework developed by Facebook that aims to solve common testing problems. He then demonstrated how Jest saves time through fast setup, writing tests quickly using familiar syntax and APIs, running tests in parallel and with a smart watch mode, and providing clear errors to fix tests fast. He concluded with a demo of Jest's features and took questions.
EggPlant Functional is an automation and testing tool that automates real user workflows and executes tests automatically. It takes an image-based approach, using visual recognition to interact with applications by looking for images, text, or areas on the screen. It works across different technologies and platforms by sending mouse and keyboard inputs through VNC or RDP to remotely control other systems. This allows it to perfectly recreate and test user experiences.
This document discusses test automation using Selenium. It provides an overview of Selenium, its components like Selenium IDE and Selenium Remote Control. It describes limitations of Selenium IDE. It then introduces Selenium WebDriver, highlighting its support for cross-browser testing on multiple platforms. It discusses how to set up Selenium and locate elements, providing examples of finding elements by ID, name, and XPath. Finally, it demonstrates verifying a page title using Selenium WebDriver in Java.
Charles Nurse, a senior architect at DotNetNuke Corporation, presented on using behavior-driven development (BDD) with Visual Studio 2010, SpecFlow, and WATIN. He began with an introduction to BDD and its practices. He then discussed using Gherkin syntax to define tests in natural language and explained how SpecFlow bridges communication between domain experts and developers. Finally, he demonstrated how to automate tests using the WATIN browser automation framework in SpecFlow scenarios.
How to Build Your Own Test Automation Framework?Dmitry Buzdin
Even though there are plenty of open source tools on the market every company needs to put them together and create a test automation framework on top. Best practices of doing that are quite well-known in industry and it is important to learn them before building your own framework. We will go through the core building blocks of test automation frameworks and how they are playing together. You will learn how to assemble your test automation toolchain out of open source libraries and how to integrate them together. The session will be heavily biased towards Java platform.
Selenium is a suite of tools to automate web application testing through a browser. It includes Selenium Core for running tests directly in the browser, Selenium RC for controlling the browser from an external program, and Selenium IDE, a Firefox plugin for recording and playing back tests. Selenium supports multiple programming languages and browsers, uses locator strategies like IDs and XPath to find elements, and has add-ons for tools like FireBug to aid in test development.
This document provides guidance on writing effective test cases. It discusses that test cases are documentation that guide testing and serve as a record. Key components of a test case are test steps that provide clear instructions to testers, and expected results that describe how to verify the outcome. The document also outlines best practices like starting test case design after exploring the application, using clear and specific language, and providing supplemental materials like test data sheets to support testing. Maintaining test cases is important as applications evolve, requiring test cases to be revised as needed to continue supporting products.
Easy Java Integration Testing with TestcontainersPayara
Having problems creating a maintainable set of integration tests for your enterprise Java application? This talk will help you understand how to use Test containers to implement easy integration tests for your next project!
Simplifying Integration Tests for Enterprise Java
Integration testing is always a difficult area. You need to make sure that all system dependencies are prepared, data is correctly initialised for each run and test runs do not interfere with each other. Even with tools like the Arquillian Framework, writing integration tests can be a complicated task and the act of maintaining large sets of tests can become a nightmare if there's not enough knowledge of all dependencies involved.
With the Testcontainers project, convoluted and complicated integration tests can be a thing of the past. A test container allows you to create reliable integration tests covering a wide range of scenarios like using databases, microservices interactions and even GUI and user experience testing. One of the important factors for the success of this framework is the usage of Docker containers to create a reliable reproducible environment for each test, which separates the dependencies and the application code in a way that it is easy to maintain for developers.
This document provides information about getting started with Fastlane, an automation tool for beta deployments and releases of iOS and Android apps. It discusses installing Fastlane, configuring the Appfile and Fastfile, common Fastlane actions like match, cert, and sigh for code signing, and provides examples of using Fastlane with Flutter projects to build and deploy iOS apps.
Unit Testing Concepts and Best PracticesDerek Smith
Unit testing involves writing code to test individual units or components of an application to ensure they perform as expected. The document discusses best practices for unit testing including writing atomic, consistent, self-descriptive tests with clear assertions. Tests should be separated by business module and type and not include conditional logic, loops, or exception handling. Production code should be isolated from test code. The goal of unit testing is to validate that code meets specifications and prevents regressions over time.
Jest is a JavaScript testing framework that allows for unit testing JavaScript code. It provides features like mocking functions, testing asynchronous code with promises and async/await, and snapshot testing. Jest can integrate with other tools like Webpack and Enzyme and provides advanced features like testing multiple projects at once and built-in code coverage.
Continuous integration involves developers committing code changes daily which are then automatically built and tested. Continuous delivery takes this further by automatically deploying code changes that pass testing to production environments. The document outlines how Jenkins can be used to implement continuous integration and continuous delivery through automating builds, testing, and deployments to keep the process fast, repeatable and ensure quality.
This document provides an introduction to unit testing and mocking. It discusses the benefits of unit testing such as safer refactoring and value that increases over time. It provides a recipe for setting up a unit test project with test classes and methods using AAA syntax. It also covers what mocking is and how to use mocking frameworks to create fake dependencies and check interactions. Resources for learning more about unit testing and related tools are provided.
Data driven Automation Framework with Selenium Edureka!
The document discusses designing a data-driven automation testing framework with Selenium. It describes different types of Selenium testing frameworks, including keyword-driven, data-driven, and hybrid frameworks. It provides examples of how to build each type of framework using Selenium and details how data-driven frameworks allow testing an application with different data sets. The document also promotes an Edureka course on mastering Selenium automation testing that includes lectures, assignments, and a project.
1) Behaviour-driven development (BDD) is an agile methodology that focuses on delivering working, tested software through collaboration between developers, testers and stakeholders.
2) BDD implements an application by describing its behavior through features and scenarios written from the perspective of stakeholders. Stories, acceptance criteria, executable examples and other tools are used to define requirements and guide development.
3) BDD aims to produce software that provides tangible value to stakeholders by being delivered incrementally, being easy to deploy and manage, and by adapting quickly to feedback through frequent testing and deployment.
This document provides an overview of software testing fundamentals and the software development lifecycle. It discusses different types of testing including static testing, dynamic testing, component testing, integration testing, and system testing. It also addresses test planning, management, and tools. The document emphasizes that early test design helps build quality and prevents faults by finding issues early when they are cheaper to fix. An experience report shows how early testing led to fewer faults and happier users compared to a previous phase without early testing.
Ben McCormick gave a presentation on how to save time by testing with Jest. He began with an introduction and explained that Jest is a JavaScript testing framework developed by Facebook that aims to solve common testing problems. He then demonstrated how Jest saves time through fast setup, writing tests quickly using familiar syntax and APIs, running tests in parallel and with a smart watch mode, and providing clear errors to fix tests fast. He concluded with a demo of Jest's features and took questions.
EggPlant Functional is an automation and testing tool that automates real user workflows and executes tests automatically. It takes an image-based approach, using visual recognition to interact with applications by looking for images, text, or areas on the screen. It works across different technologies and platforms by sending mouse and keyboard inputs through VNC or RDP to remotely control other systems. This allows it to perfectly recreate and test user experiences.
This document discusses test automation using Selenium. It provides an overview of Selenium, its components like Selenium IDE and Selenium Remote Control. It describes limitations of Selenium IDE. It then introduces Selenium WebDriver, highlighting its support for cross-browser testing on multiple platforms. It discusses how to set up Selenium and locate elements, providing examples of finding elements by ID, name, and XPath. Finally, it demonstrates verifying a page title using Selenium WebDriver in Java.
Charles Nurse, a senior architect at DotNetNuke Corporation, presented on using behavior-driven development (BDD) with Visual Studio 2010, SpecFlow, and WATIN. He began with an introduction to BDD and its practices. He then discussed using Gherkin syntax to define tests in natural language and explained how SpecFlow bridges communication between domain experts and developers. Finally, he demonstrated how to automate tests using the WATIN browser automation framework in SpecFlow scenarios.
How to Build Your Own Test Automation Framework?Dmitry Buzdin
Even though there are plenty of open source tools on the market every company needs to put them together and create a test automation framework on top. Best practices of doing that are quite well-known in industry and it is important to learn them before building your own framework. We will go through the core building blocks of test automation frameworks and how they are playing together. You will learn how to assemble your test automation toolchain out of open source libraries and how to integrate them together. The session will be heavily biased towards Java platform.
Selenium is a suite of tools to automate web application testing through a browser. It includes Selenium Core for running tests directly in the browser, Selenium RC for controlling the browser from an external program, and Selenium IDE, a Firefox plugin for recording and playing back tests. Selenium supports multiple programming languages and browsers, uses locator strategies like IDs and XPath to find elements, and has add-ons for tools like FireBug to aid in test development.
This document provides guidance on writing effective test cases. It discusses that test cases are documentation that guide testing and serve as a record. Key components of a test case are test steps that provide clear instructions to testers, and expected results that describe how to verify the outcome. The document also outlines best practices like starting test case design after exploring the application, using clear and specific language, and providing supplemental materials like test data sheets to support testing. Maintaining test cases is important as applications evolve, requiring test cases to be revised as needed to continue supporting products.
Easy Java Integration Testing with TestcontainersPayara
Having problems creating a maintainable set of integration tests for your enterprise Java application? This talk will help you understand how to use Test containers to implement easy integration tests for your next project!
Simplifying Integration Tests for Enterprise Java
Integration testing is always a difficult area. You need to make sure that all system dependencies are prepared, data is correctly initialised for each run and test runs do not interfere with each other. Even with tools like the Arquillian Framework, writing integration tests can be a complicated task and the act of maintaining large sets of tests can become a nightmare if there's not enough knowledge of all dependencies involved.
With the Testcontainers project, convoluted and complicated integration tests can be a thing of the past. A test container allows you to create reliable integration tests covering a wide range of scenarios like using databases, microservices interactions and even GUI and user experience testing. One of the important factors for the success of this framework is the usage of Docker containers to create a reliable reproducible environment for each test, which separates the dependencies and the application code in a way that it is easy to maintain for developers.
This document provides information about getting started with Fastlane, an automation tool for beta deployments and releases of iOS and Android apps. It discusses installing Fastlane, configuring the Appfile and Fastfile, common Fastlane actions like match, cert, and sigh for code signing, and provides examples of using Fastlane with Flutter projects to build and deploy iOS apps.
Unit Testing Concepts and Best PracticesDerek Smith
Unit testing involves writing code to test individual units or components of an application to ensure they perform as expected. The document discusses best practices for unit testing including writing atomic, consistent, self-descriptive tests with clear assertions. Tests should be separated by business module and type and not include conditional logic, loops, or exception handling. Production code should be isolated from test code. The goal of unit testing is to validate that code meets specifications and prevents regressions over time.
Jest is a JavaScript testing framework that allows for unit testing JavaScript code. It provides features like mocking functions, testing asynchronous code with promises and async/await, and snapshot testing. Jest can integrate with other tools like Webpack and Enzyme and provides advanced features like testing multiple projects at once and built-in code coverage.
Continuous integration involves developers committing code changes daily which are then automatically built and tested. Continuous delivery takes this further by automatically deploying code changes that pass testing to production environments. The document outlines how Jenkins can be used to implement continuous integration and continuous delivery through automating builds, testing, and deployments to keep the process fast, repeatable and ensure quality.
This document provides an introduction to unit testing and mocking. It discusses the benefits of unit testing such as safer refactoring and value that increases over time. It provides a recipe for setting up a unit test project with test classes and methods using AAA syntax. It also covers what mocking is and how to use mocking frameworks to create fake dependencies and check interactions. Resources for learning more about unit testing and related tools are provided.
Data driven Automation Framework with Selenium Edureka!
The document discusses designing a data-driven automation testing framework with Selenium. It describes different types of Selenium testing frameworks, including keyword-driven, data-driven, and hybrid frameworks. It provides examples of how to build each type of framework using Selenium and details how data-driven frameworks allow testing an application with different data sets. The document also promotes an Edureka course on mastering Selenium automation testing that includes lectures, assignments, and a project.
1) Behaviour-driven development (BDD) is an agile methodology that focuses on delivering working, tested software through collaboration between developers, testers and stakeholders.
2) BDD implements an application by describing its behavior through features and scenarios written from the perspective of stakeholders. Stories, acceptance criteria, executable examples and other tools are used to define requirements and guide development.
3) BDD aims to produce software that provides tangible value to stakeholders by being delivered incrementally, being easy to deploy and manage, and by adapting quickly to feedback through frequent testing and deployment.
This document provides an overview of software testing fundamentals and the software development lifecycle. It discusses different types of testing including static testing, dynamic testing, component testing, integration testing, and system testing. It also addresses test planning, management, and tools. The document emphasizes that early test design helps build quality and prevents faults by finding issues early when they are cheaper to fix. An experience report shows how early testing led to fewer faults and happier users compared to a previous phase without early testing.
10 conseils pour booster les performances de votre site sous WordPressAurélien Denis
Passage en revue de l'ensemble des leviers d'actions pour améliorer le temps de chargement de vos pages. Astuces, conseils et ressources appliqués à WordPress.
Qu'est ce que la Web perf ?
C'est un ensemble de :
Méthodes
Bonnes pratiques
Technologies
Outils
Permettant de maximiser l'expérience utilisateur d'un site web et de diminuer les ressources permettant de le produire.
C’est une culture, une attitude, une obsession …
Construisez votre intranet avec microsoft office 365 sans code a os canadia...Samuel Lévesque
Dans le passé, de nombreuses organisations réalisaient leurs intranets et hébergeait celui-ci à l'interne.
La tendance à changé et les organisations s'orientent maintenant vers le cloud pour répondre à leurs besoins d'intranet.
Lors de cette session nous allons tenter de répondre aux questions suivantes : "Est-ce que notre intranet doit être construit avec Microsoft Office 365 ? Est-ce possible de réaliser un intranet sans développement majeur?".
Dans cette session, Samuel Lévesque abordera :
• Les avantages d'utiliser Microsoft Office 365 pour un intranet;
• Les meilleures pratiques à considérer;
• Des composantes clés en main sans code.
12 bonnes pratiques pour apprendre à tirer le meilleur profit de votre site Web sous WordPress. Une conférence suivie d'audits en live à la Chambre de Commerce et d'Industrie de Bayonne.
Pensez Web-Performances avec WordPress - Une conférence de Julien Oger et Pie...pierredargham
Conférence WP-Tech 4 et 5 décembre 2015 à Nantes.
Votre site WordPress est lent ? Ce n’est pas une fatalité ! À travers de nombreux exemples issus de projets en production, cette conférence fera un tour des bonnes pratiques de développement et de configuration pour mettre en place des sites rapides, y compris pour des applications métiers complexes ou e-commerce.
Déterminant pour l’expérience utilisateur, important pour le référencement, les performances de votre site font partie des optimisations inévitables pour booster votre audience sur le web et améliorer votre taux de conversion.
La conférence sera également l’occasion de penser la bonne architecture des applications WordPress, les mécanismes spécifiques de l’outil pour accélérer la génération des pages et l’utilisation optimale de sa base de données.
Au programme :
Optimisations Client (concaténation, expire headers, compression gzip …)
Optimisations Serveur (cache statique, cache opcode, cache objet, transients, serialization …)
Plugins et développements tiers : comment faire le bon choix ?
Exemples de hacks réutilisables
HTTP/2 et PHP 7.0 : ce qui va changer
Slides de la conférence SemRush du 05/11/2015 sur la thématique "Optimiser réellement le référencement naturel de WordPress".
Conférence animée par Daniel Roch - Consultant WordPress et Référencement naturel chez SeoMix
WordPress sous stéroïdes : votre site Web vers les sommets !Aurélien Denis
Un site sous WordPress, c’est commun… un site sous WordPress optimisé pour votre utilisateur final, pour les moteurs de recherche, respectueux du RGPD et de l’accessibilité, rapide à charger et simple d’utilisation c’est rare !
Profitez de retours d’expérience et d’astuces actionnables pour booster votre site WordPress. Du concret, du partage et de l’échange seront les maitres-mots de cette conférence.
Grics 2017 - construisez votre intranet avec microsoft office 365 sans codeSamuel Lévesque
Dans le passé, de nombreuses organisations réalisaient leurs intranets et hébergeait celui-ci à l'interne.
La tendance à changé et les organisations s'orientent maintenant vers le cloud pour répondre à leurs besoins d'intranet.
Lors de cette session nous allons tenter de répondre aux questions suivantes : "Est-ce que notre intranet doit être construit avec Microsoft Office 365 ? Est-ce possible de réaliser un intranet sans développement majeur?".
Dans cette session, Samuel Lévesque abordera :
• Les avantages d'utiliser Microsoft Office 365 pour un intranet;
• Les meilleures pratiques à considérer;
• Des composantes clés en main sans code.
Hyperpersonnalisation des sites web et écosystèmes numériques - Les best prac...Symetris
Le graal sur vos sites et applications web est l'hyperpersonnalisation de l'expérience client par intelligence artificielle (chaque individu vit une expérience unique conçue automatiquement basée sur du big data), mais entre l'intention de personnalisation et atteindre ce graal, il y a des étapes crawl / walk / run. Je vous entretiendrai sur comment s’y retrouver dans l’analyse de votre situation actuelle, quelles sont les étapes et obstacles à la personnalisation, quoi prioriser et comment établir une stratégie claire et des objectifs mesurables pour maximiser votre retour sur investissement.
Écrire de la documentation persistante pour un projet DrupalSymetris
Une approche pratique pour la planification et la rédaction de documentation dans le cadre d'un projet Drupal.
Vous vous demandez comment rédiger de la documentation utile, qui sera lue? Cette présentation est pour vous!
Nous aborderons la rédaction de documentation technique, fonctionnelle et non-fonctionnelle.
Nous verrons comment faire survivre la documentation après sa rédaction.
How to maintain, evolve and maximize the return on your Drupal website invest...Symetris
Building Drupal websites is all nice and fun, but once the site or application is launched, too many companies just let their digital assets run on cruise control until the next major overhaul.
Symetris spends almost a third of its resources on maintaining and enhancing existing websites. During this talk, we'll share what we consider are best practices to make sure you get the most return on your initial investment in a Drupal platform.
Should you upgrade your Drupal 7 website or migrate to Drupal 8? Symetris
You've invested in Drupal as the technology for your web platform. You're ready for the next phase in its evolution (like adding new features).
But you're wondering what's the best option between upgrading your current Drupal 7 installation or migrating to Drupal 8, and are not sure how to make that decision.
This session will compare the pros and cons of each path so that you can make a clear decision for your organization.
Different approaches for different scopes: How to tackle a medium-sized Dr...Symetris
Symetris conference given at DrupalCamp Ottawa 2016 outlining the important things to note when tackling a medium-sized project. Some projects aren't large enough to be considered big/complex, but aren't small enough to be considered easy/simple!
Trop gros pour des mercenaires, trop petit pour une armée: Comment s'attaquer...Symetris
L'approche à un projet dépend de son "scope". Un projet de 150 heures ne peut pas être approché de la même manière qu'un projet de 1500 heures.
Basé sur nos 12 années d'expérience et notre expertise avec Drupal depuis Drupal 5, nous partagerons nos meilleures pratiques pour garantir le succès de projets en fonction de leur envergure.
Personnaliser l'interface administrateur de Drupal - DrupalCamp Montreal 2014Symetris
Proposer Drupal comme CMS à un client est avantageux technologiquement. Mais l'interface "out-of-the-box" du backend administrateur a été conçue par et pour des développeurs, et n'est pas nécessairement aussi intuitive qu'on pourrait le souhaiter pour les clients moins technophiles. De plus, si Drupal est utilisé dans le cadre d'une application plus complexe comme un intranet, la nécessité d'adapter les fonctionnalités des administateurs est essentielle.
Lors de cette conférence, nous vous partagerons nos expériences par rapport à la personnalisation de l'interface d'administration pour les éditeurs de site web, notamment:
- Développer un thème de l'interface administrateur sur mesure
- Concevoir des "dashboard" sur mesure pour le client (tableau de bord)
- Définir des views pour afficher des rapports d'information dans un format pratique
- Gérer les menus "éditeur" (versus le Drupal toolbar)
- Explorer les autres possibilités et les limites de ce qui peut être fait
WTF: Where To Focus when you take over a Drupal projectSymetris
Jumping into pre-built Drupal projects sometimes requires a leap of faith as much for clients as for developers. The client is usually coming out of a bad previous business relationship and the code is not always structured according to your standards.
During this talk, Symetris will share its experience and provide tips on how to navigate these often uncharted waters. Our goal is to help you convert an uncertain client into a long term partner and have a checklist of what to look out for as developers.
Présentation Symetris - Drupalcamp Montreal 2013 le diable est dans les détailsSymetris
Augmenter la qualité générale de vos sites Drupal; de petits modules qui font toute la différence. Découvrez les modules Drupal qui vous permettront d'investir votre temps à la bonne place.
////
Drupal modules that help to
Générer plus de revenus par le web: Pouvez-vous faire mieux ?Symetris
Brad Muncs, président et fondateur de Symetris, vous montre comment utiliser le web au service de vos besoins et objectifs d’affaires. À partir d’exemples concrets, repartez avec plusieurs idées applicables pour vous permettre de mieux gérer votre organisation et devenir plus profitable.
Mieux Filtrer ses listes WordPress avec Ajax et WP_Query
1. Mieux Filtrer vos listes avec AJAX
***
Trucs et conseils pour mieux filtrer
vos listes WordPress via AJAX
2. Symetris libère votre potentiel web.
***
• Fondée à Montréal en 2004
• 9 spécialistes web à l’interne
• Développement de sites web qui vont
au-delà du marketing
• Maîtrise des CMS open-source
• Optimisation pour les appareils mobiles
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
3. Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
Qui sommes-nous?
Brad Muncs
Président Symetris
12 ans d’expérience
dans le web
Je mange du web
matin, midi et soir
Matthieu Gadrat
Développeur PHP et Lead
technologique
4 ans d’expérience avec
des CMS open-source
Amateur de ski
4. Ordre du jour
1. Les listes dans WordPress
2. Améliorer les filtres avec AJAX
3. Jetons un coup d’oeil au code
4. Conclusion
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
5. - 1 -
Pourquoi WordPress est
un outil de choix
pour nos clients?
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
6. WordPress est plus qu’un blogue
• CMS complet
• Différent type de contenu (Post types)
• Catégorisation facile à utiliser
• WordPress est bon pour générer des listes
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
7. Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
Mr. Wilkins
Mr Wilkins est un distributeur de
nourriture pour chien
• Entreprise de taille moyenne
• Distribue à des détaillants (B2B)
• A besoin d'un catalogue en ligne
pour présenter ses produits
Prenons comme exemple d’entreprise :
8. • WordPress est
donc l'outil parfait
pour un catalogue
• Parfait pour
Mr Wilkins
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
9. Dans WordPress, les listes sont déjà
présentes
• Liste de post
• Archives
• Catégories
• Tags
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
10. Filtrage traditionnel dans WordPress
• Via les URL
• Par catégorie ou tag
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
11. Bénéfices
• Ça fonctionne «Out of the box »
• Intuitif
• Pas de code
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
12. Obstacles pour les utilisateurs
• Plus il y a de données, plus c’est laborieux
• Pas de «Custom fields»
• Pas de filtre complémentaire (Faceted search)
• Visuellement décevant
• La page doit être rafraichie à chaque nouvelle
requête
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
13. • Contiennent
beaucoup de
données
• Incluent des
spécifications
(Custom Fields)
• Doivent être efficaces
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
Les listes de produit de Mr Wilkins:
14. Pour atteindre les
objectifs de
Mr. Wilkins, il faut
étendre les
fonctionnalités de filtre
de WordPress
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
15. - 2 -
Mieux filtrer les listes
de « POST » dans WordPress
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
17. Plugin disponibles
• ajax posts Filter
• http://wordpress.org/plugins/ajax-post-filter/
• Quicksand jQuery Post filter
• http://wordpress.org/plugins/quicksand-jquery-post-filter/
• Utilise jQuery Quicksand
• Mauvais pour gros volume de données
• ETC…
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
18. Il est possible que l'une de ces solutions,
ou un autre plugin soient suffisants...
... Mr Wilkins, lui, n'est pas satisfait
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
19. Nous allons donc lui créer une
solution personnalisée en utilisant
AJAX avec WordPress
(et WP_Query)
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
20. WP_Query est un objet à l’origine de la création des
listes dans WordPress
En fait, c’est le dénominateur commun de toute les requêtes.
• WP_Query est roi
• WP_Query est puissant
• WP_Query est flexible
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
22. Définition
• Asynchronous JavaScript And XML
• Échange de donnée XML et Javascript de manière
asynchrone lors de la navigation d'un utilisateur sur
une même page web.
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
23. Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
24. Avantages
• Performant pour l'affichage d'un grand nombre de données
(en petites doses)
• Feedback constant à l'utilisateur
• Permet des effets Javascript « Fancy »
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
25. Inconvénients
• Attention à l'accessibilité
• Si le JavaScript est désactivé, ça ne marchera simplement
pas
• Effort supplémentaire pour le SEO
Mais nous pouvons les surmonter
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
26. Bénéfices de faire un module personnalisé
• Utiliser WP_Query
• Fonctionne avec tous les types de données
ainsi que tous les champs
• « Fancy » Javascript
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
27. Mr. Wilkins a hâte de commencer!
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
28. - 3 -
Jetons un coup d'oeil au code
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
29. Dans WordPress, il y a déjà un mécanisme pour traiter
les requêtes en AJAX
pour la section « admin »
• /wp-admin/admin-ajax.php
• /wp-admin/admin-ajax.php?action=mon_callback
• Toutes requête à ce fichier seront envoyées à la fonction
appelé dans l'argument "action"
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
30. Créons un simple plugin
• Post type
• Taxonomie
• Un Widget (affiche le filtre et le contenu)
• Javascript
• AJAX Callback
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
32. Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
33. Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
34. Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
35. Détail du contenu WP_Query et sa« Loop »
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
36. Le Javascript
• N’oubliez pas d’inclure le JavaScript
• Sur le premier chargement de la page:
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
37. Écouter les changements du formulaire et
faire un « POST »
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
38. JSON
JSON (JavaScript Object Notation) est un format de données
textuelles, générique,[...]Il permet de représenter de l’information
structurée. (Wikipédia)
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
Réponse à la requête d’AJAX:
39. Traitement de la réponse
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
40. Dernière étape: Le « Callback »
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
41. Envoyer la réponse JSON
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
43. Les « Mais »
• Beaucoup de données, utiliser un « Pager » ou un
« infinite scroll » (comme Facebook)
• Pas de Javascript?
• Afficher le bouton «Submit» du formulaire et s'assurer
que le « Widget » prenne en compte les requêtes
POST
• Référencement (SEO)
• XML Sitemap très important pour compenser
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
45. Bénéfices pour le client
• Les clients de Mr. Wilkins trouvent
rapidement ce dont ils ont besoin.
• Le site de Mr Wilkins est plus
attrayant que celui de ses
compétiteurs.
• Mr Wilkins peut utiliser le CMS pour
augmenter son volume de contenu
tout en gardant un site performant.
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
46. Bénéfices pour le développeur
• Il n'a pas eu à se battre avec un plugin pour la présentation
des produits
• Facilité d’ajouter des champs et/ou filtres
• Il a pu utiliser le merveilleux et plein de ressource WP_Query.
• Son code est facilement réutilisable pour son prochain projet
peut importe les post types ou taxonomie
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
47. Cette technique n'est pas juste valable
pour les « Posts »
• Users
• Catégories
• Commentaires
Et permet un filtrage avancé
• Sélectionner le nombre d’items par page
• Filtrer sur la langue
• Filtrer sur des plages de données (« range »)
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
48. Bref, que retenir ?
Pas la peine d’utiliser un plugin existant
pour filtrer des listes.
Avec WP_Query et AJAX, vous bénéficiez
d’un contrôle supérieur sur vos listes de données
sans pour autant alourdir votre travail.
Briser la glace WordPress
Filtrer avec
AJAX
Détail du
Code
Conclusion
49. Merci !
Des questions
Contactez-nous :
info@symetris.ca
brad@symetris.ca / matthieu@symetris.ca
Présentation PPT disponible sur Slideshare
Code on Github (https://github.com/symetris/wordcamp2013)