Difference between urlencode() and rawurlencode() in php

I have always known that urlencode() encodes spaces as plus signs and rawurlencode encodes spaces as %20. However, I always struggled to know when to use which. I just finally learned today that you should use rawurlencode() if encoding URI paths and urlencode() if encoding query strings. Who woulda thunk it would be that simple?! :-P

CSS4

Tab Atkins in 2012:

There has never been a CSS4. There will never be a CSS4. CSS4 is not a thing that exists.

Rachel Andrew in 2016:

While referring to all new CSS as CSS3 worked for a short time, it doesn’t reflect the reality of where CSS is today. If you read something about CSS3 Selectors, then what is actually being described is something that is part of the CSS Selectors Level 3 specification. In fact CSS Selectors is one of the specifications that is marked as completed and a Recommendation. The CSS Working Group is now working on Selectors Level 4 with new proposed features plus the selectors that were part of Level 3 (and CSS 1 and 2). It’s not CSS4, but Level 4 of a single specification. One small part of CSS.

Jen Simmons in 2018:

Many people are waiting for CSS4 to come out. Where is it? When will it arrive? The answer is never. CSS4 will never happen. It's not actually a thing.


So CSS3 was a unique one-off opportunity. Rather than one big spec, break them into parts and start them all off at "Level 3" but then let them evolve separately. That was very on purpose, so things could move quicker independently.

The problem? It was almost too effective. CSS3, and perhaps to a larger degree, "HTML5", became (almost) household names. It was so successful, it's leaving us wanting to pull that lever again. It was successful on a ton of levels:

  • It pushed browser technology forward, particularly on technologies that had been stale for too long.
  • It got site owners to think, "hey maybe it's a good time to update our website."
  • It got educators to think, "hey maybe it's a good time to update our curriculums."

It was good for the web overall, good for websites taking advantage of it, and there was money to be made along the way. I bet it would be staggering to see how much money was made in courses and conferences waving the CSS3 flag.

Peter-Paul Koch in 2020:

I am proposing that we web developers, supported by the W3C CSS WG, start saying “CSS4 is here!” and excitedly chatter about how it will hit the market any moment now and transform the practice of CSS.

Of course “CSS4” has no technical meaning whatsoever. All current CSS specifications have their own specific versions ranging from 1 to 4, but CSS as a whole does not have a version, and it doesn’t need one, either.

Regardless of what we say or do, CSS 4 will not hit the market and will not transform anything. It also does not describe any technical reality.

Then why do it? For the marketing effect.

I think he's probably right. If we all got together on it, it could have a similar good-for-everybody bang the way CSS3 did.

If it's going to happen, what will give it momentum is if there is a single clear message about what it is. CSS3 was like:

  • border-radius
  • gradients
  • animations and transitions
  • transforms
  • box-shadow

Oh gosh, it's hard to remember now. But at the time it was a pretty clear set of things that represented what there was to learn and they were all fairly exciting.

What would we put under the CSS4 flag?

  • Flexbox? (Too old?)
  • Grid
  • Everything new with color (like this and this)
  • Independent transforms
  • Variable fonts
  • Offset paths
  • Let's get nesting done!
  • Houdini stuff? (Not ready enough?)
  • Shadow DOM selectors?

Lemme just say I will personally spearhead this thing if container queries can get done and we make that a part of it.

What else? Wanna refute anything on my list?

The post CSS4 appeared first on CSS-Tricks.

Paytm Launches SDK for All-In-One Payments System

Bringing disparate digital payments options under one system, Paytm today launched an All-In-One payments system along with an SDK for third-party integration. The All-In-One system includes point-of-sale touchscreen machines, payment gateway switches and a QR code that works across UPI through Paytm or other apps, RuPay cards and for Paytm wallet and Paytm Payments Bank accounts.

Guteblock Joins the Block Collection Plugin Arena With an Initial 12 Custom Blocks

Last week, London-based digital marketing agency Sweans Technologies released Guteblock, its new block collection plugin. Currently, the plugin boasts 12 custom blocks. The company plans to add more and has big plans for the plugin’s future.

While the team earns no points for originality in plugin naming, they are nevertheless throwing their hat into the ring of ever-growing block collection plugins alongside the likes of Atomic Blocks, CoBlocks, and Kioken Blocks. There is already steep competition in this arena, but there is also a lot of space for growth.

“WordPress bets high on Gutenberg editor and the block styles,” said Ajay Thomas, CEO of Sweans. “With the introduction of blocks, WordPress allows greater user control over the page-designing process beyond what the theme can handle. For the upcoming block directory, we believe that blocks will be the third integral part of WordPress after plugins and themes.”

The plugin’s team has put together the following video to show installation and usage examples:

Plugin Blocks

Guteblock is still a little rough around the edges in comparison to more mature block library plugins. Some things were confusing, such as some block color options not using the theme-defined colors. The drop cap block felt like it could have simply been added as extra settings to WordPress’ paragraph block.

The container block currently does nothing but group elements. At the moment, it is a step down from WordPress’ existing group block. Thomas explained that the team wanted to develop other blocks before fleshing it out. “The main features we will add to the container block are custom background settings, which include color, customizable gradient, an image with parallax effect, video, customizable SVG and other features including shadow, border-radius, etc.,” he said.

Of its library of 12 blocks, it has some interesting blocks that will come in handy, such as the number box block, which allows users to add columns of numbered boxes. The notification block is also useful for adding a bold warning, note, or similar message.

Screenshot of the Number Box block from the Guteblock WordPress plugin.
Number Box block from the Guteblock plugin.

The post grid block is one of the nicest blocks in the collection. It lets users create a grid of posts, showcasing the featured image, post title, and optional excerpt. It has settings to control the post count, number of columns, and font sizes.

Screenshot of the Post Grid block from the Guteblock WordPress plugin.
Post Grid block from the Guteblock plugin.

The biggest downside to the post grid block at the moment is that it relies on the post-thumbnail size for featured images, which may make them look stretched and distorted on the front end. In the future, it would help if the user could select their preferred featured image size.

The plugin includes a social sharing block. Currently, it adds sharing links for Facebook, Twitter, LinkedIn, Pinterest, and Reddit. Each social network can be enabled or disabled individually. The plugin also includes round, square, and modern block styles.

Screenshot of the Social Sharing block from the Guteblock WordPress plugin.
Social Sharing block from the Guteblock plugin.

A social sharing block will likely be more useful when WordPress moves toward block-based themes. Controlling this at the post level instead of globally is unnecessary work except in some edge cases where a user wants social sharing only on a limited number of posts or pages.

Thomas believes the team members and author profiles blocks are the most useful blocks. “One of the extremely important features of team members block is that users can highlight one block separately by changing the background color, font color, etc. and drag and drop members to reorganize, he said. “Regarding the author profile block, our block will fetch the author’s name, bio, and image and display there. Users can modify the same if needed.”

Upcoming Blocks and a Premium Version

At the moment, Guteblock is a free plugin. However, Sweans plans to launch a commercial version in the future. The company did not provide an exact date of launch but said it will happen shortly. It is also unclear what the pricing model will look like.

“This will be mainly a more customizable plugin with some other blocks such as Amazon link builder, events and shows, a premium slider, etc.,” said Thomas. He stressed that the free version will have at least 34 blocks down the road.

The plugin’s development team is currently working on two primary blocks to include in the premium edition. “The first block will help Amazon affiliates search for their products in the Amazon catalog, access real-time price and availability information, and effortlessly create links in your posts to products on Amazon.com using the Amazon Product Advertising API,” said Thomas. “The second block is for adding event details in a post or page. You can show the time, date, venue, and the details of the event, and this can be directly added to your desktop/mobile calendar with one click.”

Along with work toward their commercial version, the development team is preparing to add 16 extra blocks to their free version. This update will include blocks for Google Maps, video, grids, advanced columns, newsletters, pricing tables, and more. They will also provide alternative versions of some core blocks, such as blockquotes and buttons.

The company plans to dip its toes into the upcoming block directory too. “We are planning to release some very useful and unique blocks into the block directory and will maintain its excellence and effectiveness,” said Thomas. “But, at the same time, we will improve our plugin’s collection to make them stand out from the rest as we are updating them regularly to give the finest user experience.” It will be interesting to see if the block collection plugin or the individual blocks perform better.

WordPress Pingbacks & Trackbacks: Ultimate A – Z Guide

WordPress Pingbacks & Trackbacks: Ultimate A - Z GuideI think you’ll agree when I say: As a beginner, WordPress trackbacks and pingbacks are confusing. But why? Both features have been around since the early days of blogging. Still, many WordPress users don’t know they exist or how to use them effectively. Usually, many users start learning about pingbacks/trackbacks after a ton of spammy […]

The post WordPress Pingbacks & Trackbacks: Ultimate A – Z Guide appeared first on WPExplorer.

Switching From React to Vue.js

So you're a React developer and you've decided to try out Vue.js. Welcome to the party!

React and Vue are kind of like Coke and Pepsi, so much of what you can do in React you can also do in Vue. There are some important conceptual differences though, some of which reflect Angular's influence on Vue.

4 Things Vue.js Got Right

Whether you’re suffering from Javascript fatigue, ES anxiety, post-webpack stress disorder or any other kind of web development malady, the last thing you probably want to do now is look at another Javascript framework.

But the focus, simplicity, and flexibility of Vue.js might just make it the hero you need. Coming a bit late to the game in 2014, Vue has had the advantage of being able to pick and choose from the best parts of its predecessors.

Vue.js Single-File JavaScript Components in the Browser

Browser support for native JavaScript modules is finally happening. The latest versions of Safari and Chrome support them, Firefox and Edge will soon too.

One of the cool things about JavaScript modules for Vue.js users is that they allow you to organize your components into their own files without any kind of build step required.

Freshly Designed Assets Modal

When you're working in the Pen Editor, you have complete access to both all the files you've uploaded (Asset Hosting is a PRO feature) as well as a slew of free design resources we make available to you.

Click that Assets button in the footer, and the Assets modal will pop up. We've just redesigned this area to be more useful and more in-line with other areas of the site, like our recently redesigned Pen Settings.

The biggest bit of feedback we were working from is that, for PRO members, it was too hard to access your own files. In fact, in some screen sizes and configurations, the Your Files section could have been totally off-screen and it wasn't obvious you could scroll to it. In this new design, Your Files is front-and-center when you open the modal, and all the other free resources are still there and easy to click over to.

Let us know if you have any feedback!

The post Freshly Designed Assets Modal appeared first on CodePen Blog.

How to Publish Your Vue.js Component on NPM

You've made an awesome component with Vue.js that you think other developers could use in their projects. How can you share it with them?

In this article, I'll show you how to prepare your component so that it can be packaged and published on NPM. I'll use an example project and demonstrate the following:

Avoid This Common Anti-Pattern in Full-Stack Vue/Laravel Apps

If you want your Vue.js single-page app to communicate with a Laravel backend, you will, quite reasonably, think of using AJAX. Indeed, Laravel comes with the Axios library loaded in by default.

However, it's not advisable to use AJAX to retrieve application state on the initial page load, as it requires an extra round-trip to the server that will delay your Vue app from rendering.

Vue.js + Brunch: The Webpack Alternative You’ve Been Hungry For

Imagine if there was a build tool that you could use for Vue.js projects that compiled faster than Webpack, gave you a smaller bundle size, and required only a few lines of configuration.

Brunch is that tool. In this article, I'll show you how incredibly easy it is to set up a Vue.js + Brunch project, cover some of the pros and cons of Brunch, and serve up a few tasty brunch puns on the way.