Skip to content

Instantly share code, notes, and snippets.

View ohid's full-sized avatar

Ohidul Islam ohid

View GitHub Profile
<?php
/**
* Plugin Name: [Defender Pro] - Fix Current User IP
* Plugin URI: https://premium.wpmudev.org/
* Description: This plugin is specially integrated with the Defender Pro plugin that sets the current user IP
* Task: SLS-1326
* Version: 1.0.0
* Author: Ohid @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
<?php
/**
* Plugin Name: [Defender Pro] - Fix Current User IP
* Plugin URI: https://premium.wpmudev.org/
* Description: This plugin is specially integrated with the Defender Pro plugin that sets the current user IP
* Task: SLS-1326
* Version: 1.0.0
* Author: Ohid @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
@ohid
ohid / reset-user-login-cookie.php
Last active December 21, 2020 05:00
It will override the new login cookie set hook that set by the WooCommerce Payments or any other plugin during login request
@ohid
ohid / wd-fix-current-user-ip.php
Last active December 31, 2020 15:45
Use this code snippet to set the current user IP correctly.
<?php
/**
* Plugin Name: [Defender Pro] - Fix Current User IP
* Plugin URI: https://premium.wpmudev.org/
* Description: This plugin is specially integrated with the Defender Pro plugin that sets the current user IP
* Task: SLS-1326
* Version: 1.0.0
* Author: Ohid @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
@ohid
ohid / custom-redirect-based-on-form-selection.php
Last active January 25, 2021 07:45
[Forminator] - Custom Form Redirect Based On Submitted Form Data
<?php
/**
* Plugin Name: [Forminator] - Custom Form Redirect Based On Submitted Form Data
* Plugin URI: https://premium.wpmudev.org/
* Description: Adds custom redirect to Forms based on submitted data
* Task: SLS-1147
* Version: 1.0.0
* Author: Panos Lyrakis & Ohid @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
<?php
/**
* Plugin Name: [Defender Pro] - Fix masked login URL page style on BuddyBoss theme
* Author: Ohid @ WPMUDEV
* Author URI: https://premium.wpmudev.org
* License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
@ohid
ohid / redirect-desktop-users-except-for-specific-users.php
Last active September 20, 2020 10:36
The code will redirect visitors from desktop devices but not for a specific user. Change the $my_ip to your own IP.
<?php
// Redirect mobile visitors to your desktop site
function wimtec_mobile_redirect() {
// My IP
$my_ip = '90.22.192.117';
// Get the client IP
$client_ip = $_SERVER['REMOTE_ADDR']?:($_SERVER['HTTP_X_FORWARDED_FOR']?:$_SERVER['HTTP_CLIENT_IP']);
<?php
/**
* Script Name: [Forminator Pro] Make fields read only
* Script URI: https://premium.wpmudev.org/
* Description: This is a mu-plugin that makes the selected fields not editable/read only.
* Author: Ohidul Islam @ WPMU DEV
* Version: 0.1
* Author URI: https://premium.wpmudev.org/
*
*/
@ohid
ohid / show_site_id_on_admin_bar.php
Last active September 5, 2020 09:46
This is a mu-plugin that shows the current site id in the admin bar on right side, only useful for multisites.
<?php
/**
* Script Name: Show Site ID on Admin Bar
* Script URI: https://premium.wpmudev.org/
* Description: This is a mu-plugin that shows the current site id in the admin bar on right side, only useful for multisites.
* Author: Ohidul Islam @ WPMU DEV
* Version: 0.1
* Author URI: https://premium.wpmudev.org/
*
*/
@ohid
ohid / wpmudev-hide-plugins.php
Created August 17, 2020 03:46
Hide the specific plugins from the list of plugins page in WordPress. Use this as a mu-plugin
<?php
if( ! function_exists('wpmudev_hide_plugins') ) {
function wpmudev_hide_plugins() {
global $wp_list_table;
$hidearr = array(
'wpmudev-updates/update-notifications.php',
'ultimate-branding/ultimate-branding.php',
'snapshot-backups/snapshot-backups.php',
'forminator/forminator.php',