- Ensure Python3.x and the requests library is installed.
- Create a personal access token and give it the
gistspermission. - Store the access token in the
GITHUB_TOKENenvironment value - Run the script
python3 delete-gists.py| <?php | |
| /* | |
| Plugin Name: Cache Headers | |
| Description: Sets Cache-Control headers on all GET requests for logged-out visitors | |
| Author: Danny van Kooten | |
| Author URI: https://dannyvankooten.com/ | |
| Private: True | |
| */ | |
| add_filter('wp_headers', function ($headers) { |
| <?php | |
| /* | |
| Plugin Name: Stop Comment Spam | |
| Author: Danny van Kooten | |
| Author URI: https://www.dannyvankooten.com/ | |
| Private: True | |
| */ | |
| /** | |
| * @param mixed $approved One of 1, 0, 'spam', 'trash', WP_Error |
| window.fetch('https://api.wordpress.org/plugins/info/1.2/?action=query_plugins&per_page=500&search=forms').then(r => r.json()).then(d => { | |
| let sortedPlugins = d.plugins.sort((a, b) => a.downloaded < b.downloaded); | |
| console.log("plugins", sortedPlugins); | |
| console.log(sortedPlugins.map(p => `${p.name} (${p.slug}): ${Math.round(p.downloaded/1000)}K downloads`).join("\n")); | |
| }); |
gists permission.GITHUB_TOKEN environment valuepython3 delete-gists.py