{"id":27840186,"url":"https://github.com/rupok/greenmetrics","last_synced_at":"2026-05-19T03:16:19.039Z","repository":{"id":288590363,"uuid":"967978295","full_name":"rupok/greenmetrics","owner":"rupok","description":"GreenMetrics helps you build a more sustainable internet by tracking your website's carbon footprint, energy consumption, and resource usage, offering insights and recommendations for eco-friendly performance.","archived":false,"fork":false,"pushed_at":"2025-05-27T13:53:02.000Z","size":1312,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-27T14:48:07.280Z","etag":null,"topics":["carbon","carbon-emission-calculator","carbon-emissions","carbon-footprint","eco","performance-analysis","performance-metrics","sustainability","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"https://getgreenmetrics.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rupok.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-17T09:53:39.000Z","updated_at":"2025-05-07T13:38:29.000Z","dependencies_parsed_at":"2025-05-27T14:38:46.185Z","dependency_job_id":"68e311e0-fbb3-493c-ac50-0e866b02f4f0","html_url":"https://github.com/rupok/greenmetrics","commit_stats":null,"previous_names":["rupok/greenmetrics"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/rupok/greenmetrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupok%2Fgreenmetrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupok%2Fgreenmetrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupok%2Fgreenmetrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupok%2Fgreenmetrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rupok","download_url":"https://codeload.github.com/rupok/greenmetrics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupok%2Fgreenmetrics/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265521539,"owners_count":23781529,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carbon","carbon-emission-calculator","carbon-emissions","carbon-footprint","eco","performance-analysis","performance-metrics","sustainability","wordpress","wordpress-plugin"],"created_at":"2025-05-03T03:42:13.766Z","updated_at":"2026-05-19T03:16:18.237Z","avatar_url":"https://github.com/rupok.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GreenMetrics - Website Carbon Footprint, Sustainability \u0026 Performance Metrics\n\nGreenMetrics helps you build a more sustainable internet by tracking your website's carbon footprint, energy consumption, and resource usage, offering insights and recommendations for eco-friendly performance.\n\nWebsite: [getgreenmetrics.com](https://getgreenmetrics.com)\n\n## Features\n\n### Core Features\n- **Comprehensive Dashboard**: Real-time metrics showing Carbon Footprint (g CO2), Energy Consumption (kWh), Data Transfer, HTTP Requests, Page Views, and Performance Score\n- **Environmental Impact Context**: Understanding the real-world impact of your website through relatable metrics\n- **Optimization Suggestions**: Actionable advice with status indicators for Page Size, HTTP Requests, Performance Score, and Green Hosting\n- **Real-time Tracking**: Continuous monitoring of your site's performance and environmental impact metrics\n- **Per-Page and Total Website Metrics**: View both aggregated stats and per-page averages\n- **Carbon Intensity Settings**: Configure your energy consumption calculations based on your hosting location\n\n### Display \u0026 Customization\n- **Gutenberg Block \u0026 Shortcode**: Easily display your environmental stats on any page\n- **Customizable Badge**: Control the position, theme, size, colors, icon and text of your eco-metrics badge\n- **Enhanced Metrics Display**: Fully customizable metrics list with hover effects, fonts, and styling options\n- **Global Badge Display**: Option to automatically display badge site-wide without manual placement\n- **Popover Customization**: Complete control over popover appearance including colors, fonts, metrics display and hover effects\n\n### Data Management \u0026 Reporting\n- **Data Aggregation**: Automatically aggregate detailed metrics into daily summaries for optimal database performance\n- **Data Pruning**: Scheduled cleanup of old data to maintain database efficiency\n- **Advanced Reporting**: Detailed metrics with customizable time periods and visualization options\n- **Email Reporting**: Scheduled email reports with customizable frequency (daily, weekly, monthly)\n- **Email Templates**: Fully customizable email templates with color schemes, placeholders, and content options\n- **Email History**: Track and view all sent email reports with detailed history and status information\n- **Visual Charts**: Beautiful trend charts showing metrics over time in email reports\n- **Data Export**: Export your environmental metrics data for external analysis\n\n## Installation\n\n1. Upload the plugin files to the `/wp-content/plugins/greenmetrics` directory, or install the plugin through the WordPress plugins screen directly\n2. Activate the plugin through the 'Plugins' screen in WordPress\n3. Go to your WordPress dashboard to view the metrics\n4. Use the GreenMetrics block or `[greenmetrics_badge]` shortcode to display your site's stats\n\n## Usage\n\n### Admin Dashboard\n\n1. Go to WordPress admin \u003e GreenMetrics\n2. Enable/disable tracking and badge display\n3. View your website's performance metrics and environmental impact\n\n### Display Settings\n\nThe Display Settings page provides comprehensive customization for your badge and metrics display:\n\n- **Badge Configuration**: Control visibility, position, size, and text\n- **Icon Settings**: Choose between different icon styles or upload a custom icon\n- **Color Options**: Customize badge background, text, and icon colors\n- **Popover Settings**: Configure title, metrics to display, and custom content\n- **Styling Options**: Customize fonts, font sizes, background colors, and hover effects\n\n### Data Management\n\nThe Data Management page helps you maintain optimal database performance:\n\n- **Data Aggregation**: Automatically aggregate detailed metrics into daily summaries\n- **Data Pruning**: Remove old data to keep your database lean and efficient\n- **Manual Controls**: Run aggregation and pruning operations on demand\n- **Schedule Settings**: Configure automatic maintenance schedules\n- **Data Export/Import**: Export data in CSV, JSON, or PDF formats, and import previously exported data with options to skip, replace, or merge duplicates\n\n### Advanced Reporting\n\nThe Advanced Reporting page provides detailed insights into your website's environmental impact:\n\n- **Time Period Selection**: View metrics for custom date ranges\n- **Visualization Options**: Toggle between different chart types\n- **Metric Filtering**: Focus on specific metrics of interest\n- **Data Export**: Download your metrics data in CSV, JSON, or PDF formats for external analysis\n\n### Email Reporting\n\nThe Email Reporting page allows you to set up automated email reports:\n\n- **Schedule Configuration**: Set daily, weekly, or monthly reporting frequency\n- **Recipient Management**: Add multiple email recipients\n- **Content Customization**: Choose which metrics to include in reports\n- **Template Selection**: Pick from different email templates\n- **Custom Styling**: Personalize colors, fonts, and layout\n- **Visual Charts**: Include trend charts showing metrics over time\n\n### Display Badge\n\nYou can display the eco-friendly badge in three ways:\n\n1. **Gutenberg Block**\n   - Add the \"GreenMetrics Badge\" block to your page/post\n   - Customize the appearance in the block settings\n\n2. **Shortcode**\n   ```php\n   [greenmetrics_badge theme=\"light\" size=\"medium\" position=\"bottom-right\"]\n   ```\n\n   Parameters:\n   - `theme`: light, dark (default: light)\n   - `size`: small, medium, large (default: medium)\n   - `position`: bottom-right, bottom-left, top-right, top-left (default: bottom-right)\n\n3. **Global Badge**\n   - Enable the global badge option in Display Settings to show the badge site-wide\n   - Customize all aspects of the badge and popover through the admin interface\n\n## Who is it for?\n\nGreenMetrics is ideal for:\n- Eco-conscious website owners who want to reduce their digital carbon footprint\n- Developers looking to optimize website performance and efficiency\n- Businesses striving to meet sustainability goals and showcase environmental responsibility\n- Bloggers and content creators focusing on green initiatives\n\n## Frequently Asked Questions\n\n### How does GreenMetrics calculate my site's environmental impact?\nWe use a combination of observed data based on asset size, page views, and HTTP requests. Our calculations account for data transfer, energy consumption per byte, and regional carbon intensity to provide meaningful insights.\n\n### Will it slow down my website?\nNo. GreenMetrics is lightweight and designed for performance. It uses efficient tracking methods and does not load external scripts on the frontend.\n\n### How accurate are the carbon and energy calculations?\nOur calculations are based on industry research regarding energy consumption per byte of data transferred and carbon intensity of electrical grids. While they provide meaningful approximations, they may not account for all variables in the hosting infrastructure.\n\n### Can I track individual page performance?\nYes, GreenMetrics tracks metrics on a per-page basis, allowing you to identify which pages have the highest environmental impact and optimize them accordingly.\n\n### Can I customize how the metrics are displayed?\nYes, the Display Settings page offers extensive customization options for the badge and popover, including colors, fonts, metrics selection, and hover effects.\n\n### How do the email reports work?\nEmail reports can be scheduled to send daily, weekly, or monthly summaries of your website's environmental metrics. You can customize the recipients, content, and appearance of these reports through the Email Reporting settings page. The system tracks all sent emails and maintains a complete history for your reference.\n\n### What information is included in email reports?\nEmail reports include key metrics such as carbon footprint, energy consumption, and data transfer, along with visual charts showing trends over the selected time period. You can customize which metrics to include and how they're displayed. Dynamic placeholders allow you to personalize the content with site-specific information.\n\n### How does the email history feature work?\nThe Email History tab maintains a complete record of all sent email reports, including date/time, recipients, subject, report type, and delivery status. You can view the full content of any previously sent report and track which reports were successfully delivered.\n\n### How does the data management system work?\nThe data management system automatically aggregates detailed metrics into daily summaries and prunes old data to maintain optimal database performance. You can configure the aggregation and pruning schedules, or run these operations manually when needed.\n\n### Will data aggregation affect the accuracy of my metrics?\nNo, data aggregation preserves the accuracy of your metrics while reducing database size. The system maintains daily summaries that provide the same insights as detailed data for historical analysis.\n\n### Can I export my environmental impact data?\nYes, you can export your metrics data in CSV, JSON, or PDF formats from the Data Management page. This allows you to analyze your data externally, create custom reports, or back up your metrics.\n\n### Can I import previously exported data?\nYes, the Data Management page includes an import feature that allows you to import previously exported data in CSV or JSON formats. You can choose how to handle duplicate records (skip, replace, or merge) during the import process.\n\n## Development\n\n### Requirements\n\n- WordPress 5.5+\n- PHP 7.2+\n- MySQL 5.6+\n\n### Directory Structure\n\n```\ngreenmetrics/\n├── admin/                # Admin-specific functionality\n│   ├── css/              # Admin styles\n│   ├── js/               # Admin scripts\n│   └── partials/         # Admin templates\n├── build/                # Compiled assets\n├── includes/             # Core plugin functionality\n│   ├── admin/            # Admin class files\n│   │   ├── css/          # Admin CSS files\n│   │   ├── js/           # Admin JavaScript files\n│   │   ├── img/          # Admin images\n│   │   └── fonts/        # Admin fonts\n│   ├── class-*.php       # Core classes\n│   ├── class-greenmetrics-data-manager.php    # Data management functionality\n│   ├── class-greenmetrics-advanced-reports.php # Advanced reporting functionality\n│   ├── class-greenmetrics-email-reporter.php  # Email reporting functionality\n│   ├── class-greenmetrics-chart-generator.php # Chart generation for reports\n├── languages/            # Translation files\n├── public/               # Public-facing functionality\n│   ├── css/              # Public styles\n│   ├── js/               # Public scripts\n│   │   └── blocks/       # Gutenberg blocks\n│   └── partials/         # Public templates\n├── templates/            # Email and report templates\n│   ├── emails/           # Email templates\n│   └── reports/          # Report templates\n├── vendor/               # Composer dependencies\n├── .editorconfig         # Editor configuration\n├── .gitignore            # Git ignore rules\n├── composer.json         # Composer dependencies\n├── LICENSE               # License file\n├── phpcs.xml             # PHP Code Sniffer config\n├── README.md             # This file\n├── readme.txt            # WordPress.org readme\n├── uninstall.php         # Uninstall logic\n└── greenmetrics.php      # Main plugin file\n```\n\n### Development Setup\n\n1. Clone the repository\n   ```bash\n   git clone https://github.com/yourusername/greenmetrics.git\n   cd greenmetrics\n   ```\n\n2. Install dependencies\n   ```bash\n   composer install\n   ```\n\n3. Run code formatting\n   ```bash\n   ./format-code.sh\n   ```\n\n4. Fix coding standard issues\n   ```bash\n   ./lint-fix.sh\n   ```\n\n### Coding Standards\n\nGreenMetrics follows the [WordPress Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/). We use PHP_CodeSniffer to ensure code quality:\n\n- Run `composer run lint` to check for violations\n- Run `composer run fix` to automatically fix violations where possible\n\n### Testing\n\nRun the PHPUnit tests:\n\n```bash\ncomposer run test\n```\n\n### Building Assets\n\nThe JavaScript and CSS assets need to be built for production use:\n\n1. Install Node.js dependencies:\n   ```bash\n   npm install\n   ```\n\n2. Build for development (with source maps):\n   ```bash\n   npm run dev\n   ```\n\n3. Build for production (minified):\n   ```bash\n   npm run build\n   ```\n\n### Environment Configuration\n\nGreenMetrics supports different environments:\n\n- **Development**: Enable debugging and developer tools by adding `define('GREENMETRICS_DEBUG', true);` to your wp-config.php\n- **Testing**: Special test mode for running tests\n- **Production**: Optimized performance with caching enabled\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\nPlease make sure your code follows our coding standards and includes appropriate tests.\n\n## License\n\nThis project is licensed under the GPL v2 or later - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frupok%2Fgreenmetrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frupok%2Fgreenmetrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frupok%2Fgreenmetrics/lists"}