Check if some plugin installed & active or not

If you want to check this inside the some hook, which runs after plugins_loaded hook, it is very simple. Just check some plugin specific constant or function exists or not.
For example, to check WooCommerce we will need to check any WOO constant is defined or not. Or it is enough to check if class WooCommerce exists or not.

Check if WP plugin installed & active?

But what if you want it to check it before the plugins loaded? In this case you will not be able to check some constant,function, class of the plugin is defined or not, because they are not loaded yet. So we will need some additional trick for that. We can check $wpdb->options table and get the list of active plugins, process it and get the results. Let’s see how it works.

Running AJAX sequence script in WP Admin custom settings page

If the data you are working with is too large for your server memory (for example you have millions of table rows which you should process and get some result.) you may need process it part by part- but with one single click. So we need some javascript-ajax code which should process this sequence itself and corresponding backend code for providing the needed data for each request.
Here is sample code for that:

In javascript part i have written sample js code which runs when you click to some button with “button” ID. It starts and sends its first request to the backend.
Backend gets the first requests and does some operation and returns done percentage. (in this sample there should be 10 steps, so each requests completes the next 10%).
Javascript receives “10” % message from the backend and sends the second requests.

When the last message comes from backend, javascript completes the sequence – part by part ajax process is now completed.

Hello, World!

Hi, it’s me, Elvin. I am WordPress Developer with >7 years experience and i would like to speak about WordPress.  I have already written hundreds posts about WordPress development in several websites, but now i’ve decided to create dedicated weblog for this.

In this blog i will share my custom solutions, approaches, hacks, tricks on WordPress Development.