Skip to content

Commit e9bcd9e

Browse files
committed
Merge branch 'core' of https://github.com/codesnippetspro/code-snippets into core
merge
2 parents da99945 + 5311ee9 commit e9bcd9e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+14233
-13504
lines changed

.github/workflows/pull-request.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
pull_request:
55
types: [labeled]
66

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: true
10+
711
jobs:
812
comment:
913
if: contains(github.event.pull_request.labels.*.name, 'build')
@@ -37,4 +41,4 @@ jobs:
3741
comment-id: ${{ needs.comment.outputs.comment_id }}
3842
body: |
3943
### Download and install
40-
📦 [${{ needs.install.outputs.artifact_name }}.zip](${{ needs.install.outputs.artifact_url }})
44+
📦 [${{ needs.install.outputs.artifact_name }}.${{ needs.install.outputs.version }}.zip](${{ needs.install.outputs.artifact_url }})

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ script:
5555
- find . -maxdepth 1 \( -name '*.php' \) -exec php -lf {} \;
5656
- find src/php/ \( -name '*.php' \) -exec php -lf {} \;
5757

58-
# Run tests
59-
- npm run test
58+
# Run linters
59+
- npm run lint

CHANGELOG.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,75 @@
11
# Changelog
22

3+
4+
## [3.9.3] (2025-12-03)
5+
6+
### Added
7+
* end-to-end tests to verify the toggle visual state in the snippets list page, improving UI verification and test reliability
8+
9+
### Fixed
10+
* Fix missing import of common/direction in src/css/manage.scss to restore correct styling and direction-aware layout
11+
* Fix toggle activation check to ensure the correct transformation value is used when detecting active/inactive state
12+
13+
## [3.9.2] (2025-11-17)
14+
15+
### Changed
16+
* Introduced a custom scissors icon and updated button title for the TinyMCE extension.
17+
* Improved back-navigation styling on the edit page.
18+
* Refined layout for column names and action buttons in the Cloud Snippets list.
19+
* Enhanced overall styling of cloud-related UI components.
20+
* Optimized cloud search with more efficient pagination and snippet retrieval.
21+
* Introduced groundwork to prevent Composer dependency collisions with other plugins.
22+
23+
### Fixed
24+
* Improved sanitization and normalization across Cloud API and pagination outputs.
25+
* Resolved various TinyMCE issues reported in the WordPress support forum.
26+
27+
## [3.9.1] (2025-11-14)
28+
29+
### Changed
30+
* Migrated to native CSS direction handling (RTL/LTR) for improved compatibility and simpler styling
31+
* Updated dependencies to the latest compatible versions
32+
33+
### Fixed
34+
* Fixed TinyMCE menu button registration to prevent initialization failure
35+
* Fixed the position of the 'code direction' control in the editor
36+
37+
## [3.9.0] (2025-11-13)
38+
39+
### Added
40+
* Added contextual notices in the Snippets list table to surface action results and warnings in the UI
41+
* Expanded Multisite Sharing settings for clearer control over network-wide snippet sharing
42+
43+
### Changed
44+
* Modernized browser support targets and polished admin UI (clearer row-action badges, improved Pro badge hover, refined active snippet name styling)
45+
46+
### Fixed
47+
* Fixed REST API pagination to return correct results and page counts
48+
* Resolved styling selector so the active snippet name highlights reliably
49+
50+
## [3.9.0-beta.2] (2025-11-10)
51+
52+
### Added
53+
* Added 'Snippets' row action to the Network Sites table
54+
* Improved snippet name visibility for network users
55+
56+
### Changed
57+
* Refined badge styling and hover effects for row actions and badges
58+
* Impoved icon style and color usage for network snippets for clearer differentiation
59+
60+
### Fixed
61+
* Improved network snippets management with better subsite menu permission checks
62+
* Fixed status labels for shared network snippets
63+
* Corrected network condition checks and improved snippet fetching logic
64+
* Handled fatal errors in file-based snippets to prevent crashes
65+
66+
## [3.9.0-beta.1] (2025-11-03)
67+
68+
### Added
69+
* Soft delete (Trash) functionality for snippets with ability to undo, restore or permanently delete.
70+
* Bulk actions for trashing, restoring, and permanently deleting multiple snippets.
71+
* Separate filtered view to manage trashed snippets.
72+
373
## [3.8.2] (2025-10-31)
474

575
### Fixed

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,45 @@ command:
6969
npm run watch
7070
```
7171

72+
## Managing Composer dependencies
73+
74+
Code Snippets uses the [Imposter plugin](https://github.com/TypistTech/imposter) to namespace-prefix all vendor
75+
dependencies under `Code_Snippets\Vendor\`. This prevents conflicts with other WordPress plugins that might use the
76+
same libraries (e.g., Guzzle, Minify, Monolog).
77+
78+
### Adding a new dependency
79+
80+
When adding a new Composer dependency that might exist in other plugins:
81+
82+
1. Add the package to `src/composer.json` as usual:
83+
```shell
84+
cd src
85+
composer require vendor/package
86+
```
87+
88+
2. Add corresponding PSR-4 autoload entries for the prefixed namespace in `src/composer.json`:
89+
```json
90+
"autoload": {
91+
"psr-4": {
92+
"Code_Snippets\\Vendor\\OriginalVendor\\PackageName\\": "vendor/vendor-name/package-name/src/"
93+
}
94+
}
95+
```
96+
97+
3. Run `composer dump-autoload -o` to regenerate autoload files.
98+
99+
4. The Imposter plugin will automatically rewrite the namespaces during `post-install-cmd` and `post-update-cmd` hooks.
100+
101+
5. Our autoloader in `src/php/load.php` automatically removes original (non-prefixed) namespace mappings to prevent
102+
collisions, so no code changes are needed.
103+
104+
### How it works
105+
106+
- Imposter rewrites all vendor code from `Vendor\Package\Class` to `Code_Snippets\Vendor\Vendor\Package\Class`
107+
- The `load.php` file dynamically detects and removes original namespace PSR-4 mappings at runtime
108+
- Other plugins can load their own versions of the same libraries without conflicts
109+
- Your code should always use the prefixed namespace: `use Code_Snippets\Vendor\Vendor\Package\Class;`
110+
72111
## Preparing for release
73112

74113
The plugin repository includes a number of files that are unnecessary when distributing the plugin files for

config/RtlCssPlugin.ts

Lines changed: 0 additions & 50 deletions
This file was deleted.

config/webpack-css.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import hslCompat from 'postcss-color-hsl'
77
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
88
import RemoveEmptyScriptsPlugin from 'webpack-remove-empty-scripts'
99
import { glob } from 'glob'
10-
import { RtlCssPlugin } from './RtlCssPlugin'
1110
import type { Configuration, EntryObject } from 'webpack'
1211
import type { Config as PostCssConfig } from 'postcss-load-config'
1312

@@ -103,9 +102,6 @@ export const cssWebpackConfig: Configuration = {
103102
.replace(/^codemirror-theme-/, 'editor-themes/')
104103
.replace(/-css\.css$/, '.css')
105104
: '[name].css'
106-
}),
107-
new RtlCssPlugin({
108-
entries: new Set(['manage-css', 'edit-css'])
109105
})
110106
]
111107
}

eslint.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ export default eslintTs.config(
3030
},
3131
{
3232
languageOptions: {
33-
ecmaVersion: 2018,
33+
ecmaVersion: 2022,
3434
globals: { ...globals.browser },
3535
parserOptions: {
36-
ecmaVersion: 2018,
36+
ecmaVersion: 2022,
3737
ecmaFeatures: { jsx: true },
3838
tsconfigRootDir: import.meta.dirname,
3939
projectService: { allowDefaultProject: ['eslint.config.mjs'] }

0 commit comments

Comments
 (0)