The smallest working WordPress plugin is a folder in wp-content/plugins containing a PHP file with a plugin header. WordPress reads that header, lists the plugin in the admin area, and runs the code you connect with add_action() and add_filter(). Create the folder and file, add the header, attach one small feature to a hook, activate it from Plugins, and test before packaging the folder as a ZIP.
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
What a WordPress plugin actually is
A plugin is an independent package of PHP (and, when needed, JavaScript, CSS, images, or other assets) that extends WordPress without editing WordPress core files. For a first plugin, the required structure is deliberately small:
As an Amazon Associate I earn from qualifying purchases.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →- A dedicated directory inside
wp-content/plugins. - At least one PHP file in that directory.
- A plugin header comment at the top of the main PHP file.
- Code connected to WordPress with hooks such as actions and filters.
The header makes the file discoverable in the Plugins screen. Hooks determine when your code runs and whether it performs an operation or changes a value. Activation is a separate step: copying files to the plugins directory does not turn the plugin on.
Before you write code
Use a development or staging site
Develop on a local WordPress installation or a staging copy rather than experimenting on a live site. Keep a way to access the files if a PHP error prevents the normal admin screen from loading. Make a backup before testing code that changes content, settings, or database data.
#1 Best Overall
- BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
- EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
- COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
- LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
- WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
Check the versions you intend to support
Choose the oldest WordPress and PHP versions your code will support. You declare those minimums in the plugin header with Requires at least and Requires PHP. Since WordPress 5.8, WordPress reads these two compatibility values from the main PHP file rather than from readme.txt.
Do not copy compatibility values from another plugin without deciding what your own code needs. A minimum version is a promise to users: code that uses a newer PHP or WordPress API should either raise the requirement or provide a compatible alternative.
Pick a slug and folder name
Use a short, distinctive folder name made from lowercase letters, numbers, and hyphens, such as game-tips-tools. The main file can use the same slug, for example game-tips-tools.php. A dedicated folder keeps the main file, assets, translations, and future includes together instead of scattering files through wp-content/plugins.
Create the plugin folder and main file
- Open your WordPress installation’s
wp-content/pluginsdirectory. - Create a new folder for the plugin, such as
game-tips-tools. - Inside it, create the main file
game-tips-tools.php. - Put the plugin header at the very top of that PHP file, before the feature code.
The directory should now look like this:
wp-content/
└── plugins/
└── game-tips-tools/
└── game-tips-tools.php
WordPress scans plugin directories for PHP files containing a valid header. The main file is the natural place for the header and the initial hook registrations, even when a larger plugin later divides its code among several files.
Add the WordPress plugin header
Plugin Name is the only mandatory header field. It is the name shown in the admin Plugins list. A practical header for a new plugin can look like this:
<?php
/*
* Plugin Name: Game Tips Tools
* Plugin URI: https://example.com/plugins/game-tips-tools/
* Description: Adds small editorial tools for a game-tips site.
* Version: 1.0.0
* Requires at least: 5.2
* Requires PHP: 7.2
* Text Domain: game-tips-tools
*/
Replace the example values with your own details. The URI should identify the plugin and should not be a WordPress.org URL. Keep the description under 140 characters so it remains suitable for the Plugins screen. The version is your plugin’s release number; use a consistent versioning scheme and increase it when distributing a new build.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsRank #2
- WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
- AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
- PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
- ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
- COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
Header fields you may need
| Field | Purpose | When to use it |
|---|---|---|
Plugin Name |
Human-readable name displayed in the Plugins screen. | Always; it is the only mandatory field. |
Plugin URI |
Unique page for the plugin. | Use a page you control; it may not be a WordPress.org URL. |
Description |
Short explanation shown to administrators. | Keep it below 140 characters. |
Version |
Identifies the current release. | Use for updates and troubleshooting. |
Requires at least |
Oldest WordPress version supported. | Set it to the oldest version your code can run on. |
Requires PHP |
Oldest PHP version supported. | Set it to the oldest PHP version your syntax and dependencies require. |
Text Domain |
Identifier used by translation functions. | Include it when your plugin has translatable text. |
Domain Path |
Location of translation files. | Useful when shipping translations in a subdirectory. |
Requires Plugins |
Declares WordPress.org plugin dependencies by comma-separated slug. | Use only when the plugin genuinely depends on other plugins. |
Update URI |
Controls update identification for distribution arrangements outside the normal directory. | Use when your update system requires it. |
The handbook’s header list has grown over time, so check the current WordPress Header Requirements documentation before publishing a distributed plugin, especially if you use dependency or update metadata. Network activation is a separate multisite concern; do not add a network-only value unless the plugin is designed for that use.
Write a first working feature
WordPress does not execute arbitrary plugin functions at a useful moment just because they are present in a file. Register your functions with hooks. An action tells WordPress to run your function when an event occurs. A filter receives a value, lets your function modify it, and then returns the changed value.
A minimal action example
This plugin adds a message to the end of post content by registering a function on the the_content filter. It is intentionally simple, but it demonstrates the complete lifecycle: a named function, a hook registration, and a returned value.
<?php
/*
* Plugin Name: Game Tips Tools
* Description: Adds a short notice to single posts.
* Version: 1.0.0
* Requires at least: 5.2
* Requires PHP: 7.2
* Text Domain: game-tips-tools
*/
function gtt_append_notice( $content ) {
if ( ! is_single() ) {
return $content;
}
$notice = '<p class="gtt-notice">More game tips are available in this guide.</p>';
return $content . $notice;
}
add_filter( 'the_content', 'gtt_append_notice' );
The filter must return the content it receives. Returning nothing, or returning only the notice, would replace the post rather than append to it. The conditional keeps the message out of archive and other contexts where a full single-post body is not being displayed.
An action example for admin setup
Actions are appropriate when you need to perform an operation at a lifecycle event. For example, you can register an administration-page callback on admin_menu and perform admin initialization on admin_init:
function gtt_register_admin_page() {
add_options_page(
'Game Tips Tools',
'Game Tips Tools',
'manage_options',
'game-tips-tools',
'gtt_render_settings_page'
);
}
add_action( 'admin_menu', 'gtt_register_admin_page' );
function gtt_admin_init() {
// Register settings, sections, or fields here when the plugin needs them.
}
add_action( 'admin_init', 'gtt_admin_init' );
function gtt_render_settings_page() {
echo '<div class="wrap">';
echo '<h1>Game Tips Tools</h1>';
echo '<p>Configure the plugin here.</p>';
echo '</div>';
}
The manage_options capability check in the menu registration limits the page to administrators who can manage site options. A real settings page should validate and sanitize submitted values and escape values when rendering them.
Rank #3
- Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
- Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
- Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
- ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
- Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
Loading front-end CSS or JavaScript
Use the wp_enqueue_scripts action to enqueue front-end assets rather than printing a stylesheet or script directly inside post content:
function gtt_enqueue_assets() {
wp_enqueue_style(
'gtt-styles',
plugin_dir_url( __FILE__ ) . 'assets/gtt.css',
array(),
'1.0.0'
);
}
add_action( 'wp_enqueue_scripts', 'gtt_enqueue_assets' );
Create the corresponding assets/gtt.css file inside the plugin folder. If an asset is needed only on one screen, add a conditional so it is not loaded on every request. Keep the version in the enqueue call aligned with the release when you need browsers to fetch a changed file.
Actions and filters: choosing the right hook
| Question | Use an action when… | Use a filter when… |
|---|---|---|
| What does the callback do? | It performs work at a particular event, such as registering a menu or enqueuing assets. | It receives a value, transforms it, and returns the result. |
| Typical examples in this plugin | admin_init, admin_menu, wp_enqueue_scripts. |
the_content for changing post output. |
| Return value | Usually no value is returned to WordPress. | The filtered value must be returned, even if unchanged. |
| Main failure mode | The callback never runs because it was attached to the wrong lifecycle event. | Content disappears or is corrupted because the callback does not return the incoming value. |
Read the hook’s documentation for the callback arguments it supplies. A callback that declares the wrong number or order of arguments can generate warnings or fail to modify the intended value. Start with one hook, confirm it works, then add the next feature.
Use a consistent naming strategy
Prefix your functions, hooks, option names, and handles with a distinctive short identifier such as gtt_. Generic names such as setup, render, or init can collide with another plugin or a theme. The prefix in the examples is not a reserved WordPress term; choose one that is unlikely to overlap with existing code.
Keep the main file readable. Once the plugin grows, move administrative callbacks, front-end callbacks, and shared utilities into separate files and load them from the main file. The header should remain in the main plugin file so WordPress can identify it reliably.
Activate and test the plugin
- Save the main PHP file and all referenced assets.
- Sign in to WordPress as an administrator.
- Open Plugins in the dashboard.
- Find the name from your
Plugin Nameheader and select Activate. - Visit the screen affected by your hook: open a single post for the content filter, or open the settings area for an admin-menu action.
- Check the browser output and the PHP error log for warnings or fatal errors.
If the plugin is not listed, check the path first: the PHP file must be inside a directory beneath wp-content/plugins. Then check that the header is in a PHP comment at the top of the main file and that Plugin Name is spelled correctly. If activation produces a fatal error, disable or remove the plugin file through the filesystem, correct the code, and reactivate it.
Rank #4
- Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
- Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
- 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
- Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
- USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
Test both expected and unexpected contexts
- Open a single post, an archive, and a page to confirm the filter runs only where intended.
- Check logged-out and logged-in views when the plugin changes public output.
- Use an account without administrative capabilities to verify that restricted settings screens are not exposed.
- Test with your theme’s normal content and with a post containing images, embeds, and shortcodes.
- Turn on the WordPress debugging tools in staging so notices and deprecated calls are visible during development.
Do not assume that a successful activation means the feature is correct. Hooks can run in several contexts, and a function that works on one post template may produce unwanted output in feeds, excerpts, REST responses, or administrative previews unless you explicitly account for those cases.
Organize a plugin that is growing
A single file is ideal for learning and for a tiny site-only utility. As features accumulate, separate responsibilities without changing the basic model:
game-tips-tools/
├── game-tips-tools.php
├── includes/
│ ├── admin.php
│ └── front-end.php
├── assets/
│ ├── gtt.css
│ └── gtt.js
└── languages/
The main file can load those files and register their hooks. Keep each callback focused: one function should have one clear reason to run. Avoid editing WordPress core or a theme to make the feature work; a plugin is specifically intended to keep the change portable when the theme changes.
Security and reliability checks
- Escape text and attributes when sending data to HTML.
- Sanitize values before saving settings or other user input.
- Check capabilities before administrative operations.
- Use nonces for forms and other requests that change data.
- Validate values before using them in queries, file operations, or redirects.
- Return the original value from filters when your conditions are not met.
- Keep secrets and environment-specific credentials out of the plugin files you distribute.
These checks are especially important for a game site with user comments, contributor accounts, or editorial settings. A plugin that only appends a fixed paragraph has a much smaller attack surface than one that accepts uploaded files or executes administrative requests, so match the complexity of your protections to the data and operations involved.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Package the plugin as a ZIP
When the plugin works on the development site, package the entire plugin directory, not just the main PHP file. The ZIP should expand to a single top-level folder containing the main file and its subdirectories:
game-tips-tools.zip
└── game-tips-tools/
├── game-tips-tools.php
├── includes/
└── assets/
- Confirm that the main PHP file still contains the header and that its version is correct.
- Open the ZIP and verify that the folder is not nested twice, such as
game-tips-tools/game-tips-tools/game-tips-tools.php. - Install the ZIP on a clean staging site through Plugins > Add New > Upload Plugin.
- Activate it and repeat the functional checks before giving the file to another administrator.
Submission and directory-distribution rules can add requirements beyond the basic plugin structure. If you plan to publish through a directory or an external update service, review the current WordPress requirements and make the header metadata, licensing, dependencies, and update behavior match that distribution method.
Best Value
- Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
- Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
- Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
- Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
- Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
Common problems and precise fixes
The plugin does not appear in Plugins
Verify the directory and filename, then inspect the first lines of the main PHP file. A missing or malformed Plugin Name field prevents WordPress from recognizing the file as a plugin. Make sure the file really ends in .php and was not saved as a text file with a hidden second extension.
The plugin appears but the feature does nothing
Confirm that the hook registration executes and that the callback name matches exactly. For a filter, check that the callback accepts the value and returns it. For an action, confirm that the code is attached to the lifecycle event that actually occurs on the screen you are testing.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Post content is duplicated
A content filter can run more than once in different rendering contexts. Add conditions appropriate to the intended view and avoid appending the same marker when it is already present. Test archives, feeds, previews, and single posts separately.
Activation causes a fatal error
Read the PHP error message for the file and line number, then disable the plugin through the filesystem if the dashboard is inaccessible. Check syntax, unsupported PHP features, missing included files, and function-name collisions. Raise Requires PHP only when the plugin truly needs a newer runtime; changing the header does not repair incompatible code.
The stylesheet or script is missing
Check that the path in plugin_dir_url( __FILE__ ) matches the actual asset location and that the file was included in the ZIP. Use the browser’s network panel to see the requested URL and HTTP response, then correct the path or enqueue handle.
Site-only utility or distributed plugin?
| Decision | Site-only plugin | Distributed plugin |
|---|---|---|
| Audience | One site’s administrators and content. | Users with different themes, versions, languages, and hosting environments. |
| Compatibility | Can target the site’s known WordPress and PHP versions. | Must declare and honor minimum versions with Requires at least and Requires PHP. |
| Metadata | A name, description, version, and relevant requirements may be enough. | May need translation, dependency, and update metadata such as Text Domain, Requires Plugins, or Update URI. |
| Testing | Focus on the site’s theme, content, roles, and enabled plugins. | Test clean installations and document supported environments. |
| Packaging | Keep the folder in version control or install it directly. | Build a ZIP with the correct top-level folder and test the install path. |
Both types use the same core mechanism: a plugin folder, a discoverable main file, a header, hooks, activation, and testing. Distribution broadens the compatibility and maintenance obligations; it does not require a different way to attach functionality to WordPress.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteA practical first-plugin checklist
- Create a unique folder under
wp-content/plugins. - Create the main PHP file inside that folder.
- Add a valid header with at least
Plugin Name. - Declare
Requires at leastandRequires PHPfor the versions you support. - Use a distinctive prefix for your functions and handles.
- Attach behavior with the appropriate action or filter.
- Return the incoming value from every filter callback.
- Escape output, sanitize input, check capabilities, and use nonces for state-changing forms.
- Activate from the admin Plugins screen.
- Test the intended screen plus contexts where the hook might also run.
- Package the complete folder as a ZIP and test that ZIP on staging.
What to learn next
Once the first hook works, add one feature at a time: a settings page, a properly enqueued asset, a translation-ready string, or a declared dependency. Keep each change small enough to test independently. The reliable path from a “Hello World” experiment to a maintainable plugin is not a larger bootstrap framework; it is clear metadata, narrowly scoped hooks, explicit compatibility, and repeatable activation and testing.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




