: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @copyright Copyright (c) 2015, Freemius, Inc.
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
if ( ! defined( 'ABSPATH' ) ) {
if ( ! function_exists( 'fs_get_plugins' ) ) {
* @author Leo Fajardo (@leorw)
* @param bool $delete_cache
function fs_get_plugins( $delete_cache = false ) {
$cached_plugins = wp_cache_get( 'plugins', 'plugins' );
if ( ! is_array( $cached_plugins ) ) {
$cached_plugins = array();
if ( isset( $cached_plugins[ $plugin_folder ] ) ) {
$plugins = $cached_plugins[ $plugin_folder ];
if ( ! function_exists( 'get_plugins' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
$plugins = get_plugins();
if ( $delete_cache && is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
wp_cache_delete( 'plugins', 'plugins' );