Showing posts with label tips. Show all posts
Showing posts with label tips. Show all posts

Tuesday, September 12, 2017

How to Turn Your Google Sheets Into WordPress Tables and Graphs

https://www.elegantthemes.com/blog/tips-tricks/how-to-turn-your-google-sheets-into-wordpress-tables-and-graphs

Spreadsheets are one of the most efficient ways to display and sort through large amounts of data, and Google Sheets is one of the most intuitive tools you can use to create them. In contrast, WordPress can handle simple tables, but not graphs.
Integrating the former into the latter enables you to get the best out of both worlds. By using Google Sheets, you’ll be able to access that platform’s advanced features and share your results with the world through WordPress. In this article, we’ll teach you how to turn your Google Sheets into tables and graphs for WordPress. Let’s crunch some numbers!

Why You Might Want to Use Google Sheets With WordPress

An example of a Google Sheet.
Google Sheets are a great way to handle large datasets and create tables.
Google Sheets is a cloud version of the tech giant’s take on spreadsheet applications. It packs in all of the features you’ve come to expect, while making it easy to share and collaborate with others on your work.
At first glance, integrating Google Sheets and WordPress might not make much sense. However, if your website uses tables, the combination isn’t as crazy as it seems. In fact, there are three reasons why using both platforms together makes sense:
  1. WordPress’ built-in table options are rather limited, so using Google Sheets is a welcome alternative.
  2. The cloud platform provides a better user experience when it comes to dealing with large datasets.
  3. Turning your Google Sheets data into WordPress tables enables you to modify the latter by updating the former.
To expand on this last benefit, imagine that one of your articles contains a comparison table between multiple WordPress web hosts. You’ll probably want to keep the included data up to date so your content remains evergreen, but opening up the WordPress editor time after time can get annoying.
On the other hand, if you turn a Google Sheet file containing that data into a WordPress table, you can open the former and update its values whenever you need to. Then, your WordPress table will update itself automatically. It’s a pretty neat feature!

Introducing the Inline Google Spreadsheet ViewerPlugin

The Inline Google Spreadsheet Viewer plugin.
This plugin enables you to take your Google Sheets, Comma-Separated Values (CSV) files, and MySQL databases and turn them into charts, graphs, and tables for WordPress.
The transformation from spreadsheet to table or graph is automatic. In fact, as long as your information is labeled, you can build complex charts with this plugin using only shortcodes. Plus, you can also customize how they look on your WordPress site. Of course, it goes without saying that the plugin works flawlessly with Divi too.
Key Features:
  • Turn your Google Sheets, CSV files, and MySQL databases into tables, charts, and graphs.
  • Insert your tables and charts into any WordPress post or page using shortcodes.
  • Customize the look of your new elements by adding new parameters to your shortcodes.
  • Update your WordPress tables and graphs by modifying their parent values on Google Sheets.
Price: Free | More Information

How to Turn Your Google Sheets Into WordPress Tables and Graphs

As usual, we’re going to jump right into the thick of things. So before you move on, you’ll want to install and activate the Inline Google Spreadsheet Viewer plugin. Now, let’s hit the ground running!

How to Prepare Your Google Sheets for Use With WordPress

Before adding your spreadsheets to WordPress, you need to make sure they’re correctly shared. To do this, open the spreadsheet you want to turn into a table or graph and look for the Share button at the top right corner:
A Google Sheet share button.
Clicking on the button brings up a settings screen. You can choose Anyone with the link can view from the drop-down list below Link sharing on:
Setting your Google Sheets so that anyone with a link can view them.
This makes the spreadsheet viewable by anyone. On the other hand, you can access the same drop-down menu and click on the More… option:
Making your Google Sheet accessible to anyone.
This will send you to a new window, where you’ll find a couple of extra options. In this case, you’ll want to go with On – Public on the web. If you don’t configure your sharing settings to either of these options, WordPress won’t be able to pull the data it needs from your spreadsheets.

Adding Your Google Sheets as Tables Into WordPress

An example of a Google Sheets table on WordPress.
Your Google Sheets based tables are easy on the eyes and they include a sorting feature.
Adding your Google Sheets as tables couldn’t be easier. After activating the plugin, you can go to any of your posts or pages and just paste the link to your Google Sheet anywhere you want. The plugin will automatically pull the data and render it into a table:
A WordPress table.
Now, try previewing your post to check out your new table on the front end. The plugin will automatically include borders, bold some of the elements, and even add sorting options to the top of your table:
An example of a WordPress table as seen from the front end.
Moreover, the plugin includes a pagination feature, which makes it easy to look through extensive tables without cramping all of the information in. As far as Divi goes, the feature works just as well if you paste a link to a spreadsheet within any of its modules:
An example of a WordPress table within the Divi editor.
The same applies to the front-end results, so you don’t have to worry about compatibility issues. As for customization, you can’t alter the fields on your tables using the WordPress editor directly. However, what you can do is tweak a couple of their settings with shortcodes. For example, using the [gdoc key=”Your spreadsheet’s URL goes here” class=”no-datatables”] disables the sorting feature on your tables.
You can also turn off the automatic linking feature within your tables, which works for both URLs and emails, using [gdoc key=” Your spreadsheet’s URL goes here ” linkify=”no”] shortcode.
Keep in mind – you only need to use shortcodes for your tables if you want to customize them. If you’re happy with their default style and functionality, you can simply paste a link to them directly into the WordPress editor.

Adding Your Google Sheets as Graphs Into WordPress

An example of a WordPress graph.
The plugin in question offers over 15 types of graphs for WordPress.
Turning your Google Sheets into WordPress graphs works much the same as with tables. The only difference is that in this case, you need to solely use shortcodes, and there are over 15 different types of graphs available to choose from.
We’re not going to go through all of the styles here, but we’ll tell you how to use the most common types, including bars, pie, and line charts, and how to customize them. For the first one (bar charts), you’ll need to use the [gdoc key=”Your spreadsheet’s URL goes here” chart=”Bar”] shortcode.
Notice that the plugin automatically assigns colors to each of your values, which makes your work much easier:
An example of a WordPress bar graph.
You can also handpick which colors to use by adding a new parameter to the shortcode (for example: [gdoc key=” Your spreadsheet’s URL goes here ” chart=”Bar” chart_colors=”red green”]).
If you want to use different types of graphs, simply change the corresponding value for the chart parameter. For a pie or a line chart, you’d replace bar with pie or line:
An example of a WordPress line graph.
You’ll want to check out the plugin’s WordPress.org page for a full list of all the types of graphs you can use and their parameters. Also, keep in mind that not every Google Sheet will translate into a graph perfectly. In some cases, you’ll need to rearrange the values so they make sense, but that is to be expected for automatically generated elements.

Conclusion

If your work requires you to use spreadsheet tools such as Google Sheets, inserting them into WordPress can help make them more accessible. The process isn’t complicated, and the Inline Google Spreadsheet Viewerplugin enables you to play with a ton of display options for both tables and charts.
Before you add your Google Sheets to WordPress, you’ll need to set their sharing settings to either Public on the web or Anyone with the link. Then, it’s just a matter of using the right shortcode on whichever WordPress page or post you want to add them to.
Do you have any questions about how to turn your Google Sheets into WordPress tables and graphs? Let’s talk about them in the comments section below!
Article thumbnail image by wanpatsorn / shutterstock.com.

Monday, September 4, 2017

bagaimana cara mengupate theme secara manual?

Pakai plugin wordpress.org/plugins/easy-theme-and-plugin-upgrades

Monday, July 6, 2015

Stop the Madness: Redirect those Ridiculous Favicon 404 Requests

For the last several months, I have been seeing an increasing number of 404 errors requesting “favicon.ico” appended onto various URLs:
https://perishablepress.com/press/favicon.ico
https://perishablepress.com/press/2007/06/12/favicon.ico
https://perishablepress.com/press/2007/09/25/absolute-horizontal-and-vertical-centering-via-css/favicon.ico
https://perishablepress.com/press/2007/08/01/temporary-site-redirect-for-visitors-during-site-updates/favicon.ico
https://perishablepress.com/press/2007/01/16/maximum-and-minimum-height-and-width-in-internet-explorer/favicon.ico
When these errors first began appearing in the logs several months ago, I didn’t think too much of it — “just another idiot who can’t find my site’s favicon..” As time went on, however, the frequency and variety of these misdirected requests continued to increase. A bit frustrating perhaps, but not serious enough to justify immediate action. After all, what’s the worst that can happen? The idiot might actually find the blasted thing? Wouldn’t that be nice..
But no, the 404 favicon errors just won’t go away. Last week, as I was digging through my site’s error logs, there were hundreds of these infamous favicon requests — line after line of moronic URL activity, scripted directory brachiation targeting the all-empowering favicon exploit. Give me a break. Finally, I just couldn’t deal with it any more and decided to put an end to the madness..

Pssst: it’s in the root directory

Fortunately, stopping this nonsense is relatively easy. My knee-jerk reaction was to simply block all requests for favicon.ico:
<IfModule mod_alias.c>
 RedirectMatch 403 favicon.ico
</IfModule>
..very effective; 29 characters and problem solved. I could even add this line to my 3G Blacklist, but I don’t want to prevent direct access to my real favicon, so an alternate strategy is required. Let’s try it again, this time invoking the mind-boggling powers of Apache’s mod_rewrite:
# REDIRECT FAVICONZ
<ifmodule mod_rewrite.c>
 RewriteCond %{THE_REQUEST} favicon.ico [NC]
 RewriteRule (.*) http://domain.tld/favicon.ico [R=301,L] 
</ifmodule>
Ahh, much better. With this code placed in your site’s root blog’s subdirectory 1 HTAccess file, all requests for your site’s favicon.ico file will be directed to the original location, as specified in the RewriteRule. First line: check for the proper Apache module (mod_rewrite); second line: match any request for favicon.ico (regardless of casing); third line: rewrite all matched requests as http://domain.tld/favicon.ico and declare the redirect as permanent (301); last line: close the module-check container.
I have been using this code for about a week now and have seen no further 404 errors for misdirected favicon requests. Filtering out the noise from my error and access logs makes it easier to identify more serious issues.
Finally, in case you were wondering about the identity of the ruthless favicon bandit, here you go:
<Limit GET POST PUT>
 order allow,deny
 allow from all
 deny from 65.60.102.254   "# favicon bandit zombie "
 deny from 76.175.130.100  "# favicon bandit zombie "
 deny from 80.219.216.247  "# favicon bandit zombie "
 deny from 163.192.21.42   "# favicon bandit zombie "
 deny from 203.123.182.138 "# favicon bandit zombie "
</LIMIT>
These are all coming from completely different hosts, however blocking them for the immediate future may provide some temporary relief against any other cracker nonsense (i.e., non-favicon exploits) executed through these zombie machines.
And that’s a wrap. If you are experiencing similar 404 favicon requests, I would be interested in hearing about them. As always, thank you for your generous attention :)

Footnote

  • 1 It has been discovered that the redirection method described in this article works only when placed in a subdirectory, such as would be the case for blogs installed in their own directory. When placed in the root directory, this code will create an infinite redirection loop. For more information, and to learn about a similar technique that works in all directories (including the root directory) check out my article, Redirect All Requests for a Nonexistent File to the Actual File.