Skip to content

Instantly share code, notes, and snippets.

View vovafeldman's full-sized avatar
🔥
Making sh*t happen

Vova Feldman vovafeldman

🔥
Making sh*t happen
View GitHub Profile
@vovafeldman
vovafeldman / gist.php
Created November 8, 2020 13:14 — forked from mecha/gist.php
Freemius - Free plugin updates blocked if premium and free versions do not match
<?php
// Functions that you'll need
function get_free_version() { /* ... */ }
function get_premium_version() { /* ... */ }
function is_free_plugin($plugin_basename) { /* ... */ }
// Filter the value of the transient where WordPress stores pending updates
add_filter('site_transient_update_plugins', function ($value) {
// Only proceed if the transient has responses from update servers
@vovafeldman
vovafeldman / freemius-api-license-validation.php
Last active October 2, 2024 11:04
Validates a license key using Freemius API using the PHP SDK
<?php
// Freemius PHP SDK - https://github.com/Freemius/freemius-php-sdk
require_once './php-sdk-master/freemius/Freemius.php';
define( 'FS__API_SCOPE', 'developer' );
define( 'FS__API_DEV_ID', 1234 );
define( 'FS__API_PUBLIC_KEY', 'pk_YOUR_PUBLIC_KEY' );
define( 'FS__API_SECRET_KEY', 'sk_YOUR_SECRET_KEY' );
// Init SDK.
<?php
my_fs()->add_filter( 'show_deactivation_feedback_form', '__return_false' );
@vovafeldman
vovafeldman / my.cnf
Created February 21, 2022 17:30 — forked from chrisl8888/my.cnf
my.cnf file optimized for InnoDB 64bit setups
# forked from http://forge.mysql.com/tools/tool.php?id=137
[client]
#password = [your_password]
port = 3306
socket = /tmp/mysqld.sock
# *** Application-specific options follow here ***
#
<?php
namespace Blocksy;
/*
*/
class Capabilities {
private $accounts_cache = null;
@vovafeldman
vovafeldman / detect_playground.php
Created November 23, 2023 10:23 — forked from alanef/detect_playground.php
Detect WP Playground
<?php
if ( 'PHP.wasm' === $_SERVER['SERVER_SOFTWARE'] && 'playground.wordpress.net' === $_SERVER['HTTP_HOST'] ) {
// inside playground.wordpress.net
}