Skip to content

Instantly share code, notes, and snippets.

View SpartakusMd's full-sized avatar

Marin Bînzari SpartakusMd

View GitHub Profile
@SpartakusMd
SpartakusMd / wp-disable-update.php
Created December 7, 2015 16:16
Disable Wordpress plugin update (ex: WPPUM)
<?php
function filter_plugin_updates( $value ) {
unset( $value->response['wp-popup-magic/wp-popup-magic.php'] );
return $value;
}
add_filter( 'site_transient_update_plugins', 'filter_plugin_updates' );
@SpartakusMd
SpartakusMd / .maintenance
Created November 3, 2015 12:41
Enable Worpress Maintenance mode
<?php
$upgrading = time() + 100;
?>
@SpartakusMd
SpartakusMd / ajax_queue.js
Created August 5, 2015 11:08
Run queued AJAX requests
$(function () {
//setup an array of AJAX options, each object is an index that will specify information for a single AJAX request
var ajaxes = [{ url : '<url>', dataType : 'json' }, { url : '<url2>', dataType : 'xml' }],
current = 0;
//declare your function to run AJAX requests
function do_ajax() {
//check to make sure there are more requests to make
if (current < ajaxes.length) {
@SpartakusMd
SpartakusMd / rm-attack.php
Last active August 29, 2015 14:23
PHP script to remove one line virus attacks
<?php
/**
* Usage:
* php rm-attack.php [pattern] [directory]
*
* php rm-attack.php '<?php $ctddbnvbtj' .
*
* At the end, a report file './report.log' will be generated with the list of files that were modified
*/
@SpartakusMd
SpartakusMd / template
Last active August 29, 2015 14:23
VHost template
<VirtualHost *:80>
ServerName template.url
ServerAlias www.template.url
ServerAdmin template.email
DocumentRoot template.webroot
<Directory template.webroot/>
Options +FollowSymLinks
AllowOverride All