sustainableweb/wp-carbon-calculator
最新稳定版本:1.3.9
Composer 安装命令:
composer require sustainableweb/wp-carbon-calculator
包简介
Effortlessly calculate any page’s carbon impact and performance score from the WordPress admin. Real-time results, no reliance on the Website Carbon API — works instantly on any site with minimal setup.
README 文档
README
The WordPress Carbon Calculator, drawing inspiration from the acclaimed Website Carbon Calculator algorithm 2.0 and leveraging The Green Web Foundation's co2.js, is a powerful plugin tailored to empower website owners in their quest to assess and minimize their carbon footprint.
This user-friendly tool allows you to effortlessly calculate the CO2 impact of any page on your website directly from your WordPress admin panel. Unlike other solutions, this plugin does not rely on the Website Carbon API, allowing real-time calculations without delays, instantly reflecting changes made in the back office.
Whether you're a sustainability-conscious blogger, a corporate website manager, or anyone committed to environmental responsibility, the WordPress Carbon Calculator is your essential solution for environmental impact assessment.
Key Features
-
Precision Carbon Calculations: Built upon the foundation of the Website Carbon Calculator algorithm 2.0 and powered by The Green Web Foundation's co2.js, our plugin delivers highly accurate CO2 impact calculations by incorporating the latest environmental data.
-
Intuitive Interface: The WordPress Carbon Calculator offers an intuitive and user-friendly interface within your WordPress admin area, simplifying the process of accessing and analyzing environmental data.
-
Front-End Presentation: Showcase the computed CO2 impact prominently on your website's front end, allowing you to engage and educate your website visitors.
-
Data from Google Page Speed: The plugin gathers loaded data efficiently using Google Page Speed, ensuring you have access to comprehensive performance metrics to make informed decisions.
Installation
Via Composer
$ composer require wpackagist-plugin/website-carbon-calculator
Via GitHub
- Download the plugin as a ZIP file from the GitHub repository.
- Upload the ZIP file to your WordPress site by navigating to the Plugins section in your WordPress admin panel and clicking on "Add New."
Getting Started
- Activate the
Website Carbon Calculatorplugin. - Navigate to "Settings" and select "Carbon Calculator."
- Enter the necessary information to configure the plugin.
Note: The carbon calculator functionality is not available in a local development environment.
Interface
Minimal Impact – This page has mostly text, resulting in a low CO₂ footprint.
Higher Impact – Adding a YouTube video increases the page’s CO₂ emissions.
Advanced Data – View bytes transferred, boot-up time, and key performance metrics.
Taxonomy Support – Analyze CO₂ impact directly on term pages.
Instant Insights – See a page’s CO₂ impact with green, orange, or red flags.
Dashboard Widget – View average CO₂ impact and performance scores at a glance.
Advanced Tools – Compute emissions for special pages with dedicated tools.
Customizable Settings – Fine-tune calculations for accurate CO₂ impact analysis.
How to display it in your templates ?
Integrating the Carbon Calculator into your website's front-end templates is a breeze and allows you to display the calculated carbon emissions directly to your site visitors.
In your front-end template files (such as your theme's template files or custom templates), you can access the carbon calculation method by using get_calculated_carbon(). This method is available on any page of your site.
Here's an example of how you can use the code:
<?php if($calculated_carbon = get_calculated_carbon() ): ?> This page emits <?=round($calculated_carbon,2)?>g eq. CO₂ <?php endif; ?>
The code snippet will display the calculated carbon emissions on the front-end of your website for your site visitors to see. It provides valuable information about the environmental impact of the current page.
By following these simple steps, you can raise awareness about the carbon footprint of your web content and encourage your audience to make more sustainable choices.
Feel free to customize the code or incorporate it into your templates as needed to fit your website's design and layout.
Remember, this feature adds a powerful environmental dimension to your website, aligning it with eco-conscious principles and contributing to a greener digital landscape.
Roadmap
Here's a glimpse of what's coming:
- translations
- ecoindex.fr algorithm support
- better settings/tools interface
Licence
GPL 3.0 or later
sustainableweb/wp-carbon-calculator 适用场景与选型建议
sustainableweb/wp-carbon-calculator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 05 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「plugin」 「wordpress」 「environment」 「CO2」 「sustainability」 「carbon footprint」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sustainableweb/wp-carbon-calculator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sustainableweb/wp-carbon-calculator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sustainableweb/wp-carbon-calculator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
Environment processor and contexts autoloader
The tenancy/tenancy identification driver using environment variables
Multiple cascading environmental configuration files support for Laravel 5
An environment variable convenience library extension for vlucas/phpdotenv
Utils to load, parse and work with configuration on Mezzio projects
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2025-05-30







