This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function extract() { | |
echo "Estraggo $1.rar" | |
unrar e "./$1.rar" \*.txt \*.wav './clips-mitads/' -o+ | |
} | |
if [ ! -d './clips-mitads' ]; then | |
mkdir './clips-mitads' | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Error For WP backend | |
Plugin URI: https://github.com/Mte90/ | |
Description: Wrap the PHP errors in the WP admin backend with the native notice | |
Author: Mte90 | |
Version: 1.0.0 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function remove_block_gutenberg( $content, $blockname ) { | |
$blockname = str_replace('/', '\/',preg_quote($blockname)); | |
return preg_replace('/\<\!\-\- ' . $blockname . '[^)]+\/' . $blockname . ' \-\-\>/', '', $content); | |
} | |
// Based on this ticket https://wordpress.org/support/topic/strip-table-of-content-from-excerpt/ | |
// There is a block that we don't want on excerpt automatically generated, | |
// Automatic excerpt cut the content and this can generate a broken content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
today=$(date +"%Y-%m-%d") | |
path=$(date +"%Y/%m/%d") | |
rm -rf ./backups | |
mkdir ./backups | |
tar --exclude='./public_html/cgi-bin' --exclude='*.zip' --exclude='./public_html/wp-content/cache' -zcvf ./backups/$today.tar.gz ./public_html > /dev/null | |
./wp db export --add-drop-table --path=./public_html/ - | gzip > "./backups/$today.sql.gz" | |
curl --user "user:pass" -T "./backups/$today.tar.gz" "https://domain.com/remote.php/webdav/folder/$path/domain-$today.tar.gz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mysql --user='[users]' --password='[psw]' --database='[db]' --execute="UPDATE user SET verification_token = NULL WHERE user.verification_token IS NOT NULL;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# If the branch is not master, execute phpmetrics and upoload everything on the VPS | |
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') | |
if [ $current_branch != "master" ]; then | |
sshpass -p your-password ssh user@domain.tld mkdir -p /var/www/your-path/status/master/ | |
sshpass -p your-password rsync --progress -avzP /home/your-user/.cache/QualityAnalyzer/assets -e ssh user@domain.tld:/var/www/your-metrics/status/$current_branch/ > /dev/null | |
sshpass -p your-password rsync --progress -avzP /home/your-user/.cache/QualityAnalyzer/index.html -e ssh user@domain.tld:/var/www/your-metrics/status/$current_branch/ > /dev/null | |
/usr/bin/phpmd /var/www/VVV/www/site/public_html/wp-content/plugins/your-plugin/ xml /CodeatCS/codeat-phpmd.xml --exclude vendor,tests --reportfile /tmp/phpmd-analysis.xml | |
/home/your-user/.cache/QualityAnalyzer/bin/analyze analyze /var/www/VVV/www/site/public_html/wp-content/plugins/your-plugin/ --exclude=vendor,tests --exclude_analyzers=cpd,pdepend,checkst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cd /opt/mozita/ | |
cd ./mozitaantispam_bot/ | |
git fetch --all | |
if [[ $(git rev-list HEAD...origin/master --count) -ne 0 ]]; then | |
pkill -f antispam_mozita.py | |
git stash | |
git pull |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# This script injects a file into the current Apache2 environment temporarily | |
# in order to check its syntax. | |
# | |
# INSTALL: | |
# sed -i "2i ServerName example.com" /etc/apache2/sites-available/000-default.conf | |
# Require adding this line to the example conf | |
# | |
# USAGE: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Plugin Name: Better errors | |
* Description: Better errors in log | |
* Author: Daniele Scasciafratte | |
* Version: 1.0 | |
* Author URI: http://codeat.co | |
*/ | |
function handleError($code, $description, $file = null, $line = null, $context = null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: WooCommerce Colonna IVA | |
* Description: Aggiunge una colonna nei prodotti WooCommerce | |
* Version: 1.0.0 | |
* Author: LUGRieti | |
* Author URI: | |
* Requires at least: 4.9 | |
* Tested up to: 4.9 | |
* |