Giter Site home page Giter Site logo

garridinsi / carbonbadge-block Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 330 KB

The Website Carbon widget Gutenberg Block, made with the Interactivity API

Home Page: https://wordpress.org/plugins/carbonbadge-block/

License: GNU General Public License v3.0

JavaScript 58.84% SCSS 7.61% PHP 33.55%
gutenberg-blocks interactivity-api wordpress wordpress-plugin

carbonbadge-block's Introduction

=== Carbonbadge Block ===
Contributors: garridinsi
Tags: block
Donate link: https://buymeacoffee.com/garridinsi
Requires at least: 6.5
Tested up to: 6.5
Stable tag: 1.2.3
License: GPL-3.0-or-later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

The Website Carbon widget Gutenberg block, made with the Interactivity API.

== Description ==
## Yes, websites have a carbon footprint

[Website Carbon](https://www.websitecarbon.com) is a service made by [Wholegrain digital](https://wholegraindigital.com/) to help inspire and educate people to create a zero carbon internet. Provides an easy way to check the carbon footprint of your website.

They provide a official badge to put on your website, and with this plugin, you can have that badge as a reactive Gutenberg block, thanks to the new [Interactivity API](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/)

## How it works
This plugin adds a new block to the Gutenberg editor, called "Carbonbadge". You can add it to any post or page, and it will show the carbon footprint of the current page.
The block will render a badge with the carbon footprint of the current page, and a link to the Website Carbon website.
The data is fetched from the Website Carbon API, with a client side call, and it's updated every time the page is loaded. The result for a concrete page is cached for 24 hours, client side.
More information on the Website Carbon badge can be found [here](https://www.websitecarbon.com/badge/) and on the website FAQ page [here](https://www.websitecarbon.com/faq/)
The privacy policy of the Website Carbon service can be found [here](https://www.websitecarbon.com/privacy-policy/)
The Website Carbon service is provided by [Wholegrain digital](https://www.wholegraindigital.com)

## The code on GitHub
You can find the code of this plugin on [GitHub](https://github.com/garridinsi/carbonbadge-block)

== Installation ==
1. Upload the plugin files to the `/wp-content/plugins/carbonbadge-block` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the \'Plugins\' screen in WordPress.
3. Place the block on any Gutenberg post or page.

== Changelog ==
= 1.2.3 =
* Remove Website Carbon text from i18n

= 1.2.2 =
* Fix a error with an action on the view

= 1.2.1 =
* Fix some issues with translations

= 1.2.0 =
* Add an option to hide the badge link
* Add an option to choose the tested page link
* Now the Website Carbon link points to the results of the tested page
* Improve code documentation
* Improve code structure and readability

= 1.1.0 =
* Improve localization
* Improve code documentation
* Optimize block rendering Interactivity logic
* Update dependencies

= 1.0.0 =
* First stable release
* Add block icon on the editor
* Better code documentation

= 0.1.4 =
* Fix error when generating the plugin, currentPage var was taking the testing page instead of the current page

= 0.1.2 =
* Fix localization issues
* Improve in code documentation

= 0.1.1 =
* Change plugin name and slug to `carbonbadge-block`

= 0.1.0 =
* First release

carbonbadge-block's People

Contributors

garridinsi avatar

Stargazers

Will Skora avatar Carsten Bach avatar David Bisset avatar Luis Herranz avatar Carlos Bravo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.