The Loop

Where humor doesn’t work.
Oct 28, 2024 05:11
Nor, evidentally, the details of how it came to be a part of the WP project.
Oct 28, 2024 05:08
I was a big fan of Gutenberg those first couple years, but it had more to do with it's code and architecture and supporting tooling than anything else. I liked the DX and likely never gave the UX and impact on the project and ecosystem enough consideration
Oct 28, 2024 05:03
Sometimes I really love it and others I despise it... but I guess that describes all tools, really
Oct 28, 2024 05:03
I've tinkered with it a bit for mostly non-code things, but that was a model or two ago. I'll have to give it another run now that some time has passed. I've been using Co-pilot for many months now and I still can't figure out if it's helping or hurting me
Oct 28, 2024 04:54
@MarkKaplun I was just sifting through the "Year in review" data in meta out of curiosity. It does sort of look like things were slowing down even prior to this year... I guess in retrospect things were feeling a bit quieter each time I returned. And most of the old-guard have moved on. It all bums me out a bit, albeit among many compounding issues.
Oct 25, 2024 22:20
I'm kind of surprised that the conflict isn't spilling over into WPSE, given the shennanigans elsewhere. I came here to put out fires, but there's nothing to cook my smores over.
Sep 22, 2022 15:30
Oh, definitely! I had a vaguely similar experience there where a plugin's JS in a closure would DOS the site if left to run in an open tab for many hours... My hack-around was quickly obsolete thanks to their quick patch
Sep 22, 2022 15:15
Definitely! It always felt dirty to me. One scenario was exactly as you described. I couldn't fork or modify the plugin, but I needed a reference to a class instance which was unobtainable outside of the hook's callable.
Sep 22, 2022 14:52
@kero @TomJNowell thank you very much - I really appreciate that input :)
Sep 22, 2022 07:36
If there is no other means to achieve a specific result, would it be an egregious hack to dig a third-party hook out of $wp_filter, remove the registration, and add a new one which wraps a manual execution of the original callback with my own functionality? I've used this to enact a temporary patch under heavy restrictions a couple times before - but I have to imagine such a practice would not be considered fit for distribution in a public plugin?
Sep 6, 2022 22:17
ayyyy we're back
 
Sep 1, 2022 00:30
Man I understand your frustration now
Sep 1, 2022 00:26
@DevelJoe I can't get it... even with modifications to the schema which would be permissible in JSON Schema, like setting common properties and oneOfing additional property sets. I think this reveals some other issues with WordPress's implementation - I'd like to dig in further, but it may have to wait for now
Sep 1, 2022 00:00
hmmm
Aug 31, 2022 23:30
No preferences - if it's a single file maybe just a hastebin or GitHub gist?
Aug 31, 2022 23:18
@DevelJoe sure!
Aug 31, 2022 23:18
Core issues can take from weeks to... many years in some cases. Given the prominence of the REST API I'd reckon within a release or two, at least so far as to eliminate the current work-around for the strange behavior.
Aug 31, 2022 23:17
WordPress core issues are tracked in Trac using your wordpress.org profile, and for everything Gutenberg it's just the wordpress/gutenberg GitHub repo. This would go to Trac!
Aug 31, 2022 23:14
:P
Aug 31, 2022 23:10
(well, apart from the type => null, and the type => object arg that's missing from that hastebin)
Aug 31, 2022 23:09
Just about - I think I might have modified some required keywords when I was converting to JSON to test some things in a JSON Schema validator. But otherwise I think it's 1:1 - hastebin.com/imohutosif.php
Aug 31, 2022 23:07
Like in the schemas I've written for other things?
Aug 31, 2022 23:00
no problem! I find I learn a lot by these sorts of things as well. happy to help where I can
Aug 31, 2022 22:58
totally fair, I'd get that, lol
Aug 31, 2022 22:57
Maybe also worth a mention that some security plugins disable app passwords by default - but if you were able to see/create one from your user profile, then it should be enabled
Aug 31, 2022 22:54
don't delete the spaces from the app password, for what that might be worth
Aug 31, 2022 22:54
that looks correct to me - generates the right token
Aug 31, 2022 22:54
ahh gotchya
Aug 31, 2022 22:53
@DevelJoe You're making the request from PHP?
Aug 31, 2022 22:52
@DevelJoe Cookie auth/app password auth are separate mechanisms. You can use one or the other. If you've got cookie auth already working, you shouldn't need to go the app password route - I just find it a lot easier for dev and testing
Aug 31, 2022 22:51
@DevelJoe I feel that - totally my last few days on a project
Aug 31, 2022 22:51
Where are you making the request from?
Aug 31, 2022 22:50
Yeah - btoa(${username}:${app password}) in JS gives me the right token
Aug 31, 2022 22:50
@DevelJoe It's listed as a plugin in the devhub right now, but it's since been merged into core
Aug 31, 2022 22:48
@DevelJoe IIRC yes, but it's been a minute since I've done it manually
Aug 31, 2022 22:48
@DevelJoe excellent!
Aug 31, 2022 22:46
You can use the automatic roles & capabilities checks for your own routes - or customize them however you see fit with those auth_callbacks
Aug 31, 2022 22:45
That is, for the core routes, anyway. The core routes' authorization is handled automatically based on user roles/capabilities - if a piece of content would usually be publicly available on the front-end of the site, so too is it on the REST API. If a WordPress user has the capabilities to manage users or plugins on the dashboard - so too will they be able to over the REST API.
Aug 31, 2022 22:45
> A lot of the GET requests are completely public, but most every request which can modify data will require authentication
Aug 31, 2022 22:42
When you get around to making sensitive requests from your frontend, you'll want to use some other authentication mechanism, like passing around NONCEs alongside the WordPress cookies
Aug 31, 2022 22:39
Aug 31, 2022 22:39
Like Postman:
Aug 31, 2022 22:39
But most HTTP thingies have a shortcut
Aug 31, 2022 22:39
You'll pass your username and app password concatenated with a colon and b64 encoded as a header:

Authorization: Basic YWRtaW46dmZOcSBFa2I0IGVPUGggYUpUYiBERVg1IEJxdXo
Aug 31, 2022 22:38
A lot of the GET requests are completely public, but most every request which can modify data will require authentication
Aug 31, 2022 22:36
Easiest way to authenticate for dev is to create an "App Password" for your user Dashboard > Users > {User profile} > scroll to the bottom, add a new one titled whatever
Aug 31, 2022 22:36
That'd be authorization rather than authentication
Aug 31, 2022 22:35
Yep - but I take it you're not authenticating?
Aug 31, 2022 22:26
(not that any of this is a fault in your approach - you've totally gotten eyes-deep in a substantial core bug 🤣)
Aug 31, 2022 22:23
You might try deleting your stored value and POSTing it instead of add_post_meta(), just to be absolutely sure it's validating