• Skip to primary navigation
  • Skip to main content
pragati logo

Pragati Tech Services

  • Home
  • About
  • Services
    • Ecommerce Solutions
    • Customer Happiness
  • Blog
  • Contact
  • Show Search
Hide Search
You are here: Home / Archives for Sachin

Sachin

Fixing data in WooCommerce Analytics

Sachin · May 24, 2021 ·

Photo of Woman Showing Frustrations on Her Face

No Orders! What?

Yesterday morning I woke up to a text message from our client, saying they don’t see any orders in WooCommerce Analytics. This got me worried about site going down or something bad happening which must have led to no orders being received since we finished work day before. I quickly login and check Orders in WordPress Admin and I am relieved to see that website is working fine and we are getting orders consistently. However we had the problem of that data not being reflected in the WooCommerce Analytics, which just showed 0 orders and 0 revenue for the day.

Management relies on WooCommerce Analytics to keep track on online sales so we needed to fix it quickly. Analytics data can’t be calculated in real-time for performance reasons so it’s handled in background using ‘Action Scheduler’, so I check pending actions at WooCommerce > Status > Scheduled Actions and see thousands of pending actions there. Most of these were Mailchimp actions. Somehow all these actions have piled up and since Analytics Data actions are stuck in the queue, they aren’t being processed and instead are waiting for their turn. Now these thousands of actions won’t be processed normally obviously so I had to process them myself.

Action Scheduler

Action Scheduler is a modern replacement for WP-Cron and has an interface in the WP-Admin, so you can always see which tasks got executed, failed or still pending. If you are a plugin developer and need to execute some actions in background, you should definitely use Action Scheduler instead of WP-Cron and if you are using WP-Cron already, it does make sense to migrate to Action Scheduler as this plugin did.

Solution

Thankfully I have WP-CLI to rescue so the first command I run there is:

> wp action-scheduler run --group="wc-admin-data" --force

This executes all the pending actions for analytics data and now Analytics starts showing correct Order count and revenue.

However this only refreshes the figures till now and doesn’t ensure that it will keep refreshing it automatically every few minutes as it should. I had to get rid of all the pending actions obviously. Ofcourse fast and dirty approach would have been to just delete all the pending actions, but it wasn’t a good idea in my opinion as those actions needed to run. So I decide to run Mailchimp actions as well in WP-CLI so I run:

wp action-scheduler run --hook="MailChimp_WooCommerce_Single_Order" --force

Now I come back to WordPress Admin and check the ‘Scheduled Actions’ again, I can now see the pending actions going down slowly. However it was still going to take a long time. So I decide to run another queue in parallel. Again this is possible because I have access to WP-CLI. I just run the above command again. Now it doubles the speed at which pending actions are being run. I don’t take chance to run more queues at this point of time as it could have overwhelmed the server. I let them run and after a few hours all the pending actions have been executed and Analytics data is being generated automatically as it should.

WP-CLI

WP-CLI or WordPress Command-Line Interface lets you do tasks like updating plugins, installing themes on your terminal so it’s a much faster way to do things which you normally do using WordPress Admin.

What caused this?

Ok so anytime you see lots of pending actions in ‘Scheduled Actions’ tab, you will probably find your analytics isn’t working properly. If you server goes down for sometime or if you migrate the server, that could cause this. However in our case it was a silly reason. We need to connect Mailchimp plugin to our Mailchimp account, this enables us to monitor which mail campaign by marketing team is resulting in orders. We had re-connected the Mailchimp a few days ago after realising that it had got disconnected, but in the meanwhile lots of Mailchimp actions couldn’t run and led to this pile of actions. So something like that can also cause this and may not be that obvious to notice at times.

Hope you found this little post helpful and if you are looking for a reliable, prompt and communicative web-agency to create your next e-commerce website or maintain your existing website, you know who to hire, right?

Overhauling IT Education in India

Sachin · April 29, 2015 ·

I feel that level of IT education is really pathetic in our country (except in maybe top 20% colleges like IITs and NITs). It may seem funny coming from a non-graduate like me, but running my own software company for over 10 years gave me enough exposure and interaction with programmers coming out of colleges and also teachers teaching them. I visited colleges often to give seminar, workshops etc.

I have observed that in most technical fields, everybody first wants to join a great company and earn big bucks. Engineers, MCAs want to join Microsoft, Google, TCS, Infosys when they come out of college. Students who are not selected by big companies, try to get job with small software companies and students who don’t get job with any software company end up finally applying for teaching positions with colleges. So basically we have failed programmers teaching programmers of future.

How can we expect this system to work? We need to change the system at many levels. Here are my thoughts in brief:

  1. We need to attract good bright people to become teachers.
  2. We need to partner with Software companies and involve working professionals to teach in colleges part-time or over the weekend.
  3. We need to make competitive coding contests compulsory to attend. Google Code Jam happens once every year. Should be mandatory for every IT engineering and MCA student.
  4. Every student should participate on challenges on websites such as HackerEarth, Codechef, Topcoder etc.
  5. Many courses from Harvard, Stanford etc. are available online and even free in many cases. May be they can be taught as it is to whole class-room with teacher just acting as facilitators.
  6. MCA is a Master’s program, but it’s considered inferior to engineering which is a Graduation program. It needs to be improved with greater stress on industrial training which is part of 6th Sem.
  7. Colleges should open incubation centers and encourage their students to become entrepreneurs. Maybe college can even have a stake in the formed company. Not all such startups will succeed, but even if a few do, govt. will easily make up the investment in other failed companies.
  8. Teachers normally don’t upgrade themselves with the time. They should be regularly asked to take courses and appear for exams themselves to keep improving.
  9. IT Teachers should also be allowed to pursue some programming related profession. Not teaching or private coaching business, but some real programming with some software company or independent programming work. It’s allowed for Architects and Doctors as they are quite practical intensive fields. It should be done for the IT teachers as well.
  10. Students should be made aware about open-source resources such as Github and made to participate in resources like StackOverFlow
  11. New and Emerging programming languages/ frameworks should be included in the curriculum — Ruby on Rails, Python, Node.js & of course Swift

Update: 27th May 2015 — Google has just published it’s own guide if you are looking at a Career in Software for yourself.

If given a chance, I would love to talk to Colleges and even Government in detail and explore how can we work along these lines and overhaul the IT education scenario in the country. Looking forward to hear thoughts from readers of this blog.

Hello Swift

Sachin · October 14, 2014 ·

Person holding Swift programming language sticker

I was thinking about learning Swift someday, but what really made me take the plunge was this article on Wired. This article has one of the best opening I have read, it goes something like this:

Chris Lattner spent a year and a half creating a new programming language — a new way of designing, building, and running computer software — and he didn’t mention it to anyone, not even his closest friends and colleagues. He started in the summer of 2010, working at night and on weekends, and by the end of the following year, he’d mapped out the basics of the new language. That’s when he revealed his secret to the top executives at his company, and they were impressed enough to put a few other seasoned engineers on the project. Then, after another eighteen months, it became a “major focus” for the company, with a huge team of developers working alongside Lattner, and that meant the new language would soon change the world of computing. Lattner, you see, works for Apple.

You can continue reading at Wired. After reading this article I spent most of my day stalking Chris online 🙂

OK so I started investing some time and money into it. I began by watching some really great WWDC Videos by Apple. Those videos were really helpful in getting me started quickly. I watched following videos to get upto speed quickly:

  • Introduction to Swift
  • What’s New in Cocoa Touch
  • What’s New in Xcode 6
  • Storyboards and Controllers on OS X

These videos should be sufficient to get started, if you have done even a little bit of iOS programming sometime in your life. Rest of the videos you can consume, as and when time permits or need arises. Next I headed to Apple’s official book on Swift. Do checkout the ‘About Swift’ section to better understand the philosophy behind this new language. Some pearls of wisdom from there are:

  • Swift is not compatible with C unlike Objective C. It frees itself from constraints of C by doing this.
  • Swift is friendly to new programmers.
  • It supports playgrounds, which is really a much improved REPL
  • Swift combines the best in modern language thinking. Many features inspired from Javascript, C#, Ruby etc.

Next is the very useful ‘Swift Tour’ section in the book which introduces you to the basics in a 30 mins read. If you have done all these things, you should be ready to do some programming in Swift. Fire-up the X-Code 6 and create a Playground project and start playing. If you don’t have a Mac or Xcode installed yet, don’t worry, you can write Swift code in Browser without installing anything at all, thanks to Skip Wilson

OK so I did all that and was feeling pretty happy with my progress so far and was all pumped up to really dive-into this new language and become an expert, but I didn’t know what to do next so really kind of got stuck for a few days, trying to figure out what should be my next step in learning Swift. Watching WWDC Videos one after the other or just reading a book didn’t really look interesting to me. I needed something to do, that’s the best way to learn I think. What did I do? Please wait for my next post to find out.

2 UX Tips to Bubbly

Sachin · September 26, 2013 ·

Bubbly is a voice based social network so instead of typing on your phone, you can record your voice and post it to share with rest of the world. Interestingly celebrities like Amitabh Bacchan, Priyanka Chopra, Salman Khan etc are using it so fans now have a great option to connect with them on a more personal level. You can also apply filters and effects to your voice before posting which is really cool. They already have more than 30 million users. Tech Crunch has a good article on them saying how they started as Twitter for Voice and later morphed into Instagram of Voice.

I was just playing with Bubbly iOS App and it occurred to me that they can make 2 simple changes to make user-experience even better so I am sharing my thoughts here:

1. Continuous Playback when navigating app

Now my biggest issue with the app is that voice playback stops if I navigate away to a different screen. Sometime I tap on a user and navigate to his feed while listening to voice post of another user. When I do that playback just stops suddenly. Even an accidental tap which takes you a different screen will stop playback. Now this is not a very pleasant experience and I think playback should continue until I stop it or it is done playing or I start listening to another post.

iTunes store app already has a good solution for it. As you can see in the image below, I am listening to a song while browsing another album. Current song is simply moved to top bar and rest of the screen shows the screen I navigated to. Something along these lines will be very helpful in Bubbly app as well.

2. Pause option (May be even reverse/forward)

I would really love to jump to a certain playback position sometimes or may be go back a few seconds/minutes in playback at times. Also this will be really helpful in absence of continuous playback as suggested above. So even if I navigate away to a new screen, I can atleast comeback and don’t need to listen to same post from the beginning and can just jump to the section I haven’t listened already. May be I can just swipe along the playback circle to control this?

Also maybe the current stop button can be converted into a pause button instead? And may be even multiple posts can remain paused and I can choose to resume playing whichever I want, whenever I want?

So these were my 2 cents aka 2 tips 🙂

However I would also like to point out that I really like the UI of the app, their pull-down-to-refresh animation is really cool and these are just 2 things which I would like to see improved, other than that I find their UI very innovative and usable.

I would like to leave you by sharing an interesting fact about Bubbly which is, it is headquartered in Singapore and CEO Thomas Clayton recently shared how he created a Silicon Valley caliber team in Asia and I think he was quite successful in doing that and their CTO Justin Mann is one proof of that.

Wanted Hackers

Sachin · September 21, 2013 ·

Wanted hackers!! from Sachin Palewar

I gave a talk to MCA (Master of Computer Applications) students of GHRCE yesterday. Topic of my talk was ‘Wanted Hackers’ and objective was to inspire students to adopt hacker culture so that they can become better programmers and do great things in future.

At the outset I emphasised that Hacking is not actually what media and general public thinks it is and there is difference between hacking and cracking. Hacking is good, cracking is not. I showed a video of TED talk by Thomas Suarez: A 12-year-old app developer to inspire students.

Then I elaborated on various websites which organise programming contests and challenges. I also shared my views on which programming languages students should learn and from where.

I ended my talk with a brilliant video from code.org starring Bill Gates, Mark Zuckerberg, will.i.am, Chris Bosh, Jack Dorsey, Tony Hsieh, Drew Houston etc.

I hope my talk inspired atleast a few students to become good programmers and not average unemployable college passouts which are so common in India.

Next Page »

Pragati Tech Services

Copyright © 2023