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
<?php
add_action('wp_footer','custom_js_form_validation');
function custom_js_form_validation(){
?>
<script>
jQuery( document ).ready(function($) {
@alfredo-wpmudev
alfredo-wpmudev / forminator-populate-usermeta.php
Created September 28, 2022 23:40 — forked from wpmudev-sls/forminator-populate-usermeta.php
[Forminator] - Auto populate fields with usermeta.
<?php
/**
* Plugin Name: [Forminator] - Auto populate fields with usermeta.
* Plugin URI: https://premium.wpmudev.org/
* Description: Autopopulate Forminator fields with usermeta.
* Author: Panos Lyrakis, Prashant Singh @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*/
@alfredo-wpmudev
alfredo-wpmudev / frmt-limit-form-sub.php
Created July 8, 2023 19:25 — forked from wpmudev-sls/frmt-limit-form-sub.php
Forminator - Limit form submissions per IP for 24 hours.
<?php
/**
* Plugin Name: Forminator
* Description: Limit form submissions per IP for 24 hours.
* Author: Konstantinos Xenos @ WPMUDEV
* Author URI: https://premium.wpmudev.org
* License: GPLv2 or later
*/
<?php
add_filter( 'forminator_custom_form_submit_errors', function( $submit_errors, $form_id, $field_data_array ) {
// Add your form IDs here.
$form_ids = array( 842 );
// Change this to the message that you want to show.
$message = 'You cannot submit more than 5 times within 30 days.';
if ( in_array( intval( $form_id ), $form_ids, true ) ) {
$user_ip = Forminator_Geo::get_user_ip();
<?php
/**
* Plugin Name: [Forminator] - Limit the submition by email.
* Description: [Forminator] - Limit the submition by email.
* Author: Thobk @ WPMUDEV
* Author URI: https://premium.wpmudev.org
* License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
@alfredo-wpmudev
alfredo-wpmudev / forminator-custom-uploads.php
Created July 12, 2023 23:06 — forked from wpmudev-sls/forminator-custom-uploads.php
[Forminator Pro] - Change Upload Path. This snippet should be changing the Forminator upload path to wp-content/YOUR_PATH. By default it's wp-content/forminator
<?php
/**
* Plugin Name: [Forminator Pro] - Change Upload Path
* Plugin URI: https://premium.wpmudev.org/
* Description: This snippet should be changing the Forminator upload path to wp-content/YOUR_PATH. By default it's wp-content/forminator
* Task: 0/11289012348292/1168134495134017
* Version: 1.0.0
* Author: Panos Lyrakis @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
<?php
/**
* Plugin Name: Forminator smsportal integration ( Custom )
* Description: This is a really simple example of integration, full doc https://docs.smsportal.com/recipes/send-smses-using-php
* Version: 1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@alfredo-wpmudev
alfredo-wpmudev / hummingbird-minify-oom-fix.php
Created July 16, 2023 23:31 — forked from wpmudev-sls/hummingbird-minify-oom-fix.php
[Hummingbird Pro] Fix OOM error when a huge amount of wphb_minify_group posts are present
<?php
/**
* Plugin Name: [Hummingbird Pro] Fix OOM error when a huge amount of wphb_minify_group posts are present
* Description: Limits the query that retrieves the minify groups to 10 to prevent an excessive resource usage on the server
* Author: Anderson Salas @ WPMUDEV
* Task: SLS-4065, SLS-4071
* Author URI: https://premium.wpmudev.org
* License: GPLv2 or later
*/
<?php
/**
* Plugin Name: [Forminator] - Remove field IDs from header row values
* Plugin URI: https://premium.wpmudev.org/
* Description: Removes field IDs from header row values of googlesheet
* Task: SLS-4106
* Author: Prashant Singh @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*/
@alfredo-wpmudev
alfredo-wpmudev / wp-dir-file-permissions-reset.php
Created October 21, 2023 22:08 — forked from ali7ali/wp-dir-file-permissions-reset.php
WordPress Directories & Files Permissions reset
<?php // phpcs:ignore -- \r\n notice.
/**
* Plugin Name: WordPress Directories & Files Permissions reset
* Description: Correct WordPress directories/files permissions.
* Author: Ali Ali