src/Controller/PluginUpdateController.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Component\HttpFoundation\JsonResponse;
  4. use Symfony\Component\HttpFoundation\Request;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. class PluginUpdateController
  7. {
  8.     /**
  9.      * @Route("/updates/better-wordpress-plugin/plugin-update.json", name="plugin_update_json")
  10.      */
  11. public function getPluginUpdateJson(Request $request): JsonResponse
  12. {
  13.     $response = [
  14.         'name' => 'Better Wordpress Plugin',
  15.         'version' => '2.3.1',
  16.         'download_url' => 'https://my.freelinelab.pl/wp-plugins/better-wordpress-plugin/better-wordpress.zip',
  17.         'requires' => '6.0',
  18.         'tested' => '6.6.2'
  19.         'requires_php' => '8.0',
  20.         'last_updated' => date('Y-m-d H:i:s'),
  21.         'sections' => [
  22.             'description' => 'Kompleksowe ulepszenie WordPressa: zaawansowane ustawienia, optymalizacja wydajności, integracja z Google, tryb konserwacji i wiele więcej.',
  23.             'installation' => "<ol><li>Wgraj pliki wtyczki do katalogu `/wp-content/plugins/better-wordpress-plugin/`</li><li>Aktywuj wtyczkę w panelu 'Wtyczki' w WordPressie\n</li><li>Przejdź do ustawień wtyczki, aby skonfigurować jej opcje</li></ol>",
  24.             'changelog' => file_get_contents('https://my.freelinelab.pl/wp-plugins/better-wordpress-plugin/changelog.txt')
  25.         ],
  26.         'icons' => [
  27.             '1x' => 'https://my.freelinelab.pl/wp-plugins/better-wordpress-plugin/icon-128x128.gif',
  28.             '2x' => 'https://my.freelinelab.pl/wp-plugins/better-wordpress-plugin/icon-256x256.gif'
  29.         ],
  30.         'banners' => [
  31.             
  32.         ],
  33.         'compatibility' => [
  34.             '6.6' => ['6.6''6.6.1''6.6.2'],
  35.             '6.5' => ['6.5''6.5.1''6.5.2'],
  36.             '6.4' => ['6.4''6.4.1''6.4.2']
  37.         ]
  38.     ];
  39.     return new JsonResponse($response);
  40. }
  41. }