1

We have a tight budget for a new Craft 3 site. How can the paid plugins be filtered from the store, so we can review only the free ones?

4

I'm afraid you can not. But a bit of PHP and the plugin store's API url shows you the list of plugins of which the first edition is free (or go to this page):

<?php

 $perPage = 100;
 $page = 1;

 $done = false;
 while (!$done) {
   $url = 'https://api.craftcms.com/v1/plugin-store/plugins?perPage=' . $perPage . '&page=' . $page . '&orderBy=name&direction=asc';
   $response = json_decode(file_get_contents($url));

   if (isset($response->plugins) && !empty($response->plugins)) {
     foreach ($response->plugins as $plugin) {
       if ($plugin->editions[0]->price === null) {
         echo '<strong>' . $plugin->name . '</strong><br />';
         echo $plugin->shortDescription . '<br />';
         echo '<a href="https://plugins.craftcms.com/' . $plugin->handle . '" target="_blank">Show me more</a><br /><br />';
       }
     }
   }

   if ($response->totalResults <= ($perPage * ($page))) {
     $done = true;
   }

   $page++;
 }
| improve this answer | |
  • 1
    Well done, Paul. – Brad Bell Feb 15 at 0:46
  • Thanks, Brad :) – Paul Feb 15 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.