Polylang Copy Updated

Polylang Copy is now in version 1.1.0. Goto Bitbucket and get the new version.

I’ve just added support for automatic translations! From now on you can decide if you like to translate only certain posts or pages in a particular language or switch to auto mode. Then every new created post or page will be translated immediately into all available languages considering allready existing translations.

Some screenshots:

Find new settings panel for Polylang copy

Decide which method you prefer:

In single translating mode you will get a dropdown below every entry’s quickedit menu

Any suggestions and bug reports welcome.

 

New Free WP Plugin: Polylang Copy

Sometimes work is boring and inefficient. While I was working on the relaunch of ClientSolutions website I had the idea to make copying of posts and pages to other languages more easy.

If you use Polylang (thanks for this great plugin) for translating your wordpress page too, you maybe interested in using my little plugin. It will add a dropdown to each row action in posts, cpt or page listings from which you can select a language to translate a post or page in. After that you will be redirected  to the edit screen.

Polylang Copy makes an exact copy of the item, including featured image, categories and tags. If there are translations of categories or tags they will be used instead of original cats or tags.

That’s all.

Updated: See this post for more information.

Developer Tools: Debug :hover etc. in Chrome

Did you ever try to get a css style for a hovered or active button or link? Today I tried to figure out, why the bootstrap btn-success don’t accepts my :active state style. Searching for a way to get this brings me to the simple solution:

Open developer tools in chrome (ctrl-shift-i or F12), select  the element (crtl-shift-c or the most left button in the menu bar) and then see this:

dev-tools

Click on the dotted button to get the context menu for this element:

dev-tools-states

Select the states you need and you will see the corresponding style in the style window and on the webpage.

In my case it was the combination of to states:

.btn:active:hover

and not only :active.

Free Plugin: get-image

get-image – serve (tracking) images via php

get-image is intended to serve images from your wordpress installation to any other site via php as base64 encode image tag source. It includes rudimentary statistic to see, how often this image has been served.

What can you do with it?

Place it on other sites in your blog posts, place it as email footer logo in your emails or something else and see, how often this image is downloaded in total and in the current month. Since this small piece of code is open source feel free to enhance it’s functions and create pull requests on https://bitbucket.org/skurrilewelt/get-image or create issues in the issue tracker. Every comment is helpful and welcome.

How it works

Backend is short and easy. Here is the list view:

get-image-list

You can see the menu item ‘Request’ and the list view shows the already created items with title, image and the counts column. Every entry represents an image which can be served.

The edit view shows this:

get-image-edit

You can enter a title to identify a little bit later an additionally short description. Then you can choose or upload an image and after that you will see in the text box the img tag which you have to place where the image should appear.

Thats all.

get-image creates a rewrite rule which manages the redirecting and responding the image as base64 encoded data.

Conclusion

Don’t know. Use it and have fun, you can download or clone here:

https://bitbucket.org/skurrilewelt/get-image

 

Duplicator ( LifeInTheGrid) SQL-Fehler

Der WordPress Duplicator ist ein Supertool, wenn man eine live oder lokale Wordpress Installation umziehen bzw. deployen möchte. Es gibt aber hier und da einige Schwierigkeiten und Fallstricke.

Im aktuellen Fall wollte ich ein live Projekt vom Kundenserver lokal duplizieren, um daran zu arbeiten. Duplicator meldete mir keine wesentlichen Fehler und erstellte problemlos das Archiv.

Bei der Installation auf meinem lokalen System allerdings stieg der Duplicator beim Einspielen des Datenbank Dumps aus. Ein Blick in die log Datei von Duplicator zeigte, dass das Erstellen der Tabellen bereits fehl schlug. Nachdem ich die MySQL Versionen überprüft hatte (live 5.5.28 und lokal 5.5.32) konnte das nicht das Problem sein.

Ich habe mir dann in der lokalen Installation die Datei database.sql angeschaut. Das Problem war die falsche Create-Anweisung im SQL Dump:

CREATE TABLE `wgo_options` (
 `option_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
 `option_name` varchar(191) NOT NULL DEFAULT '',
 `option_value` longtext NOT NULL,
 `autoload` varchar(20) NOT NULL DEFAULT 'yes',
 PRIMARY KEY (`option_id`),
 UNIQUE KEY `option_name` (`option_name`)
) TYPE=InnoDB AUTO_INCREMENT=30474;

Die MySQL Doku sagt: TYPE keyword is depreciated (since 5.0) and not supported in MySQL5.5. Scheint also ein Bug in Duplicator Version 1.1.16 zu sein.

Lösung:
Aus dem heruntergeladenen Archiv die database.sql extrahieren und aus dem Archiv löschen. In Notepad++ TYPE gegen ENGINE getauscht und wieder ins Archiv hineinkopiert.

Bevor man jetzt die Installation erneut starten kann, muss die wp-config.php gelöscht werden, da Duplicator sonst (korrekterweise) den Fehler meldet, die Datei wäre bereits vorhanden, Das Duplicator die vorhandene wp-config.php nicht überschreibt, ist prinzipiell eine gute Sache.

Ein anderer Weg ist, Duplicator mitzuteilen, dass die Dateien manuell entpackt werden:

duplicator_advanced_settings

Danach läuft die Installation problemlos und die Datenbank kann installiert und migriert werden.

Custom Charts Examples

There are five chart types you can choose from. Enclose a plain html table with the schart shortcode to bild the chart. The table may look like this:

<table class="test-table">
 <tbody>
 <tr>
 <td></td>
 <td>January</td>
 <td>February</td>
 <td>March</td>
 <td>April</td>
 <td>May</td>
 </tr>
 <tr>
 <td>Income</td>
 <td class="right">55</td>
 <td class="right">65</td>
 <td class="right">72</td>
 <td class="right">81</td>
 <td class="right">69</td>
 </tr>
 <tr>
 <td>Gross</td>
 <td>22</td>
 <td>4</td>
 <td>16</td>
 <td>23</td>
 <td>16</td>
 </tr>
 <tr>
 <td>Tax</td>
 <td>23.7</td>
 <td>21.4</td>
 <td>27.7</td>
 <td>29.7</td>
 <td>31.2</td>
 </tr> 
 </tbody>
</table>
January February March April May
Income 55 65 72 81 69
Gross 22 4 16 23 16
Tax 23.7 21.4 27.7 29.7 31.2

facebook share    

Next example has the option show_table=”0″ so that the table is hidden.
facebook share    

This table is copied from wikipedia. Shortcode attribs are slightly different because there are formatted numbers.
[* schart type=”line” show_table=”1″ thousands=”,” decimal=”.” *]

World historical and predicted populations (in millions)
Region 1500 1600 1700 1750 1800 1850 1900 1950 1999 2008 2010 2012 2050 2150
World 458 580 682 791 978 1,262 1,650 2,521 5,978 6,707 6,896 7,052 9,725 9,746
Africa 86 114 106 106 107 111 133 221 767 973 1,022 1,052 2,478 2,308
Asia 243 339 436 502 635 809 947 1,402 3,634 4,054 4,164 4,250 5,267 5,561
Europe 84 111 125 163 203 276 408 547 729 732 738 740 734 517
Latin America 39 10 10 16 24 38 74 167 511 577 590 603 784 912
North America 3 3 2 2 7 26 82 172 307 337 345 351 433 398
Oceania 3 3 3 2 2 2 6 13 30 34 37 38 57 51

facebook share    

Pie and doughnut charts can display only one data row. SCalc takes the first on per default.

January February March April May
Income 55 65 72 81 69
Gross 22 4 16 23 16
Tax 23.7 21.4 27.7 29.7 31.2

facebook share    

Last but not least the radar chart;

January February March April May
Income 55 65 72 81 69
Gross 22 4 16 23 16
Tax 23.7 21.4 27.7 29.7 31.2

facebook share    

SCalc Calculator Shortcodes

Basically there are three possibilities:

[* scalc type=”hourlyRate” *]

[* scalc type=”investment” *]

[* scalc type=”annuity” *]

All basic settings and colors are made by the SCalc settings in the Settings panel. You will have two more options:

type: as shown above
height: pixel or percent numeric (i.e. “100%” or “300” for 300 px) (optional)
width: same as height

Be careful with width and height: Since charts are responsive, adjustment of width and / or height may lead to unwanted results.

SCalc Custom Chart Shortcodes

To add a custom chart you will need to things: The shortcode and a data table from which SCalc generates the datasets and labels.

[* schart type=”line” symbol=”€” height=”300″ width=”200″ show_table=”1″ *]

Here is the place for the table. It must be a valid HTML table.

[* /schart *]

Colors can be set in the Settings panel SCalc. Same colors will used for calculators and custom charts.

The options:

type: line, bar, doughnut, pie (mandatory)
symbol: Appendix for labels and legends (i.e. $) (optional)
height: pixel or percent numeric (i.e. “100%” or “300” for 300 px) (optional)
width: same as height
thousands: , or . (defaults to “,”. If your table data contains formatted numbers you must set this according to data format)
decimals: , or . (defaults to “.”. If your table data contains formatted numbers you must set this according to data format)
show_table: “0” or “1” Display the data table or not (optional)

Be careful with width and height: Since charts are responsive, adjustment of width and / or height may lead to unwanted results.

SCalc Installation and Settings

SCALC AND SK-LIBRARY INSTALLATION

The download archive contains to plugins: SCalc and sk-library.
You must install both within the wordpress plugin panel. Activate first sk-library and then SCalc.

If you already have installed sk-library in version 1.3 you can omit this installation.

SCalc contains an update checker so that you will be informed about plugin or library updates.

SCalc Settings

You will find a new menu in the Settings panel: SCalc. It consists of two main sections:

Colors

You can choose colors for 6 datasets that will be used in calculators or custom charts. After changing a color you will see the result in the live chart preview.

Basic Settings

At first you can add here your facebook app id. Only with this id the share buttons will appear and can work. SCalc uses the facebook javascript library to share content. Second entry is the email subject for mails that are sent when visitor clicks the email button below the charts.

Next item is the container class. You can add here a class which will be added to the most outer chart container. This will give you more control for styling.

All other settings should be self explanatory.

SCalc – Calculators and Custom Charts for Your WordPress

The next Wordpress plugin from skurrilewelt will be SCalc. It serves different interactive financial calculators and custom charts. Custom chart shortcode can turn native HTML tables into charts.

Key Features

  • Three calculators with charts and table data
  • Five custom chart types for visualizing table data
  • Export and mailing functions for all calculators
  • Facebook sharing for custom charts (facebook app id necessary)
  • Different chart types for calculators
  • Chart data table can be hidden
  • All charts are responsive
  • Multilingual with .po files
  • Many settings in admin panel

For example an investment calculator:

Investment Calculator

Total Value

$ 0.00

Total Contributions

$ 0.00

Total Interest

$ 0.00

Total Taxes

$ 0.00

Year Interest Capital Taxes Contributions End Balance
       

Many settings can be done in the admin panel such as currency symbol, start balance, colors for charts and more.

More information about scalc shortcode and calculators here.

Every calculator has a couple of buttons to change chart type or export chart or send chart and calculation by email.

2016-09-06 11_54_52-Skurrilewelt – Customer management – from strategic consulting to operational im

Beside the calculators you can create custom charts easily bei adding a (maybe hidden) table to your content enclosed with the schart shortcode.

More information about the schart shortcode and custom charts here.

January February March April May
Income 55 65 72 81 69
Gross 22 4 16 23 16
Tax 23.7 21.4 27.7 29.7 31.2

facebook share