+ All Categories
Home > Technology > Power of mu plugins

Power of mu plugins

Date post: 17-Jul-2015
Category:
Upload: mikel-king
View: 68 times
Download: 0 times
Share this document with a friend
23
Unlock the power of WordPress Using mu-plugins By Mikel King
Transcript
Page 1: Power of mu plugins

Unlock the power of

WordPress

Using mu-plugins

By Mikel King

Page 2: Power of mu plugins

Mu-plugins

● Require manual installation

● Activate automatically

● Are persistent

● Do not work in subdirectories like regular plugins*

● Should not alter the DB schema**

Page 3: Power of mu plugins

Mu-plugins

● Require manual installation

● Activate automatically

● Are persistent

● Do not work in subdirectories like regular plugins*

● Generally should not alter the DB schema**

* There are methods and mu-plugin managers to help use regular plugins as mu’s

Page 4: Power of mu plugins

Mu-plugins

● Require manual installation

● Activate automatically

● Are persistent

● Do not work in subdirectories like regular plugins*

● Generally should not alter the DB schema**

* There are methods and mu-plugin managers to help use regular plugins as mu’s

** This is a use at your own risk kind of situation

Page 5: Power of mu plugins

Goals...

● Familiarize you with mu-plugins

● Expose you to a new tool

● Expand your horizons

Page 6: Power of mu plugins

Why use mu-plugins?

Page 7: Power of mu plugins

Why use mu-plugins?

● They grant you abilities that other systems of

modification do not (dropins, themes, plugins)

Page 8: Power of mu plugins

● They grant you abilities that other do not (dropins, themes, plugins)

● The persistence model can be used to your

advantage (library code, api’s etc...)

Why use mu-plugins?

Page 9: Power of mu plugins

Let’s look at an example

Page 10: Power of mu plugins

Theme augmentation

News Magazine Theme

Page 11: Power of mu plugins

Theme augmentation

News Magazine Theme

Page 12: Power of mu plugins

Side by side comparison

Page 13: Power of mu plugins

Let’s look at some code!!!

https://github.com/mikelking/singleton_base

000-singleton-base.php

010-base-plugin.php

Page 14: Power of mu plugins

tabular-css/plugin.php

Tabular-css tree

Page 15: Power of mu plugins

tabular-data.css

Page 16: Power of mu plugins

Let’s take a deeper look at some code!!!

https://github.com/mikelking/singleton_base

000-singleton-base.php

010-base-plugin.php

Page 17: Power of mu plugins

So what’s the point?

● Can’t I just add the css to the main style sheet?

Page 18: Power of mu plugins

So what’s the point?

● Can’t I just add the css to the main style sheet?

● Or put it in it’s own file and @import it?

Page 19: Power of mu plugins

So what’s the point?

● Can’t I just add the css to the main style sheet?

● Or put it in it’s own file and @import it?

● Or enqueue it through function.php?

Page 20: Power of mu plugins

So what’s the point?

● Can’t I just add the css to the main style sheet?

● Or put it in it’s own file and @import it?

● Or enqueue it through function.php?

● Really I’m having trouble connecting the dots, man.

Page 21: Power of mu plugins

Well the point is that:

None of those methods are future proof.

You are responsible for reimplemention after EVERY

update.

None of those methods are easy to troubleshoot.

A plugin built like this can be turned off

Hey man this is just a high level example.

Actually this is a real world example.

Page 22: Power of mu plugins

Unlock the power of

WordPress

Using mu-plugins

By Mikel King

This has been:

Page 23: Power of mu plugins

Contact info:

https://twitter.com/mikelking

https://www.linkedin.com/in/mikelking

https://github.com/mikelking


Recommended