the full height nexus icon
 red n black circle yellow n black circle green n black circle 

[ Useful Internet Links ]

** Primary Note, ..
[ Read more ]

Note: if you see a (*) against a menu option, means that the article has a download link associated with it.


WordPress developer, ..
(( search box )) located here.

WPBeginer, gotta say here: that this website has some really cool stuff on it, and it ain’t just for beginners neither, but it does has a Noob approach to searching for stuff. It also has a very heavy emphasis on the over-use of paid Plugins in my opinion.

StackOverFlow, not a Noob in sight: except for some of the unresearched questions being asked, here be the questionable search box in, ..
(( question ))

The Mozilla support site is a right royal bitch to navigate, but it does have some real neat stuff on it to peruse. Downside, you do really need to know what you want to find — before even looking for it. The place is not Noob friendly at all, that said, it’s got shed loads of brilliant examples.

But above all, there’s the king ‘n’ queen of all searches, ..
Google itself.

** Remember, this stuff discussed here can kill your website stone dead, so only proceed with a current backup under your belt.

This page title is, ..

[ Howtoo: make a WP Plugin ]

HEADER WARING.

Oh’ my God, (just look at that!) — But at least I’ve got your attention.
Anyhow – You can really cause a major faux-pas (pronounced as foe-par), to your cherished web presents in playing with this sort of dirty backend shit, (and not the nice giving type of pass-through present either), so make funking well sure that you have a backup of your WordPress site, **before** you bloomin’ well start.

This really looks horrid, .. don’t it.

Now, .. first off, .. none of this PHP coding stuff found here in the Plugin Page is mine, but in reading the various articles on the matter of the plugins themselves, then I kinda’ figured that it could be made a lot easier for the many Noobs out there, of whom I consider myself to be a foundling member of that exclusive camp.

The first part of the tutorial will just print a stupid message on the screen.

But the second part will force the internal WordPress editor (tinyMCE), to use the Verdana font as it’s default, and from there: the sky’s literally the limit in what you can get the editor to do, and in fact, WordPress itself.

And No!

** To make it perfectly clear from the outset, we are not talking about that general funk up called Guttenberg, we are in in actual fact; addressing what you can do with the normal classic editor.



Here it is, the nitty gritty good stuff, ..
right then, making a WordPress Plugin really is dead easy, but every tutorial that I’ve ever read about the process; then goes into a great deal of technical depth and infinite mindboggling detail about (what) goes (where), and does it in fine high class sounding words like your plugin folder, or your root directory for that, ..
– And in all that clever waffle, they never actually just simply (show) the befuddled Noobes (what) actually goes (where).

So here it is, the physical layout of (where) a new Plugin actually goes in your WordPress website.

A file manager panel showing a directory treeThe image above, just shows the bog standard file structure of a bog standard WordPress website install, and right off the bat: they all look the same.

In the above example, I’m would currently be using the (Author theme), and it’s the one that’s highlighted. I also have the (twentyfourteen theme) installed as well: that I could select in the Customizer to change to, should the whim take me, (but it won’t: ever!)


picture showing the WP directory layout Moving back up the root structure, and shown above, is my WordPress Plugins folder, with all of my own installed Plugins dutifully listed, .. obviously yours will be vastly different.

Side-TIP off track and off-tack. [read-more]

Should you ever funk up your website, and all the noble sniffy tossers advise you to uninstall all of your plugins, then this is where they mean that you should go!

Usage:- If you were to rename all of the Plugin Folders to [OLD-xxx], it effectively uninstalls them. You then rename them one by one to their real name again, till you then crash out you website once more, this is done to find out what Plugin did it:

If it was in fact a plugin that did it. [/read]

What we need to understand next, is the role of your own website’s Plugins folder, which in my day was called a (directory) btw.

Here, inside this website’s *directory*, is where you place your own newly created Plugin folder, along with its attendant PHP files, but more of that later.

Again, all WordPress websites are the same in this respect of their internal file layouts, with the public_html/wp-content folder having the themes and plugins folders contained inside it.

** As well as other directories, but we don’t need to discuss them at all.


Here’s how plugins work:-

Now, .. the very existence of your new Plugin folder, makes the WordPress software process all the files that it finds inside the sites “Plugin” directory itself: whereby it then builds up a list of all of the (your) plugins shown in the backend menu Plugins listings.

** And the WordPress software does this every-flippin-time you select the Plugins link on your Admin backend.


Making your Plugin, .. here we go.

Think of a name for your plugin folder to go on your local machine, make it weird in case of other Plugins having the same name: not a good scenario btw, and guaranteed to funk up your site somewhat.

I’m gonna’ use mjs-mega-ultimate-plugin as my weird directory (folder) name.

So, .. with your ordinary file manger on your local machine: make a directory called ‘mjs-mega-ultimate-plugin‘.

Go inside it, and then make a text file with your common garden text-editor, and name it for example: ‘my_additional_functions.php‘, also keep in mind that you can actually call it what you want, but good practice dictates that it’s name is the same as the directory name.

Inside the file put this:-

BTW it’s OK to cut and paste the included text.

But please keep in mind that [‘] [“] and extra spaces could cause errors, especially if their not in the standard ASCII character format, (in other words), they can’t be in the nice looking swept back and forward style (quotes) “” ” — that some posh text editors offer.

** Attention:- you also need to change the text words ( ??? xx ???  ) to reflect you own name, and additionally your own website’s name: cos it shows up later in the Plugin listings.
>> By-the-By, you also don’t need to include the question marks (??) – they are just there to get your attention.

YOUR ATTENTION, .. THIS DOESN’T ACTUALLY WORK: YOU ALSO NEED TO HAVE INSTALLED THE TINYMCE CSS FILE FIRST, MORE ON THAT LITTLE ISSUE TO FOLLOW.

<?php

/*
Plugin Name: writeOn's Functionality Plugin.
Description: All of the extra PHP functionality of my site goes here.
Version: 0.1
License: GPL
Author: Mrs Jessica Simpson
Author URI: https://www.b92.co.uk
*/

//  Adds a class to the lazy load buttons.
add_filter( 'llc_button_class', function () {
    return 'custom-class-1 custom-class-2';
});

// Loads a css file to change the default font in tinyMCE
function pump_up_editor_styles() {
    add_editor_style( 'styles/tinymce_editor.css' );
}
add_action( 'after_setup_theme', 'pump_up_editor_styles' );

// Reduces the width of the editor (backend), to reflect the front end widths.
add_filter( 'admin_footer', 'fulleditorwidth', 99 );
function fulleditorwidth() { 

  echo '<style> #content_ifr { block;margin-left: auto;margin-right: auto;width: 60%!important;}</style>';
  
  echo '<style> .mce-fullscreen #wp-content-wrap .mce-edit-area, .mce-fullscreen #wp-content-wrap .mce-menubar, .mce-fullscreen #wp-content-wrap .mce-statusbar, .mce-fullscreen #wp-content-wrap .mce-toolbar-grp { margin-left: auto; margin-right: auto; padding: 0!important; width: 60%!important;}</style>';
  
/*   '<style type="text/css"> #tinymce div.mce-fullscreen { margin-left: auto; margin-right: auto; width: 40%; }</style>';     */
  
}

// Remove the WP version for extra WordPress security.
function remove_wp_version() {

    return ' ' ;
}
add_filter( 'the_generator' , 'remove_wp_version' );

// Change the failed login message for extra WordPress security.
function failed_login() {
    
    return 'Incorrect login information supplied.';
    
}
add_filter( 'login_errors' , 'failed_login' );

// Lazy comments doesn't work if no comments, does now.
add_filter( 'llc_can_lazy_load_minimum_count', function () {
    // Lazy load only if there are 0 or more comments.
    return 0;
});

?>

Performing the Plugin Operation, .. OK, this is the complicated bit, so follow the steps carefully.

  1. Open your website in you favorite browser, and marvel at your WordPress Home-Page, or whatever your using as the main display.
  2. Next, open a new tab to view the backend Admin page.
  3. All good if you press Ctrl-F5 a few times?
    • No issues in reloading your site?

GOOD!

Right then, ..

  • Start your FTP program and connect to your website via your FTP credentials.
    1. Open it at your website’s root folder.
    2. Now, copy your local directory over to your website’s Plugin directory.

Remember: see the picture above for a reminder at what you’re looking at, and where you’re copying what and where to. NB: when finished dragging and dropping; or whatever method you used, please ensure that your new folder, is in-fact: inside the Plugins folder.

IMPORTANT TIP:-

  • KEEP YOUR FTP PROGRAM OPEN.

Now, .. in your favorite browser, and at your site’s Admin backend tab.

  1. Select the ‘Plugins’ link, and down the list you should see something similar to what’s shown below, along with the links Activate and Delete included as well.
My Extended Functionality Plugin.

Activate | Delete

This is where I’m going to put PHP code to basically extend the functions.php file, but without having it overridden when my theme gets updated.

Version 0.1 | By Mrs Jessica Simpson

Activate it!

Then in the favorite browser tab that currently still showing your glorious Home-Page, check that your website is still working, (Ctrl-F5) a few times, and also check to see if the added code you’ve written, is actually doing what it should.

  • Then click a load of links on your site, ..
  • All OK?

You can now release your control over the FTP program: don’t close it, but don’t worry about it.

  • If it’s not all OK.

And the browser has crashed out along with your wonderfully crafted website: you can at that point simply delete your Plugin from within the Plugins directory with your currently open FTP program, thusly returning your site to it’s original state.

(Ctrl – F5) a few times will reboot the sites html code to get it back to normal.


This is the no harm, no foul rhythm method of temporary pentation that I employ; mainly to ensure that no untoward bastards being conceived in the sites deep core.


OH’ NO!, .. If you were forced to rapidly withdraw from your own site, and all without any form of real satisfaction being enjoyed at your end: then you could, (can) start debugging the wayward code on your 
own local machine.

** The above is a popup link to a free program that I use on my own backend.

Running your own WordPress stable is a wonderful, deeply sensuous experience in its own right, and getting yourself to code right off the bat without a worry in the world: really is a brilliant feeling of mindless liberation.

** Please also keep in mind when running your own lodging house, and also taking in paying lodgers as one does, that it’s usually just incorrect ASCII characters being allowed in: especially when copying over lodging code from a random John that usually causes the problem, but fingering typos with sick sticky messy client Johns can’t be ruled out either, and relying on them to point it out is inconceivable, .. (Fairy Princess.)

So in conclusion, my Dearly Belove’d, – this is how you make a WordPress Plugin. It’s just straight forward PHP code that’s run after, or even before the site loads with the aid of WordPress’s many built in software hooks: which is a deep mega-thrusting subject in it own right.

 

Thanks for reading, Jessica: Praise be the ORI.

 

Information.

email icon This is my email address.



Your message may get put into the spam folder if my internet provided thinks it a bit phishy. So as an alternative — you can also use shopper@b92.co.uk if you so wish.

** This particular email address declared above, has positively and absolutely no spam filters on it, (at all), which means that positively and absolutely *everything* gets through.

Thanks for seeking me out, Jessica:
Praise be the ORI.

Information.

Disclaimer:-
The stuff found here in the Nexus is for amusement purposes only, and I guarantee that none of it is fit for purpose.

SO! – With that Pop-up popped up and properly put to bed, then the legal garbage is outta’ of the way.

Thanks for reading the trash, Jessica:
Praise be the ORI.

WARNING!

To view this website, you must be considered as an ADULT (with legal consent) in your current location to proceed any further.

Failure to comply, could result in a criminal prosecution (within the local domicile) that you physically reside.

This book site isn't for children, nor any childish attitudes towards sexual ambivalence. It is for -- ADULTS ONLY!

Pressing [ No! ] - Will take you away, to another type of less salubrious activity that's more suited to your young tender age (and/or) delicate disposition.

Only press [ YES! ] - If you understand these legally binding terms and conditions. Whereby, a one year cookie will be set on your browser: thusly declaring you to be an adult, (a constitutional time-Warrior), with all of your timely facilities intact.

It's a big decision that you're about to undertake coder, choose wisely: because you can never go back.