Skip to content

Instantly share code, notes, and snippets.

View xxsimoxx's full-sized avatar

SIMONE FIORAVANTI xxsimoxx

  • Gieffe edizioni srl
  • Italy
View GitHub Profile
@xxsimoxx
xxsimoxx / class-classicpress-releases.php
Last active March 8, 2024 15:31
Class to get a list of all CP releases and to get the migration URL from a release.
<?php
class ClassicPressReleases {
/**
* Get migration URL fetching created_at from api.github.com.
*
* @param string $version Version to retrive migration URL.
*
* @return string|bool URL for release. Empty string if no release found. False on API failure.
*/
public static function getMigrationFromCPVersion($version) {
@xxsimoxx
xxsimoxx / cp_versions_util.php
Last active March 6, 2024 13:28
Functions to get a list of all CP releases and to get the migration URL from a release.
/**
* Get a list of ClassicPress released versions from api-v1.classicpress.net.
*
* @return array|false Array of CP versions or false on API failure.
*/
function get_cp_versions() {
$response = wp_remote_get('https://api-v1.classicpress.net/v1/upgrade/index.php', ['timeout'=>3]);
if (is_wp_error($response) || empty($response)) {
return false;
@xxsimoxx
xxsimoxx / test-ap.php
Last active April 20, 2023 11:51
Test Application Passwords
<?php
/**
* Plugin Name: Test Application Password
*/
namespace XXSimoXX\testAP;
if (!defined('ABSPATH')){
die('-1');
};
@xxsimoxx
xxsimoxx / estraibollettini.pl
Created March 1, 2022 08:10
Separa un PDF in due files in base a step.
#!/usr/bin/perl
use strict;
use warnings;
use PDF::API2;
my ($pdf, $step) = @ARGV;
if (not defined $pdf) {
die "Need file name\n";
@xxsimoxx
xxsimoxx / fix.php
Created October 6, 2021 14:49
Fix (the worst way) troubles with untrusted certificates in ClassicPress.
<?php
/**
* Plugin Name: twk
*
* Description: Fix (the worst way) troubles with untrusted certificates in ClassicPress.
*
*/
if (!defined('ABSPATH')){
die('-1');