Moving to a new domain in the same server

You are facing the error because the database tables have old domain stored in all tables and post meta data. You need to replace all instances of previous domain with the new one in the database, the following link will help: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ You should also update your permalinks after the above process.

Can WordPress be installed at the root level, if a homepage called index.php already exists?

In theory, you could rename the file and change the rewrite rule accordingly. Assuming you rename it to wp-index.php, it would look something like this: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wp-index.php [L] </IfModule> There are a few references to index.php in the WP source, but they’re … Read more

On Install, which code sets the ‘home’ option?

When the installer runs it calls wp_install(), that in turn calls populate_options() defined in wp-admin/includes/schema.php, which runs the following.. if ( !__get_option(‘home’) ) update_option(‘home’, $guessurl); Prior to that $guessurl is defined by.. $guessurl = wp_guess_url(); The guess URL function is defined in wp-includes/functions.php and looks like this. function wp_guess_url() { if ( defined(‘WP_SITEURL’) && ” … Read more

Programatically Creating Initial WordPress Site

I’d highly recommend WP-CLI for such tasks. It is a tool that allows installation and configuration of WordPress on the command line. What you are trying could easily be done: wp core download wp core config –dbname=<dbname> –dbuser=<dbuser> –dbpass=<dbpass> wp core install –url=<url> –title=<site-title> –admin_user=<username> –admin_password=<password> –admin_email=<email> There are a lot of other commands that … Read more

Plugin to install a plugin

You can take a look at TGM-Plugin-Activation plugin. It should give you good starting point. As written in the documentation: TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins). It allows your users to install and even automatically activate plugins in singular … Read more

Failed to open stream / no such file or directory

It could be 2 things Most like it’s your file permissions. It is probably that your apache isn’t able to open the files set files to 0644 and directories 0755. The other problem could be your php version. Since you are upgrading to a new server, why not get the php in version 7? php … Read more

What is $tab in `install_plugins_{$tab}` hook?

If you go to the plugin-install.php inside the WordPress dashboard, there may be many tabs: wp-admin/plugin-install.php?tab=featured wp-admin/plugin-install.php?tab=popular wp-admin/plugin-install.php?tab=recommended … Here is the function you referenced: File: wp-admin/plugin-install.php 145: /** 146: * Fires after the plugins list table in each tab of the Install Plugins screen. 147: * 148: * The dynamic portion of the action … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)