Skip to content

Instantly share code, notes, and snippets.

View flyingwebie's full-sized avatar
:octocat:
Coding coding coding...bug

Flying Web Solutions flyingwebie

:octocat:
Coding coding coding...bug
  • flyingwebsolutions
  • Cork
View GitHub Profile
@marijn
marijn / README.markdown
Last active October 1, 2023 13:42
List of countries in YAML, CSV and TXT format
@mattclements
mattclements / function.php
Last active April 16, 2024 17:04
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}
@nbeers22
nbeers22 / remove-meta-wordpress.php
Last active July 3, 2023 23:10
Remove all the extra bloat of meta tags that WordPress adds to the <head> and disables the JSON API
<?php
// remove some meta tags from WordPress
remove_action('wp_head', 'wp_generator');
function remove_dns_prefetch( $hints, $relation_type ) {
if ( 'dns-prefetch' === $relation_type ) {
return array_diff( wp_dependencies_unique_hosts(), $hints );
}
return $hints;
}
@cartpauj
cartpauj / mepr-active-memberships.php
Created March 7, 2018 15:51
Get a list of the current user's active MemberPress Subscriptions
<?php
if(class_exists('MeprUtils')) {
$user = MeprUtils::get_currentuserinfo();
if($user !== false && isset($user->ID)) {
//Returns an array of Membership ID's that the current user is active on
//Can also use 'products' or 'transactions' as the argument type
$active_prodcuts = $user->active_product_subscriptions('ids');
if(!empty($active_prodcuts)) {
Name : Finding vulnerabilities in PHP scripts FULL ( with examples )
Author : SirGod
Email : sirgod08@gmail.com
Contents :
1) About
2) Some stuff
3) Remote File Inclusion
3.0 - Basic example
3.1 - Simple example
@cartpauj
cartpauj / memberpress-footer-tracking-script-thank-you-page.php
Created May 1, 2019 19:23
MemberPress footer tracking scripts on the thank you page
@giovanni-d
giovanni-d / allinonemigration.md
Last active May 28, 2024 16:55
All-in-One WP Migration - Restore From Server (without PRO version) - Restore

All-in-One WP Migration Restore From Server (without pro version)

If you don't want to pay for the PRO version of this plugin, and you want to use the "Restore from Server" functionally that was present in the version 6.77, follow the instructions below:

  1. Open the js file: wp-content/plugins/all-in-one-wp-migration/lib/view/assets/javascript/backups.min.js
  2. On line 1208, replace the code below:
$('.ai1wm-backup-restore').click(function (e) {

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@yankiara
yankiara / oxygen-repeater-dynamic-query.php
Last active September 6, 2023 19:25
Use dynamic queries with Oxygen's repeater
/* I'll put here different examples of dynamic query for Oxygen repeater :
* - Use one of the following repeater_dynamic_query definitions
* in code block just BEFORE the repeater
* - Set the repeater custom query settings : post type, number of posts, order...
* - Add the remove_action in a code block AFTER the repeater
*/
/****************************************************************************************************
* Display related posts for any CPT with taxonomy:
@aleua
aleua / oxygen-repeater-dynamic-query.php
Created June 11, 2020 09:00 — forked from yankiara/oxygen-repeater-dynamic-query.php
Use dynamic queries with Oxygen's repeater
/*
* Example of related posts repeater for any CPT with taxonomy:
* - Filter query to prevent altering queries inside the repeater items,
* - Retrieve post category slug : I have only one for each post, so I just take first element.
* (You might need to add error tests, of course, if you don't accept empty results,
* for instance if you forgot to set post category.)
* - Set tax_query arg with category slug
* - Set random order
* - Exclude current post
* - Deactivate pagination