Top Tweets for #WPCode
@ShifuMusaWP the function code you gave is truly awesome, the only issue is you need to add it manually and inside the function of the theme and so i made a plugin with it
Make it easy to use and it been effective on 6 websites i tried on
still setting it up for general use

I wrote the code below for my WordPress Site speed optimization, If your site is slow in loading, put the code in your theme "function.php" and thank me later.
You can use #wpcode or #snippet plugin to add the code to your site.
Remember to give feedback in the comment section.
#Code
// Optimize site speed with conditional script loading and other optimizations
function optimize_site_speed() {
// Conditional Script Loading
add_action('wp_enqueue_scripts', function () {
// Get page context
global $post;
$is_home = is_front_page();
$is_single = is_singular('post');
$is_page = is_page();
$is_archive = is_archive();
$page_slug = $is_page && $post ? $post->post_name : '';
// Define scripts and their required pages
$script_conditions = array(
// Example: Replace 'your-script-handle' with actual script handles
'your-script-handle' => array(
'load_on' => array(
'is_home' => true, // Load on homepage
'is_single' => false,
'is_archive' => false,
'specific_pages' => array('about', 'contact'), // Load on specific page slugs
)
),
'another-script-handle' => array(
'load_on' => array(
'is_home' => false,
'is_single' => true, // Load on single posts
'is_archive' => true,
'specific_pages' => array(),
)
),
// Add more scripts as needed
);
// Dequeue scripts based on conditions
foreach ($script_conditions as $handle => $conditions) {
$should_load = false;
// Check page conditions
if ($conditions['load_on']['is_home'] && $is_home) {
$should_load = true;
} elseif ($conditions['load_on']['is_single'] && $is_single) {
$should_load = true;
} elseif ($conditions['load_on']['is_archive'] && $is_archive) {
$should_load = true;
} elseif ($is_page && in_array($page_slug, $conditions['load_on']['specific_pages'])) {
$should_load = true;
}
// Dequeue script if it shouldn't load
if (!$should_load) {
wp_dequeue_script($handle);
wp_deregister_script($handle);
}
}
}, 999); // High priority to ensure dequeuing happens after enqueuing
// Add cache headers for static assets
add_action('template_redirect', function () {
if (!is_admin()) {
$cacheable_types = array(
'css' => 'text/css',
'js' => 'application/javascript',
'jpg|jpeg|png|gif|svg|webp' => 'image',
'woff|woff2|ttf|otf|eot' => 'font'
);
$uri = $_SERVER['REQUEST_URI'];
foreach ($cacheable_types as $extension => $mime) {
if (preg_match("/\.($extension)$/", $uri)) {
header('Cache-Control: public, max-age=31536000'); // Cache for 1 year
header("Expires: " . gmdate('D, d M Y H:i:s', time() + 31536000) . " GMT");
break;
}
}
}
});
// Remove query strings from static resources for better caching
add_filter('script_loader_src', 'remove_query_strings_from_static_resources', 15, 1);
add_filter('style_loader_src', 'remove_query_strings_from_static_resources', 15, 1);
}
// Helper function to remove query strings
function remove_query_strings_from_static_resources($src) {
if (strpos($src, '?ver=') || strpos($src, '&ver=')) {
$src = remove_query_string($src, 'ver');
}
return $src;
}
function remove_query_string($src, $key) {
$parts = explode('?', $src);
if (count($parts) > 1) {
$params = array();
parse_str($parts[1], $params);
unset($params[$key]);
$new_query = http_build_query($params);
return $parts[0] . ($new_query ? '?' . $new_query : '');
}
return $src;
}
add_action('init', 'optimize_site_speed');
Connect @GravityView & your #WordPress plugins with #NoCode like:
- Form entry approved > Add to @MailerLite
- Form entry disapproved > Add post card through #Blockli
- Form entry approved > Activate #WPCode snippet
More info:π
https://t.co/z0Ssf3gLig
#automator #marketing #form

Connect @wpcharitable & your #WordPress plugins with #NoCode like:
- Make a donation > Add user to @ActiveCampaign
- Make a donation > Add as @easyaffapp affiliate
- Make a donation > Activate #WPCode snippet
More info:π
https://t.co/07iT2FFUAJ
#automator #fundraising #marketing

Another Wordpress plugin exploited, stealing credit card info from e-commerce sites
https://t.co/MinEiTQkXm
#wordpress #plugin #exploit #dessky #securi #woocommerce #wpcode #vextrio #sign1 #DataBreach#cyber#breakingnews#gdpr#OSINT#infosec#Opsec#digitalsecurity #security

π₯ New Episode on RackNerdTV! β
βοΈ How to Setup WP-Code Plugin for WordPress π»π | πΊβΆ WATCH HERE: https://t.co/V59qzNr7iT
π ORDER CPANEL HOSTING https://t.co/4wMQvGQwlg
#RackNerd #wpcode #snippet #snippets #wordpress #wordpresssnippets #codingsnippets

Connect @wpcharitable & your #WordPress plugins with #NoCode like:
- Make a donation > Add user to @ActiveCampaign
- Make a donation > Add as @easyaffapp affiliate
- Make a donation > Activate #WPCode snippet
More info:π
https://t.co/07iT2FFmLb
#automator #fundraising #marketing

Connect @GravityView & your #WordPress plugins with #NoCode like:
- Form entry approved > Add to @MailerLite
- Form entry disapproved > Add post card through #Blockli
- Form entry approved > Activate #WPCode snippet
More info:π
https://t.co/z0Ssf3gLig
#automator #marketing #form

[#HighSeverity] #WordPress #WPCode #Plugin < 2.0.13. 1Β is #vulnerable to Cross Site Scripting (#XSS)
https://t.co/TSiCxEd5xY
Message me if you need help monitoring your #website(s) for #Security, #Plugin, #Theme, #WPCore, #PHP #vulnerabilities.
#wordpresssecurity
WordPress Code Snippets Plugin Vulnerability: 1 Million Sites Compromised - https://t.co/QtFtyJosHQ
WordPress #WPCode Plugin Found Vulnerable β 1 Million Sites Affected.
Know how it happened and how to fix this #vulnerability.
#WordPress #WebSecurity

Vulnerability discovered in WPCode - Insert Headers & Footers WordPress plugin for the second time in 2023.
#wordpress #wpcode #plugin #wordpressdevelopment #header #wordpresswebsite

#WPCode <= 2.0.8 - Cross-Site Request Forgery (#CSRF)
https://t.co/Reolv1VuQU
Message me if you need help monitoring your #website(s) for #Security, #Plugin, #Theme, #WPCore, #PHP #vulnerabilities.
#wordpresssecurity #wordpressmonitoring #wordpressmaintenance
The best way to add a custom code to #WordPress website is to:
1. Use the functions.php file of a child theme
2. A custom plugin
3. A WordPress plugin, my best is #WPCode
Editting a parent theme file isn't a good practice because when you update the theme, the code is removed
How to Properly Disable Lazy Load in WordPress?
https://t.co/KEfjIavHe0
#WordPress #Plugin #WPCode #Snippet #Websites

How to Delay Posts From Appearing in WordPress RSS Feed?
https://t.co/SJcx2BKdbr
#WordPress #RSS #Feed #WPCode #Plugin

#WPCode < 2.0.7 - Contributor+ WPCode Library Auth Key Update/Deletion
https://t.co/XVepv7wKy9
Message me if you need help monitoring your #website(s) for #Security, #Plugin, #Theme, #WPCore, #PHP #vulnerabilities.
#wordpresssecurity #wordpressmonitoring #wordpressmaintenance
How to Delay Posts From Appearing in WordPress RSS Feed?
https://t.co/5wpfT4092v
#WordPress #RSS #Feed #WPCode #Plugin

How to Disable Google Fonts on Your WordPress Website?
https://t.co/gR2KrgYM3X
#WordPress #GoogleFonts #Plugin #Website #WPCode

Como aΓ±adir un enlace personalizado a un menΓΊ de WordPress #GenesisWP #WordPress #WPmenu #WPcode https://t.co/ULf56cB9F9
Last Seen Hashtags on Sotwe
bodymodifications
Seen from Japan
mama #puta
Seen from Mexico
sitpop
Seen from United Kingdom
omegle
Seen from United States
Ψ³ΩΨ¨Ψ±ΩΨ§ΫΩ
Seen from Qatar
baitedboys
Seen from Germany
COCKSHOCK
Seen from United Kingdom
trisha thevidiyamunda
Seen from India
γΆγ£γγ
Seen from Japan
FearRTs
Seen from United States
Trends for you
Most Popular Users

Elon Musk 
@elonmusk
240.6M followers

Barack Obama 
@barackobama
119.2M followers

Donald J. Trump 
@realdonaldtrump
111.7M followers

Cristiano Ronaldo 
@cristiano
110.7M followers

Narendra Modi 
@narendramodi
107M followers

Rihanna 
@rihanna
97.7M followers

NASA 
@nasa
92.2M followers

Justin Bieber 
@justinbieber
90.9M followers

KATY PERRY 
@katyperry
87.7M followers

Taylor Swift 
@taylorswift13
81.5M followers

Lady Gaga 
@ladygaga
73.1M followers

Virat Kohli 
@imvkohli
69.9M followers

Kim Kardashian 
@kimkardashian
69.8M followers

YouTube 
@youtube
68.7M followers

Bill Gates 
@billgates
63.9M followers

Neymar Jr 
@neymarjr
62.7M followers

The Ellen Show
@theellenshow
62.4M followers

CNN 
@cnn
61.9M followers

X 
@x
60.8M followers

Selena Gomez 
@selenagomez
60.8M followers












