Giter Club home page Giter Club logo

htmxpress's People

Contributors

svandragt avatar thinkstylestudio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

htmxpress's Issues

Nonce cannot be verified

I was having trouble with hx-post to /htmx/demo/partial-ascii and it turns out that the nonce in $_SERVER is actually called HTTP_X_WP_NONCE and not X_WP_NONCE.

After fixing it locally, I was getting the right response instead of getting the security nope. (uncommented for debugging)

I am uncertain if this is an issue with my (very vanilla) setup or a bug.

Also, very cool idea to integrate htmx with WordPress. This feels like it could be very productive!

Rewrite rules are not flushed on activation

Thought to try this out on a minimal client WP ajax-widget project and partially out of personal interest in django+htmx development. I didn't get it to run after half a day trying to run the demo however.

Testing log

I set up the suggested wp-env development environment on Debian stable (NodeJS v18.13.0, Docker version 24.0.2 rootless). wp-env start gets the stock WP installation up and running with htmxpress-plugin activated ok and not producing errors. Htmx javascript file loads globally on site (from unpkg.com).

When accessing demo urls I only get the classic Apache "Not Found" 404 page, access log:

"GET /htmxpress HTTP/1.1" 404 489 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
"GET /htmx/ascii HTTP/1.1" 404 490 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
"GET /html/partial-ascii HTTP/1.1" 404 490 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
"GET /htmx/demo HTTP/1.1" 404 490 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"

Same results on Mac M1, Docker Desktop 4.19.0.

"GET /htmx/demo HTTP/1.1" 404 490 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/114.0"

Another trial with Linux laptop and using VVV vagrant box which is personally more familiar tool. Installing htmxpress plugin as zip on the default "wordpress-one" site. Htmx script loads ok here as well. Accessing https://one.wordpress.test/htmx redirects to same url with ending slash and just shows the stock WP home page.

Access log:

192.168.56.1 - - [01/Jul/2023:14:21:26 +0000] "GET /htmx HTTP/1.1" 301 5 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
192.168.56.1 - - [01/Jul/2023:14:21:26 +0000] "GET /htmx/ HTTP/1.1" 200 13372 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
192.168.56.1 - - [01/Jul/2023:14:33:58 +0000] "GET /htmx/ascii HTTP/1.1" 301 5 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
192.168.56.1 - - [01/Jul/2023:14:33:59 +0000] "GET /htmx/ascii/ HTTP/1.1" 200 13372 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
192.168.56.1 - - [01/Jul/2023:14:38:24 +0000] "GET /htmx/partial-ascii HTTP/1.1" 301 5 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
192.168.56.1 - - [01/Jul/2023:14:38:25 +0000] "GET /htmx/partial-ascii/ HTTP/1.1" 200 13372 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
192.168.56.1 - - [01/Jul/2023:14:38:50 +0000] "GET /htmx/demo HTTP/1.1" 301 5 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"
192.168.56.1 - - [01/Jul/2023:14:38:51 +0000] "GET /htmx/demo/ HTTP/1.1" 200 13372 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0"

Spent bit of time reading WP Rewrite Endpoints API docs and related code but didn't get any further yet...

Composer.json installation support

When completed, it's possible to install htmxpress for composer.json WordPress projects, as follows:

composer config repositories.htmxpress vcs [email protected]:svandragt/htmxpress.git
composer require svandragt/htmxpress:dev-main  --no-update
composer update svandragt/htmxpress --prefer-source

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.