Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ coverage
.editorconfig
.eslintrc.js
.prettierrc
phpunit.xml
phpcs.xml
phpunit.xml*
phpcs.xml*
phpstan.neon

# Build tools
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Quality

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
php-syntax:
name: PHP ${{ matrix.php }} syntax
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
- run: php tests/php-lint.php

quality:
name: Coding standards and tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none
tools: composer:v2
- run: composer install --no-interaction --prefer-dist
- run: composer phpcs
- run: composer test
- run: |
for file in $(find assets -name '*.js' -type f); do
node --check "$file"
done
- run: bash -n build.sh

package:
name: Distribution package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ./build.sh
- run: |
version=$(grep -m1 'Version:' functionalities.php | awk '{print $NF}')
zip="functionalities-${version}.zip"
test -s "$zip"
unzip -t "$zip"
for required in \
functionalities/functionalities.php \
functionalities/readme.txt \
functionalities/uninstall.php \
functionalities/includes/admin/class-admin.php \
functionalities/includes/admin/class-module-controller.php \
functionalities/includes/admin/class-settings-portability-controller.php \
functionalities/includes/admin/class-site-health-controller.php \
functionalities/includes/core/class-module-registry.php \
functionalities/includes/storage/class-atomic-json-store.php \
functionalities/assets/js/admin-redirects.js \
functionalities/assets/js/admin-tools.js; do
unzip -Z1 "$zip" | grep -qx "$required"
done
if unzip -Z1 "$zip" | grep -Eq '(^|/)(tests|vendor|node_modules|\.git|\.github)/|composer\.(json|lock)$|\.md$'; then
echo 'Development files leaked into the distribution.' >&2
exit 1
fi
70 changes: 52 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Dynamic Functionalities

All-in-one WordPress optimization toolkit with 15+ modules for performance, security, SEO, and content management. Built with modern WordPress coding standards and a clean module-based dashboard. Optimized for performance with lazy-loading, static property caching, and intelligent transients.
All-in-one WordPress optimization toolkit with 16 modules for performance, security, SEO, and content management. Built with modern WordPress coding standards and a clean module-based dashboard. Optimized for performance with modular initialization, static property caching, and intelligent transients.

**Version:** 1.4.7
**Version:** 1.4.8
**License:** GPL-2.0-or-later
**Text Domain:** `functionalities`
**Pricing:** Free
Expand All @@ -19,26 +19,16 @@ All-in-one WordPress optimization toolkit with 15+ modules for performance, secu
All modules are accessed through a unified dashboard at `wp-admin/admin.php?page=functionalities`. Click any module card to configure its settings.

Learn more on [Functionalities Site](https://functionalities.dev)
---

## Performance & Footprint

This plugin is built with a "Performance First" philosophy. Unlike many all-in-one plugins that slow down your site, Functionalities is designed to be as lightweight as possible:

- **Modular & Lazy Loaded:** Using a custom autoloader, the plugin only loads the code required for active modules. If a feature is disabled, its code is never even included in memory.
- **Minimized Database Load:** All module settings are cached in static properties. This ensures that `get_option()` is called at most once per module per request, regardless of how many times a feature is accessed.
- **Zero Frontend Bloat:** Most modules are "Zero Footprint" on the frontend, meaning they load no CSS or JS unless explicitly required (like the Components or Fonts modules).
- **Intelligent Filtering:** Content filters (`the_content`, etc.) use `strpos()` fast-exit checks. If the specific markers or tags for a feature aren't present in your content, the plugin exits immediately without running expensive regular expressions or DOM parsing.
- **Efficient HTML Processing:** We use targeted regex for lightweight tasks (like Schema injection) and only resort to `DOMDocument` when structural manipulation is strictly necessary, ensuring maximum speed.
- **Aggressive Caching:** Heavy operations—such as reading JSON exception lists, calculating file hashes, or managing redirects—are cached using WordPress Transients or versioned options to minimize Disk I/O.
See the [public roadmap](ROADMAP.md) for planned fixes and features.

---

## Performance & Footprint

This plugin is built with a "Performance First" philosophy. Unlike many all-in-one plugins that slow down your site, Functionalities is designed to be as lightweight as possible:

- **Modular & Lazy Loaded:** Using a custom autoloader, the plugin only loads the code required for active modules. If a feature is disabled, its code is never even included in memory.
- **Modular Initialization:** Each module checks its enabled state before registering its feature hooks. Disabled modules add no frontend assets or feature behavior.
- **Minimized Database Load:** All module settings are cached in static properties. This ensures that `get_option()` is called at most once per module per request, regardless of how many times a feature is accessed.
- **Zero Frontend Bloat:** Most modules are "Zero Footprint" on the frontend, meaning they load no CSS or JS unless explicitly required (like the Components or Fonts modules).
- **Intelligent Filtering:** Content filters (`the_content`, etc.) use `strpos()` fast-exit checks. If the specific markers or tags for a feature aren't present in your content, the plugin exits immediately without running expensive regular expressions or DOM parsing.
Expand Down Expand Up @@ -254,6 +244,8 @@ Manage URL redirects directly from WordPress admin with high-performance file-ba
- File-based JSON storage for zero database overhead during redirects
- Integrated hit counter for tracking redirect usage
- Normalized path matching
- CSV import/export with a validated dry-run preview
- Optional bounded 404 aggregation without visitor identifiers or full referrers

**Navigate to:** `?page=functionalities&module=redirect-manager`

Expand All @@ -274,6 +266,21 @@ Enhanced login protection and security measures for your WordPress site.

---

### Progressive Web App

Make the site installable with a web app manifest, service worker, offline fallback, and optional install prompt.

**Features:**
- Configurable app name, colors, icons, display mode, and orientation
- Offline page and versioned runtime caching
- App shortcuts, screenshots, and advanced manifest fields
- Optional install prompt and Web Share Target support
- Root-level manifest and service worker endpoints

**Navigate to:** `?page=functionalities&module=pwa`

---

## Link Management: Developer Reference

### JSON Preset Format
Expand Down Expand Up @@ -373,14 +380,24 @@ functionalities/
│ │ └── svg-icons-editor.css
│ └── js/
│ ├── admin.js
│ ├── admin-redirects.js
│ ├── admin-tools.js
│ ├── admin-ui.js
│ ├── content-regression.js
│ └── svg-icons-editor.js
├── includes/
│ ├── admin/
│ │ ├── class-admin.php
│ │ ├── class-admin-ui.php
│ │ └── class-module-docs.php
│ │ ├── class-module-controller.php
│ │ ├── class-module-docs.php
│ │ ├── class-redirect-manager-controller.php
│ │ ├── class-settings-portability-controller.php
│ │ ├── class-site-health-controller.php
│ │ ├── class-svg-icons-controller.php
│ │ └── class-task-manager-controller.php
│ ├── core/
│ │ └── class-module-registry.php
│ ├── features/
│ │ ├── class-assumption-detection.php
│ │ ├── class-block-cleanup.php
Expand All @@ -392,11 +409,14 @@ functionalities/
│ │ ├── class-login-security.php
│ │ ├── class-meta.php
│ │ ├── class-misc.php
│ │ ├── class-pwa.php
│ │ ├── class-redirect-manager.php
│ │ ├── class-schema.php
│ │ ├── class-snippets.php
│ │ ├── class-svg-icons.php
│ │ └── class-task-manager.php
│ └── storage/
│ └── class-atomic-json-store.php
├── languages/
├── exception-urls.json.sample
├── functionalities.php
Expand All @@ -409,9 +429,23 @@ functionalities/
## Adding New Modules

1. Create a feature class in `includes/features/class-your-module.php`
2. Add module definition in `Admin::define_modules()`
3. Register settings in `Admin::register_settings()`
4. Initialize in `functionalities.php`
2. Add its definition to `Core\Module_Registry::get_definitions()`
3. Register its settings in the module controller
4. Add focused tests for defaults and any pure helpers

## Local development checks

```bash
composer install
composer lint
composer phpcs
composer test
node --check assets/js/admin.js
bash -n build.sh
./build.sh
```

The pull-request workflow runs PHP syntax checks on PHP 7.4 through 8.5, coding standards, PHPUnit, JavaScript and shell syntax, version consistency, and distribution ZIP assertions.

Example module definition:

Expand Down
57 changes: 57 additions & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Dynamic Functionalities Roadmap

All planned fixes and features below ship in **v1.4.8**. GitHub issues remain the
source of truth for scope and acceptance criteria. The release is tagged only
after automated checks and the real-WordPress smoke gate pass.

## Phase 1: Stabilize the foundation

- Fix SVG Icons so a fresh install leaves the module disabled until the user
enables it, matching the explicit-activation policy introduced in v1.2.0.
- Correct README duplication, module coverage, and performance claims.
- Make Task Manager and Redirect Manager JSON updates atomic and concurrency-safe
([#41](https://github.com/wpgaurav/functionalities/issues/41)).
- Add pull-request CI, supported-PHP checks, distribution validation, coding
standards, and a minimal test foundation
([#42](https://github.com/wpgaurav/functionalities/issues/42)).

## Phase 2: Improve architecture and portability

- Introduce a true lazy module registry so disabled feature classes are not
loaded on frontend requests
([#43](https://github.com/wpgaurav/functionalities/issues/43)).
- Split the monolithic Admin class into module controllers and move remaining
inline assets into versioned files
([#44](https://github.com/wpgaurav/functionalities/issues/44)).
- Add validated, versioned settings export/import plus a redacted diagnostics
bundle ([#45](https://github.com/wpgaurav/functionalities/issues/45)).

## Phase 3: Add operational workflows

- Add CSV redirect migration and a bounded, privacy-conscious 404 monitor
([#46](https://github.com/wpgaurav/functionalities/issues/46)).
- Integrate Assumption Detection and Content Integrity with Site Health,
scheduled scans, deduplicated notifications, and useful snapshot diffs
([#47](https://github.com/wpgaurav/functionalities/issues/47)).

## v1.4.8 release gate

- All seven roadmap issues are closed through reviewed changes.
- Automated checks pass across the supported PHP and WordPress range.
- Concurrent file updates cannot lose redirects, tasks, or hit counts.
- Existing settings, hooks, admin URLs, and stored data remain compatible.
- Settings can round-trip between clean sites without exposing sensitive data.
- Monitoring is opt-in, capped, rate-limited, and cheap on frontend requests.
- Redirect imports are validated, previewable, and all-or-nothing.
- The manual block-editor iframe smoke test in `CLAUDE.md` passes in a real
WordPress install.

## Planning rules

- Fix security, data loss, and compatibility regressions before feature work.
- Every feature needs a disabled-by-default path with no frontend assets.
- Persisted-data changes need migration, rollback, concurrency, and uninstall
coverage.
- New admin UI must reuse WordPress patterns and remain keyboard accessible.
- A release is not complete until the GitHub artifact, WordPress.org package,
version metadata, and manual editor smoke test agree.
39 changes: 39 additions & 0 deletions assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -1543,3 +1543,42 @@
grid-template-columns: repeat(2, 1fr);
}
}

.functionalities-tools {
margin-top: 30px;
padding: 20px;
background: #fff;
border: 1px solid #c3c4c7;
border-radius: 4px;
}

.functionalities-tools h2 {
margin-top: 0;
}

.functionalities-tools details {
margin: 14px 0;
}

.functionalities-tools__modules {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
gap: 8px 16px;
margin: 12px 0;
}

.functionalities-tools__actions {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: 16px;
}

.functionalities-tools__result {
max-height: 320px;
overflow: auto;
margin: 16px 0 0;
padding: 12px;
background: #f6f7f7;
white-space: pre-wrap;
}
Loading
Loading