/** * Checks the other WP RSS Aggregator add-ons and deactivates those that have become useless. * * @since 1.0 */ public function check_other_addons() { // Allow plugins to be activated if using imported feed items if ( wprss_ftp_using_feed_items() ) return; // Disabled add-ons tracker $addons = array(); // List of add-ons to be disabled $addons_to_disable = apply_filters( 'wprss_ftp_addons_to_disable', self::$ADDONS_TO_DISABLE ); // Disable add-ons foreach ( $addons_to_disable as $file => $name) { // Categories //$active_plugins = get_option('active_plugins'); //$key = array_search( $file, $active_plugins ); //if ( $key !== FALSE ) { if ( is_plugin_active( $file ) ) { deactivate_plugins( $file ); array_push( $addons, $name ); } } // If any add-ons have been disabled if ( count( $addons ) > 0 ) { self::$disabled_addons = $addons; add_action( 'all_admin_notices', array( self::get_instance(), 'notify_about_disabled_addons' ) ); } }
/** * @param SimplePie_Item $item The feed item to prepare * @since 3.5 */ protected static function _prepareItem( $item ) { $event = WPRSS_FTP::do_action( 'converter_prepare_item_before', array( 'item' => $item ) ); self::_keepItemContentHtmlAttributes( $item ); $event = WPRSS_FTP::do_action( 'converter_prepare_item_after', $event->args ); }
/** * Renders the activate/deactivate license button. * * @since 1.0 */ public function license_activation_callback() { $status = WPRSS_FTP::get_instance()->get_license_status(); if ( $status === 'site_inactive' ) $status = 'inactive'; $valid = $status == 'valid'; $btn_text = $valid ? 'Deactivate License' : 'Activate License'; $btn_name = 'wprss_ftp_license_' . ( $valid? 'deactivate' : 'activate' ); wp_nonce_field( 'wprss_ftp_license_nonce', 'wprss_ftp_license_nonce' ); ?> <input type="submit" class="button-secondary" name="<?php echo $btn_name; ?>" value="<?php _e( $btn_text, WPRSS_TEXT_DOMAIN ); ?>" /> <span id="wprss-ftp-license-status-text"> <strong>Status: <span class="wprss-ftp-license-<?php echo $status; ?>"> <?php _e( ucfirst($status), 'wprss' ); ?> <?php if ( $status === 'valid' ) : ?> <i class="fa fa-check"></i> <?php elseif( $status === 'invalid' ): ?> <i class="fa fa-times"></i> <?php elseif( $status === 'inactive' ): ?> <i class="fa fa-warning"></i> <?php endif; ?> </strong> </span> </span> <style type="text/css"> .wprss-ftp-license-valid { color: green; } .wprss-ftp-license-invalid { color: #b71919; } .wprss-ftp-license-inactive { color: #d19e5b; } #wprss-ftp-license-status-text { margin-left: 8px; line-height: 27px; vertical-align: middle; } </style> <?php }