Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →To create a WordPress plugin, make a folder inside wp-content/plugins, add a PHP file with a valid plugin header, connect your code with WordPress hooks such as add_action() and add_filter(), then activate it from Plugins in the WordPress admin. The smallest working plugin can be one PHP file; larger plugins should keep their files in a dedicated folder.
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
What a WordPress plugin is
A plugin is a collection of files that extends WordPress without changing WordPress core. WordPress discovers plugins in wp-content/plugins. A plugin becomes identifiable when one of its PHP files contains a plugin header comment, and the Plugin Name field is the only header field required for it to appear in the Plugins screen.
As an Amazon Associate I earn from qualifying purchases.
Your code does not run merely because the file exists. WordPress loads an activated plugin and executes the callbacks you attach to its hook system. Actions let you run code at a particular event; filters let you receive a value, modify it, and return the result. This separation keeps custom behavior in your plugin instead of in core files, so WordPress updates do not overwrite it.
Decide the plugin’s scope before writing code
A short design decision prevents many rewrites. Write down the single behavior the first version must provide, where it should run, and the oldest WordPress and PHP versions you intend to support.
#1 Best Overall
- [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
- [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
- [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
- [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
- [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
- Site-wide or administrator-only: front-end features commonly use hooks such as
wp_enqueue_scriptsandthe_content; settings pages and maintenance tasks use hooks such asadmin_menuandadmin_init. - One purpose per plugin: a focused plugin is easier to activate, test, disable, and move to another site.
- Compatibility floor: choose the oldest WordPress and PHP versions you will actually test. Put those values in the main PHP file’s header.
- Distribution needs: a private, site-specific plugin may need only a name and description. A plugin intended for other sites may need additional metadata such as update information or declared dependencies.
Create the plugin folder and main PHP file
Use a dedicated folder so every file belonging to the plugin stays together. For a plugin called “Reading Note,” create this path:
wp-content/
└── plugins/
└── reading-note/
└── reading-note.php
The folder and file names are examples; choose a distinctive, lowercase name for your own project. The main file must have a .php extension. Keep the plugin header at the beginning of that file, before ordinary executable code.
Free tools Windows power users keep installed
One-click scans. No signup required.
You can create the file with your hosting file manager, SFTP, a local WordPress installation, or a code editor. Do not edit files inside WordPress core to add plugin behavior.
Add the WordPress plugin header
Place a PHP comment containing the metadata at the top of the main file. The following is a complete illustrative header:
<?php
/*
* Plugin Name: Reading Note
* Plugin URI: https://example.com/reading-note/
* Description: Adds a short note below single blog posts.
* Version: 1.0.0
* Requires at least: 6.0
* Requires PHP: 7.4
* Text Domain: reading-note
*/
Only Plugin Name is mandatory. The other values describe the plugin and tell WordPress which environments it supports. Treat the version numbers in the example as placeholders for your tested support policy rather than universal recommendations.
Rank #2
- 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
- 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
- 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
- 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
- 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
Header fields and when to use them
| Field | Purpose | Important qualification |
|---|---|---|
Plugin Name |
The name shown in the Plugins list. | The only mandatory field. |
Plugin URI |
A unique page about the plugin. | It should be unique to the plugin and should not be a WordPress.org URL. |
Description |
A short explanation displayed with the plugin. | Keep it under 140 characters. |
Version |
The plugin’s release version. | Increase it when you publish a new release so updates can be identified. |
Requires at least |
The oldest WordPress version your code supports. | Use the oldest version you test, not simply the version running on your development site. |
Requires PHP |
The oldest PHP version your code supports. | Use the oldest PHP version you test. |
Text Domain |
Identifies translation strings. | Include it when the plugin contains translatable text. |
Network |
Marks a plugin intended for network activation. | Use true only when network activation is appropriate; otherwise omit the field. |
Domain Path |
Describes where translation files are stored. | Use when your translation setup requires it. |
Requires Plugins |
Declares plugin dependencies. | Values are comma-separated WordPress.org plugin slugs. |
Update URI |
Provides update identification for plugins distributed outside the normal directory workflow. | Check the current WordPress handbook syntax before publishing. |
WordPress 5.8 and later read the Requires at least and Requires PHP values from the main PHP file rather than from readme.txt. Header fields documented by the handbook have expanded over time, so verify the live Header Requirements documentation when you prepare a public release.
Write a first working plugin
The example below adds a note to the end of single blog posts and creates a small page under Settings. It demonstrates both a filter and an action while remaining a single-file plugin.
<?php
/*
* Plugin Name: Reading Note
* Plugin URI: https://example.com/reading-note/
* Description: Adds a short note below single blog posts.
* Version: 1.0.0
* Requires at least: 6.0
* Requires PHP: 7.4
* Text Domain: reading-note
*/
function reading_note_append_to_content( $content ) {
if ( is_singular( 'post' ) && in_the_loop() && is_main_query() ) {
$content .= '<p class="reading-note">Thanks for reading this article.</p>';
}
return $content;
}
add_filter( 'the_content', 'reading_note_append_to_content' );
function reading_note_add_settings_page() {
add_options_page(
'Reading Note',
'Reading Note',
'manage_options',
'reading-note',
'reading_note_render_settings_page'
);
}
add_action( 'admin_menu', 'reading_note_add_settings_page' );
function reading_note_render_settings_page() {
echo '<div class="wrap">';
echo '<h1>Reading Note</h1>';
echo '<p>The plugin is active and its content filter is available.</p>';
echo '</div>';
}
Save the file, upload the reading-note folder to wp-content/plugins, and activate it. On a single published post, the filter appends the paragraph. A user with the manage_options capability can open Settings > Reading Note to see the administrator page.
Understand actions and filters
Hooks are the connection points between your plugin and WordPress. Select the hook according to whether you are responding to an event or changing a value.
| Hook type | What your callback does | Examples from a typical plugin |
|---|---|---|
| Action | Runs code when WordPress reaches an event. It does not replace a value. | admin_init for administrator initialization and admin_menu for adding menu pages. |
| Filter | Receives a value, changes it, and returns the changed value. | the_content for modifying post output. |
| Front-end action | Runs code while the public-facing page is being prepared. | wp_enqueue_scripts for registering or enqueueing front-end assets. |
For a filter, always return the value you received, even when you decide not to change it. In the example, returning $content prevents other content from disappearing. Restrict the callback with conditions such as is_singular(), in_the_loop(), or is_main_query() when the feature should not affect feeds, widgets, previews, or secondary queries.
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 reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchRank #3
- [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
- [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
- [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
- [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
- [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
Add front-end CSS or JavaScript correctly
If the plugin needs browser assets, enqueue them from the wp_enqueue_scripts action rather than printing script or style tags directly in post content. A minimal pattern looks like this:
function reading_note_enqueue_assets() {
wp_enqueue_style(
'reading-note',
plugins_url( 'assets/reading-note.css', __FILE__ ),
array(),
'1.0.0'
);
}
add_action( 'wp_enqueue_scripts', 'reading_note_enqueue_assets' );
Create the matching assets/reading-note.css file inside the plugin folder. Keep the handle unique to your plugin, and change the version when you need browsers to fetch a changed asset. If an asset is needed only on a particular type of page, add conditions inside the enqueue callback so it is not loaded everywhere.
Choose names that do not collide
WordPress runs code from many plugins in one PHP process. Prefix functions, handles, option names, and other global identifiers with a distinctive project prefix, as reading_note_ does in the example. Generic names such as setup() or customize() can collide with another plugin or a theme and cause fatal errors.
As the plugin grows, split responsibilities into files while keeping the main file as the entry point. A practical structure might be:
reading-note/
├── reading-note.php
├── includes/
│ ├── admin.php
│ └── content.php
├── assets/
│ ├── reading-note.css
│ └── reading-note.js
└── languages/
Require those files from the main plugin file after the header. Keep the folder self-contained so it can be moved or zipped without relying on paths outside the plugin.
Rank #4
- Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
- Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
- All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
- Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
- Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
Activate and test the plugin
- Copy the complete plugin folder into
wp-content/plugins. - Sign in to the WordPress administrator area and open Plugins > Installed Plugins.
- Find the name from your
Plugin Nameheader and select Activate. - Visit the exact front-end page or administrator screen where the feature should work.
- Test while logged out and logged in when permissions matter. Check a single post, an archive, a page, a feed, and an area using a secondary query if your filter could affect them.
- Deactivate the plugin and confirm that the added behavior disappears without leaving the site unusable.
Before activating on a production site, test on a staging or local copy when possible. A PHP syntax error or an uncaught fatal error can prevent normal page rendering. If you have command-line PHP available, php -l reading-note.php performs a syntax check; it does not replace testing inside the WordPress version and PHP version you declared.
Declare compatibility honestly
The header is a compatibility contract. Requires at least should name the oldest WordPress release your implementation supports, and Requires PHP should name the oldest PHP release you test. If your code uses a newer API or language feature, raise the corresponding requirement instead of allowing activation on an environment that cannot run it.
Do not copy the example’s version numbers blindly. Recheck them whenever you add a dependency, change PHP syntax, or adopt a newer WordPress API. If you support multisite, decide deliberately whether the plugin should be activated per site or across the network; add the Network header only for a plugin intended for network activation.
Package the plugin as a ZIP
When the plugin is ready to move between sites, package the entire folder, including the main PHP file and any includes, assets, or translation directories. The ZIP should contain the plugin folder at its top level, not a loose collection of files:
reading-note.zip
└── reading-note/
├── reading-note.php
├── includes/
└── assets/
That layout lets WordPress place the files in one directory when the ZIP is uploaded or extracted. Open the archive before distributing it and verify that the header file is present, paths still point to files inside the plugin, and no development secrets or unrelated backups are included. WordPress.org submission and packaging rules can change, so consult the current directory guidelines if you plan to submit there rather than simply install the ZIP on your own sites.
Best Value
Troubleshoot common first-plugin failures
The plugin is not listed
- Confirm the file is inside
wp-content/plugins, either directly or inside one plugin folder. - Confirm the file ends in
.phpand contains a correctly formattedPlugin Name:line in its header comment. - Check that the header is in the main PHP file and that the file was uploaded completely.
Activation produces a fatal error
- Run a PHP syntax check and inspect the server’s PHP error log.
- Compare the site’s PHP version with
Requires PHP; a requirement that is too low can allow incompatible code to activate. - Look for a duplicate function name caused by an unprefixed callback or by loading the same file twice.
The plugin activates but nothing changes
- Verify that the callback is attached to the hook you actually need and that the function name in
add_action()oradd_filter()matches exactly. - For a filter, return the incoming value. A callback that omits
return $content;can blank the output. - Check conditional logic. The example intentionally runs only for the main loop of a singular post, so it will not alter pages or archive listings.
- Confirm that the code path is reached on the page you are testing and that a cache is not showing an older response.
The administrator page does not appear
- Make sure the
admin_menuaction is registered and the callback name is correct. - Sign in with a user who has the capability supplied to
add_options_page();manage_optionsnormally restricts the page to administrators. - Check that another plugin or a theme has not removed or renamed the menu entry.
Content is duplicated
- Ensure the filter is not registered twice through two included files.
- Keep the scope conditions for the intended query and avoid appending the same markup in more than one callback.
- Check whether a page builder or another plugin applies
the_contentmore than once; narrow the condition or use the integration point provided by that system.
Plan for maintainability and safe changes
Keep the main file short enough to show the plugin’s entry points at a glance. Put administrator code, front-end code, and reusable logic in separate files once the plugin grows. Use a version in the header and update it for each release. Record the minimum WordPress and PHP versions you test so the header stays accurate.
When a feature stores settings or changes data, add its own administrator capability checks and validate input before saving it. When rendering stored or user-provided values, escape them for the output context. For settings forms, use WordPress’s nonce and settings APIs rather than accepting an unverified request. These practices are especially important once a one-file experiment becomes a plugin used by other people.
Recommended Free Tools
Keep activation, normal runtime, and deactivation responsibilities distinct. Activation can create required options or database structures; normal hooks should do only the work needed for the current request; deactivation should stop scheduled or visible behavior without unexpectedly deleting a site’s content. Document any cleanup decision so an administrator knows what deactivation does.
ClassicPress is not WordPress
ClassicPress is a separate WordPress fork with its own header requirements, including fields such as Requires CP. Do not copy ClassicPress metadata rules into a WordPress plugin, or assume that a WordPress header is valid for ClassicPress. If you are targeting that fork, check its current documentation separately.
Quick Recap
First-plugin checklist
- A dedicated folder exists under
wp-content/plugins. - The main PHP file contains a header with a valid
Plugin Name. Requires at leastandRequires PHPmatch the oldest versions you test.- Every action or filter callback is registered with the correct hook and a uniquely prefixed name.
- Filter callbacks return the value they receive.
- Front-end assets are loaded through
wp_enqueue_scriptswhen appropriate. - Administrator pages use a suitable capability.
- The plugin has been activated and tested on the pages it should affect and the pages it should leave alone.
- The ZIP, if distributed, contains the complete plugin folder and no unrelated files.
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.




