Perry Rylance

Personal & Professional blog

Validation, Errors and Resources

My REST Cache plugin for WordPress, powered by Laravel, is coming on very well indeed.

I’ve facilitated saving plugin settings using a POST route on the AdminController interface, I’ve added validation via Illuminate, and have added error display to the Blade template for the page.

As well as that, I’ve changed the tables over to use a RESTful Resource, so there are now Controller classes for both the records and rules table, allowing easy indexing, creation, updating and deletion of records via Eloquent‘s Model interface.

I can see I’ve barely scratched the surface with Laravel here, but I’m really impressed so far. Everything is well standardised and compared to my time with WordPress, I’m finding that I spent more time stitching things together rather that re-inventing the wheel or carrying out other laborious tasks.

Now that I’ve successfully facilitated reading and writing settings to a plain HTML page (eg web route) I’m working on hooking up the RESTful API for the records and rules table, so that I can learn how to do validation, error display and CRUD handling for these tables and their corresponding database tables.

Once this has been wrapped up, I can simply port in the actual caching code from my existing WordPress code, you can expect to see this plugin go to release within the month.

I’m still having issues uploading images on this server, from what I believe are issues stemming from a memory leak in Imagick on my hosts server. They’ve escalated this to their engineers and are actually using my report specifically as a test case for the engineers. This issue very much reminds me of a catastrophic backtrace, so I’m quite sure based on experience that I’ve called this right – in spite of having no logs to view – however in any case, I’ll be very interested to see how this turns out!

Coming soon, I’ll be having a bit of fun, and implementing a JavaScript PRNG for my project, Payload. Occasionally, the physics engine (a Box2D port) will stall and introduce NaN values into the simulation. I can confirm this isn’t due to bodies initially intersecting one another, which was my first suspicion, so I’m at a bit of a loss with this at the moment. By implementing a seedable PRNG I’ll be able to identify seeds which lead to problematic initial conditions, then run performance profiling from there to figure out why the engine stalls. From there I can either correct that, or consider using a different port of Box2D.