Wednesday, February 1

PHP

PHP

Building an Image Gallery Blog with Symfony Flex: Data Testing

In the previous article, we demonstrated how to set up a Symfony project from scratch with Flex, and how to create a simple set of fixtures and get the project up and running. The next step on our journey is to populate the database with a somewhat realistic amount of data to test application performance. Note: if you did the “Getting started with the app” step in the previous post, you've already followed the steps outlined in this post. If that's the case, use this post as an explainer on how it was done. As a bonus, we'll demonstrate how to set up a simple PHPUnit test suite with basic smoke tests. More Fake Data Once your entities are polished, and you've had your "That's it! I'm done!" moment, it's a perfect time to create a more significant dataset that can be used for further testin...
Building an Image Gallery Blog with Symfony Flex: the Setup
PHP

Building an Image Gallery Blog with Symfony Flex: the Setup

This post begins our journey into Performance Month's zero-to-hero project. In this part, we'll set our project up so we can fine tune it throughout the next few posts, and bring it to a speedy perfection. Now and then you have to create a new project repository, run that git init command locally and kick off a new awesome project. I have to admit I like the feeling of starting something new; it's like going on an adventure! Lao Tzu said:The journey of a thousand miles begins with one stepWe can think about the project setup as the very first step of our thousand miles (users!) journey. We aren't sure where exactly we are going to end up, but it will be fun! We also should keep in mind the advice from prof. Donald Knuth:Premature optimization is the root of all evil (or at least most...
Apache vs Nginx Performance: Optimization Techniques
PHP

Apache vs Nginx Performance: Optimization Techniques

Some years ago, the Apache Foundation's web server, known simply as "Apache", was so ubiquitous that it became synonymous with the term "web server". Its daemon process on Linux systems has the name httpd (meaning simply http process) --- and comes preinstalled in major Linux distributions. It was initially released in 1995, and, to quote Wikipedia, "it played a key role in the initial growth of the World Wide Web". It is still the most-used web server software according to W3techs. However, according to those reports which show some trends of the last decade and comparisons to other solutions, its market share is decreasing. The reports given by Netcraft and Builtwith differ a bit, but all agree on a trending decline of Apache's market share and the growth of Nginx. Nginx --- pronounced e...
Making Your Website Faster and Safer with Cloudflare
PHP

Making Your Website Faster and Safer with Cloudflare

Cloudflare is an industry leader in the content-delivery space, reducing load and speeding up millions of websites.What is peculiar about this provider is that it didn't start as speed-up/performance tool, but was instead born from Project Honeypot, which was conceived as a spam and hacking protection service. To this day, this is one of Cloudflare's major selling points: DDoS detection and protection. Their algorithms take note of visitors' IP addresses, payloads, resources requested, and request frequency to detect malicious visitors. Because it sits as a proxy between websites and all incoming traffic, Cloudflare is able to reduce strain on servers significantly, so much so that DDoS attacks won't even reach the origin websites, as explained in this introduction. Cloudflare also provi...
What Is a CDN and How Does It Work?
PHP

What Is a CDN and How Does It Work?

CDN - you keep seeing the acronym. Maybe in URLs, maybe on landing pages, but it never quite clicked - what are Content Delivery Networks, what do they do exactly? We'll explain in this overview article, and demonstrate on two popular ones in followup posts.CDN Basics A CDN is a network of computers that delivers content. More specifically, it's a bunch of servers geographically positioned between the origin server of some web content, and the user requesting it, all with the purpose of delivering the content faster by reducing latency. This is their primary purpose. These geographically closer servers, also called PoPs or Points of Presence, also cache the cacheable content which removes a lot of the load from the origin server. There are different types of CDNs offering different kinds...
What are the Best Programming Languages if you DON’T have a Degree?
PHP

What are the Best Programming Languages if you DON’T have a Degree?

Without a degree, your best chances of getting work is with a small business. Over 80% of small businesses use PHP to power their websites. So that makes PHP the #1 choice for those with no degrees. WordPress is also widely used by small business, and WordPress is created with PHP, some JavaScript, HTML5 and CSS3. Together, these coding languages are part of what is called the ‘web stack’. Learn the web stack and you will open up MANY job opportunities. PHP is old and sucks – no? LOL! No! Old PHP from the 1990’s wasn’t very good, but much has changed since PHP4. Today PHP is at version 7 and it has all the ability and security as any of the other mainstream languages including: JavaScript Python Java C# Ruby … So don’t let uninformed nerds convince you that somehow PHP has problems. It do...
HTTP/2: Background, Performance Benefits and Implementations
PHP

HTTP/2: Background, Performance Benefits and Implementations

On top of the infrastructure of the internet --- or the physical network layers --- sits the Internet Protocol, as part of the TCP/IP, or transport layer. It's the fabric underlying all or most of our internet communications. A higher level protocol layer that we use on top of this is the application layer. On this level, various applications use different protocols to connect and transfer information. We have SMTP, POP3, and IMAP for sending and receiving emails, IRC and XMPP for chatting, SSH for remote sever access, and so on. The best-known protocol among these, which has become synonymous with the use of the internet, is HTTP (hypertext transfer protocol). This is what we use to access websites every day. It was devised by Tim Berners-Lee at CERN as early as 1989. The specification fo...
The Complete Guide to WordPress Performance Optimization
PHP, Web Tricks

The Complete Guide to WordPress Performance Optimization

  According to Builtwith.com, WordPress holds close to 50% of the CMS share of the world's top 1,000,000 websites. As for the ecommerce sphere, we're at 33% with WooCommerce. And if we cast a wider net, percentages go higher. Although we may complain that WordPress can get bloated, resource-heavy, and its data model leaves a lot to be desired, there is no denying that WordPress is everywhere.WordPress can thank its simplicity and a low barrier to entry for this pervasiveness. It's easy to set up, and requires next to no technical knowledge. Hosting for WordPress can be found for as little as a couple of dollars per month, and the basic setup takes just a half hour of clicking. Free themes for WordPress are galore, some with included WYSIWYG page builders.Many look down on...
PHP, Web Tricks

Building A Central Logging Service In-House

  We all know how important debugging is for improving application performance and features. BrowserStack runs one million sessions a day on a highly distributed application stack! Each involves several moving parts, as a client’s single session can span multiple components across several geographic regions.Without the right framework and tools, the debugging process can be a nightmare. In our case, we needed a way to collect events happening during different stages of each process in order to get an in-depth understanding of everything taking place during a session. With our infrastructure, solving this problem became complicated as each component might have multiple events from their lifecycle of processing a request.That’s why we developed our own in-house Central Logging ...
How to Fix Magento Login Issues with Cookies and Sessions
PHP

How to Fix Magento Login Issues with Cookies and Sessions

This article was created in partnership with Ktree. Thank you for supporting the partners who make SitePoint possible. In this article are looking at how Magento cookies can create issues with the login functionality of both the customer-facing front-end and admin back-end, the reason it occurs and how it should be resolved. This is also known as the looping issue, as the screen redirects itself to the same screen, even though the username and password is correct. A script is provided at the end of the article which can help detect a few of the issues. Feel free to use and modify as per your needs. What is a Cookie? A cookie is a piece of text that a web server can store on a user's hard drive, and can also later retrieve it. Magento uses cookies in Cart & Backend Admin functionalities...
PHP

Google Flutter vs Swift, Java and Kotlin

Mobile app development has moved toward hybrid apps, using the web stack (HTML5, CSS3 and JavaScript,) and frameworks like Phonegap or React Native. But when it comes to the development of high demand (in terms of performance) mobile apps, using native languages like Swift for iOS and Java for Android is still the way to go. This might change with Googles Flutter framework. Check out the video:https://flutter.io/https://facebook.github.io/react-native/https://phonegap.com/ Thanks! Stef The post Google Flutter vs Swift, Java and Kotlin appeared first on KillerPHP.com. Source: Killerphp
PHP

The 2018 Tour De Nerd Language Race is ON!!

Which programming language is fastest? Which language will win the software development race? The participants include: C++ C# Java PHP Python JavaScript Ruby … and a late entrant, server side Swift. When measuring a programming language’s speed, you have to consider three things: write time, deployment and run-time. Learn PHP web development fast: https://shop.killervideostore.com/ Learn Python 3 fast: http://www.killervideostore.com/python/ Create an AMAZING Business: https://goo.gl/kpVUD2 Thanks! Stef The post The 2018 Tour De Nerd Language Race is ON!! appeared first on KillerPHP.com. Source: Killerphp
PHP

8 Tips for Improving Bootstrap Accessibility

A few years ago, I wrote about my experiences on developing a Bootstrap version 3 project to be fully accessible for people with disabilities. This focussed mostly on how accessible it is in terms of front-end design. (It didn’t cover accessibility in terms of screen readers, as that’s a whole other story.) While I could see that the developers behind Bootstrap were making an effort, there were a few areas where this popular UI library fell short. I could also see that there were issues raised on the project that showed they were actively improving — which is fantastic, considering how approximately 3.6% of websites use Bootstrap. Recently, Bootstrap version 4 was released, so let’s take a look and see if any of the issues I had in the past have improved. What We’re Looking For with Design...
PHP-FPM tuning: Using ‘pm static’ for Max Performance
PHP

PHP-FPM tuning: Using ‘pm static’ for Max Performance

Let's take a very quick look at how best to set up PHP-FPM for high throughput, low latency, and a more stable use of CPU and memory. By default, most setups have PHP-FPM’s PM (process manager) string set to dynamic and there’s also the common advice to use ondemand if you suffer from available memory issues. However, let's compare the two management options based on php.net’s documentation and also compare my favorite for high traffic setup --- static pm:pm = dynamic: the number of child processes is set dynamically based on the following directives: pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers.pm = ondemand: the processes spawn on demand when requested, as opposed to dynamic, where pm.start_servers are started when the service is started.pm = stat...
23 Development Tools for Boosting Website Performance
PHP

23 Development Tools for Boosting Website Performance

When dealing with performance, it's hard to remember all the tools that might help you out during development. For that purpose, we've compiled a list of 23 performance tools for your reference. Some you'll have heard of, others probably not. Some have been covered in detail in our performance month, others are yet to be covered future articles; but all are very useful and should be part of your arsenal. Client-side Performance Tools 1. Test your Mobile Speed with Google Google’s Test My Site is an online tool offered by Google and powered by the popular website performance tool WebPageTest.org.You can either visualize your report on site or have it emailed to you via your email address.The tool gives you your website loading time (or Speed Index) calculated using a Chrome browser on...