=== Amoos Functionality Suite ===
Contributors: manraraluca
Tags: functionality, analytics, seo, contact, maintenance
Requires at least: 5.0
Tested up to: 6.9
Stable tag: 1.1.0
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Donate link: https://donate.stripe.com/8x2dR98uweuIc0V4pQc7u00

A comprehensive WordPress plugin that provides multiple functionalities for your website, all manageable from a single admin interface.

== Upgrade Notice ==

= 1.1.0 =
Added support for two phone numbers in floating icons. Enhanced visual distinction between phone numbers with different colors (blue and green). Updated admin interface with separate fields for Phone Number 1 and Phone Number 2.

= 1.0.0 =
Initial release with all core functionalities including analytics integration, password protection, floating icons, contact box, and dynamic cities.

## Description

The Amoos Functionality Suite is a powerful WordPress plugin that consolidates multiple website functionalities into one easy-to-manage package. Each functionality can be activated or deactivated independently, giving you complete control over your website's features.

## Features

### 1. Ahrefs Analytics
- **Purpose:** Add Ahrefs Analytics tracking script to your website
- **Features:**
  - Asynchronous script loading
  - Customizable tracking key
  - Admin settings panel
  - Duplicate script detection

### 2. Password Protection
- **Purpose:** Add password protection to your entire website
- **Features:**
  - Domain-specific protection (optional)
  - Exclude specific pages from protection
  - Skip protection for logged-in users
  - Cookie-based authentication (cache-friendly)
  - Customizable password form design

### 3. Google Analytics
- **Purpose:** Add Google Analytics 4 tracking to your website
- **Features:**
  - Google Analytics 4 (gtag.js) integration
  - Customizable Measurement ID
  - Asynchronous script loading
  - Duplicate script detection

### 4. Custom CSS Classes
- **Purpose:** Add custom CSS classes meta box to pages
- **Features:**
  - Meta box in page editor
  - Comma-separated class input
  - Automatic body class addition
  - Easy CSS customization

### 5. Floating Icons
- **Purpose:** Add floating WhatsApp and phone icons to your website
- **Features:**
  - WhatsApp icon with direct messaging
  - Two phone icons with direct calling (different colors)
  - 4 position options (corners)
  - Responsive design
  - Inline SVG icons (no external dependencies)
  - Customizable contact numbers
  - Visual distinction between phone numbers

### 6. Contact Box
- **Purpose:** Insert contact information box into blog posts
- **Features:**
  - Automatic insertion in blog posts
  - Middle-of-content positioning
  - Clickable phone and email links
  - Customizable contact information
  - Modern styled design

### 7. Dynamic Cities
- **Purpose:** Create dynamic city pages with SEO optimization
- **Features:**
  - Dynamic URL rewriting
  - SEO-optimized titles and descriptions
  - Shortcode for city lists
  - Automatic city list insertion
  - Customizable SEO templates
  - Romanian cities included

== Screenshots ==

1. Main Dashboard - Centralized control panel for all functionalities organized into SEO and Other Functionalities sections
2. Ahrefs Analytics Settings - Configure your Ahrefs Analytics tracking key
3. Password Protection Settings - Set up website protection with domain restrictions and page exclusions
4. Google Analytics Settings - Add your Google Analytics 4 Measurement ID
5. Custom CSS Classes Settings - Add custom CSS classes meta box to pages
6. Floating Icons Settings - Configure WhatsApp and phone icons with position options
7. Contact Box Settings - Customize contact information display for blog posts
8.Dynamic Cities Settings - Set up SEO-optimized city pages with customizable templates
9. About Dynamic Cities Settings
10. About Dynamic Cities Settings
11. Maintenance Mode Settings - Configure maintenance page with custom message and image
12. Portfolio Showcase Settings - Manage portfolio items and display options
13. Shortcode Usage - Portfolio shortcode configuration and usage examples
14. Notification Bar Settings - Customize notification bar with colors and content



== Frequently Asked Questions ==

= Can I use multiple functionalities at the same time? =
Yes! All functionalities can be enabled simultaneously. Each feature works independently and can be toggled on or off individually from the main dashboard.

= Will this plugin slow down my website? =
No. The plugin is designed with performance in mind. Scripts load asynchronously, and functionalities only load when enabled. The plugin uses minimal resources and optimized database queries.

= Do I need coding knowledge to use this plugin? =
No. All functionalities are managed through an intuitive WordPress admin interface. Simply enable the features you need and configure them through the settings panels.

= Can I exclude certain pages from password protection? =
Yes. The password protection feature allows you to exclude specific pages from protection. You can select which pages to exclude directly from the settings panel.

= How do I add custom CSS classes to pages? =
Once the Custom CSS Classes functionality is enabled, a meta box will appear in the page editor. Simply enter your CSS classes (comma-separated) and they will be automatically added to the body tag.

= Can I customize the floating icons position? =
Yes. The floating icons can be positioned in any of the four corners of your website. You can choose the position from the Floating Icons settings page.

= What happens if I disable a functionality? =
When you disable a functionality, it immediately stops working on your website. Your settings are preserved, so you can re-enable it later without losing your configuration.

= Is this plugin compatible with caching plugins? =
Yes. The plugin is designed to work with popular caching plugins. The password protection feature uses cookie-based authentication which is cache-friendly.

= Do I need separate accounts for Google Analytics and Ahrefs Analytics? =
Yes. You need valid accounts and tracking keys/IDs from both services to use their respective functionalities. The plugin only integrates with these services; it doesn't provide the analytics accounts themselves.

= Can I use the Dynamic Cities feature for cities outside Romania? =
The plugin comes with Romanian cities pre-configured, but you can filter the city list using the `amoos_dynamic_cities_list` filter hook to add or modify cities for your specific needs.

## Installation

1. Upload the plugin files to `/wp-content/plugins/amoos-functionality-suite/` directory
2. Activate the plugin through the 'Plugins' screen in WordPress
3. Navigate to 'Amoos Suite' in your WordPress admin menu
4. Configure each functionality as needed

## Usage

### Main Dashboard
- Access the main dashboard at **Amoos Suite** in your WordPress admin
- Toggle functionalities on/off using the switch controls
- Click "Configure" to access individual settings

### Individual Functionality Settings

#### Ahrefs Analytics
1. Go to **Amoos Suite > Ahrefs Analytics**
2. Enable the functionality
3. Enter your Ahrefs Analytics tracking key
4. Save settings

#### Password Protection
1. Go to **Amoos Suite > Password Protection**
2. Enable the functionality
3. Set your protection password
4. Configure domain restrictions (optional)
5. Select pages to exclude from protection
6. Save settings

#### Google Analytics
1. Go to **Amoos Suite > Google Analytics**
2. Enable the functionality
3. Enter your Google Analytics Measurement ID
4. Save settings

#### Custom CSS Classes
1. Go to **Amoos Suite > Custom CSS Classes**
2. Enable the functionality
3. Edit any page to add custom CSS classes
4. Classes will be automatically added to the body tag

#### Floating Icons
1. Go to **Amoos Suite > Floating Icons**
2. Enable the functionality
3. Enter WhatsApp number
4. Enter first phone number (blue icon)
5. Enter second phone number (green icon)
6. Choose icon position
7. Save settings

#### Contact Box
1. Go to **Amoos Suite > Contact Box**
2. Enable the functionality
3. Configure contact information
4. Set box title and contact form link
5. Save settings

#### Dynamic Cities
1. Go to **Amoos Suite > Dynamic Cities**
2. Enable the functionality
3. Set base page slug
4. Configure SEO templates
5. Save settings
6. Flush rewrite rules (go to Settings > Permalinks)

## Shortcodes

### City List Shortcode
Use `[orase_optimizare_seo]` to display a list of Romanian cities with links to their respective pages.

## Hooks and Filters

### Actions
- `amoos_functionality_suite_init` - Fired when the plugin initializes
- `amoos_ahrefs_analytics_script` - Fired before Ahrefs script output
- `amoos_google_analytics_script` - Fired before Google Analytics script output

### Filters
- `amoos_contact_box_content` - Filter contact box HTML content
- `amoos_dynamic_cities_list` - Filter the list of cities
- `amoos_floating_icons_position` - Filter floating icons position

## Security Features

- All inputs are sanitized and validated
- Nonce verification for all forms
- Capability checks for admin functions
- XSS protection for output
- SQL injection prevention

## Performance Features

- Asynchronous script loading
- Conditional loading (only when enabled)
- Optimized database queries
- Minimal resource usage

## Compatibility

- **WordPress:** 5.0 or higher
- **PHP:** 7.4 or higher
- **MySQL:** 5.6 or higher
- **Tested up to:** WordPress 6.4

## Browser Support

- Chrome 80+
- Firefox 75+
- Safari 13+
- Edge 80+

## Troubleshooting

### Common Issues

1. **Scripts not loading**
   - Check if functionality is enabled
   - Verify script keys/IDs are correct
   - Check for JavaScript errors in browser console

2. **Rewrite rules not working (Dynamic Cities)**
   - Go to Settings > Permalinks
   - Click "Save Changes" to flush rewrite rules

3. **Password protection not working**
   - Check domain settings
   - Verify password is correct
   - Clear browser cache and cookies

4. **Floating icons not appearing**
   - Check if functionality is enabled
   - Verify phone numbers are correctly formatted
   - Check for CSS conflicts

### Debug Mode

Enable WordPress debug mode to see detailed error messages:
```php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
```

## Changelog

### Version 1.1.0
- **NEW:** Added support for two phone numbers in floating icons
- **ENHANCED:** Floating icons now support two distinct phone numbers with different colors
- **IMPROVED:** Better visual distinction between phone numbers (blue and green)
- **UPDATED:** Admin interface now includes separate fields for Phone Number 1 and Phone Number 2
- **FIXED:** Updated plugin activation to include new phone number options

### Version 1.0.0
- Initial release
- Ahrefs Analytics integration
- Password protection system
- Google Analytics integration
- Custom CSS classes meta box
- Floating icons functionality
- Contact box insertion
- Dynamic cities with SEO optimization

## External Services

This plugin connects to third-party external services when certain functionalities are enabled. This section documents what data is sent, when it's sent, and where it goes.

### Google Analytics

**What it is:** Google Analytics is a web analytics service provided by Google LLC that tracks and reports website traffic and user behavior.

**What it's used for:** This plugin integrates Google Analytics 4 (GA4) to track website visitors, page views, user interactions, and other analytics data when the Google Analytics functionality is enabled.

**What data is sent and when:** 
- The plugin loads the Google Analytics tracking script from `googletagmanager.com` on every page load when the functionality is enabled
- Google Analytics automatically collects visitor data including: IP address, page URLs, referrer information, browser and device information, geographic location (derived from IP), and user interactions (clicks, scrolls, form submissions, etc.)
- Data is sent to Google's servers each time a page is viewed by a visitor
- The data collection is controlled by Google Analytics and follows Google's data collection practices

**Service provider:** Google LLC
- **Terms of Service:** https://marketingplatform.google.com/about/analytics/terms/
- **Privacy Policy:** https://policies.google.com/privacy

**Note:** This functionality is optional and only active when explicitly enabled in the plugin settings. You can disable it at any time through the plugin's admin interface.

### Ahrefs Analytics

**What it is:** Ahrefs Analytics is a web analytics service provided by Ahrefs Pte. Ltd. that tracks and reports website traffic and user behavior.

**What it's used for:** This plugin integrates Ahrefs Analytics to track website visitors, page views, and other analytics data when the Ahrefs Analytics functionality is enabled.

**What data is sent and when:**
- The plugin loads the Ahrefs Analytics tracking script from `analytics.ahrefs.com` on every page load when the functionality is enabled
- Ahrefs Analytics automatically collects visitor data including: IP address, page URLs, referrer information, browser and device information, and user interactions
- Data is sent to Ahrefs' servers each time a page is viewed by a visitor
- The data collection is controlled by Ahrefs Analytics and follows Ahrefs' data collection practices

**Service provider:** Ahrefs Pte. Ltd.
- **Terms of Service:** https://ahrefs.com/terms
- **Privacy Policy:** https://ahrefs.com/privacy

**Note:** This functionality is optional and only active when explicitly enabled in the plugin settings. You can disable it at any time through the plugin's admin interface.

## Support

For support, feature requests, or bug reports, please contact:
- **Email:** support@amoos.ro
- **Website:** https://amoos.ro

## License

This plugin is licensed under the GPL v2 or later.

## Credits

- Font Awesome icons by Fonticons, Inc.
- WordPress hooks and filters
- jQuery for admin interface enhancements

## Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.

## Roadmap

- [ ] Additional analytics providers
- [ ] More floating icon options
- [ ] Advanced SEO features
- [ ] Performance monitoring
- [ ] Multi-language support
- [ ] Import/Export settings
- [ ] White-label options

---

**Made with ❤️ by Amoos**
