Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
assets
docker
inc
languages
wp-assets
.gitignore
Dockerfile
README.md
make.sh
readme.txt
youtube-channel.php

README.md

Lightweight YouTube Channel Widget

Author: Daniel Jonsson
License: GPL version 3
Download URL: https://wordpress.org/plugins/lightweight-youtube-channel-widget/

This is a slimmed down fork of the WordPress plugin youtube-channel which is written by Aleksandar Urošević. See readme.txt for the WordPress metadata README file.

License

As the original codebase (YouTube Channel version 2.4.1.3) is licensed under GPLv3, this project as a whole needs to retain that license. However, my contributions are licensed under the MIT License, though not very useful as long as the there still exists GPL licensed code in the project.

Codebase comparison

Lightweight YouTube Channel Widget 10.0 YouTube Channel 2.4.1.3
PHP SLOC * 438 1452
PHP LOC * 623 1853
SLOC/LOC 0.70 0.78
WordPress plugin dependencies - Redux Framework
JavaScript dependencies - jQuery, FitVids.JS, Magnific Popup
JavaScript w/ jQuery, minimized † 0 B 119.8 kB ‡
JavaScript w/o jQuery, minimized 0 B 24.0 kB §
CSS, minimized 1.1 kB ‖ 7.1 kB ¶

* Calculated by CLOC.
† jQuery version 1.11.1 bundled with WordPress 4.1.
‡ 95807 + 22012 + 1746 + 270 = 119835
§ 22012 + 1746 + 270 = 24028
‖ 1139 = 1139
¶ 5998 + 1139 = 7137

Note, SI unit prefixes are used, where k = kilo = 1000.

Local development and testing

The plugin can easily be tested locally during development with Docker.

The following two steps will create a Docker container with a complete LAMP stack and a WordPress blog running within it:

$ sudo docker build -t wordpress .
$ sudo docker run -i -t -p 80:80 -v `pwd`:/var/www/html/wordpress/wp-content/plugins/lightweight-youtube-channel-widget wordpress

The blog is then accessible at http://localhost/wordpress.

Packaging

Build a zip file containing the plugin with all its necessary files by running the following command:

$ ./make.sh

Wordpress.org assets

The assets (banners, screenshots and icon) being used on wordpress.org/plugins/lightweight-youtube-channel-widget/ are found in the directory wp-assets/.

The icon is available on Wikimedia Commons under CC BY-SA 2.5.

Generate POT file

Attach to the Docker container and run the following command inside it:

$ php /var/www/html/wordpress/tools/i18n/makepot.php wp-plugin /var/www/html/wordpress/wp-content/plugins/lightweight-youtube-channel-widget/ /var/www/html/wordpress/wp-content/plugins/lightweight-youtube-channel-widget/languages/lightweight-youtube-channel-widget-xx_XX.pot

The POT file is accessible outside the Docker container inside the languages directory.

Compile PO file to MO

Use the program msgfmt to compile a .po file to a binary .mo file. This program is available on most Linux distributions in the package gettext. Click here for more information.