Custom Functions Wordpress Plugin - Rating, Reviews, Demo & Download
Plugin Description
Enables the ability to input custom WordPress functions such as filters in a centralized place to avoid the dependence on a theme functions.php file.
- Join our FREE Facebook group for support!
- Worth a 5-star review? Thank you!
- Plugin Homepage
- Plugin GitHub
Our related OSS projects:
The Long Version
Some custom functions plugins rely on the database, which is very unstable and doesn’t allow proper debug checks. This plugin integrates the new code (syntax) editor API from WordPress COre to edit an actual PHP file where all your custom WordPress functions and filters can be stored as a physical file on the server. This way, the syntax editor can do its job properly, the functions/filters are parsed faster (e.g. via PHP Opcache) and no reliance on database is needed, meaning no database queries or possible fatal errors/crashes scenario.
Current version edits the following file (do not edit/delete via SFTP):
wp-content/functions.php
To access visit WP Admin > Plugins Submenu > Custom Functions link
In the future we may have a include line at the very top of wp-config.php to prioritize loading order, as certain defined constants (etc) are better loaded prior to the mu-plugins / plugins / theme load sequence.
Dev team notes (1.0.0): the plugin editor integration has been a bit complicated because to be executed outside of the plugin/theme editor it needed several adjustments in javascript, replacing event handlers, overwrite some part of the code, etc. The server side code (managed via an AJAX action) to validate the submitted code uses functions copied from the WP core instead of calling their functions because the code does not allow to change default paths and URLs (no functions params or available filters). When the code is submitted, the wp-content/custom-functions.php file is saved directly without any validation. After that, the plugin sets a WP internal status in ‘scrape mode’ to detect PHP fatal errors, and performs two remote calls, one to the same plugin page emulating current logged user status (same cookies and headers emitted by browsers), and one to the homepage. If any of them produces a code exception, then error info is captured and makes a roll-back to the previous custom-functions.php code.
Last minute tweaks:
-
Create file on plugin activation starting with <?php and also two line breaks.
-
Changed target filename from custom-functions to functions.php
-
Set sslverify to false in remote requests to avoid false positives in code validation checks due certificates issues (detected on temp.littelbizzy.com)
-
Improved crap code removing its own plugin ajax requests via two ways:
a) Attemp to remove any previous existing buffer with ob_start, but it does not work on temp.littlebizzy.com, it is possible output_buffering = off in php.ini ?
b) Just if buffering fails, also it does not execute (include_once) the functions.php file from the plugin (this will not work if functions.php is included from other PHP script)
Why 1.0.0 doesn’t include_once in wp-config file:
-
WP functions does not exists yet at the wp-config.php level, so except for non-dependant functions it will generate warnings (include_once generates warnings instead of fatal errors of require_once)
-
Code before <?php is considered HTML, but yes it is a problem too.
Compatibility
This plugin has been designed for use on LEMP (Nginx) web servers with PHP 7.0 and MySQL 5.7 to achieve best performance. All of our plugins are meant for single site WordPress installations only; for both performance and security reasons, we highly recommend against using WordPress Multisite for the vast majority of projects.
Note: Any WordPress plugin may also be loaded as “Must-Use” by using the Autoloader script within the mu-plugins
directory.
Defined Constants
The following defined constants are supported by this plugin:
define('DISABLE_NAG_NOTICES', true);
Plugin Features
- Premium Version: SEO Genius
- Settings Page: No
- PHP Namespaces: Yes
- Object-Oriented Code: Yes
- Includes Media (images, icons, etc): No
- Includes CSS: No
- Database Storage: Yes
- Transients: No
- Options: Yes
- Table Data: Yes
- Creates New Tables: No
- Database Queries: Backend Only
- Query Types: Options API
- Multisite Support: No
- Uninstalls Data: Yes
Nag Notices
This plugin generates multiple Admin Notices in the WP Admin dashboard. The first is a notice that fires during plugin activation which recommends several related free plugins that we believe will enhance this plugin’s features; this notice will re-appear approximately once every 6 months as our code and recommendations evolve. The second is a notice that fires a few days after plugin activation which asks for a 5-star rating of this plugin on its WordPress.org profile page. This notice will re-appear approximately once every 9 months. These notices can be dismissed by clicking the (x) symbol in the upper right of the notice box. These notices may annoy or confuse certain users, but are appreciated by the majority of our userbase, who understand that these notices support our free contributions to the WordPress community while providing valuable (free) recommendations for optimizing their website.
If you feel that these notices are too annoying, than we encourage you to consider one or more of our upcoming premium plugins that combine several free plugin features into a single control panel, or even consider developing your own plugins for WordPress, if supporting free plugin authors is too frustrating for you. A final alternative would be to place the defined constant mentioned below inside of your wp-config.php
file to manually hide this plugin’s nag notices:
define('DISABLE_NAG_NOTICES', true);
Note: This defined constant will only affect the notices mentioned above, and will not affect any other notices generated by this plugin or other plugins, such as one-time notices that communicate with admin-level users.
Inspiration
- n/a
Free Plugins
- 404 To Homepage
- Autoloader
- CloudFlare
- Custom Functions
- Delete Expired Transients
- Disable Admin-AJAX
- Disable Author Pages
- Disable Cart Fragments
- Disable Embeds
- Disable Emojis
- Disable Empty Trash
- Disable Image Compression
- Disable jQuery Migrate
- Disable Search
- Disable WooCommerce Status
- Disable WooCommerce Styles
- Disable XML-RPC
- Download Media
- Download Plugin
- Download Theme
- Duplicate Post
- Enable Subtitles
- Export Database
- Facebook Pixel
- Force HTTPS
- Force Strong Hashing
- Google Analytics
- Header Cleanup
- Index Autoload
- Maintenance Mode
- Profile Change Alerts
- Remove Category Base
- Remove Query Strings
- Server Status
- StatCounter
- View Defined Constants
- Virtual Robots.txt
Premium Plugins
Special Thanks
- Alex Georgiou
- Automattic
- Brad Touesnard
- Daniel Auener
- Delicious Brains
- Greg Rickaby
- Matt Mullenweg
- Mika Epstein
- Mike Garrett
- Samuel Wood
- Scott Reilly
- Jan Dembowski
- Jeff Starr
- Jeff Chandler
- Jeff Matson
- Jeremy Wagner
- John James Jacoby
- Leland Fiegel
- Paul Irish
- Rahul Bansal
- Roots
- rtCamp
- Ryan Hellyer
- WP Chat
- WP Tavern
Disclaimer
We released this plugin in response to our managed hosting clients asking for better access to their server, and our primary goal will remain supporting that purpose. Although we are 100% open to fielding requests from the WordPress community, we kindly ask that you keep the above-mentioned goals in mind… thanks!
Screenshots
No screenshots provided