This guide walks you through installing Secure Custom Fields (SCF) on your WordPress site.
Before installing, ensure your site meets these requirements:
- WordPress 6.0 or later
- PHP 7.4 or later
- WordPress memory limit of 40MB or greater (64MB recommended)
- Log in to your WordPress admin panel
- Navigate to Plugins → Add New
- Search for "Secure Custom Fields"
- Click "Install Now"
- Click "Activate"
- Download the latest release from WordPress.org
- Extract the plugin files
- Upload the plugin folder to
/wp-content/plugins/
- Activate through the WordPress admin interface
This guide explains how to install and integrate the Secure Custom Fields plugin in your WordPress theme or plugin using Composer.
Add the following configuration to your composer.json
file:
{
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org"
}
],
"extra": {
"installer-paths": {
"vendor/{$name}/": ["type:wordpress-plugin"]
}
},
"require": {
"wpackagist-plugin/secure-custom-fields": "6.4.1"
},
"config": {
"allow-plugins": {
"composer/installers": true
}
}
}
Once the configuration is set, run the following command in your terminal to install the dependencies:
composer install
or
composer i
To ensure Composer dependencies are loaded correctly, add the following line in your plugin or theme:
require_once plugin_dir_path(dirname(__FILE__)) . 'vendor/autoload.php';
Now you need to manually load the Secure Custom Fields plugin and define its paths. Adjust the paths according to the structure of your plugin or theme:
if (! class_exists('ACF')) {
// Define the path and URL to the Secure Custom Fields plugin.
define('MY_SCF_PATH', plugin_dir_path(dirname(__FILE__)) . 'vendor/secure-custom-fields/');
define('MY_SCF_URL', plugin_dir_url(dirname(__FILE__)) . 'vendor/secure-custom-fields/');
// Include the plugin main file.
require_once MY_SCF_PATH . 'secure-custom-fields.php';
}
You have successfully installed and integrated Secure Custom Fields via Composer. You can now use it as you would with a normal installation, but with all the benefits of Composer-based dependency management.
// Hide the SCF admin menu item.
add_filter( 'acf/settings/show_admin', '__return_false' );
// Hide the SCF Updates menu.
add_filter( 'acf/settings/show_updates', '__return_false', 100 );
After installation:
- Navigate to Custom Fields in your admin menu
- Verify you can access all plugin features
- Create a test field group to ensure functionality