no_update ) ) { foreach ( $plugin_info->no_update as $plugin ) { $slugs[] = $plugin->slug; } } if ( isset( $plugin_info->response ) ) { foreach ( $plugin_info->response as $plugin ) { $slugs[] = $plugin->slug; } } return $slugs; } private function _get_items_from_wp( $args = array() ) { $tab = LP_Helper::sanitize_params_submitted( $_REQUEST['tab'] ?? '' ); if ( empty( $tab ) ) { return; } global $learn_press_add_ons; $plugins = learn_press_get_add_ons_from_wp( $args ); if ( ( $tab == 'bundle_activate' ) && sizeof( $plugins ) ) { $_plugins = array_values( $plugins ); $plugins = array(); $bundle_activate = $learn_press_add_ons['bundle_activate']; for ( $n = sizeof( $_plugins ), $i = $n - 1; $i >= 0; $i-- ) { foreach ( $bundle_activate as $slug ) { if ( ( false !== strpos( $slug, $_plugins[ $i ]->slug ) ) || ( false !== strpos( $_plugins[ $i ]->slug, $slug ) ) ) { $plugins[] = $_plugins[ $i ]; } } } } $this->items = $plugins; } private function _get_items_from_thimpress( $add_ons ) { $cache = WP_CONTENT_DIR . '/upgrade/' . md5( serialize( $add_ons ) ) . '.cache'; $timeover = HOUR_IN_SECONDS * 24; if ( file_exists( $cache ) && ( time() - filemtime( $cache ) ) < $timeover ) { $items = LP_Helper::maybe_unserialize( file_get_contents( $cache ) ); } else { $repo_url = 'http://thimpress.com/lprepo/'; foreach ( $add_ons as $slug ) { if ( false !== strpos( $slug, '.php' ) ) { $filename = basename( $slug ); $slug = dirname( $slug ); } else { $filename = "{$slug}.php"; } $item = array( 'name' => '', 'slug' => '', 'version' => '0.0', 'author' => 'thimpress', 'author_profile' => 'http://profiles.wordpress.org/thimpress', 'contributors' => array(), 'requires' => '4.0', 'tested' => '4.2.2', 'rating' => 0, 'num_ratings' => 0, 'ratings' => array( '5' => 0, '4' => 0, '3' => 0, '2' => 0, '1' => 0, ), 'active_installs' => 0, 'last_updated' => gmdate( 'Y-m-d h:iA', strtotime( 'last Friday', time() ) ) . ' GMT', 'homepage' => 'http://thimpress.com/learnpress', 'short_description' => '', 'icons' => array( '2x' => LP_PLUGIN_URL . '/assets/images/icon-128x128.png', '1x' => LP_PLUGIN_URL . '/assets/images/icon-128x128.png', ), ); $readme = $this->upgrader->get_plugin_info( $repo_url . "/{$slug}.zip", $filename ); $item['name'] = $readme['name']; $item['slug'] = $slug; if ( preg_match( '!