Introduction
Craft tips, plugins, news and more for everyone.
Hey Crafters. Welcome to another issue of Craft Link List. Highlights include some details about what "active installs" means, making Craft 2 plugins written without composer easier, advice on hosting and more.
Thank you to fortrabbit for sponsoring this issue!
Want to submit a link for an upcoming issue? Here's how.
Let's hit the links.
-John Morton
News
Regarding the "Active Installs" count in the plugin store
Curious about the Active installs count in the Plugin Store? You are not alone. Here are answers to your burning questions.
1) Does the number reported as active installations count only 1 per site license (shared across multiple installs across different environments), or will the count be inflated if the developer has the plugin installed on dev/staging/production environments (so it’d count as 2 or 3 instead of 1).
once per unique Craft license key
2) Does the count include installs that were done via the command line?
yep
3) When someone uninstalls the plugin, does the active install count decrease?
yep
4) If the plugin was uninstalled but not removed completely, does this plugin count towards the active install count?
only counts if the plugin is installed & enabled
5) Anything else interesting about active install count we might want to know?
right now the count does not decrease if a Craft license goes MIA, as we don't really know if that is because the license has been discarded, or they just haven't logged into the Control Panel in a while. We probably need to come up with a threshold where if we haven't heard from a Craft license in X days/months, we consider it inactive and stop including its plugins when tallying up active plugin counts. Maybe 3 or 6 months?
Craft CMS 2 Packages Composer repository
Souvik Das Gupta and Prateek Rungta posted a treat for devs moving from Craft 2 to Craft 3.
As we transition over to Craft 3, here’s a bit of Composer love for Craft 2 plugins so that managing older projects gets easier. https://craft2packages.miranj.in. You can now simply
composer require <vendor>/<plugin-name>
and the correct plugin folder will show up inside thecraft/plugins
directory.We’ve seeded the plugins we’re currently working with and we’ll keep the list growing. But feel free to contribute the ones you need here: https://github.com/miranj/craft-packages
Just to clarify: This adds Composer support for plugins that weren’t written with Composer compatibility in mind.
Craft 3.0.9 released
This release includes number of fixes and improvements, including "improved memory usage when using the {% cache %}
tag."
The new Craft 3 Class Reference is live, now with Twig code examples!
Above is a link to the announcement. If you just want to cut to the chase though, here are the docs with the Twig examples.
Craft 2.6.3016 released
You can now tell Craft 2 to not transform your animated GIFs. Craft 3 got this feature in version 3.0.7 earlier in the month.
Featured Sponsor

Craft CMS Hosting Partner
fortrabbit is affordable, easy-to-use, scalable, and super developer-friendly. Regardless of the size of your project, fortrabbit takes care of the AWS heavy lifting allowing you to focus on development.
Tools, tips, and fundamentals
Craft 3: Can't backup database ("mysqldump: command not found")
Have you stumbled into the “mysqldump: command not found
” error? Take comfort this StackExchange has the answer.
Clear stalled pending tasks
To clear stalled pending tasks you can safely truncate the queue
table in the database. Don’t delete the table, but rather truncate it, which removes all of the rows in the table. You can do this via the command line or a GUI tool. (h/t Andrew)
Craft 3 logging
Yo, plugin devs. Here's how to write to the Craft logs in your plugins.
Craft::error($message);
Craft::info($message);
Craft::warning($message);
Craft::getLogger()->log($message);
Although mentioned previously, you might be interested in logging to a separate file instead.
How do I "register" a service in a Craft 3 plugin?
Ye olde handy Yii to the rescue. (See what I did there?)
{% css %} Documentation
Am I the only one who didn’t know about the {% css %}
tag to register a style
tag in the header of your page?
How can I check from a plugin config file if devMode is enabled?
This is a follow-on to the previous link. Spoiler:
if ( craft()->config->get( 'devMode' ) )
{
//do stuff
}
How to host your Craft web site.
Hosting of your Craft site is a fundamental part of actually having a Craft site. It’s a common question and Nevin Lyne, aka the guy who founded Arcustech, had a helpful and succinct suggestion recently in Slack.
“If you are not well versed in setting up servers or want someone else to manage the server side for you, take a look at managed hosting from someone like us at https://www.arcustech.com/managed/craftcms-hosting/ or the other Craft hosting partners at https://www.fortrabbit.com/craft-hosting. Other options would be a server deployment service like https://forge.laravel.com/. For a good listen on hosting check out https://devmode.fm/episodes/web-hosting-with-arcustechs-nevin-lyne podcast episode, or https://nystudio107.com/blog/web-hosting-for-agencies-freelancers for a great blog post.
Arcustech and Fortrabbit are both Craft Hosting partners as well.”
Perfecting your technique
GDPR - Generating a Data Report Within Craft CMS
This article is an accompaniment to the GDPR Data Checker plugin for Craft 2 later in this issue.
Intro to Craft 3 // Speaker Deck
This slide was mentioned as "still the best documentation of examples for an Element Query". Bookmarked.
Sponsor

Pic Puller: The Instagram plugin for Craft CMS 2 & 3
Pic Puller brings your Instagram media into Craft CMS with one-click authorization. Full documentation and code samples get you up and running quickly. Learn more at picpuller.com or find it in the plugin store in your Craft 3 control panel.
Plugged In
fortrabbit Craft Copy
Deployment tools for Craft on fortrabbit.
(Note: As you can probably see already from the Featured Sponsor post in this issue, fortrabbit sponsors Craft Link List.)
Craft Support
Simple support system for tracking, prioritizing and solving customer support tickets.
Craft React
Craft CMS React Renderer lets you implement React.js client and server-side rendering in your Craft CMS projects. It’s an implementation of ReactBundle for CraftCMS.
It’s still a young plug-in so “don’t use it in production” just yet, according to the author.
Craft 3 Seeder
Seeder allows you to quickly create dummy entries through the command line. And you can just as easily remove the dummy data when you're done building the site.
Craft Scout
Craft Scout provides a simple solution for adding full-text search to your entries. Scout will automatically keep your search indexes in sync with your entries.
GDPR Data Checker for Craft 2
Run through the database and pull out any information associated with a specified email address.
Yii, Twig, PHP & More
date_modify in Twig
Twig has some built-in magic in the date_modify filter. It modifies a date with a given modifier string.
You can do things like the following:
{% set interval = now.diff(now|date_modify('+' ~ mins ~ ' min')) %}
You can then add in Craft's duration filter and make even more powerful code snippets.
Overheard
It’s not Craft, but it’s interesting.
Converting rewrite rules for Nginix
If you’re used to configuring your rewrite rules using only Apache’s .htaccess files, take heart. Here are some tips to doing it “the right way” on Nginx.
Web performance made easy (Google I/O '18)
In this talk, learn how to find and fix the most common web performance bottlenecks to improve your UX by using tools like Lighthouse and DevTools, and discover the latest browser APIs (e.g. Service Workers, Async Images, Fetch Priorities) to get more control over your loading experience.
Freelance Transformation Ep 165: Backdoors to Find Clients
A podcast on finding higher-paying projects, working less, and getting rid of the stress.