定制 sustainableweb/wp-carbon-calculator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

  1. Download the plugin as a ZIP file from the GitHub repository.
  2. 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

  1. Activate the Website Carbon Calculator plugin.
  2. Navigate to "Settings" and select "Carbon Calculator."
  3. 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.

Summary

Higher Impact – Adding a YouTube video increases the page’s CO₂ emissions.

Calculator

Advanced Data – View bytes transferred, boot-up time, and key performance metrics.

Tools

Taxonomy Support – Analyze CO₂ impact directly on term pages.

Settings

Instant Insights – See a page’s CO₂ impact with green, orange, or red flags.

Settings

Dashboard Widget – View average CO₂ impact and performance scores at a glance.

Settings

Advanced Tools – Compute emissions for special pages with dedicated tools.

Settings

Customizable Settings – Fine-tune calculations for accurate CO₂ impact analysis.

Settings

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 我们能提供哪些服务?
定制开发 / 二次开发

基于 sustainableweb/wp-carbon-calculator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 21
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2025-05-30