Category Archives: Website stuff

Whose wordpress related posts plugin is fastest – WordPress Related Posts plugins Performance Tests and switching from Zemanta WordPress Plugin to Contextual Related Posts

wordpress-reduce-sql-queries-with-best-wordpress-related-posts-plugin

Since some time I’ve noticed one of my blog wordpress plugins (Zemanta WordPress Related Posts at pc-freak.net/blog is causing a serious mysql overhead, the plugin simply created too many SQL requests to the mysql server causing each client to the blog to cause an useless overhead. I’ve done a quick search whether this Zemanta propertiery (plugin) was slow and I ended up a nice article
calledRelated Posts Plugins performace – measured

The article compares the most popular used plugins to show Related Posts at the end of a WordPress Posted Page:

Speed Analysis was made withusing P3 Performance Profiler wordpress plugin which is outstanding one to use for anyone who want to debug what and how efficient is a wordpress install.

Tests were performed to following Related Posts plugin which more or less are doing the same (though some have some more options than others)

For the output were picked two very important calculations.

  • The overall average plugin load time, relative to the core load time
  • The average plugin load time after the initial hit (thus after the first page load)

performance-chart-comparison-between-most-related-posts-plugins-yarpp-related-posts-lite-zemante-related-posts-easy-related-posts-bwp-related-posts

All values are in per cents, indicating how much of the page load time is taken by the plugins – the lower the better.

The picture clearly shows that most efficient plugin with approximate best results is Contextual Related Posts. Seing that I’ve immediately disabled Zemnta Related Posts and switched to Contextual Related Posts. Once Contextual Related posts is enabled, to configure it I just had to tune few things (I set 8 related posts to show) and enabled related posts to show in the Feed. That’s it now my machine can perform better without Zemanta stoining mySQL.
I’ve given YARPP a test too and it works quite well but it is a little bit slower than CRP.
Well that’s all folks, before switching from Zemnta don’t just trust this statistics but try it yourself.
Happy testing ! 🙂

Web Wedevelopment basics – What is REST (Representational state transfer) and why it is important to programming?

web-development-basics-what-is-rest-protocol-used-to-communicate-server-client-via-http-rest-service-import-to-programming

Representational State Transfer (REST) has gained widespread acceptance across the Web as a simpler alternative to SOAP and WSDL based Web services. In layman’s terms, REST is an architecture style or design pattern used as a set of guidelines for creating web services which allow anything connected to a network (web servers, private intranets, smartphones, fitness bands, banking systems, traffic cameras, televisions etc.) to communicate with one another via a shared common common communications protocols known as HyperText Transfer Protocol (HTTP). The same HTTP Verbs (GET, POST, PUT, DELETE etc.) used by web browsers to retrieve and display web pages, audio/video files, images etc. from remote servers and post data back to them when performing actions like filling out and submitting forms are used by all of the aforementioned devices/services to communicate with one another.

rest-vs-soap-web-data-transfer-protocols
By leveraging and repurposing a lightweight and universal protocol like HTTP, software engineers and system architects are given a set of guidelines to use when designing RESTful web services for both new and existing products and services that contribute to what has become collectively known as the Internet of Things (IoT).

A simple example of designing a web service for managing employee data using an OData REST implementation might involve several methods, each corresponding to one of the HTTP verbs. A method like “Employees/GetEmployees” would be mapped to the GET verb (or “Employees/GetEmployee/12345” in the case of retrieving details for a single specific employee), handling all requests submitted to the web service, “Employees/AddEmployee” would be mapped to the POST verb, “Employees/UpdateEmployee” would be mapped to PUT and “Employees/DeleteEmployee” would be mapped to the DELETE verb. If the service were also exposing an interface to allow remote clients to manage consumer products the API would follow a similar naming convention but obviously specific to consumer products (i.e. Products/GetProducts, Products/AddProduct etc.). Any remote client that has access and is authorized to use any of these methods would be able to execute them provided that the remote client is capable of sending and receiving data using the HTTP protocol.

Technically speaking, it is an abstraction of the architecture of the World Wide Web (WWW); more precisely, REST is an architectural style consisting of a coordinated set of architectural constraints applied to components, connectors, and data elements, within a distributedhypermedia system. REST ignores the details of component implementation and protocol syntax in order to focus on the roles of components, the constraints upon their interaction with other components, and their interpretation of significant data elements.

The REST architectural style is also applied to the development of web services. One can characterize web services as “RESTful” if they conform to the constraints described in the architectural constraints section. RESTful web services are assumed to return data in XML and/or JSON format, the latter of which has been gaining more and more support and seems to be the data format of choice for many of the newer REST implementations.

Source of info: Wikipedia

Howto add adsense advertisements to your StatusNet micro blogging social Network

howto-add-adsense-to-statusnet-social-network-free-twitter-like-service
If you’re running your own statusnet micro blogging network and you happen to have a lot of content inside which you want to monetarize, sooner or later you will think of embedding Google Adsense advertisements to StatusNet.

I’ve found few discussions online like the thread on statusnet forums.
However there is no clear tutorial online yet explaining how to add adsense to statusnet, therefore, I decided to write this little guide.

Luckily StatusNet has a special Adsense Plugin enabling you to include adsense advertisements into your statusnet.

To enable advertising, you must sign up with Google Adsense and get a client ID.

https://www.google.com/adsense/

You’ll also need to create an Adsense for Content unit in one
of the four sizes described above. At the end of the process,
note the “google_ad_client” and “google_ad_slot” values in the
resultant Javascript.

If you’re a programmer check out StatusNet Adsense Plugin code in

/var/www/statusnet/plugins/Adsense/AdsensePlugin.php

Even if you’re not a programmer it is quite easy to add new Adsense sizes, however you have to be sure the new size placement in browser will show correctly.

The way to enable / use the plugin is to add in your /var/www/statusnet/config.php

line:

addPlugin(‘Adsense’, array(‘client’ => ‘ca-pub-6964339082113074’, ‘rectangle’ => ‘2824360868’));

The general Syntax of addPlugin(); is

addPlugin(‘Adsense’, array(‘client’ => ‘Your client ID’, ‘rectangle’ => ‘slot’));

Where client should be your adsense code google_ad_client,

rectangle field could be one of the values:

‘mediumRectangle’, ‘rectangle’, ‘leaderboard’, ‘wideSkyscraper’

Each of this values should be selected based on the width and size of the Google Adsense Ads to be shown.

Here are the general sizes:

MediumRectangle – To show Ads sized width 300 height 250 (300×250)

rectangle – 180×150

wideSkyscaper – 160×600

Leaderboard – heigh x width ( 728 x 90 )

Note that:
Some StatusNet themes might interact quite poorly with this plugin.

It could take some time until ads start appearing on page as after generation in adsense to make it working it takes up to 10 / 15 minutes for it to become active

Once config.php is saved check out, whether Adsense advertisements will appear in the left top of your StatusNet, right below the Search field, like on below screenshot.

adsense-advertisements-on-my-statusnet-social-network-howto

If it doesn’t appear there and you have the code embedded scroll down to StatusNet and check out whether adsense ads are not partially visualized (this sometimes happens if you try to insert adsense code with dimensions bigger than the size of its right pane, if that’s the case you should see your Ads visualize somewhere on the bottom left of page.

Well that’s all, hopefully if your statusnet gets a good traffic and is frequently updated you will start making money with adsense.

How to add Google Adsense to BuddyPress WordPress?

howto-add-adsense-to-buddypress-and-wordpress-without-plugin

If you have installed Multi-site BuddyPress or WordPress you can easily add adsense advertisements and there is no need to use any plugin or anything to add Adsense ads to Widgets.

This site itself is running BuddyPress and my quick research on plugin to use to add Adsense ads just led me to various suggestions plenty of different approaches like:

 

None of this however doesn’t seemed to work for me until finally I found this post pointing out that it is possible to use embedded WordPress Widgets to add the required code to WordPress.

I’ve tested and it seems, the Widget using Method to inject advertisements into your BuddyPress social network works perflectly fine.

Here is how to add Adsense to BuddyPress

1.

Login with adminsitrator to wp-admin or whatever URL you put for admin

2.

sites-all-sites-dashboard-add-adsense-to-buddypress-wordpress-screenshot

Sites -> All Sites -> Dashboard

3.

On the next page to display go to

add-appearance-widget-in-buddypress-add-adsense-code-in-widget-wordpress-buddypress

Appearance -> Widgets

4.

On this page Drag and Drop

Text Widget

(Hold on Text Widget with mouse button and drag to ordered list of Widgets to show on page)

add-text-to-widget-add-adsense-code-to-buddypress-and-wordperss-howto-pic

5.

Add a title to the newly added Text field to Widgets (lets say just type Ads)

And then paste the generated from Google Adsense interface Google Adsense code:

howto-add-adsense-tobuddypress-wordpress-installation-easy-without-plugin

Then press the Save button to save the Widget and if you need drag and drop between the available Widgets to change the exact place where Adsense Ads will appear.

That’s all give thanks to The Lord Jesus Christ for finding this post 🙂