One of the issues we need or at least should tackle before resubmitting CiviCRM 4.7.x to the WP plugin repo is address the issue of WordPress in it's own directory - https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory. While this is not the standard or common way of installing, it is used. It is more common for Agency installed or Enterprise sites than stand alone smaller organizations.
Currently CiviCRM does not handle this well. WordPress ends up with two urls - one for the home page and one fro the admin. So http://example.com is the public facing web site, and http://example.com/wp is the path to wp-admin, the content directory and CiviCRM.
If we try and use a CiviCRM link such as https://example.com/wp/civicrm/?q=civicrm%2Fcontribute%2Ftransact&reset=1&id=1 WP sends us to https://example.com/civicrm/?q=civicrm%2Fcontribute%2Ftransact&reset=1&id=1 This results in a 404 error.
##Hack
If we go and make the base page 'civicrm' a child page (using a parent named 'wp') then this link https://example.com/wp/civicrm/?q=civicrm%2Fcontribute%2Ftransact&reset=1&id=1 becomes valid and works.
However, the shortcode button is still broken.
##Testing and Planed fixes:
In the file: civicrm/CRM/Utils/System/WordPress.php replace the function private function getBaseUrl($absolute, $frontend, $forceBackend) with the following:
```
private function getBaseUrl($absolute, $frontend, $forceBackend) {
This is because the [civicrm.root] variable returns - http://wpcrazy.dev/wp/srv/www/wpcrazy/alt-plugins/civicrm/civicrm/ instead of http://wpcrazy.dev/alt-plugins/civicrm/civicrm/
```
After above changes: Result - Success
##Next Steps
Update installer - test for site_url() home_url() and admin_url() and set as below - look at getCiviSourceStorage in \Civi\Core\Paths – determine if this can be corrected for alternate wp-content plus WP in subdirectory. If not set at install:
I've just collared Tim and he's put a system of adding extra settings/constants into civicrm-settings.php (via an external file in the same directory) which means we can look at adding the useful constants via that mechanism. Here's the diff https://gist.github.com/totten/f080b6fa821d1b6c4d6711e750f04cd2
Therefore, so we only need to create the civicrm.settings.extra.php for WP.
PR: https://github.com/civicrm/civicrm-core/pull/10214 and PR: https://github.com/civicrm/civicrm-wordpress/pull/105 implements the above. Currently adds the civicrm.settings.extra.php file for WP only and adds the minimum number of defines to get all common install scenarios automated.
##17 October 2017
Changes Merged Release scheduled 4.7.27
##19 October 2017
Further testing due to CRM-21297 has uncovered that if wp is in its own directory AND the content directory has been moved there is an issue with ckeditor. https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/Resources.php#L737 uses "[civicrm.root]" and does not find the new settings via civicrm.settings.php. https://github.com/civicrm/civicrm-core/blob/master/CRM/Admin/Page/CKEditorConfig.php#L273 uses "[civicrm.files]" and this also does not find the overridden settings.