3 ms·
My blog is one small php file that can 1) load a html document (that is a blog post) into a textarea. 2) Write out a html document by sticking html above and be
by 6510 5y ago
My blog is one small php file that can 1) load a html document (that is a blog post) into a textarea. 2) Write out a html document by sticking html above and below that what sits in the text area. 3) find links to the html document on the index page, rss feed and tag pages. 4) load and update the index and tag pages. It does 4 whenever a html document (post) is saved.
There are no bugs in my code. There isn't enough of it to have bugs.
php stopped working at least twice over the life of my blog. As all pages are static html everything simply continued to work with the exception that editing and posting had to be done over ftp.
I download wordpress OS one time and spend a few hours gazing over the thousands of files. I remember thinking sarcastically how I wish I had that level of confidence in my own code. What could possibly go wrong?
I do still admire the company and the project.
- kichimi 5y ago>There are no bugs in my code. There isn't enough of it to have bugs. So I take it your code could handle a 1GB blog post safely without giving you an error about exceeding post_max_size or something similar? That would be a bug. Small code != bug free code.
- 6510 5y agoI've never tried inserting that much text into a textarea. > To prevent users from causing server timeouts, the default maximum upload size in WordPress typically ranges from 4 MB to 128 MB. > Google will index up to 2.5MB of an HTML file. But I read lynx has no issues with giant html files. If I had a need for it I could use ftp. If the need is frequent I could upload chunks of textarea at a time. Until then I'm going to consider it undesirable.
- kichimi 5y agoThat's fair, but my point was small code doesn't mean bug free, and just because you only use it in a certain way and don't see any bugs doesn't mean they're not there. In fact I'd wager there are multiple gaping issues with it, that you simply wont encounter. If your code is as small as I'm imagining it, then it's not handling a lot of error cases, and doesn't cover any edge cases. That's where bugs lurk.
- 6510 5y agoThe components are like this: Auth is a cookie, session, ip and password check. It builds a html document from 3 strings. It writes the document to the file system and to the backup folder. Which part do you imagine to be the most error prone? I'm having a hard time imagining doing fwrite wrong. I mean? lol? For the malicious actor to gain access they would need to guess the url, guess what the post vars are called, obtain a cookie (set by a deleted php file) and guess the password. Then one would be able to edit or create a html document. I suppose inserting some malicious js into the newest post shortly after its created could escape my attention. It could take some time for me to notice it. When I do notice it ill restore the documents from a backup. It wouldn't take a DBA. My rss reader wouldn't like <script> onload onclick etc. I think I would notice my own feed getting flagged. I'm sure someone could hack the blog but its not worth the effort.
- Dunedan 5y ago> I download wordpress OS one time and spend a few hours gazing over the thousands of files. I remember thinking sarcastically how I wish I had that level of confidence in my own code. > There are no bugs in my code. There isn't enough of it to have bugs. Apparently you have a lot of confidence in your code. I'm pretty confident if you'd post a link to your code here, it wouldn't take long for people point out some bugs in it.
- 6510 5y agoDepends on your definition of a bug. The topic is a bug that affect hundreds of millions of websites. WP probably has many more. They do share their code but there is so much of it that you cant find those bugs. How many users would there be who know the WP code base inside out? 1 in a million seems a lot?