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 / 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
}
<?php
namespace Blocksy;
/*
*/
class Capabilities {
private $accounts_cache = null;
@vovafeldman
vovafeldman / my.cnf
Created February 21, 2022 17:30 — forked from chrisjlee/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 ***
#
@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 / sp-edd-fs.php
Created September 10, 2020 11:10 — forked from shamim2883/sp-edd-fs.php
Redirect EDD license renew request to Freemius
<?php
add_action('add_meta_boxes', function(){
add_meta_box('sp_edd_fs_metabox', 'Freemius data', 'sp_edd_fs_metabox', 'download', 'side', 'default' );
});
function sp_edd_fs_metabox( $post ){
$plugin_id = get_post_meta( $post->ID, '_sp_edd_fs_plugin_id', true );
$coupon = get_post_meta( $post->ID, '_sp_edd_fs_coupon', true );
@vovafeldman
vovafeldman / .env
Created December 16, 2018 12:47 — forked from xplodedthemes/.env
Ticksy External Purchase Verification Freemius Integration
FS_API_SCOPE="developer"
FS_API_DEV_ID=000
FS_API_PUBLIC_KEY=""
FS_API_SECRET_KEY=""
TICKSY_SECRET_KEY=""
@vovafeldman
vovafeldman / freemius-api-client.rb
Created December 19, 2016 23:25 — forked from cyberhobo/freemius-api-client.rb
Basis for a Ruby Freemius HTTP API client.
module Freemius
API_HOST = 'api.freemius.com'
SANDBOX_HOST = 'sandbox-api.freemius.com'
class Base
# Options taken from http://docs.freemius.apiary.io/#introduction/the-authentication-header
# * host Default is api.freemius.com
# * api_version Default is v1
# * scope_entity Default is 'plugin'. Could also be 'developer', 'install', 'site', 'user'
# * scope_entity_id Required.