=== Basic Optimization ===
Contributors: shahalom, microsolutions
Tags: performance, optimization, multisite, disable emojis, xml-rpc, heartbeat
Requires at least: 5.5
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 2.1.0
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

A lightweight WordPress optimization plugin for disabling selected default frontend and header outputs such as emojis, shortlinks, embeds, XML-RPC, self pingbacks, heartbeat, WordPress version output, and selected WordPress core auto email notifications.

== Description ==

Basic Optimization provides simple on/off controls for common WordPress cleanup and performance-related tweaks. It is intentionally small, dependency-free, and designed for site owners who want practical optimization controls without a large performance suite.

The plugin adds a **Basic Optimization** admin screen where administrators can enable or disable each feature independently. It also includes a child **Email Notifications** settings page for disabling selected WordPress core auto emails.

Basic Optimization supports regular single-site WordPress installs and WordPress Multisite. On multisite, when the plugin is network activated, Super Admins configure the plugin only from Network Admin and all sites use the network settings.

= Features =

* **Multisite Support** - Adds Network Admin settings pages and stores network-wide settings with WordPress network options.
* **Network-Only Mode** - When network activated, subsite admin pages are not added and every site uses the Network Admin settings.
* **Disable Emojis** - Removes WordPress emoji scripts, styles, filters, and emoji DNS prefetch output.
* **Remove Shortlink** - Removes the shortlink tag from the document head.
* **Remove CSS/JS Version** - Removes the `ver` query argument from enqueued stylesheet and script URLs.
* **Remove RSD Links** - Removes the Really Simple Discovery link from the document head.
* **Disable Embeds** - Removes WordPress oEmbed discovery links and dequeues the default `wp-embed` frontend script.
* **Disable XML-RPC** - Disables XML-RPC requests and removes the `X-Pingback` response header.
* **Remove WLW Manifest Link** - Removes the Windows Live Writer manifest link from the document head.
* **Disable Self Pingback** - Prevents self pingbacks when content links to the same site.
* **Hide WordPress Version** - Removes the WordPress generator meta tag from the document head.
* **Disable Heartbeat** - Deregisters the WordPress heartbeat script on the frontend.
* **Email Notifications** - Adds dropdown controls to disable selected WordPress core auto emails, including new user registration, password changed, comment moderation, and automatically approved comment notifications.

= Multisite Behavior =

On a multisite network, the plugin can be network activated. When network activated, only the Network Admin settings pages are shown. Subsite admin pages are not added, and all sites use the network-level settings.

Network settings are available under **Network Admin > Basic Optimization**. Subsite dashboards do not receive a Basic Optimization admin menu while the plugin is network activated.

= Notes =

Some features can affect integrations that rely on WordPress defaults. For example, disabling XML-RPC can affect external publishing clients and services that still depend on XML-RPC. Disabling auto emails can also affect administrator awareness of user and comment activity. Disable only the features that match your site requirements.

== Installation ==

= From the WordPress dashboard =

1. Go to **Plugins > Add New**.
2. Click **Upload Plugin**.
3. Choose the plugin ZIP file.
4. Click **Install Now**.
5. Activate the plugin.
6. Go to **Basic Optimization** in the WordPress admin menu and configure the available settings.
7. Go to **Basic Optimization > Email Notifications** to disable selected WordPress core auto emails.

= Network installation =

1. Install the plugin ZIP from **Network Admin > Plugins > Add New** or upload the `basic-optimization` folder to `/wp-content/plugins/`.
2. Click **Network Activate**.
3. Go to **Network Admin > Basic Optimization** to configure the settings for the whole network.
4. All subsites will use these network settings automatically.

= Manual installation =

1. Upload the `basic-optimization` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the **Plugins** screen in WordPress, or network activate it from Network Admin on multisite.
3. Go to **Basic Optimization** in the WordPress admin menu and configure the available settings.
4. Go to **Basic Optimization > Email Notifications** to disable selected WordPress core auto emails.

== Frequently Asked Questions ==

= Will this plugin change WordPress core files? =

No. The plugin does not modify WordPress core files. It uses WordPress hooks and options only.

= Does it support WordPress Multisite? =

Yes. The plugin supports network activation and Network Admin settings pages. When network activated, all sites use the network settings and subsite admin pages are not shown.

= Can I enable or disable individual optimizations? =

Yes. Each optimization is managed separately from the plugin settings screen.

= Is disabling XML-RPC always recommended? =

No. Disable XML-RPC only if your site does not rely on XML-RPC-based tools, remote publishing apps, or services.

= Does removing CSS/JS version query strings improve performance? =

It may help in some caching or CDN setups, but it can also make cache invalidation less explicit. Use this option only if it fits your caching strategy.

= Where are the settings located? =

On single-site WordPress, go to **Basic Optimization** in the WordPress admin menu. On multisite network activation, use **Network Admin > Basic Optimization** only. Email disable controls are available under **Basic Optimization > Email Notifications**.

= Which auto emails can be disabled? =

The plugin provides dropdown controls to disable the auto email sent to the site administrator when a new user registers, the auto email sent to the site administrator when a user changes their password, the moderation email sent when a comment awaits moderation, and the automatically approved comment notification email. WordPress sends the automatically approved comment notification to the post author, which may be the site administrator depending on the post author.

== Screenshots ==

1. Basic Optimization settings screen with individual on/off controls.
2. Email Notifications sub-settings screen with dropdown controls to disable selected WordPress core auto emails.
3. Network Admin settings screen for multisite network-wide settings.

== Changelog ==

= 2.1.0 =
* Added WordPress Multisite support.
* Added Network Admin settings pages for optimization and email notification controls.
* Added network-level option storage using WordPress network options.
* Network activation now uses network-only settings without subsite admin pages.
* Added Network Admin plugin settings link.
* Updated plugin documentation for multisite installation and behavior.
* Added upgrade-time version synchronization for `basic_optimization_version`.
* Ensures the stored plugin version is refreshed on reactivation and plugin upgrades.

= 2.0.1 =
* Refactored plugin into a cleaner class-based structure.
* Added consistent prefixed option keys through the plugin helper function.
* Improved settings sanitization and admin redirect handling.
* Expanded embed cleanup to remove oEmbed discovery output.
* Updated repository-ready `readme.txt` metadata and documentation.
* Added GitHub-style `README.md` documentation.
* Added an Email Notifications sub-settings page with controls to disable selected WordPress core auto emails.

== Upgrade Notice ==

= 2.1.0 =
Adds multisite-aware Network Admin settings. When network activated, configure the plugin from Network Admin only.
