• WordPress database error Table crashed

    For mysql database you may get the following error:

    Fix “WordPress database error Table … is marked as crashed and should be repaired”

    WordPress database error Table … is marked as crashed and last repair (automatic?) failed. 

    We can fix this error using the following commands:

    Fix “WordPress database error Table … is marked as crashed and should be repaired”

    [Read More...]
  • Cache with nginx

    Here are some good resources to use cache a website with NGINX.

    NGINX is commonly deployed as a reverse proxy or load balancer in an application stack and has a full set of caching features. It can be helpful for:

    1. Speeding up the website by caching full pages, static files (js, images, css etc.).
    2. Serving g-zipped data to browsers for faster delivery.
    3. Rewrite the urls to make them more human readable and easier to remember.
    4. Adding proper ‘expires header’ to static content so that they can be cached by the browsers.
    [Read More...]
  • Good resources learn how to develop WordPress plugin

    Admin panel

    Create a Custom WordPress Plugin From Scratch

    This tutorial is from: http://code.tutsplus.com/tutorials/create-a-custom-wordpress-plugin-from-scratch–net-2668

    1 Files and folders

    WordPress stores its plugins in the wp-content/plugins/ folder. This is the place where we’ll be adding our files as well.

    we are going to use two files (one for the main plugin file and one for implementing the administration page) therefore we’ll be putting all our files in a specific folder that we’ll name oscommerce_importer

    2. Creating the plugin file

    Now we create our main plugin file. We’ll name it as  itoscommerce_importer.php.

    [Read More...]
  • How to create plugins for wordpress

    Screen Shot 2015-03-18 at 9.41.47 pm

    Here are two good examples to show how to add buttons to wordpress editor by build wordpress plugins. 

    WordPress has two different editors: TinyMCE editor(i.e., visual editor) and Text editor(i.e., HTML editor).

    WordPress also lets us create custom buttons to both of the visual and text(or HTML) editor. To add a button for Text editor we need to use Quicktags API and to add buttons to the TinyMCE editor we have to use JavaScript APIs provided by the TinyMCE library. Here are two articles that will help you to learn these APIs.

    Add Buttons to WordPress Text Editor

    Here is an example code snippet which adds a button to the WordPress code editor and wraps the selected text using [code][/code] tags.

    [Read More...]
  • remove alternativ background lines for wp-syntax

    wp-syntax is a power tool to highlight your code, but the alternative background lines can make your code unreadable on some screens. 

    To remove the alternative background lines feature, we can just overwrite the css by adding the two lines in your theme’s style.css.

    You can change the background color to whatever you like.

    [Read More...]
  • How to use memcached in WordPress

    What is Memcached?

    Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.

    Memcached is simple yet powerful. Its simple design promotes quick deployment, ease of development, and solves many problems facing large data caches. Its API is available for most popular languages.

    You can get more information of memecached from this link: https://github.com/memcached/memcached/wiki

    Why do you use Memcached?

    By using memcached (properly), you limit the number of queries to the database (because they’ll read the results from memcached instead).

    [Read More...]
  • Top CDN services to speed up your website

    Best CDN Services MaxCDN

    If you build a website using popular CMS tools such as wordpress, you may wonder how to speed up your website. CDN is one the methods you need to adopt to make your site faster and more reliable. This post will describe what CDN is, how it can speed up your website, and recommend the top CDN providers you can choose. 

    What is CDN

    Content Delivery Network (CDN) is a group of servers placed across the global in order to deliver static contents such as html file, images much faster. According to BuiltWith, out of top 10k websites,

    [Read More...]
  • How to solve page not found error when using permalinks for wordpress

    I got the page not found error when I use the pretty permalinks of wordpress.

    Here is how I solved the problem after several round searches using search engines.

    1. make sure you have the write permission of /var/www/html/ folder
    2. sudo a2enmod rewrite
    3. edit the file /etc/apache2/apache2.conf (here we have an example of /var/www/html):

    and change it to;

    then,

    Most people can solve the page not found error after step 3, but I got internal server error.

    check the log:

    cat /var/log/apache2/error.log,

    [Read More...]