Current user in plugin returns NULL

Wait for the action plugins_loaded before you create the class instance. The pluggable functions are loaded at this time. From wp-settings.php: /** * Fires once activated plugins have loaded. * * Pluggable functions are also available at this point in the loading order. * * @since 1.5.0 */ do_action( ‘plugins_loaded’ ); I would even wait … Read more

WordPress Plug-In Active installation count

The active install count is updated daily based on update checks from real active installs on active sites. Sites that do not receive any visit on a given day don’t count, neither do sites that have just installed the plugin and haven’t checked for updates yet. The download count is always much higher than active … Read more

rms_unique_wp_mu_pl_fl_nm.php

I just encountered the same issue. After quick analysis I found that this file is allowing remote access of your website to a third party which is pretty much dangerous. This is found in wordpress websites that are using nulled wordpress plugins. This file is being generated from these two files bundled inside nulled plugins: … Read more

Bulk Image Uploader to create new post from each image [closed]

add_action(‘add_attachment’, ‘create_post’); function create_post( $attach_ID ) { $attachment = get_post( $attach_ID ); $my_post_data = array( ‘post_title’ => $attachment->post_title, ‘post_type’ => ‘post’, ‘post_category’ => array(‘0’), ‘post_status’ => ‘publish’ ); $post_id = wp_insert_post( $my_post_data ); // attach media to post wp_update_post( array( ‘ID’ => $attach_ID, ‘post_parent’ => $post_id, ) ); set_post_thumbnail( $post_id, $attach_ID ); return $attach_ID; }

Display price range on woocommerce product variations

try it like this: /** * This code should be added to functions.php of your theme **/ add_filter(‘woocommerce_variable_price_html’, ‘custom_variation_price’, 10, 2); function custom_variation_price( $price, $product ) { $price=””; if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) $price .= ‘<span class=”from”>’ . _x(‘From’, ‘min_price’, ‘woocommerce’) . ‘ </span>’; $price .= woocommerce_price($product->get_price()); if ( $product->max_variation_price && $product->max_variation_price … Read more