FIXED: PHP Unit test issue PHP Warning/Warning/Fatal error: Failed to open stream: No such file (mock-mailer.php) for windows

After setup the PHP unit test on your Windows operating system maybe you get below error:

PHP Warning:  require_once(/tmp/wordpress//wp-includes/class-phpmailer.php): failed to open stream: No such file or directory in C:\Users\MaheshW\AppData\Local\Temp\wordpress-tests-lib\includes\mock-mailer.php o
n line 2
Warning: require_once(/tmp/wordpress//wp-includes/class-phpmailer.php): failed to open stream: No such file or directory in C:\Users\MaheshW\AppData\Local\Temp\wordpress-tests-lib\includes\mock-mailer.php on lin
e 2
PHP Fatal error:  require_once(): Failed opening required '/tmp/wordpress//wp-includes/class-phpmailer.php' (include_path='C:\xampp\php\PEAR') in C:\Users\MaheshW\AppData\Local\Temp\wordpress-tests-lib\includes\
mock-mailer.php on line 2
Fatal error: require_once(): Failed opening required '/tmp/wordpress//wp-includes/class-phpmailer.php' (include_path='C:\xampp\php\PEAR') in C:\Users\MaheshW\AppData\Local\Temp\wordpress-tests-lib\includes\mock-
mailer.php on line 2

In file C:\Users\MaheshW\AppData\Local\Temp\wordpress-tests-lib\wp-tests-config.php line 7 has code:

define( 'ABSPATH', '/tmp/wordpress/' );

Here, ABSPATH return the invalid path.

You can simply change the above code with below:

define( 'ABSPATH', 'C:\Users\{USERNAME}\AppData\Local\Temp/wordpress/' );

NOTE: Here change the {USERNAME} with your own user name.

To know the user name just open command prompt which shows your username.


In my case it was MaheshW so, I have change the code as below:

define( 'ABSPATH', 'C:\Users\MaheshW\AppData\Local\Temp/wordpress/' );

Now WordPress have 55 thousands of plugins

WordPress now have 55 thousands of plugins in plugin repository.

We can browse the plugins by 4 categories:

Bhari WordPress theme for the bloggers

Created ‘Bhari‘ (भारी) WordPress theme for the bloggers, Who love to write articles, share awesome stuff etc. and which is hosted on

Bhari WordPress Theme for the bloggers.
Bhari The WordPress Theme for Bloggers

Useful links:

Contribute Bhari on GitHub.

Special Thanks:


Add your suggestions in comment in the article


Add your feedback at

Importing WooCommerce Dummy Data – ( XML )

1) Quick Import:

I have created a simple plugin which imports the WooCommerce dummy data on your site within a few minutes. Check below video:

Quick – Download plugin – Sample Data.

2) Manual Download

you can use below XML files to import dummy content of the WooCommerce.

As of version 1.5.3, the plugin comes bundled with dummy data that can be imported to instantly give you a working store with products to test different WooCommerce features.

Below is the list of all (XML) files for download.

version 3.3.3 – download

version 3.3.2-rc.1 – download

version 3.3.2 – download

version 3.3.1 – download

version 3.3.0 – download

version 3.2.6 – download

version 3.2.5 – download

version 3.2.4 – download

version 3.2.3 – download

version 3.2.2 – download

version 3.2.1 – download

version 3.2.0 – download

version 3.1.2 – download

version 3.1.1 – download

version 3.1.0 – download

version 3.0.9 – download

version 3.0.8 – download

version 3.0.7 – download

version 3.0.6 – download

version 3.0.5 – download

version 3.0.4 – download

version 3.0.3 – download

version 3.0.2 – download

version 3.0.1 – download

version 3.0.0 – download

version 2.6.9 – download

version 2.6.8 – download

version 2.6.7 – download

version 2.6.6 – download

version 2.6.5 – download

version 2.6.4 – download

version 2.6.3 – download

version 2.6.2 – download

version 2.6.14 – download

version 2.6.13 – download

version 2.6.12 – download

version 2.6.11 – download

version 2.6.10 – download

version 2.6.1 – download

version 2.6.0 – download

version 2.5.5 – download

version 2.5.4 – download

version 2.5.3 – download

version 2.5.2 – download

version 2.5.1 – download

version 2.5.0 – download

version 2.4.9 – download

version 2.4.8 – download

version 2.4.7 – download

version 2.4.6 – download

version 2.4.5 – download

version 2.4.4 – download

version 2.4.3 – download

version 2.4.2 – download

version 2.4.13 – download

version 2.4.12 – download

version 2.4.11 – download

version 2.4.10 – download

version 2.4.1 – download

version 2.4.0 – download

version 2.3.9 – download

version 2.3.8 – download

version 2.3.7 – download

version 2.3.6 – download

version 2.3.5 – download

version 2.3.4 – download

version 2.3.3 – download

version 2.3.2 – download

version 2.3.13 – download

version 2.3.12 – download

version 2.3.11 – download

version 2.3.10 – download

version 2.3.1 – download

version 2.3.0 – download

version 2.2.9 – download

version 2.2.8 – download

version 2.2.7 – download

version 2.2.6 – download

version 2.2.5 – download

version 2.2.4 – download

version 2.2.3 – download

version 2.2.2 – download

version 2.2.11 – download

version 2.2.10 – download

version 2.2.1 – download

version 2.2.0 – download

version 2.1.9 – download

version 2.1.8 – download

version 2.1.7 – download

version 2.1.6 – download

version 2.1.5 – download

version 2.1.4 – download

version 2.1.3 – download

version 2.1.2 – download

version 2.1.12 – download

version 2.1.11 – download

version 2.1.10 – download

version 2.1.1 – download

version 2.1.0 – download

version 2.0.20 – download

version 1.6.6 – download

After download goto Importing WooCommerce Dummy Data.


Apple MacBook Pro (13″ Retina, 2.3GHz Quad-Core Intel Core i5, 8GB RAM, 128GB SSD) – Space Grey

WordPress Rollback Plugins and Themes

In development lots of times, We need to check the old version of current plugin/theme. Use WordPress plugins & themes WP Rollback.


Translation Ready

Github Repo.

Support and Documentation

We answer all support requests on the support forum.

How to create tinymce buttons at wordpress

To create mce buttons to your wordpress tiny editor, just follow below 2 steps.

Step-1: Add following code to your function.php file. This file found at /wp-content/themes/YOUR_THEME/function.php.

// Hooks your functions into the correct filters
function my_add_mce_button() {
	// check user permissions
	if ( !current_user_can( 'edit_posts' ) && !current_user_can( 'edit_pages' ) ) {
	// check if WYSIWYG is enabled
	if ( 'true' == get_user_option( 'rich_editing' ) ) {
		add_filter( 'mce_external_plugins', 'my_add_tinymce_plugin' );
		add_filter( 'mce_buttons', 'my_register_mce_button' );
add_action('admin_head', 'my_add_mce_button');

// Declare script for new button
function my_add_tinymce_plugin( $plugin_array ) {
	$plugin_array['my_mce_button'] = get_template_directory_uri() .'/mg-mce-btns.js';
	return $plugin_array;

// Register new button in the editor
function my_register_mce_button( $buttons ) {
	array_push( $buttons, 'my_mce_button' );
	return $buttons;


Step-2: Create file mg-mce-btns.js, Save this file to /wp-content/themes/YOUR_THEME. Note: Save file into same directory where function.php. Copy below code and place it into mg-mce-btns.js file.


(function() {
	tinymce.PluginManager.add('my_mce_button', function( editor, url ) {
		editor.addButton( 'my_mce_button', {
			text: 'JQuery',
			icon: false,
			type: 'menubutton',
			menu: [
					text: 'Item 1',
					menu: [
							text: 'Sub Item 1',
							onclick: function() {
								editor.insertContent('This is Sub Item-1');
							text: 'Sub Item 2',
							onclick: function() {
								editor.insertContent('This is Sub Item-2');
					text: 'Item 2',
					menu: [
							text: 'Sub Item 1',
							onclick: function() {
								editor.insertContent('This is Munu-2 - Sub Item-1');
							text: 'Sub Item 2',
							onclick: function() {
								editor.insertContent('This is Munu-2 - Sub Item-2');



How to create drop down mce buttons at wordpress tiny editor window

Download complete source code: Source files

How to Install WordPress in localhost?

Read this tutorial to learn how to install wordpress on localhost and build your own website….
Section-1 Download & Unzip wordpress on localhost
Section-2 Creating database for wordpress
Section-3 Installation of wordpress
Section-4 Change Default theme of wordpress
Section-1 Download & Unzip wordpress on localhost
Step-1.1 Download wordpress in .zip or .tar.gz format
Step-1.2 Open .zip file and click on extract
Step-1.3 Choose path of your folder. Here I unzip wordpress in “wp-shop1” folder into c:\wamp\www\. You can choose your own.
Step-1.4 Following folder structure of wordpress shown in our c:\wamp\www\wp-shop1 folder.
OK, Section-1 is complete now you successfully unzip wordpress to localhost. To install wordpress you need a database. To create database read Section-2 Create database for wordpress
Section-2 Creating database for wordpress
Step-2.1 Open localhost/phpmyadmin on your favorite browser. I like open it in Mozilla. Click on Databases
Step-2.2 EnterDatabase name and click on create. Here I create database shop1. You can choose your own database.
After click on create “Database created successfully” message shown on your browser.
Now next step is wordpress installation. Read next section.
Section-3 Installation of wordpress
Step-3.1 Goto browsers address bar and enter “localhost/wp-shop1”. Then page is open as follows:
Click on create configuration file to install wordpress.
Step-3.2 Now you are ready to install wordpress. Click on lets go!
Step-3.3Enter Database name which is created in phpmyadmin here my database name is shop1.
Also enter user name, password, host. Here default user name is root & password is nothing. Note table prefix is (optional).
Step-3.4 Click on run the install
Step-3.5 Enter your site name, user name & password. Note this user name & password is important. Because after installation & all times when you open the wordpress in admin mode, wordpress ask you admin name & password. So, use strong password here.
Step-3.6 Click on log intoopen login window
Step-3.7 Enter user name & password to open wordpress admin.
Step-3.8 This window show you your dashboard. It means you install wordpress successfully. This is your admin dashboard. To view your site follows next steps.
Note: To open admin panel of wordpress enterlocalhost/your-site/wp-admin. “wp-admin” is used for logging into wordpress.Whenever you want to login to
WordPress admin panel then enter localhost/your-site/wp-admin. I use “localhost/wp-shop1/wp-admin”
Step-3.9 Right click on my site-> view site to open your site.
Step-4 OK. This is your site. WordPress show you default theme of wordpress. You can create your own or use another one. To change theme follow next section.
Section-4 Change Default theme of wordpress
Step-4.1 To change theme goto your admin panel i.e. opened at “localhost/wp-shop1/wp-admin”
Notewp-admin” is used for logging to wordpress admin dashboard. Ok to change theme click on appearance->Themes
Step-4.2 WordPress shows default 3 themes. To activate theme click on activate button of specific theme as you like and click on activate.
Step-4.4 Again click on my Shop-> ViewsiteOR enter on address bar “localhost/wp-shop1” press enter to view your new theme.
Ok. This is basic tutorial. Now you successfully download, install & change theme of wordpress.
If you have a about query about wordpress please feel free to contact me.
I hope this tutorial is helpful for you. Thanks.

 For more details visit