Strict Standards: Redefining already defined constructor for class Better_GitHub_Widget in /var/sites/k/korvin.org/public_html/blog/wp-content/plugins/better-github-widget/better-github-widget.php on line 31

Warning: Cannot modify header information - headers already sent by (output started at /var/sites/k/korvin.org/public_html/blog/wp-content/plugins/better-github-widget/better-github-widget.php:31) in /var/sites/k/korvin.org/public_html/blog/wp-includes/feed-rss2.php on line 8
Korvin M Media http://korvin.org Need help to weave your web? Sat, 15 Apr 2017 01:32:26 +0000 en-US hourly 1 https://wordpress.org/?v=4.8 56222405 Uploading with html5/php http://korvin.org/uploading-with-html5php/ http://korvin.org/uploading-with-html5php/#respond Thu, 13 Apr 2017 23:46:56 +0000 http://korvin.org/?p=1284 Resources on handling file uploads.

http://php.net/manual/en/features.file-upload.php
http://php.net/manual/en/reserved.variables.post.php#87512
https://www.sitepoint.com/file-uploads-with-php/
https://www.sitepoint.com/monitoring-file-integrity/

Front end

https://www.quirksmode.org/dom/inputfile.html

https://www.sitepoint.com/tracking-upload-progress-with-php-and-javascript/

http://stackoverflow.com/questions/29727436/upload-progress-bar-using-session-in-php-5-4-with-codeigniter

Related

https://www.sitepoint.com/monitoring-file-integrity/

https://www.sitepoint.com/html5-native-drag-and-drop-api/

Sulphur

https://github.com/KorvinM/sulphur

]]>
http://korvin.org/uploading-with-html5php/feed/ 0 1284
Too clever by two-thirds: code styles for protecting WP files http://korvin.org/too-clever-by-two-thirds/ http://korvin.org/too-clever-by-two-thirds/#respond Sat, 19 Dec 2015 03:18:23 +0000 http://korvin.org/?p=1211 Continue reading Too clever by two-thirds: code styles for protecting WP files ]]> WordPress’ PHP Coding Standards include the interesting advice that code need not get too clever.

The authors argue that, in general:

readability is more important than cleverness or brevity.

isset( $var ) || $var = some_function();


Although the above line is clever, it takes a while to grok if you’re not familiar with it. So, just write it like this:

if ( ! isset( $var ) ) {
    $var = some_function();
}


make.wordpress.org/core/handbook/best-practices/coding-standards/php/#clever-code

The preferred example uses the familiar if statement, checking a variable is not set before assigning it (to a function, in this case).
The terser version uses the OR logical operator, represented by || to say, as if rendered in English or pseudocode: “either the variable ‘var’ is set OR assign the variable to a function”.

In preferring the longer, less clever version, committing to code which can be grokked by all, the authors reflect the democratic missionary aspect of WordPress culture. Advising readability over clever tricks implies I think two things: code for WordPress should require an average, if sturdy, baseline of knowledge to at least begin to grok, and as a corollary, is considered code that will be read, and hacked with, by a wide audience. The emphasis then seems to be on encouraging comprehension of and play with the code, by keeping the learning curve from getting steeper than it really needs to be. And it seems like a good example of the kind of clever-clogs approach WP seeks to abjure.

What’s this got to do with protecting WP files?

I just noticed an example of the kind of construction the Standards warn against above.
Many plugins add a statement to the beginning of the main plugin file, basically a security feature that says, in pseudocode:
if this file is accessed directly: abort..
thus preventing unauthorised access to the file. There are two constants defined in WordPress core we can use to help us realise the idea, WP_INC and ABSBATH. This gives rise to two different ways you might see this feature implemented.

if( ! defined( 'ABSPATH' ) ) exit;


This is the most common way I’ve seen. In English it means: “if the constant ABSPATH is not defined, terminate the current script”.
Alternatively, I have seen this one around instead:

if ( ! defined( 'WPINC' ) ) {
        die;
}

Leaving aside questions of style and the use of die or exit, how is WP_INC different from ABSPATH?
Seek answers here.
However, and going with the ABSPATH constant for the sake of progress, there is a third style available we met earlier:

defined( 'ABSPATH' ) || exit;

which I spotted perusing https://github.com/espellcaste/User-Private-Files and it instantly reminded me of the clever code example cited above. But lets look at it with fresh eyes.

defined( 'ABSPATH' ) || exit;


In English, that rather brusquely and abruptly says:

ABSPATH must be defined OR here’s the door

No more needs to be said. Here is a line of code that to me might embody, an almost humourous example, the dictum ‘code is poetry’. In its terse, no nonsense and no fuss way it suggests to me exactly the impression of simple and direct lawgiving you want a from a reliable bouncer or guardian.
So here’s an example I think where this clever construction enhances the pleasure of reading the code. Security should be terse, no?

]]>
http://korvin.org/too-clever-by-two-thirds/feed/ 0 1211
Hillary Clinton’s old website http://korvin.org/hillary-clintons-old-website/ http://korvin.org/hillary-clintons-old-website/#respond Mon, 13 Apr 2015 23:30:33 +0000 http://korvin.org/?p=1104 Continue reading Hillary Clinton’s old website ]]> On Sunday, Hillary Rodham Clinton announced she would definitely like to be the next President of the United States of America. Before that announcement HillaryClinton.com looked like this: a holding page linking to the website of her official office.
HillaryClinton.com on 27th March 2015, retrieved from archive.org
HillaryClinton.com on 27th March 2015, retrieved from archive.org

Blue, a notoriously popular colour in web design, seems deployed here according to colour theory:always reassuringly safe, friendly and almost frivolous when light, while the darker blue brings a more serious tone. The background gradient gives an abstract sense of a horizon; the ground and the sky; don’t stop thinking about tomorrow. We’re meant to be reassured. The contrasting darker blue used for the ‘Hillary’ headline – really a logo – fits it quite well: we’re on first name terms with Mrs Clinton, but we’re still encouraged to take her name seriously as a strong and powerful proposition. The colour contrast emphasises the seriousness of ‘Hillary’ as a concept. We’re meant to be impressed.
The gradient is deployed as a background image rather than modern css: old-fashioned but fine for a lightweight single page site. There’s a technical fail, however, whereby the bottom curve of the ‘y’ descender in the logo (also deployed as an image) has been truncated by over-zealous cropping. This could have been avoided with modern web typography – or a steadier hand.

But never mind because the typography itself is interesting. The font used, Garamond, has a fascinating history dating from the mid-16th Century, and categorised as Garalde (or Old Style), referring to a family of fonts that succeeded the Humanist fonts of the early Renaissance. Like them, the Garalde style was inspired by the hand calligraphy of the pre-Gutenberg scribes, but moved away from the Humanist’s mimetic approach of trying to mimic handwriting, towards a new style informed by the technology of typeset print. The fonts then represent the spirit of the dawn of the industrial printing revolution, Garamond being arguably the classic of the type. It is perhaps a little too traditional and staid here, and it is usually considered much better in print than on screen, but it certainly seems appropriate for a senior American politician, since the emergent technology of mass produced documents played an important role in the revolutionary birth of that nation. To modern eyes Garamond looks old-fashioned, yet nevertheless triggers a deep association with dramatic change, with a sense of continuity even in the midst of it. You can see why a mainstream politician might like it.
Technically the font’s served in its websafe form of ‘Garamond’, but if not available the site helpfully falls back to EB Garamond, served as a google web font, and that is what you see on the screenshot. If neither will do there is a final fallback of, of course, Georgia, the original websafe serif of choice.

Content-wise we have a big thank-you and a call to action. The small print (in Arial), aside from linking to a privacy policy (like the main CTA, the link is in non-threatening light blue), lets us know the site is ‘Paid for by Friends of Hillary‘. Interestingly this info-nugget is rendered according to the ghost button pattern, one of last year’s noted web design trends. But, it isn’t a button, leading to potential wasted taps, clicks or hovers.

Overall then it’s a mixed bag and a curate’s egg of a page. But how has it changed now Hillary’s openly campaigning to be President? It is said Barack Obama was the first cyber-candidate in terms of raising money online and being a regular user of the web. How will Hillary do in terms of using the web to power her campaign? You can of course see for yourself, but tune into this channel soon to see what I make of Hillary Clinton’s New Website.
Until then, adiós!

]]>
http://korvin.org/hillary-clintons-old-website/feed/ 0 1104
WordPress.tv videos watched http://korvin.org/wordpress-tv-videos-watched/ http://korvin.org/wordpress-tv-videos-watched/#respond Thu, 19 Mar 2015 11:11:36 +0000 http://korvin.org/?p=1047 Continue reading WordPress.tv videos watched ]]> These are some of the videos I’ve enjoyed watching earlier this year on wordpress.tv, and thought worth noting.

Michael McNeill: Things you should know about WordPress (but were always afraid to ask)

A technical overview of the structures and processes of a WordPress site.

http://wordpress.tv/2015/01/04/michael-mcneill-things-you-should-know-about-wordpress-but-were-always-afraid-to-ask/

Kevin Fodness: Object-Oriented Theme Development

Straightforward, well-structured talk on developing themes in object-oriented style.

http://wordpress.tv/2015/01/14/kevin-fodness-object-oriented-theme-development/

Ray Mitchell: Create Your Podcast Platform on WordPress

Nice beginners introduction to podcast culture.

http://wordpress.tv/2015/01/02/ray-mitchell-create-your-podcast-platform-on-wordpress/

Chris Reynolds : Why Hacking WordPress Search Isn’t Some Big Scary Thing

Useful 20 minute demystification of WP search functionality. Chris points out WP search already uses standard WP queries, so isn’t very hard if you already know about those. Chris then demos some cool ways WP search can be manipulated.

http://wordpress.tv/2015/01/16/chris-reynolds-why-hacking-wordpress-search-isnt-some-big-scary-thing/

Some additional search resources:

Build Your Own Custom WordPress Search

https://codex.wordpress.org/Function_Reference/get_search_form

Extend the default WordPress Search

http://wordpress.stackexchange.com/questions/2623/include-custom-taxonomy-term-in-search/5404#5404

http://wordpress.stackexchange.com/questions/32687/extend-wordpress-search-to-include-user-search

http://wpdevsnippets.com/extend-search-include-custom-fields-without-plugin/

Justin Sternberg: CMB2: The Metabox Strikes Back

Interesting talk on an implementation of custom meta boxes, forms and fields in WordPress, centring around the CMB2 plugin which looks worth a look as an alternative to the popular ACF.
https://wordpress.org/plugins/cmb2/installation/
http://wordpress.tv/2015/01/07/justin-sternberg-cmb2-the-metabox-strikes-back/

]]>
http://korvin.org/wordpress-tv-videos-watched/feed/ 0 1047
WordCamp Brum roundup – Sunday http://korvin.org/wordcamp-brum-roundup-sunday/ http://korvin.org/wordcamp-brum-roundup-sunday/#respond Wed, 25 Feb 2015 23:50:48 +0000 http://korvin.org/?p=1026 Continue reading WordCamp Brum roundup – Sunday ]]> Part Two of my report on WordCamp Birmingham 2015.

You can read Part One here .

As noted by Claire Brotherton in her round up of Day 2, Sunday morning seemed sparsely attended, the announcement that the previous night’s social was a record bar taking for a UK Wordcamp presumably no coincidence.

Despite a brisk and enjoyable late-night walk home, I confess I was one of those lunching out the morning, so I missed Petra Foster on how to Be a Brand, Not a Commodity (although I’d caught this presentation at the previous month’s WP Brum meetup) and Pauline Roche and Ted Ryan on WordPress for Small and Not For Profit Enterprises. 

I also missed Paul Cherry on Customers and the Web, who has put the slides from his talk online.

And the morning concluded with Ben Furfie on Why it’s time to stop using Photoshop for web design. But,  you can read useful summaries of all these talks in Claire Brotherton’s post.

Meanwhile there were two workshop sessions running all morning. Here’s the slides for Rachel McCollin’s session on Manage Your WordPress Website Now and For the Future [direct link to slides], which seems well received, garnering some ‘social proof’ with this tweet:


Meanwhile Jonny A’s theme building workshop continued. Judging by the slides, it seems like a comprehensive and useful look at the process of creating a WP theme:

After lunch

The afternoon got off to a cracking start with Nivi Morales on WordPress in Local Government.

This was one talk I was keen to catch as I built and administer a site in this very sector, for a Barnt Green Parish Council.
Nivi works for Warwickshire Council who have used WordPress for some time but recently have been migrating more of their web presence, including microsites, to the platform. I particularly liked the emphasis Nivi placed on analytics and user testing informing a design review, which seems to me the obvious way to achieve user-focused improvements. Most sites can easily afford analytics of some kind, even if they don’t budget for user testing, so data’s always available for analysis, but of course data alone is useless wthout a sensitive and imaginative reading of it. I also liked Nivi’s story about using the talents available internally on their team, gaining bespoke icons to use across the sites.

I first saw the expression Content is King back in the 90s, and it’s a curious phrase, which could also be expressed as ‘stuff matters’. In the second afternoon session Rachel McCollin was back with a presentation on this subject, which from the slides took an interestingly practical approach.

Crowdfunding WordPress plugins – The case of QPress was the subject of Jonathan Bishop‘s talk:

Finally in the Explore room, Jessica Rose talked about Easy, Lazy SEO. This was a useful introduction to the subject, and the 2014 Manchester version of this presentation is available on wordpress.tv and embedded below:
http://wordpress.tv/2014/10/10/jessica-rose-easy-lazy-wordpress-seo/

Meanwhile we had two afternoon workshops on offer.
Karl Craig West on How to market and sell more WordPress websites

and WP Brum meet-up stalwarts Nathan Roberts and Kirsty Burgoine on Custom fields.

And barring the wrap-up and Sunday night’s social, that was WordCamp Brum 2015.

]]>
http://korvin.org/wordcamp-brum-roundup-sunday/feed/ 0 1026
WordCamp Brum Roundup – Saturday http://korvin.org/wordcamp-brum-roundup-saturday/ http://korvin.org/wordcamp-brum-roundup-saturday/#comments Fri, 13 Feb 2015 19:47:05 +0000 http://korvin.org/?p=1003 Continue reading WordCamp Brum Roundup – Saturday ]]> WordCamp Birmingham (UK) 2015 happened last weekend, and seems to have been a great success for all concerned, putting the Birmingham WordPress community in, if you’ll excuse the pun, bullish mood. I certainly enjoyed myself. The event reignited my passion for WordPress and web-work in general, answering a few questions, confirming a few biases and giving me new energy and contacts. For anyone involved in WordPress, whether as a developer, designer, site manager or content creator, I would heartily recommend getting along to your nearest WordCamp. They tend to cater for all tastes and areas of this kind of work, and, as with most conferences and meet-ups, the most interesting conversations occur at the margins outside the programmed content.

But that’s another story. I thought here I’d gather all of the most relevant online stuff I can find from the event: slides of the talks, comments from myself on those talks I attended, comments and a sense of the buzz from others, as well as some of the photos available online. This will be a multi-part post, and in this one I’ll focus on day one.

For programmed content, there were three tracs: Explore, Innovate, and Think & Smile, which I suppose maps roughly to beginner, intermediate/advanced, and workshops respectively, although the distinction between the first two tracs wasn’t to me as clear as it might have been.

Improving the UX of Search in WP – Steven Jones


Explore began with a round-up of ways to improve WordPress search. Steven covered the basic details of what content types WP’s native search queries. I had a specific question about how to index and search any pdf documents in the media library, and was directed by Steven to Search WP, a premium plugin which does indeed advertise this functionality. It was pointed out afterwards that Steven did not mention google custom search, which would also be an option for the lazy, or budget-conscious, developer, or site manager.

Turbo-speed your WordPress website! – Mike Pead

Meanwhile in Innovate, Mike Pead looks at caching, minifying and so on. I can’t find any online content for this talk,  but Mike has tweeted that slides will be online soon:

And it sounds like it contained some useful tips and tricks, so I look forward to that.

Theme Building Tricks of the TradeJonny A

Here’s Jonny’s slides for those interested in theming with confidence:

Get Your Git On – Matt Radford

Innovate continued with an engaging talk on how Matt’s team has integrated version control and attacked the problems of syncing between dev, stage and production versions of their WP-powered products. Here’s the slides:

Training Clients on how to use WordPress – Brian Duffy

This seems to be one of the most talked about presentations of the weekend. An unpromisingly uncontroversial, if important, subject turned out to be a passionate argument in favour of consolidation over innovation as a priority for the WP community. Brian argued that Matt Mullenweg’s aim of growing WP to power 50% of active websites needs to be achieved through training. He used the analogy of MS Word. How did MS Word become the standard for word processing software? By MicroSoft aggressively going to businesses, educational institutions, and other organsisations, talking up the benefits of the software and offering training on how to use it. Brian argued that we need to do the same for WordPress,  and encourage adoption of it as a new standard for web publishing. Without such consolidation, Brian argued, some big company might well introduce a product that can steal WP’s current >20% share of the web from under us if we are not careful. He mentioned that there are already many cheap or gratis WYSIWYG web publishing platforms competing with WP out there, all of which offer people cheaper and easier ways to screw up web design. It was an impassioned plea I think for us to stand strong in our professionalism and not deny that good web design isn’t easy, it’s hard. But with WP, and good WP training,  we can help people realise successful websites.

Making WordPress realtime –Josh Hillier

Another much talked-about presentation, Josh explores the cutting edge of using WP as a platform for modern web applications that deal with ‘real time’ data. Here’s the slides:

While all this was going on WP co-creator Mike Little hosted a two hour workshop in Think & Smile with a Hands-on introduction to WordPress. This is kind of like going to a conference on electrical engineering and having Tesla himself as a workshop tutor, so must have been a boon for all concerned.

Catering for WordPress – Kirsty Burgoine

First after lunch, Kirsty spoke about her major project MyEChef, a portal and network for catering professional, built on the WordPress multi-site platform. This complex project certanly seemed to impress Mike Little, WP co-creator, who was watching and congratulated Kirsty on wrangling WP Multisite in such a way.

Content manage everything! – Mark Wilkinson

Meanwhile, Innovate had a great talk on customising WP’s content management on the back end to handle the different types of content individual projects might require. Here’s the slides:

Building a business by using WordPress as an application framework for universities – Nathan Monk

This talk concerned the application Nathan and his team have built for Birmingham University, providing an online open day to cater for potential students from far away who may not be able to visit in person. It’s an impressive piece of work and Nathan has given talks on it before, including at the Brum WordPress meet-up. Here’s a prior YouTube video discussing the app.

Mind your Language! A practical guide to implementing ‘proper’ language encoding on multilingual WordPress websites – Belinda Mustoe, Doug Lawrence

This sounded interesting but I wasn’t able to attend as I was volunteering in the Explore trac to keep speakers on-time. I can’t find anything online about it, but here’s a link to the WordPress resource on WP internationalisation and translation.

WOW Plugins 2015 – Kimb Jones

Maeanwhile Kimb gave his regular talk on his pick of the plugins. Here’s the slides of the 2013 version:

Automate & Integrate WP with Other Applications Jason King

Jason’s talk provided one of the quotes of the weekend when he defined an API as when one application loves another very much, and “they give each other a special hug”. Here’s the slides on this talk with wide appeal.

Lightning Talks

Finally in Explore we had some lightning talks, including Mark Wilkinson on front-end editing in WP, specifically editing user profiles, especially useful when developing applications for users who may not need access to the back-end dashboard, but still need to able to edit their personal profiles. Slides:

As well as a useful talk by Chelsea Haden on “customer profiling”, similar to what I have elsewhere heard described as developing ‘personas’, as a tool for creating successful content.
Update: Chelsea has written a blog post inspired by her talk. Also, Mike Wilkinson has produced a blog post outlining both his talks.

How to build better businesses for your customers – Mike Killen

This all-afternoon workshop sounded great, and resources, including slides and an audio recording, are available at the low cost of your email address here.

For more about Saturday’s events, you could do worse than to check out Claire Brotherton’s post on her site.

And so, to the social, for falling down, passes and interesting conversations. And that was Saturday.

Stay tuned for part two!

]]>
http://korvin.org/wordcamp-brum-roundup-saturday/feed/ 1 1003