Skip to content

Instantly share code, notes, and snippets.

View alfredo-wpmudev's full-sized avatar
🏠
Working from home

Alfredo Galano Loyola alfredo-wpmudev

🏠
Working from home
View GitHub Profile
@alfredo-wpmudev
alfredo-wpmudev / Suspicious_javascript_encoded.txt
Created June 19, 2024 18:58
Suspicious Javascript Encoded and Decoded versions. https://www.urldecoder.org/
// <![CDATA[
createInlineScriptElement("var%20LEO_HIGHLIGHTS_DEBUG%20%3D%20true%3B%0Avar%20LEO_HIGHLIGHTS_DEBUG_POS%20%3D%20false%3B%0Avar%20LEO_HIGHLIGHTS_INFINITE_LOOP_COUNT%20%3D%20300%3B%0Avar%20LEO_HIGHLIGHTS_MAX_HIGHLIGHTS%20%3D%20200%3B%0Avar%20LEO_HIGHLIGHTS_IFRAME_ID%20%3D%20%22leoHighlights_iframe%22%3B%0Avar%20LEO_HIGHLIGHTS_IFRAME_DIV_ID%20%3D%20%22leoHighlights_iframe_modal_div_container%22%3B%0Avar%20LEO_HIGHLIGHTS_SHOW_DELAY_MS%20%3D%20300%3B%0Avar%20LEO_HIGHLIGHTS_HIDE_DELAY_MS%20%3D%20750%3B%0Avar%20LEO_HIGHLIGHTS_BACKGROUND_STYLE_DEFAULT%20%3D%20%22transparent%20none%20repeat%20scroll%200%25%200%25%22%3B%0Avar%20LEO_HIGHLIGHTS_BACKGROUND_STYLE_HOVER%20%3D%20%20%20%22rgb%28245%2C245%2C0%29%20none%20repeat%20scroll%200%25%200%25%22%3B%0Avar%20_leoHighlightsPrevElem%20%3D%20null%3B%0A%0A/**%0A%20*%20General%20method%20used%20to%20debug%20exceptions%0A%20*%20%0A%20*%20@param%20location%0A%20*%20@param%20e%0A%20*%20@return%0A%20*/%0Afunction%20_leoHighlightsReportExeception%28location%2Ce%29%0
@alfredo-wpmudev
alfredo-wpmudev / wpmudev_chat_ai_footer_injection.php
Created June 19, 2024 00:43
Inject the AI Assistant in a page if it has specific Custom Field(Meta Data)
@alfredo-wpmudev
alfredo-wpmudev / wpmudev_chat_ai_injection.php
Created June 19, 2024 00:39
AI Chat Assistant using Shortcode. [iframe-chat link='https://URL_FOR_IFRAME']
<?php
/**
* Plugin Name: Shortcode for Iframe Chat
* Description: Display iframe using a shortcode to insert in a page or post or any place that accept shortcodes.
* Version: 0.1
* Author: Alfredo Galano Loyola
* Author URI: https://wpmudev.com
*/
function listing_iframe_chat($atts) {
$default = array(
@alfredo-wpmudev
alfredo-wpmudev / forminator_sph_cyl_logic.php
Last active June 5, 2024 17:01
Forminator SPH and CYL Logic and conditionals
<?php
/*
Plugin Name: Forminator Lens SPH and CYL logic conditions
Version: 0.1
Description: Forminator Lens SPH and CYL logic conditions
Author: Alfredo Galano Loyola
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
defined('ABSPATH') || exit;
@alfredo-wpmudev
alfredo-wpmudev / wpmudev_server_cache.php
Last active June 2, 2024 20:00
Clear Static Server Cache and Object Cache(Only site Administrators)
<?php
/**
* Plugin Name: WPMUDEV Hosting Clear Static Server Cache and Object Cache
* Description: Adds a button to the WordPress Admin Bar to clear WPMUDEV Hosting Static Server Cache and Object Cache.
* Version: 1.0
* Author: Alfredo Galano Loyola | WPMUDEV
* Author URI: https://wpmudev.com/
*/
function cwpai_add_clear_static_cache_button() {
@alfredo-wpmudev
alfredo-wpmudev / convert_csv_to_json.php
Last active May 26, 2024 19:14
Convert a CSV file with two columns, where column A is the source URL and column B is the destination
<?php
/**
* Settings your variables
* $csv_file handles the name of your CSV file.
* $csv_separator is the symbol used to sepparate the columns in the CSV file.
* $sc_redirect_file is the final file you will need to import in Smartcrawl Pro -> Tools -> URL Redirection
*/
$csv_file = "redirect_list.csv";
$csv_separator = ";";
$sc_redirect_file = "sc_redirect.json";
@alfredo-wpmudev
alfredo-wpmudev / redirect_guest_visitor.php
Last active May 23, 2024 04:58
Custom redirect for guest visitors and in logout.
<?php
/**
* Plugin Name: Custom Guess Redirector
* Description: Redirect guess visitor to the Home Page or custom page, same after user logout will be redirected to a custom page.
* Version: 1.0.0
* Author: Alfredo Galano Loyola
* Author URI: https://wpmudev.com
* License: GPL v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
@alfredo-wpmudev
alfredo-wpmudev / forminator_show_entries_ip.php
Created May 15, 2024 18:38
Show entry IP in the Forminator Submission without the need to add any extra fiekd
<?php
/**
* Plugin Name: [Forminator Pro] - Show IPs on the submission list
* Plugin URI: https://premium.wpmudev.org/
* Description: Show IPs on the submission list
* Author: Alfredo Galano Loyola | @WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*/
<?php
/**
* Plugin Name: [Forminator] - Pagination skip empty pages
* Plugin URI: https://premium.wpmudev.org
* Description: A custom snippet that allows skipping empty pages when Pagination is used.
* Task: SLS-2198
* Author: Panos Lyrakis @ WPMUDEV
* Author URI: https://premium.wpmudev.org
* License: GPLv2 or later
*/
@alfredo-wpmudev
alfredo-wpmudev / forminator_order_number.php
Last active May 13, 2024 03:17
Custom submission id as order number, available to display it with the tag {order}
<?php
/**
* Plugin Name: [Forminator] - Custom submission id as order number
* Description: [Forminator] - Custom submission id as order number, available to display it with the tag {order}
* Jira: SLS-224
* Author: Thobk | Alfredo Galano Loyola @ WPMUDEV
* Author URI: https://premium.wpmudev.org
* License: GPLv2 or later
*/
if (!defined('ABSPATH')) {