Skip to content

Commit 09dc84f

Browse files
Merge pull request #4 from MrDemonWolf/claude/sharp-lamarr-4d9b7f
Code audit: deduplication, security hardening, and CI improvements
2 parents c875895 + cb6568d commit 09dc84f

6 files changed

Lines changed: 275 additions & 162 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ jobs:
2020
- name: PHP syntax check
2121
run: php -l theme/functions.php
2222

23+
- name: PHP Code Sniffer (WordPress-Core, errors only)
24+
run: |
25+
composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
26+
composer global require wp-coding-standards/wpcs:"^3" --no-progress --no-interaction -q
27+
~/.composer/vendor/bin/phpcs --standard=WordPress-Core -n --extensions=php theme/functions.php
28+
2329
- name: Check for leftover Nexus references
2430
run: |
2531
! grep -ri "nexus" theme/ supplementary/ --include="*.php" --include="*.css" --include="*.js" --include="*.json" --include="*.xml"

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Changelog
2+
3+
All notable changes to this project are documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.0] - 2026-04-17
9+
10+
Initial public release.
11+
12+
### Added
13+
- `service` custom post type with icon metabox.
14+
- Shortcodes: `[mrdemonwolf_breadcrumbs]`, `[mrdemonwolf_tags]`, `[mrdemonwolf_social_share]`.
15+
- Bundled Magnific Popup 1.1.0 for video popups.
16+
- Cleanup mu-plugin notice on theme deactivation.
17+
- CI (PHP lint, phpcs with WordPress Coding Standards, Nexus reference check, zip build) and tagged release workflow.
18+
- CSS custom properties `--mdw-bg` and `--mdw-border` for neutral palette.
19+
- Dedicated `theme/assets/admin-service-metabox.js` with `wp_localize_script` for i18n strings; scoped to the service edit screen via `admin_enqueue_scripts`.
20+
- Breadcrumb helpers `mrdemonwolf_breadcrumb_link()`, `mrdemonwolf_breadcrumb_current()`, and `mrdemonwolf_primary_term_link()`.
21+
- `mrdemonwolf_mu_dir()` helper for mu-plugins path resolution.
22+
- README documentation for the Magnific Popup pin and upgrade path.
23+
24+
### Changed
25+
- Breadcrumbs shortcode refactored to use the new helpers — removes duplicated anchor/span escaping across WooCommerce, post, project, page, category, and archive branches.
26+
- Social share shortcode uses `rawurlencode()` instead of `urlencode()` for query-string URL components.
27+
- Hardcoded `#EEF2F7` and `#C8D3E0` values in `style.css` replaced with `var(--mdw-bg)` / `var(--mdw-border)`.
28+
29+
### Security / Robustness
30+
- `file_put_contents()` return value is now checked when writing the cleanup mu-plugin; failures are reported via `error_log()`.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ times.
265265
| Lightbox | Magnific Popup 1.1.0 (bundled) |
266266
| Migration | WP-CLI |
267267

268+
> Magnific Popup is pinned to [v1.1.0](https://github.com/dimsemenov/Magnific-Popup/releases/tag/1.1.0) and bundled under `theme/assets/`. To upgrade, replace `jquery.magnific-popup.min.js` and `magnific-popup.min.css` from the upstream release and bump the version string in `theme/functions.php`.
269+
268270
## Development
269271

270272
### Prerequisites
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
jQuery(function ($) {
2+
var cfg = window.mdwServiceMetabox || {};
3+
var frame;
4+
5+
$('#mdw-service-upload-btn').on('click', function (e) {
6+
e.preventDefault();
7+
8+
if (frame) {
9+
frame.open();
10+
return;
11+
}
12+
13+
frame = wp.media({
14+
title: cfg.title || 'Select Image',
15+
button: { text: cfg.buttonText || 'Use this image' },
16+
multiple: false
17+
});
18+
19+
frame.on('select', function () {
20+
var attachment = frame.state().get('selection').first().toJSON();
21+
$('#mdw-service-image').val(attachment.url);
22+
$('#mdw-service-image-preview').attr('src', attachment.url).show();
23+
$('#mdw-service-remove-btn').show();
24+
});
25+
26+
frame.open();
27+
});
28+
29+
$('#mdw-service-remove-btn').on('click', function () {
30+
$('#mdw-service-image').val('');
31+
$('#mdw-service-image-preview').hide();
32+
$(this).hide();
33+
});
34+
});

0 commit comments

Comments
 (0)