Skip to content

Commit 8172c5a

Browse files
committed
added plugin-path env check
1 parent d97c830 commit 8172c5a

File tree

7 files changed

+141
-153
lines changed

7 files changed

+141
-153
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Added: experimental Gutenberg editor integration - [EnlighterJS/Plugin.Gutenberg on GitHub](https://github.com/EnlighterJS/Plugin.Gutenberg)
66
* Added: keyboard shortcut `+x` to highlight inline code - requested by [dahnark on WordPress.org Forums](https://wordpress.org/support/topic/override-theme-code-style/)
77
* Added: Visual Editor Plugin ([EnlighterJS.TinyMCE](https://github.com/EnlighterJS/Plugin.TinyMCE)) **v3.5.0**
8+
* Added: Environment check to ensure the plugin is uploaded into `wp-content/plugins/enlighter/`
89
* Changed: moved experimental settings into panel "Beta"
910
* Removed: outdated translations
1011
* Bugfix: styles of the "plugin upgrade notification" were broken

class/EnvironmentCheck.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ public function check(){
7676
}
7777
}
7878

79+
// plugin path wp-content/plugins/enlighter ?
80+
if (strpos(__DIR__, 'enlighter/class') === false){
81+
$errors[] = __('The plugin is located within an invalid path - the <code>enlighter/</code> directory name is <strong>mandatory</strong>', 'enlighter');
82+
}
83+
7984
return array(
8085
'errors' => $errors,
8186
'warnings' => $warnings

lang/Enlighter.pot

Lines changed: 106 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ msgid ""
22
msgstr ""
33
"Content-Type: text/plain; charset=UTF-8\n"
44
"Content-Transfer-Encoding: 8bit\n"
5-
"POT-Creation-Date: 2018-06-14 08:32:03+00:00\n"
5+
"POT-Creation-Date: 2018-09-06 12:47:14+00:00\n"
66
"PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
77
"MIME-Version: 1.0\n"
8-
"Project-Id-Version: Enlighter 3.7\n"
8+
"Project-Id-Version: Enlighter 3.8\n"
99
"Report-Msgid-Bugs-To: andi DOT dittrich AT a3non DOT org\n"
1010
"Last-Translator: Andi Dittrich\n"
1111

@@ -41,7 +41,7 @@ msgstr ""
4141
msgid "External Themes"
4242
msgstr ""
4343

44-
#: views/admin/SettingsPage.phtml:38
44+
#: views/admin/SettingsPage.phtml:39
4545
msgid "Enlighter - Customizable Syntax Highlighter"
4646
msgstr ""
4747

@@ -77,6 +77,10 @@ msgstr ""
7777
msgid "Autoset Permissions failed - Please change the directory permission (chmod <code>0644</code> or <code>0777</code>) manually!"
7878
msgstr ""
7979

80+
#: class/EnvironmentCheck.php:81
81+
msgid "The plugin is located within an invalid path - the <code>enlighter/</code> directory name is <strong>mandatory</strong>"
82+
msgstr ""
83+
8084
#: class/TinyMCE.php:131
8185
msgid "Enlighter Codeblocks"
8286
msgstr ""
@@ -165,6 +169,46 @@ msgstr ""
165169
msgid "Info-button"
166170
msgstr ""
167171

172+
#: views/admin/Beta.phtml:5
173+
msgid "BETA Features"
174+
msgstr ""
175+
176+
#: views/admin/Beta.phtml:8
177+
msgid "Warning: These options are for advanced users only and subjected to change!"
178+
msgstr ""
179+
180+
#: views/admin/Beta.phtml:11
181+
msgid "Dynamic Resource Invocation (DRI)"
182+
msgstr ""
183+
184+
#: views/admin/Beta.phtml:12
185+
msgid "To optimize your website load-time it`s possible to load the EnlighterJS script dependencies only if they are required (requires script-position: footer)."
186+
msgstr ""
187+
188+
#: views/admin/Beta.phtml:13
189+
msgid "In case it`s enable, the plugin will observer it`s invocation (visual editor, shortcodes, markdown)."
190+
msgstr ""
191+
192+
#: views/admin/Beta.phtml:15
193+
msgid "Enable DRI"
194+
msgstr ""
195+
196+
#: views/admin/Beta.phtml:18
197+
msgid "Gutenberg Editor Plugin"
198+
msgstr ""
199+
200+
#: views/admin/Beta.phtml:19
201+
msgid "To use EnlighterJS within Gutenberg you can enable this feature. It loads the EnlighterJS Gutenberg.Plugin."
202+
msgstr ""
203+
204+
#: views/admin/Beta.phtml:20
205+
msgid "Warning: Please keep in mind that this version of Enlighter Plugin.Gutenberg is still BETA software and may have some serious bugs!"
206+
msgstr ""
207+
208+
#: views/admin/Beta.phtml:22
209+
msgid "Enable"
210+
msgstr ""
211+
168212
#: views/admin/Compatibility.phtml:5
169213
msgid "Compatibility Mode / 3rd Party Migration"
170214
msgstr ""
@@ -501,30 +545,6 @@ msgstr ""
501545
msgid "Enable I18n"
502546
msgstr ""
503547

504-
#: views/admin/Options.phtml:83
505-
msgid "EXPERIMENTAL OPTIONS"
506-
msgstr ""
507-
508-
#: views/admin/Options.phtml:86
509-
msgid "Warning: These options are for advanced users only and subjected to change!"
510-
msgstr ""
511-
512-
#: views/admin/Options.phtml:89
513-
msgid "Dynamic Resource Invocation (DRI)"
514-
msgstr ""
515-
516-
#: views/admin/Options.phtml:90
517-
msgid "To optimize your website load-time it`s possible to load the EnlighterJS script dependencies only if they are required (requires script-position: footer)."
518-
msgstr ""
519-
520-
#: views/admin/Options.phtml:91
521-
msgid "In case it`s enable, the plugin will observer it`s invocation (visual editor, shortcodes, markdown)."
522-
msgstr ""
523-
524-
#: views/admin/Options.phtml:93
525-
msgid "Enable DRI"
526-
msgstr ""
527-
528548
#: views/admin/Related.phtml:4
529549
msgid "Enlighter Related"
530550
msgstr ""
@@ -557,31 +577,26 @@ msgstr ""
557577
msgid "Options"
558578
msgstr ""
559579

560-
#: views/admin/SettingsPage.phtml:39
580+
#: views/admin/SettingsPage.phtml:35
581+
msgid "BETA"
582+
msgstr ""
583+
584+
#: views/admin/SettingsPage.phtml:40
561585
msgid "Select the content you want to highlight and Enlighter takes care of the rest."
562586
msgstr ""
563587

564-
#: views/admin/SettingsPage.phtml:107
588+
#: views/admin/SettingsPage.phtml:112
565589
msgid "is developed by"
566590
msgstr ""
567591

568-
#: views/admin/SettingsPage.phtml:108
592+
#: views/admin/SettingsPage.phtml:113
569593
msgid "It`s released under the terms of the %s. "
570594
msgstr ""
571595

572-
#: views/admin/SettingsPage.phtml:108
596+
#: views/admin/SettingsPage.phtml:113
573597
msgid "MIT X11 License"
574598
msgstr ""
575599

576-
#: views/admin/SettingsPage.phtml:109 views/admin/SettingsPage.phtml:110
577-
#: views/admin/SettingsPage.phtml:111
578-
msgid "License"
579-
msgstr ""
580-
581-
#: views/admin/SettingsPage.phtml:110 views/admin/SettingsPage.phtml:111
582-
msgid "by"
583-
msgstr ""
584-
585600
#: views/admin/SystemInfo.phtml:4
586601
msgid "System Info"
587602
msgstr ""
@@ -590,60 +605,64 @@ msgstr ""
590605
msgid "PHP Version:"
591606
msgstr ""
592607

593-
#: views/admin/SystemInfo.phtml:12
594-
msgid "Server Software:"
608+
#: views/admin/SystemInfo.phtml:13 views/admin/SystemInfo.phtml:15
609+
msgid "PHP JSON Extension"
595610
msgstr ""
596611

597-
#: views/admin/SystemInfo.phtml:15
598-
msgid "Enlighter Plugin Version:"
612+
#: views/admin/SystemInfo.phtml:13
613+
msgid "available"
599614
msgstr ""
600615

601-
#: views/admin/SystemInfo.phtml:18
602-
msgid "EnlighterJS Version:"
616+
#: views/admin/SystemInfo.phtml:15
617+
msgid "not installed"
603618
msgstr ""
604619

605-
#: views/admin/SystemInfo.phtml:21
606-
msgid "TinyMCE Extension:"
620+
#: views/admin/SystemInfo.phtml:19
621+
msgid "Server Software:"
607622
msgstr ""
608623

609-
#: views/admin/SystemInfo.phtml:25 views/admin/SystemInfo.phtml:27
610-
msgid "Cache writeable"
624+
#: views/admin/SystemInfo.phtml:29
625+
msgid "Enlighter Plugin Version:"
611626
msgstr ""
612627

613-
#: views/admin/SystemInfo.phtml:25
614-
msgid "true"
628+
#: views/admin/SystemInfo.phtml:32
629+
msgid "EnlighterJS Version:"
615630
msgstr ""
616631

617-
#: views/admin/SystemInfo.phtml:27
618-
msgid "false"
632+
#: views/admin/SystemInfo.phtml:35
633+
msgid "TinyMCE Extension:"
619634
msgstr ""
620635

621-
#: views/admin/SystemInfo.phtml:32 views/admin/SystemInfo.phtml:34
622-
msgid "JSON Extension"
636+
#: views/admin/SystemInfo.phtml:38
637+
msgid "Gutenberg Extension:"
623638
msgstr ""
624639

625-
#: views/admin/SystemInfo.phtml:32
626-
msgid "installed"
640+
#: views/admin/SystemInfo.phtml:42 views/admin/SystemInfo.phtml:44
641+
msgid "Cache writeable"
627642
msgstr ""
628643

629-
#: views/admin/SystemInfo.phtml:34
630-
msgid "not installed"
644+
#: views/admin/SystemInfo.phtml:42
645+
msgid "true"
631646
msgstr ""
632647

633-
#: views/admin/SystemInfo.phtml:40 views/admin/SystemInfo.phtml:42
634648
#: views/admin/SystemInfo.phtml:44
649+
msgid "false"
650+
msgstr ""
651+
652+
#: views/admin/SystemInfo.phtml:50 views/admin/SystemInfo.phtml:52
653+
#: views/admin/SystemInfo.phtml:54
635654
msgid "Shortcode Processor"
636655
msgstr ""
637656

638-
#: views/admin/SystemInfo.phtml:40
657+
#: views/admin/SystemInfo.phtml:50
639658
msgid "disabled"
640659
msgstr ""
641660

642-
#: views/admin/SystemInfo.phtml:42
661+
#: views/admin/SystemInfo.phtml:52
643662
msgid "WordPress internal"
644663
msgstr ""
645664

646-
#: views/admin/SystemInfo.phtml:44
665+
#: views/admin/SystemInfo.phtml:54
647666
msgid "Enlighter low-level"
648667
msgstr ""
649668

@@ -795,7 +814,7 @@ msgstr ""
795814
msgid "Font Styles"
796815
msgstr ""
797816

798-
#: views/admin/VisualEditing.phtml:34
817+
#: views/admin/VisualEditing.phtml:37
799818
msgid "Font-Family"
800819
msgstr ""
801820

@@ -804,23 +823,23 @@ msgstr ""
804823
msgid "e.g. Monaco, Courier, Monospace"
805824
msgstr ""
806825

807-
#: views/admin/VisualEditing.phtml:37
826+
#: views/admin/VisualEditing.phtml:40
808827
msgid "Font-Size"
809828
msgstr ""
810829

811830
#: views/admin/ThemeCustomizer.phtml:39 views/admin/ThemeCustomizer.phtml:70
812831
msgid "e.g. 12px, 1.2em, 11pt"
813832
msgstr ""
814833

815-
#: views/admin/VisualEditing.phtml:40
834+
#: views/admin/VisualEditing.phtml:43
816835
msgid "Line height"
817836
msgstr ""
818837

819838
#: views/admin/ThemeCustomizer.phtml:42 views/admin/ThemeCustomizer.phtml:73
820839
msgid "e.g. 16px, 1.5em"
821840
msgstr ""
822841

823-
#: views/admin/VisualEditing.phtml:43
842+
#: views/admin/VisualEditing.phtml:46
824843
msgid "Font-Color"
825844
msgstr ""
826845

@@ -841,7 +860,7 @@ msgstr ""
841860
msgid "RAW Font Styles"
842861
msgstr ""
843862

844-
#: views/admin/VisualEditing.phtml:46
863+
#: views/admin/VisualEditing.phtml:49
845864
msgid "Background-Color"
846865
msgstr ""
847866

@@ -1018,46 +1037,54 @@ msgid "Add Editor Formats"
10181037
msgstr ""
10191038

10201039
#: views/admin/VisualEditing.phtml:24
1021-
msgid "By default, the <kbd>tab</kbd> button does not add indentation to the content. Enlighter comes with its own editing plugin which allows you to use tabs within the Editor to align code."
1040+
msgid "The default keyboard shortcut (shift+alt+x) action can be modified to convert the current selection into an Enlighter codeblock."
10221041
msgstr ""
10231042

10241043
#: views/admin/VisualEditing.phtml:25
1044+
msgid "Enable Keyboard Shortcut"
1045+
msgstr ""
1046+
1047+
#: views/admin/VisualEditing.phtml:27
1048+
msgid "By default, the <kbd>tab</kbd> button does not add indentation to the content. Enlighter comes with its own editing plugin which allows you to use tabs within the Editor to align code."
1049+
msgstr ""
1050+
1051+
#: views/admin/VisualEditing.phtml:28
10251052
msgid "This option disables the <strong>tabfocus plugin</strong> and requires that the Enlighter <code>indent</code> option has been set to spaces!"
10261053
msgstr ""
10271054

1028-
#: views/admin/VisualEditing.phtml:26
1055+
#: views/admin/VisualEditing.phtml:29
10291056
msgid "Enable Tab Indentation"
10301057
msgstr ""
10311058

1032-
#: views/admin/VisualEditing.phtml:29
1059+
#: views/admin/VisualEditing.phtml:32
10331060
msgid "Code-Block Styles"
10341061
msgstr ""
10351062

1036-
#: views/admin/VisualEditing.phtml:30
1063+
#: views/admin/VisualEditing.phtml:33
10371064
msgid "It is also possible to influence the code-block styles of the Visual-Editor. Maybe you like another background color or font-family."
10381065
msgstr ""
10391066

1040-
#: views/admin/VisualEditing.phtml:34
1067+
#: views/admin/VisualEditing.phtml:37
10411068
msgid "e.g. \"Source Code Pro\", \"Liberation Mono\", \"Courier New\", Courier, monospace"
10421069
msgstr ""
10431070

1044-
#: views/admin/VisualEditing.phtml:37
1071+
#: views/admin/VisualEditing.phtml:40
10451072
msgid "e.g. 0.7em"
10461073
msgstr ""
10471074

1048-
#: views/admin/VisualEditing.phtml:40
1075+
#: views/admin/VisualEditing.phtml:43
10491076
msgid "e.g. 1.4em"
10501077
msgstr ""
10511078

1052-
#: views/admin/VisualEditing.phtml:43
1079+
#: views/admin/VisualEditing.phtml:46
10531080
msgid "e.g. #565b60"
10541081
msgstr ""
10551082

1056-
#: views/admin/VisualEditing.phtml:46
1083+
#: views/admin/VisualEditing.phtml:49
10571084
msgid "e.g. #f7f7f7"
10581085
msgstr ""
10591086

1060-
#: views/admin/VisualEditing.phtml:49
1087+
#: views/admin/VisualEditing.phtml:52
10611088
msgid "Restore defaults"
10621089
msgstr ""
10631090

0 commit comments

Comments
 (0)