Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workaround for potential file permission issues #109

Merged
merged 6 commits into from
Nov 20, 2023

Conversation

swissspidy
Copy link
Owner

When loading a file such as wp-content/plugins/foo-plugin/languages/foo-plugin-de_DE.mo
If wp-content/plugins/foo-plugin/languages/foo-plugin-de_DE.mo.php cannot be created
Try creating wp-content/languages/plugins/foo-plugin-de_DE.mo.php instead

When loading a file such as wp-content/plugins/foo-plugin/languages/foo-plugin-de_DE.mo again
Look up wp-content/plugins/foo-plugin/languages/foo-plugin-de_DE.mo.php
And then look up wp-content/languages/plugins/foo-plugin-de_DE.mo.php

Ditto for themes (note the change in file name!):

When loading a file such as wp-content/themes/foo-theme/languages/de_DE.mo
If wp-content/themes/foo-theme/languages/de_DE.mo.php cannot be created
Try creating wp-content/languages/themes/foo-theme-de_DE.mo.php instead

When loading a file such as wp-content/themes/foo-theme/languages/de_DE.mo again
Look up wp-content/themes/foo-theme/languages/de_DE.mo.php
And then look up wp-content/languages/themes/foo-theme-de_DE.mo.php

Fixes #108

@swissspidy swissspidy added the enhancement New feature or request label Oct 30, 2023
@swissspidy swissspidy added this to the 1.0.7 milestone Oct 30, 2023
@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (1d83d08) 95.34% compared to head (b62885d) 95.03%.

Files Patch % Lines
lib/class-performant-translations.php 91.66% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #109      +/-   ##
============================================
- Coverage     95.34%   95.03%   -0.32%     
- Complexity      181      195      +14     
============================================
  Files             6        6              
  Lines           430      463      +33     
============================================
+ Hits            410      440      +30     
- Misses           20       23       +3     
Flag Coverage Δ
default 95.03% <91.66%> (-0.32%) ⬇️
multisite 36.71% <91.66%> (+4.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@swissspidy
Copy link
Owner Author

swissspidy commented Oct 30, 2023

Performance Test Results

Performance test results for 0e8f916 are in 🛎️!

WordPress Admin

Locale Scenario wp-memory-usage wp-total
en_US Default 17.45 MB 143.29 ms
de_DE Default 34.35 MB 197.02 ms
de_DE Ginger MO (MO) 22.05 MB 176.68 ms
de_DE Ginger MO (PHP) 18.94 MB 148.28 ms

Twenty Twenty-Three

Locale Scenario wp-memory-usage wp-total
en_US Default 16.31 MB 131.80 ms
de_DE Default 30.03 MB 170.35 ms
de_DE Ginger MO (MO) 19.90 MB 152.55 ms
de_DE Ginger MO (PHP) 17.55 MB 136.32 ms

Twenty Twenty-One

Locale Scenario wp-memory-usage wp-total
en_US Default 15.80 MB 107.95 ms
de_DE Default 29.62 MB 146.50 ms
de_DE Ginger MO (MO) 19.40 MB 132.28 ms
de_DE Ginger MO (PHP) 17.05 MB 114.66 ms

@swissspidy swissspidy modified the milestones: 1.0.7, 1.0.8 Nov 9, 2023
@swissspidy swissspidy merged commit 7454fff into main Nov 20, 2023
22 of 24 checks passed
@swissspidy swissspidy deleted the fix/108-permissions branch November 20, 2023 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

file_put_contents(xxxx), Failed to open stream: permission denied
1 participant