Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond. I am also slow as a person.

Salvatore Capolupo salvatorecapolupo

💭
I may be slow to respond. I am also slow as a person.
Block or report user

Report or block salvatorecapolupo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View sderenato
.----------------. .----------------. .----------------. .----------------. .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |
| | _______ | || | ________ | || | _________ | || | _______ | || | _________ | |
| | / ___ | | || | |_ ___ `. | || | |_ ___ | | || | |_ __ \ | || | |_ ___ | | |
| | | (__ \_| | || | | | `. \ | || | | |_ \_| | || | | |__) | | || | | |_ \_| | |
| | '.___`-. | || | | | | | | || | | _| _ | || | | __ / | || | | _| _ | |
| | |`\____) | | || | _| |___.' / | || | _| |___/ | | || | _| | \ \_ | || | _| |___/ | | |
| | |_______.' | || | |________.' | || | |_________| | || | |____| |___| | || | |_________| | |
| | | || | | || | | || | | || | | |
| '--------------' || '--------------' || '--------------' || '--------------' || '--------------' |
@salvatorecapolupo
salvatorecapolupo / htaccess sal
Created Mar 18, 2020
HTACCESS standard senza HTTP/HTTPS mixed content - https://overstep.it
View htaccess sal
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2020
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://seoagentur-hamburg.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################
@salvatorecapolupo
salvatorecapolupo / post-identity.php
Last active Mar 6, 2020
This is an automated heavy metal verses generator, based on a very basic pseudo-crawler (pseudo AI involved). Step 1: select a random band on darklyrics.com Step 2) pick an album 3) extract 3 not contiguous verses 4) show it! This script needs https://sourceforge.net/projects/simplehtmldom/
View post-identity.php
<?PHP
/*
Post-Identity Dark Lyrics Generator
Author: Salvatore Capolupo
Version 1.1
Date: 03/06/2020
Loosely based on Uncreative Writing: Managing Language in the Digital Age by Kenneth Goldsmith
*/
include_once ( "simple_html_dom.php" );
@salvatorecapolupo
salvatorecapolupo / WordPress analysis without login data
Created Mar 5, 2020
Using basic REST API in WordPress for getting some data for SEO website audit, security checks etc.
View WordPress analysis without login data
You can use REST API, i.e mybeatifulwebsite.com
- mybeatifulwebsite.com/wp-json/wp/v2/users will give all users in JSON format (no emails included)
- mybeatifulwebsite.com/wp-json/wp/v2/categories will list all categories list in JSON format
- mybeatifulwebsite.com/wp-json/wp/v2/tags will list all tags list in JSON format
- wp-json/wp/v2/posts will lists latest posts, very similar to /rss or /feed but in JSON
- wp-json/wp/v2/media will list all media files (images, ecc.) in JSON format
Source: https://developer.wordpress.org/rest-api/
View Plugin WordPress - Default header (Copy&Paste)
/*
Plugin Name:
Plugin URI: http://capolooper.it
Description:
Version: 1.0
Author: Salvalupo Capotore
Author URI: http://capolooper.it
License: GPLv2
*/
View WordPress SAFE mode
<?PHP
// hide all errors / warning in WP, useful for production websites
// file: wp-config.php
ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_LOG', false);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);
@salvatorecapolupo
salvatorecapolupo / gist:8ea42445d9fe1cce5991250876fd5b0d
Created Dec 8, 2019
Most common script JS/ CSS styles loaded by wordpress plugins and theme. Mantain them on every page just if really needed. Useful while using i.e Assets Cleanup plugin for improving PageSpeed Insights
View gist:8ea42445d9fe1cce5991250876fd5b0d
- Handle: cookie-law-info, cookie-law-info-gdpr - CSS/JS for Cookie Privacy plugin
- Handle: jetpack-photon: Jetpack CDN
- to be continued
@salvatorecapolupo
salvatorecapolupo / Ebook gratuiti per SEO e web-marketing in italiano
Last active Nov 21, 2019
Ebook per studiare la SEO ed il web marketing, in italiano. Lista aggiornata al 21 novembre 2019. Suggerisci una risorse (purchè sia gratuita) a s.capolupo@gmail.com, se ti va ;-)
We couldn’t find that file to show.
@salvatorecapolupo
salvatorecapolupo / referrer-basis-redirect
Created Sep 21, 2019
This is useful for some backlinks "recovery".
View referrer-basis-redirect
<?PHP
function smart_seo_redirect(){
if ( isset($_SERVER['HTTP_REFERER']) ){
$referrer = $_SERVER['HTTP_REFERER'];
$parse = parse_url($referrer);
$referrer = $parse['host'];
$matches = [];
$matches[]= preg_match('/cool_referral_name/', $referrer, $matches);
@salvatorecapolupo
salvatorecapolupo / FAQPage-rich-snippets.php
Created Sep 21, 2019
Dynamic WordPress FAQPage Rich Snippets - use this in a plugin or functions.php
View FAQPage-rich-snippets.php
<?PHP
function add_rich_snippets_content( $content ) {
global $post;
$post_ID = $post->ID;
$page_title = get_the_title ( $post_ID );
$page_object = get_post( $post_ID );
$page_excerpt = wp_strip_all_tags ( $page_object->post_content );
$page_excerpt = preg_split ("/\s/", $page_excerpt);
You can’t perform that action at this time.