Skip to content

Commit

Permalink
Merge branch 'develop' into update-production-deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
EarthlingDavey committed Oct 4, 2024
2 parents d421a09 + c2df83c commit 48b44bb
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 89 deletions.
6 changes: 3 additions & 3 deletions bin/composer-post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# Add logging to amazon-s3-and-cloudfront-pro plugin.

# Define the search and replace strings.
AS3CF_FILE=/var/www/html/public/app/plugins/amazon-s3-and-cloudfront-pro/classes/upgrades/upgrade.php
AS3CF_FILE=/var/www/html/public/app/mu-plugins/amazon-s3-and-cloudfront-pro/classes/upgrades/upgrade.php
AS3CF_SEARCH="\$this->items_processed++;"
AS3CF_NEW="if(\$upgraded % 100 === 0) { error_log(\"AS3CF_Upgrade - total \$total, items_processed \$this->items_processed, upgrade_name \$this->upgrade_name\"); }"
AS3CF_REPLACE="$AS3CF_SEARCH\n\n\t\t\t$AS3CF_NEW"

# If serach string is in file. Then replace it.
# If search string is in file. Then replace it.
if grep -q $AS3CF_SEARCH $AS3CF_FILE ; then
echo "Adding logging to amazon-s3-and-cloudfront-pro..."
sed -i "s/$AS3CF_SEARCH/$AS3CF_REPLACE/g" $AS3CF_FILE
Expand All @@ -18,7 +18,7 @@ TOTAL_POLL_FILE=/var/www/html/public/app/plugins/totalpoll-lite/src/Plugin.php
TOTAL_POLL_SEARCH="\${tooltip}"
TOTAL_POLL_REPLACE="{\$tooltip}"

# If serach string is in file. Then replace it.
# If search string is in file. Then replace it.
if grep -q $TOTAL_POLL_SEARCH $TOTAL_POLL_FILE ; then
echo "Fixing syntax error in totalpoll-lite..."
sed -i "s/$TOTAL_POLL_SEARCH/$TOTAL_POLL_REPLACE/g" $TOTAL_POLL_FILE
Expand Down
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,21 @@
"ministryofjustice/wp-moj-components": "^3.5.0",
"ministryofjustice/wp-moj-elasticsearch": "^2.3.0",
"wpackagist-plugin/elasticpress": "^5.0.0",
"php-http/guzzle7-adapter": "^1.0",
"alphagov/notifications-php-client": "^6.0",
"aws/aws-sdk-php": "^3.133",
"wpackagist-plugin/query-monitor": "^3.15",
"wpackagist-plugin/debug-bar": "^1.1",
"wpackagist-plugin/debug-bar-elasticpress": "^3.1",
"deliciousbrains-plugin/wp-offload-media": "^3.2",
"deliciousbrains-plugin/wp-offload-media-assets-pull": "^1.1",
"stayallive/wp-sentry": "^7.11",
"ext-mysqli": "*",
"ext-openssl": "*",
"ext-posix": "*",
"ext-zlib": "*",
"league/oauth2-client": "^2.7",
"firebase/php-jwt": "^6.10",
"wpackagist-plugin/redis-cache": "^2.5",
"guzzlehttp/guzzle": "^7.9"
"guzzlehttp/guzzle": "^7.9",
"php-http/guzzle7-adapter": "^1.0"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.0.2"
Expand All @@ -97,8 +95,13 @@
"installer-paths": {
"public/app/mu-plugins/{$name}/": [
"type:wordpress-muplugin",
"deliciousbrains-plugin/wp-offload-media",
"ministryofjustice/wp-moj-elasticsearch",
"ministryofjustice/php-markdown-extra",
"wpackagist-plugin/wp-document-revisions",
"wpackagist-plugin/elasticpress",
"wpackagist-plugin/ewww-image-optimizer",
"ministryofjustice/php-markdown-extra"
"wpengine/advanced-custom-fields-pro"
],
"public/app/plugins/{$name}/": [
"type:wordpress-plugin"
Expand Down
82 changes: 25 additions & 57 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion public/app/themes/clarity/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* @since 1.0
* @version 1.0
*/
wp_enqueue_script('googleOptimizeAB', 'https://www.googleoptimize.com/optimize.js?id=OPT-5MGTCQZ');
get_header();
?>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,28 @@
$oAgency = new Agency();
$activeAgency = $oAgency->getCurrentAgency() ? $oAgency->getCurrentAgency() : 'hq';

// define the title
$header_title = get_the_title();

// Search page?
if (is_search()) {
$header_title = 'Search: ' . get_search_query();

$query_post_type = sanitize_text_field($_GET['post_types'] ?? null);
if ($query_post_type) {
$header_title .= ' (' . $query_post_type . ')';
}
}

?><!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<meta name="theme-color" content="<?= $agency_colour ?>">
<meta name="agency" content="<?= $activeAgency['label'] ?>">
<title><?= single_post_title(); ?><?= ' - ' . $activeAgency['label'] . ' Intranet'; ?></title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"/>
<meta name="theme-color" content="<?= $agency_colour ?>"/>
<meta name="agency" content="<?= $activeAgency['label'] ?>"/>

<title><?= $header_title ?><?= ' - ' . $activeAgency['label'] . ' Intranet'; ?></title>

<link rel="icon" sizes="180x180" href="<?= get_stylesheet_directory_uri() ?>/dist/images/icons/apple-touch-icon-180x180.png">
<link rel="shortcut icon" href="<?= get_stylesheet_directory_uri() ?>/dist/images/icons/favicon.ico" type="image/x-icon" />
Expand All @@ -36,26 +49,13 @@
<link rel="apple-touch-icon" sizes="152x152" href="<?= get_stylesheet_directory_uri() ?>/dist/images/icons/apple-touch-icon-152x152.png" />
<link rel="apple-touch-icon" sizes="180x180" href="<?= get_stylesheet_directory_uri() ?>/dist/images/icons/apple-touch-icon-180x180.png" />
<?php
/**
* wp_head() required WP function do not remove. Used by plugins to hook into and for theme development.
*/
wp_head();
?>
wp_head() ?>

<script defer>
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
}
return null;
}
document.addEventListener('DOMContentLoaded', function() {
<!-- Ensure the correct agency cookie gets picked up -->
var agency_cookie = readCookie("dw_agency");
if (agency_cookie !== null && agency_cookie !== '<?= $agency_shortcode ?>') { window.location.reload(true) }
var agency_cookie = ('; ' + document.cookie).split('; dw_agency=').pop().split(';').shift();
if (agency_cookie !== null && agency_cookie !== '<?= $agency_shortcode ?>') { window.location.reload() }
});
</script>
</head>
Expand Down

0 comments on commit 48b44bb

Please sign in to comment.