| 开发者 | yedaye |
|---|---|
| 更新时间 | 2026年9月5日 12:02 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
[lwakit_eco_badge] shortcode and a matching Gutenberg block render an inline-SVG "Eco-Friendly Site" badge (zero extra image requests) in 3 style variants, with a settings-based default and a live-preview customizer.lwakit-carbon-footprint-tracker folder to /wp-content/plugins/, or install the plugin zip through Plugins → Add New → Upload Plugin.[lwakit_eco_badge] shortcode or the "Lwakit Eco Badge" block to any page or post.They are estimates, not precise measurements. Lwakit Carbon Footprint Tracker uses the published Sustainable Web Design Model methodology (energy per gigabyte transferred × a grid carbon-intensity assumption you can edit) combined with real, server-measured page weight from your own site's traffic. Actual emissions vary by visitor device, network path, and local energy mix, and no software can measure true end-to-end emissions without instrumenting every device and network hop involved. Treat the numbers as a consistent, comparable trend indicator rather than an audited absolute figure.
Lwakit Carbon Footprint Tracker only measures pages that are already being rendered — it buffers the page output to count its size and reads file sizes already known to WordPress (enqueued scripts/styles, referenced local images), it does not add new database tables to every query, fetch additional remote resources, or block/modify your page output. Metrics are written once per page load using a single upsert query. Your own visits as a logged-in administrator are skipped automatically so testing doesn't add overhead or skew your stats. The one exception is the optional, off-by-default Green Grid Caching feature — see the next question.
By default, none. Green-hosting detection works fully offline against a static list of known providers bundled with the plugin. The only outbound network request Lwakit Carbon Footprint Tracker can make is an optional, opt-in check against the Green Web Foundation's public API, which is off by default — see "External services" below for exactly what that sends.
No. Lwakit Carbon Footprint Tracker aggregates page weight, view counts, and database query counts per page per day. It does not store IP addresses, cookies, or any other visitor-identifying information.
Not in the free version. Image conversion and script blocking remain out of scope for this version.
Yes — both are included free. PDF reports: go to Lwakit CFT → Reports to download or email a branded carbon-footprint audit, after customizing your logo/company name/accent color on Settings → PDF Reports. The report is generated locally (no external service involved) and, if emailed, is sent only through your own site's mail configuration — never through Lwakit's or any third party's servers. Green Grid Caching (Settings → Green Grid Caching, off by default): when enabled, the site shifts to an aggressive page cache during detected peak carbon-intensity hours on your regional grid. This is the one place this plugin does change front-end behavior, and only while this optional feature is turned on. It only ever serves cached pages to visitors with no logged-in, comment-author, or cart/session cookie present — never to a logged-in user, and never a search result, feed, 404, or password-protected page. Two trade-offs worth knowing: while a page is served from cache during a peak window, WordPress does not run for that request, so that view is not added to your traffic/CO2e metrics (an expected consequence of genuinely skipping backend work, not a bug); and if another plugin personalizes anonymous page output using its own cookie or session mechanism that this plugin doesn't recognize (membership/paywall plugins, quiz progress, A/B testing, etc.), that personalization is not automatically detected — test carefully before relying on this feature alongside such a plugin. The feature automatically stays off entirely if another caching plugin (WP Rocket, W3 Total Cache, WP Super Cache, or LiteSpeed Cache) is already active.
redirect_canonical(), wp_old_slug_redirect()) had a chance to run, risking a blank cached page in place of a legitimate redirect during a peak window. Also excludes feeds and 404 pages from caching (their correct Content-Type/status can't be replayed by this cache), and never caches an empty response body as an extra safety net.[lwakit_eco_badge] (was [begreen_badge]) to match the plugin's new name — WordPress shortcode tags can't contain spaces, so this is the closest valid form to "Lwakit Eco Badge".lwakit-carbon-footprint-tracker), per WordPress.org review feedback regarding potential brand confusion with the "BeGreen" name. Updated the display name, Text Domain, and all user-facing UI text accordingly.wp_register_style()/wp_add_inline_style() instead of a raw echo'd <style> tag, per Plugin Check guidance to use WordPress's enqueue APIs for all CSS/JS output.Text Domain header now matches the plugin slug assigned by the WordPress.org review team (begreen-carbon-footprint-tracker), resolving a textdomain_mismatch warning from Plugin Check. Every translation-function call across the plugin (PHP and the Eco Badge block's JS) and block.json's textdomain field were updated to match.class-begreen-admin.php's current_page_slug() — the $_GET['page'] read happened on two separate lines, so a single-line phpcs:ignore only ever covered one of them. Collapsed to a single statement with one ignore comment; re-ran WP-CLI's wp plugin check and confirmed zero remaining findings.apiVersion: 3 in block.json, as required for WordPress 7.0's iframe-based block editor.class-begreen-db.php, class-begreen-recommendations.php and uninstall.php now passes the table name through $wpdb->prepare()'s %i identifier placeholder instead of raw string interpolation.class-begreen-admin.php (a read-only $_GET['page'] navigation check, not a state-changing action) by relocating the existing phpcs:ignore justification onto the exact line PHPCS parses.phpcs:ignore/phpcs:disable comments (with justification) for the direct-database-query and local-template-variable warnings that Plugin Check reports on every custom-table query and every included admin view — both are expected, unavoidable patterns for a plugin with its own table and plain-include view templates, not real issues.object-fit: contain) instead of pre-cropped image files, so the artwork displays correctly without a visible background box.add_menu_page() icon. Replaced it with a properly sized 20x20 icon.