54.2 F
Los Angeles
Wednesday, November 29, 2023

ASUS Announces 2023 Vivobook Classic Series

On April 7, 2023, ASUS introduced five new models in the 2023 Vivobook Classic series of laptops. The top laptops in the series use the 13th Gen Intel® Core™...

Airman Arrested In Case of Leaked Classified Documents

Massachusetts Air National Guardsman Jack Teixeira has been arrested in the latest case of leaked classified documents. Teixeira, 21, is the head of Thug Shaker Central, an online gaming...

Microsoft OneNote to Gain Copilot

Microsoft 365 Copilot is coming to OneNote.
StaffPenguin Flight LogBetter Bootstrap File for XenWord Plugin

Better Bootstrap File for XenWord Plugin

The WordPress plugin bootstrap file contains the name of the plugin, version, author, description, links, etc. all in a header. All plugins begin with this information. What follows is usually unique; there are security concerns and decisions made by the developer to follow procedural or OOP design patterns.

XenWord has gone through numerous revisions. The first file, though, has rarely been modified. This weekend, I decided the file needed updating. The PHP version of the server needed to be detected and the plugin deactivated gracefully if the PHP version was not at least PHP 5.3. My hope in making the change was to stop people from trying to activate the plugin when the server doesn’t meet requirements.

After fussing for quite some time, I settled on a class named XenWord_Pro, and instantiating it at the end of the file. Five methods within the class are the constructor, php_check, load the required files, show a notice if something goes wrong as well as gracefully deactivate the plugin.

I’m not happy with the lack of adding a namespace at the top of the file but my understanding is too rudimentary. Too many issues were caused with the plugin when a namespace was added to the top of the XenWord class.

The nicest part of the changes is that the skeleton can be used for future plugins.

Layne Heinyhttp://www.layneheiny.com
LPH is a high school physics teacher interested in the Apple iPad and iPhone, Microsoft Surface, Tablet PCs, and other mobile devices. He resides with one large dog who begs for pizza, hamburgers, French fries, and anything else on the dinner table.

Latest news

Related news