diff --git a/composer.json b/composer.json index 9c9f4827..1da74c8f 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,12 @@ "deps": [ "curl -O -q --output-dir themes/jquery/lib/typesense-minibar 'https://raw.githubusercontent.com/jquery/typesense-minibar/1.3.4/{typesense-minibar.css,typesense-minibar.js,LICENSE.txt}'", "curl -q https://raw.githubusercontent.com/jquery/typesense-minibar/1.3.4/typesense-minibar-foot.css >> themes/jquery/lib/typesense-minibar/typesense-minibar.css", - "curl -O -q --output-dir plugins/memcached 'https://raw.githubusercontent.com/Automattic/wp-memcached/35e1ea16f6b8cb8a1e6fbca124e33a44db21fa74/{object-cache.php,readme.txt,LICENSE}'" + + "curl -O -q --output-dir plugins/memcached 'https://raw.githubusercontent.com/Automattic/wp-memcached/35e1ea16f6b8cb8a1e6fbca124e33a44db21fa74/{object-cache.php,readme.txt,LICENSE}'", + + "git rm -rf plugins/disable-emojis/", + "curl -s 'https://downloads.wordpress.org/plugin/disable-emojis.1.7.7.zip' | tar -xv -C plugins/", + "git add plugins/disable-emojis/" ] } } diff --git a/plugins/disable-emojis/composer.json b/plugins/disable-emojis/composer.json new file mode 100644 index 00000000..a7ced755 --- /dev/null +++ b/plugins/disable-emojis/composer.json @@ -0,0 +1,12 @@ +{ + "name": "ryanhellyer/disable-emojiis", + "description": "WordPress plugin which disables the WordPress emoji functionality. GDPR friendly.", + "type": "wordpress-plugin", + "license": "GPL-2.0", + "authors": [ + { + "name": "ryanhellyer" + } + ], + "require": {} +} diff --git a/plugins/disable-emojis/disable-emojis.php b/plugins/disable-emojis/disable-emojis.php index 5c7f7437..fed54201 100644 --- a/plugins/disable-emojis/disable-emojis.php +++ b/plugins/disable-emojis/disable-emojis.php @@ -1,9 +1,9 @@ $url ) { + if ( strpos( $url, $emoji_svg_url_bit ) !== false ) { + unset( $urls[$key] ); + } + } + } return $urls; diff --git a/plugins/disable-emojis/readme.txt b/plugins/disable-emojis/readme.txt index 5d3752b0..d3dd881d 100644 --- a/plugins/disable-emojis/readme.txt +++ b/plugins/disable-emojis/readme.txt @@ -1,21 +1,25 @@ -=== Disable Emojis === +=== Disable Emojis (GDPR friendly) === Contributors: ryanhellyer -Tags: emojis +Tags: emojis, gdpr, disable Donate link: https://geek.hellyer.kiwi/donate/ -Requires at least: 4.2 -Tested up to: 4.7 -Stable tag: 1.5.2 +Requires at least: 4.8 +Tested up to: 6.8 +Stable tag: 1.7.7 -This plugin disables the new WordPress emoji functionality. +This plugin disables the new WordPress emoji functionality. GDPR friendly. == Description == -This plugin disables the new WordPress emoji functionality. +This plugin disables the new WordPress emoji functionality. GDPR friendly. -Note: Emoticons will still work and emoji's will still work in browsers which have built in support for them. This plugin simply removes the extra code bloat used to add support for emoji's in older browswers. +Note: Emoticons will still work and emojis will still work in browsers which have built in support for them. This plugin simply removes the extra code bloat used to add support for emojis in older browsers. + += GDPR compliancy = + +This plugin does not do anything to make your site less GDPR compliant. It disables the DNS prefetching of emojis within WordPress, which should ensure improved privacy. To determine if your site is GDPR compliant, please seek legal advice. I have done my best to ensure the plugin is 100% GDPR compliant, but I am not a lawyer so can not guarantee anything ;) == Installation == @@ -31,6 +35,38 @@ Visit the Disable Em == Changelog == += 1.7.7 = +* Confirmed support for newer WordPress versions. + += 1.7.6 = +* Confirmed support for newer WordPress versions. + += 1.7.5 = +* Added Composer support. + += 1.7.4 = +* Fixing typos. + += 1.7.3 = +* Unneeded version bump to shut the WordPress.org notice up. + += 1.7.2 = +* Subtle improvement to code cleanliness. +* Improved documentation regarding GDPR issues. + += 1.7.1 = +* Added GDPR friendly label on advice from Ipstenu. + += 1.7 = +* Removed DNS prefetch URL again. +* This time using simple string check rather than relying on internal WordPress filters. + += 1.6 = +* Removed DNS prefetch URL. Props to Aaron Queen for assisting with this. + += 1.5.3 = +* Catering to new DNS prefetch URL in version 4.7 of core + = 1.5.2 = * Improved documentation. * Removed redundant dns prefetching. Thanks to Milan Dinic for the pull request. diff --git a/plugins/jquery-actions.php b/plugins/jquery-actions.php index 63fe7dc1..b1869e37 100644 --- a/plugins/jquery-actions.php +++ b/plugins/jquery-actions.php @@ -8,11 +8,14 @@ // (such as references to theme assets and intra-site links). // This does not influence 'home' and 'siteurl' options, and thus // does not affect and sitemap output. -if ( @$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) { +$jq_proto = $_SERVER['HTTP_X_FORWARDED_PROTO'] ?? ''; +if ( $jq_proto == 'https' ) { $_SERVER['HTTPS'] = '1'; -} elseif ( @$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'http' ) { +} elseif ( $jq_proto == 'http' ) { $_SERVER['HTTPS'] = '0'; } +unset( $jq_proto ); + add_filter( 'wp_headers', function ( $headers ) { if ( isset( $headers['Vary'] ) ) { $headers['Vary'] .= ',X-Forwarded-Proto'; diff --git a/plugins/jquery-filters.php b/plugins/jquery-filters.php index b7edbda8..98e2afb3 100644 --- a/plugins/jquery-filters.php +++ b/plugins/jquery-filters.php @@ -62,8 +62,68 @@ // Disable WordPress auto-paragraphing for posts, except on actual blog sites remove_filter( 'the_content', 'wpautop' ); + + add_filter( 'option_uploads_use_yearmonth_folders', '__return_false' ); + + add_filter( 'upload_dir', function( $upload_dir ) { + if ( defined( 'UPLOADS' ) ) { + $upload_dir['path'] = $upload_dir['basedir'] = UPLOADS; + } else { + $upload_dir['path'] = $upload_dir['basedir'] = WP_CONTENT_DIR . '/uploads'; + } + + return $upload_dir; + }); } +/** + * Content Security Policy + * https://github.com/jquery/infrastructure-puppet/issues/54 + */ +add_action( 'send_headers', function() { + $nonce = bin2hex( random_bytes( 8 ) ); + $report_url = 'https://csp-report-api.openjs-foundation.workers.dev/'; + $policy = array( + 'default-src' => "'self'", + 'script-src' => "'self' 'nonce-$nonce' code.jquery.com", + // The nonce is here so inline scripts can be used in the theme + 'style-src' => "'self' 'nonce-$nonce' code.jquery.com", + // Allow style="" attributes in blog posts and markdown. + 'style-src-attr' => "'unsafe-inline'", + // data: SVG images are used in typesense + // Allow gravatars in wordpress admins + 'img-src' => "'self' data: secure.gravatar.com code.jquery.com", + 'connect-src' => "'self' typesense.jquery.com", + // Allow data fonts for the wordpress admins + 'font-src' => "'self' data:", + 'object-src' => "'none'", + 'frame-ancestors' => "'none'", + 'base-uri' => "'self'", + 'block-all-mixed-content' => '', + 'report-to' => 'csp-endpoint', + // Add report-uri for Firefox, which + // does not yet support report-to + 'report-uri' => $report_url, + ); + + $policy = apply_filters( 'jq_content_security_policy', $policy ); + + if ( is_admin() ) { + // wp-admin (as used by blogs) requires inline scripts, inline styles, + // and workers from blob: URLs + $policy[ 'script-src' ] = "'self' 'unsafe-inline' blob: code.jquery.com"; + $policy[ 'style-src' ] = "'self' 'unsafe-inline' code.jquery.com"; + } + + $policy_string = ''; + foreach ( $policy as $key => $value ) { + $policy_string .= $key . ' ' . $value . '; '; + } + + header( 'Reporting-Endpoints: csp-endpoint="' . $report_url . '"' ); + header( 'Content-Security-Policy: ' . $policy_string ); +} ); + // Disable WordPress text transformations (smart quotes, etc.) for posts. remove_filter( 'the_content', 'wptexturize' ); @@ -128,17 +188,6 @@ function jquery_unfiltered_html_for_term_descriptions() { return $classes; }); -add_filter( 'option_uploads_use_yearmonth_folders', '__return_false' ); -add_filter( 'upload_dir', function( $upload_dir ) { - if ( defined( 'UPLOADS' ) ) { - $upload_dir['path'] = $upload_dir['basedir'] = UPLOADS; - } else { - $upload_dir['path'] = $upload_dir['basedir'] = WP_CONTENT_DIR . '/uploads'; - } - - return $upload_dir; -}); - add_filter( 'get_terms', function( $terms, $taxonomies, $args ) { if ( !isset( $args[ 'orderby' ] ) || $args[ 'orderby' ] !== 'natural' ) { return $terms; diff --git a/themes/jquery.com/style.css b/themes/jquery.com/style.css index 8b09ea62..d528f694 100755 --- a/themes/jquery.com/style.css +++ b/themes/jquery.com/style.css @@ -217,136 +217,3 @@ a, padding-left: 10%; padding-right: 10%; } - -/* Blog comments */ - -#comments-title, -#content h2#comments-title { - margin-top: 2.6em; - text-transform: uppercase; -} -.nopassword, -.nocomments { - font-size: 24px; - font-weight: 100; - margin: 26px 0; -} -.commentlist { - list-style: none; - margin: 0 auto; -} -.content .commentlist { - width: 100%; /* reset the width for the one-column layout */ -} -#comments .commentlist > li.comment { - background: #f6f6f6; - border: 1px solid #ddd; - border-radius: 3px; - margin: 0 0 1em 60px; - padding: 5px 12px 0; - position: relative; - word-wrap: break-word; -} -#comments .commentlist > li.pingback { - margin: 0 0 1em 60px; - padding: 0; -} -.comment-meta .fn { - font-style: normal; - font-weight: bold; -} -.comment-meta { - color: #666; - font-size: 12px; - line-height: 2.2em; -} -#comments .commentlist > li.bypostauthor { - border-color: #0769ad; /* jQuery Primary Blue */ -} -#comments .commentlist > li.bypostauthor .comment-meta { - background: #ddd; - border-radius: 3px 3px 0 0; - color: inherit; - margin: -5px -12px 5px -12px; - padding: 5px 12px; -} -.commentlist .avatar { - border-radius: 3px; - box-shadow: 0 1px 2px #ccc; - left: -82px; - padding: 0; - position: absolute; - top: 0; -} -a.comment-reply-link { - background: #eee; - border-radius: 3px; - color: #666; - display: inline-block; - font-size: 12px; - padding: 0 8px; - text-decoration: none; -} -a.comment-reply-link:hover, -a.comment-reply-link:focus, -a.comment-reply-link:active { - background: #888; - color: #fff; -} -a.comment-reply-link > span { - display: inline-block; - position: relative; - top: -1px; -} - -/* Blog comment form */ - -#respond { - background: #f6f6f6; - border: 1px solid #ddd; - border-radius: 3px; - margin: 0 0 1.625em; - padding: 1.625em; -} -#respond form { - padding: 0; -} -#respond p { - margin: 10px 0; -} -#respond .comment-notes, -#respond .logged-in-as, -#respond label { - font-size: 12px; -} -#respond label { - line-height: 2.2em; -} -#respond .comment-form-comment label { - display: block; -} -#respond .required { - color: #bd3500; - font-weight: bold; -} -#respond input[type="text"], -#respond textarea { - background: #fff; - border-radius: 5px; - padding: 10px; -} -#respond textarea { - resize: vertical; - width: 95%; -} -#respond input[type=text] { - display: block; - height: 24px; - width: 75%; -} -#respond .form-submit { - text-align: right; -} -#respond input[type=submit] { - float: none; -} diff --git a/themes/jquery/css/base.css b/themes/jquery/css/base.css index 719b0748..08792414 100644 --- a/themes/jquery/css/base.css +++ b/themes/jquery/css/base.css @@ -2025,6 +2025,10 @@ footer .books li a cite { background-color: #eee; position: relative; } +.listing .hentry:first-child { + /* align top of first sidebar heading, with top of first homepage article */ + margin-top: 0; +} .listing #content .entry-title { font-size: 1.3em; diff --git a/themes/jquery/css/blog.css b/themes/jquery/css/blog.css new file mode 100644 index 00000000..a3d93c5f --- /dev/null +++ b/themes/jquery/css/blog.css @@ -0,0 +1,140 @@ +/* Blog comments */ + +#comments-title, +#content h2#comments-title { + margin-top: 2.6em; + text-transform: uppercase; +} +.nopassword, +.nocomments { + font-size: 24px; + font-weight: 100; + margin: 26px 0; +} +.commentlist { + list-style: none; + margin: 0 auto; +} +.content .commentlist { + width: 100%; /* reset the width for the one-column layout */ +} +#comments .commentlist > li.comment { + background: #f6f6f6; + border: 1px solid #ddd; + border-radius: 3px; + margin: 0 0 1em 60px; + padding: 5px 12px 0; + position: relative; + word-wrap: break-word; +} +#comments .commentlist > li.pingback { + margin: 0 0 1em 60px; + padding: 0; +} +.comment-meta .fn { + font-style: normal; + font-weight: bold; +} +.comment-meta { + color: #666; + font-size: 12px; + line-height: 2.2em; +} +#comments .commentlist > li.bypostauthor { + border-color: #0769ad; /* jQuery Primary Blue */ +} +.jquery-ui #comments .commentlist > li.bypostauthor { + border-color: #b24926; /* jQuery UI Secondary Orange */ +} +.jquery-mobile #comments .commentlist > li.bypostauthor { + border-color: #108040; /* jQuery Mobile Secondary Green */ +} +#comments .commentlist > li.bypostauthor .comment-meta { + background: #ddd; + border-radius: 3px 3px 0 0; + color: inherit; + margin: -5px -12px 5px -12px; + padding: 5px 12px; +} +.commentlist .avatar { + border-radius: 3px; + box-shadow: 0 1px 2px #ccc; + left: -82px; + padding: 0; + position: absolute; + top: 0; + width: 68px; + max-height: 68px; +} +a.comment-reply-link { + background: #eee; + border-radius: 3px; + color: #666; + display: inline-block; + font-size: 12px; + padding: 0 8px; + text-decoration: none; +} +a.comment-reply-link:hover, +a.comment-reply-link:focus, +a.comment-reply-link:active { + background: #888; + color: #fff; +} +a.comment-reply-link > span { + display: inline-block; + position: relative; + top: -1px; +} + +/* Blog comment form */ + +#respond { + background: #f6f6f6; + border: 1px solid #ddd; + border-radius: 3px; + margin: 0 0 1.625em; + padding: 1.625em; +} +#respond form { + padding: 0; +} +#respond p { + margin: 10px 0; +} +#respond .comment-notes, +#respond .logged-in-as, +#respond label { + font-size: 12px; +} +#respond label { + line-height: 2.2em; +} +#respond .comment-form-comment label { + display: block; +} +#respond .required { + color: #bd3500; + font-weight: bold; +} +#respond input[type="text"], +#respond textarea { + background: #fff; + border-radius: 5px; + padding: 10px; +} +#respond textarea { + resize: vertical; + width: 95%; +} +#respond input[type=text] { + display: block; + height: 24px; + width: 75%; +} +#respond .form-submit { + text-align: right; +} +#respond input[type=submit] { + float: none; +} diff --git a/themes/jquery/functions.php b/themes/jquery/functions.php index 2e2d5b3a..13f65d70 100755 --- a/themes/jquery/functions.php +++ b/themes/jquery/functions.php @@ -21,6 +21,7 @@ wp_dequeue_style('wp-block-library'); wp_dequeue_style('classic-theme-styles'); wp_dequeue_style('global-styles'); + wp_dequeue_style('akismet-widget-style'); }); }); @@ -251,43 +252,3 @@ function jq_image_posted_on() { return $classes; } ); - -/** - * Content Security Policy - */ -function jq_content_security_policy() { - $nonce = bin2hex( random_bytes( 8 ) ); - $report_url = 'https://csp-report-api.openjs-foundation.workers.dev/'; - $policy = array( - 'default-src' => "'self'", - 'script-src' => "'self' 'nonce-$nonce' code.jquery.com", - // The nonce is here so inline scripts can be used in the theme - 'style-src' => "'self' 'nonce-$nonce' code.jquery.com", - // data: SVG images are used in typesense - // Allow gravatars in wordpress admins - 'img-src' => "'self' data: secure.gravatar.com code.jquery.com", - 'connect-src' => "'self' typesense.jquery.com", - // Allow data fonts for the wordpress admins - 'font-src' => "'self' data:", - 'object-src' => "'none'", - 'frame-ancestors' => "'none'", - 'base-uri' => "'self'", - 'block-all-mixed-content' => '', - 'report-to' => 'csp-endpoint', - // Add report-uri for Firefox, which - // does not yet support report-to - 'report-uri' => $report_url, - ); - - $policy = apply_filters( 'jq_content_security_policy', $policy ); - - $policy_string = ''; - foreach ( $policy as $key => $value ) { - $policy_string .= $key . ' ' . $value . '; '; - } - - header( 'Reporting-Endpoints: csp-endpoint="' . $report_url . '"' ); - header( 'Content-Security-Policy: ' . $policy_string ); -} - -add_action( 'send_headers', 'jq_content_security_policy' ); diff --git a/themes/jquery/header.php b/themes/jquery/header.php index 6e1d7ab3..d4bb88f9 100755 --- a/themes/jquery/header.php +++ b/themes/jquery/header.php @@ -19,6 +19,13 @@ + + + diff --git a/themes/jqueryui.com/style.css b/themes/jqueryui.com/style.css index df5fdbec..c212365b 100755 --- a/themes/jqueryui.com/style.css +++ b/themes/jqueryui.com/style.css @@ -109,6 +109,10 @@ a, background: #eee; } +#content .demo-list li::marker { + content: ""; +} + #content .demo-list .active { background: #fff; }