Latest Posts

Home/Latest Posts/

MYOB Accountright API Integration With WordPress/PHP

Since a year or so, we are doing multiple projects on integration of wordpress with MYOB Accountright Live API. The projects were difficult in the beginning, because the API docs do not give much details about problems encountered in interacting with API using PHP. The first project we did was integrating Membermouse plugin with Accountright API. Our custom MYOB plugin created invoice for every new Membership and a renewal. Since the memberships were subscriptions, we had to keep a track of dates and billing period. Dealing with Membermouse was a pain, it has a lot encrypted code in it, which makes it close to impossible for a developer to see its workflow. Working on it with dedication, we were able to complete and deliver the integration to client. It worked perfectly :) After this project we had several others, where we integrated Woocommerce with Accountright API. This was overall a very good and smooth experience. Woocommerce is open-source and has lots and lots of documentation which makes it easy to work with its API and functions. Whenever a customer ordered

WordPress Membership based sites – Membermouse Plugin

I recently used membermouse plugin for wordpress so I thought I will share my insights about it. This plugin provides a platform for membership based websites, subscriptions and a lot more. It has payment gateways integrated and also a test payment method which is very usefeul and can be used while development for test payments. Overall the plugin provides a lot of functionality and seems to be a very good fit for a membership subscription based website. On the other hand there are some shortcomings too. The plugin is a premium product so the company has hidden/encrypted a lot of code. This is a serious problem when you are trying to integrate it with existing system. Its not flexible and scale able. The product does have hooks for executing desired actions at certain points but they are quite few and are not much useful. The documentation is not comprehensive too. You also cannot find much troubleshoot information about it. Overall for me it wasn't a good experience because I had to extend it and integrate it with company's accounting system.

Open Letter to PM – Bringing Paypal to Pakistan

The Freelance Industry in Pakistan is in full bloom. Young programmers of Pakistan are taking over global freelance market with their passion, hard work and brilliance. Despite of Indians programmers being in large number, Pakistanis are professionally competing hand in hand with Indians. Clients are impressed by Pakistani Freelancers availability and dedication to completing their job   On freelance websites like Upwork.com, Freelancer.com and others, When clients post projects, they prefer Pakistanis over Indians mostly due to their competence and more availability. However, Pakistanis are at a big disadvantage against Indians when it comes to receiving payments and that is, we don't have PayPal in Pakistan. This results in lower profits for us. Every single client for whom we work in long term, asks for PayPal. They want a payment method which has no hassle and is easy for them. When paying through PayPal, the client and the freelancer can both avoid the high fee that job portals like Upwork charge them. The famous payment methods available for Pakistanis are: Payoneer, Skrill and Xoom. All of them are difficult for clients

Search by Exact Words in WordPress Search

Improve Wordpress Search to Make it Search Exact Words. The native wordpress search, does not look for exact complete words. It means that when you look for 'Los' you also get words like 'lost' 'loser' in search results. I found a lot of plugins which can improve search but found glitches in each of it. I decided to write my own solution. I needed a search which could look for exact word in posts. I implemented wordpress search for exact word in post titles using this code in functions.php. // Search SQL filter for matching against post title only. function __search_by_title_only( $search, $wp_query ) { global $wpdb; if ( empty( $search ) ) return $search; // skip processing - no search term in query $q = $wp_query->query_vars; $n = ! empty( $q['exact'] ) ? '' : '%'; $search = $searchand = ''; foreach ( (array) $q['search_terms'] as $term ) { $term = esc_sql( like_escape( $term ) ); $search .= "{$searchand}($wpdb->posts.post_title REGEXP '[[:<:]]{$term}[[:>:]]')"; $searchand = ' AND '; } if ( ! empty( $search ) ) { $search = "

SpeedUp Your Website

Are you looking for "Best wordpress plugin to speed up site" or "wordpress site speed optimization plugin" ? Do you want to speedup your website? Good news is, you have come to the right place! Boost Google Pagespeed Rank Site Optimization is a major consideration these days. This is because if your site loading speed is not fast enough, you are losing a lot of visitors hence ad revenues. So, website owners are pretty much concerned about speed now. We will try to answer the common questions website owners have about speed: How can I know the speed of my Website? There are some utilities available on the internet for free, where you can just type in your url and test your speed. The ones I use are Google PageSpeed Insight and GTMetrix . Out of these two I have found GTMETRIX to be more detailed and solid. Why is my website slow? When you have tested your website loading speed then you might wonder what is making it slow. Now look at the list of suggestions that are given

WordPress Send Email in Foreign Language – Japanese

Sending emails in Japanese language was a challenge for me. Any email, which had a subject in Japanese language failed and was not being sent at all. I tried encoding the email subject, but nothing worked. I tweaked things until i found a solution. I then re-defined the wordpress core wp_mail() function to allow sending emails with Japanese language in subject. My solution is given below (see modifications from line 337 and onwards in code below): //wp_mail redefined, to send japanese subject line in emails. function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) { // Compact the input, apply the filters, and extract them back out /** * Filter the wp_mail() arguments. * * @since 2.2.0 * * @param array $args A compacted array of wp_mail() arguments, including the "to" email, * subject, message, headers, and attachments values. */ $atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) ); if ( isset( $atts['to'] ) ) { $to = $atts['to']; } if ( isset( $atts['subject'] ) ) { $subject = $atts['subject']; } if (

Upworks Vs Toptal

I started my journey as a freelancer from Elance. After several months, I started getting jobs there. I got excellent reviews and a five star rating on those jobs. One Major problem with Elance was constant competition with low-priced inexperienced developers. Every time I placed a bid, i had to prove myself through my proposal and give a competitive price so i could stand out of 50-60 other applicants. The competition was tough and growing everyday. Elance-Odesk merger into Upwork resulted in further increasing this competition. People were biding at extremely low rates like $5 for a project. I decided to look for a new freelancing platform. I tried searching for good and reliable freelancing platforms other than Upwork and I came to know about toptal.com. When I read about their screening process, I was convinced that this is what I was looking for. I wanted a place where only seasoned developers or at least people who knew how to code could bid. I searched more for toptal.com and found many good reviews for it on quora.com and other websites.

Remove Slug from Custom Post Type URLs

Many times, you would like to remove the custom post type slug from urls. You don't want frontend users to see you custom post type slug and to know you are using one. I kept looking for solutions, modified rewrite rules and did lots of things finally found a very easier solution. This solution works for hierarchical posts and non-hierarchical both. It also removes parent slug from hierarchical posts.  I hope this would help you guys. Here is the code. add_filter( 'post_type_link', 'custom_post_type_link', 10, 3 ); function custom_post_type_link($permalink, $post, $leavename) { if (!gettype($post) == 'post') { return $permalink; } switch ($post->post_type) { case 'your_custompost_type_slug': $permalink = get_home_url() . '/' . $post->post_name . '/'; break; } return $permalink; } The above code snippet will be put into your functions.php and it will remove slugs from all post urls. So where ever in the template you are displaying the_permalink() . But clicking those links you will get a 404, page not found if you don't set the right query vars which are set in code given below: add_action( 'pre_get_posts',

WordPress Display Posts From Category

A lot of times we need to display posts from a certain category on a page or a part of page. This is possible by using a bit of code in the relevant template file. For example if you need to display the posts from a category on homepage then edit the index.php (or any other file which has been set up as homepage in dashboard settings). Display Posts by Category Its easy to display posts by category using 'wp_query' object in code. You can easily use the arguments of the 'wp_query'  to pass the category id and then display relevant posts. Now question is how to find the catagory id (which is a number) of a certain category. There two ways of doing that: Two Ways of Finding Category ID in Wordpress 1-Click on posts->categories and hover over the category name at the bottom of the screen you will see a link, which has a word call tag_id. See what is the value of tag_id and that gives you the category id. 2-Install the 'reveal IDs' plugin and it