Make your plugin compatible with LS4/da: Difference between revisions
From LimeSurvey Manual
Maren.fritz (talk | contribs) Created page with "<center>File:path_possiblity.png</center>" |
Maren.fritz (talk | contribs) Created page with "Nogle plugin-begivenheder fra LS3 blev forældet. Brug de nye plugin-begivenheder introduceret i LS4 til at erstatte de gamle plugin-begivenheder. For mere information se vor..." |
||
Line 34: | Line 34: | ||
Nogle plugin-begivenheder fra LS3 blev forældet. Brug de nye plugin-begivenheder introduceret i LS4 til at erstatte de gamle plugin-begivenheder. | |||
For | For mere information se vores udviklingsmanual om [[Plugin_events|plugin begivenheder]]. | ||
== | ==Udgåede funktioner og metoder== | ||
Revision as of 12:44, 29 December 2023
Tekniske ændringer
Den nye XML-konfigurationsfil
Siden LimeSurvey 4.0 har plugins brug for en XML-konfigurationsfil for at blive kørt i applikationen.
Årsagen til dette er muligheden for at gemme metadataoplysninger såsom plugin-forfatter, support-e-mail eller opdateringsoplysninger.
Denne XML-fil er obligatorisk i LimeSurvey 4. Den skal være placeret i pluginnets rodbibliotek. For mere information se plugin-udviklingen plugins
Eksempel:

Den nye plugin-mappe
Plugin-mappen er ændret i LimeSurvey 4. Af sikkerhedsmæssige årsager er plugin-mappen nu placeret i upload-mappen (/upload/plugins) på grund af den nye plugin-manager (Plugin-uploader). For manuelle uploads anbefaler vi at uploade dine filer til den nye mappe for at undgå softwarefejl.
Sørg for at ændre eller tilføje den nye mappe, hvis den er hårdkodet i dit plugin.
Eksempel:

De nye plugin-begivenheder
Nogle plugin-begivenheder fra LS3 blev forældet. Brug de nye plugin-begivenheder introduceret i LS4 til at erstatte de gamle plugin-begivenheder. For mere information se vores udviklingsmanual om plugin begivenheder.
Udgåede funktioner og metoder
Since the code base or structure of LimeSurvey 4 changed, there are a lot of methods or functions that are not used anymore. To fix this problem, you need to enable the debug mode on the config.php file first and then go to the plugin page. Any method that does not exit anymore will be shown on the error page.
Some of the methods are renamed in LS4 or are not used anymore. To be sure that your plugin works for both LS3 & LS4, check the version of LS before calling the method you need.
Example:

Best Practice
Avoid SVG files
For security (XSS) reasons, the upload of SVG Files is not possible. The Plugin uploader will ignore SVG files. Replace them by PNG or JPEG files. The upload of SVG files is possible only if you have access to the installation directory via ftp or other server tools (Upload any files at your own risks).
Avoid global constants
Avoid the use of global constants that can collapse with variables of the core application or other plugins like „ROOT_PATH“. Don‘t use global constant in general for plugin development.
Use Namespaces
Use namespace for better organization by grouping classes that work together to perform a task in your plugin. In that way you avoid using classes that are being used already in the core application.
Example:

