public static function get_remote_post_params()
 {
     global $wpdb;
     if (!function_exists('get_plugins')) {
         require_once ABSPATH . 'wp-admin/includes/plugin.php';
     }
     $plugin_list = get_plugins();
     $site_url = get_bloginfo("url");
     $plugins = array();
     $active_plugins = get_option('active_plugins');
     foreach ($plugin_list as $key => $plugin) {
         $is_active = in_array($key, $active_plugins);
         //filter for only gravityforms ones, may get some others if using our naming convention
         if (strpos(strtolower($plugin["Title"]), "gravity forms") !== false) {
             $name = substr($key, 0, strpos($key, "/"));
             $plugins[] = array("name" => $name, "version" => $plugin["Version"], "is_active" => $is_active);
         }
     }
     $plugins = json_encode($plugins);
     //get theme info
     $theme = wp_get_theme();
     $theme_name = $theme->get("Name");
     $theme_uri = $theme->get("ThemeURI");
     $theme_version = $theme->get("Version");
     $theme_author = $theme->get("Author");
     $theme_author_uri = $theme->get("AuthorURI");
     $form_counts = GFFormsModel::get_form_count();
     $active_count = $form_counts["active"];
     $inactive_count = $form_counts["inactive"];
     $fc = abs($active_count) + abs($inactive_count);
     $entry_count = GFFormsModel::get_lead_count_all_forms("active");
     $im = is_multisite();
     $post = array("of" => "gravityforms", "key" => self::get_key(), "v" => self::$version, "wp" => get_bloginfo("version"), "php" => phpversion(), "mysql" => $wpdb->db_version(), "version" => "2", "plugins" => $plugins, "tn" => $theme_name, "tu" => $theme_uri, "tv" => $theme_version, "ta" => $theme_author, "tau" => $theme_author_uri, "im" => $im, "fc" => $fc, "ec" => $entry_count, "emc" => self::get_emails_sent(), "api" => self::get_api_calls());
     return $post;
 }
 public static function get_remote_post_params()
 {
     global $wpdb;
     if (!function_exists('get_plugins')) {
         require_once ABSPATH . 'wp-admin/includes/plugin.php';
     }
     $plugin_list = get_plugins();
     $site_url = get_bloginfo('url');
     $plugins = array();
     $active_plugins = get_option('active_plugins');
     foreach ($plugin_list as $key => $plugin) {
         $is_active = in_array($key, $active_plugins);
         //filter for only gravityforms ones, may get some others if using our naming convention
         if (strpos(strtolower($plugin['Title']), 'gravity forms') !== false) {
             $name = substr($key, 0, strpos($key, '/'));
             $plugins[] = array('name' => $name, 'version' => $plugin['Version'], 'is_active' => $is_active);
         }
     }
     $plugins = json_encode($plugins);
     //get theme info
     $theme = wp_get_theme();
     $theme_name = $theme->get('Name');
     $theme_uri = $theme->get('ThemeURI');
     $theme_version = $theme->get('Version');
     $theme_author = $theme->get('Author');
     $theme_author_uri = $theme->get('AuthorURI');
     $form_counts = GFFormsModel::get_form_count();
     $active_count = $form_counts['active'];
     $inactive_count = $form_counts['inactive'];
     $fc = abs($active_count) + abs($inactive_count);
     $entry_count = GFFormsModel::get_lead_count_all_forms('active');
     $im = is_multisite();
     $post = array('of' => 'gravityforms', 'key' => self::get_key(), 'v' => self::$version, 'wp' => get_bloginfo('version'), 'php' => phpversion(), 'mysql' => $wpdb->db_version(), 'version' => '2', 'plugins' => $plugins, 'tn' => $theme_name, 'tu' => $theme_uri, 'tv' => $theme_version, 'ta' => $theme_author, 'tau' => $theme_author_uri, 'im' => $im, 'fc' => $fc, 'ec' => $entry_count, 'emc' => self::get_emails_sent(), 'api' => self::get_api_calls());
     return $post;
 }
Esempio n. 3
0
 public static function get_site_info()
 {
     if (!function_exists('get_plugins')) {
         require_once ABSPATH . 'wp-admin/includes/plugin.php';
     }
     $plugin_list = get_plugins();
     $site_url = get_bloginfo('url');
     $plugins = array();
     $active_plugins = get_option('active_plugins');
     foreach ($plugin_list as $key => $plugin) {
         $is_active = in_array($key, $active_plugins);
         if ($is_active) {
             $name = substr($key, 0, strpos($key, '/'));
             $plugins[] = array($name . 'v' . $plugin['Version']);
         }
     }
     $plugins = join(', ', $plugins);
     //get theme info
     $theme = wp_get_theme();
     $theme_name = $theme->get('Name');
     $theme_uri = $theme->get('ThemeURI');
     $theme_version = $theme->get('Version');
     $theme_author = $theme->get('Author');
     $theme_author_uri = $theme->get('AuthorURI');
     $form_counts = GFFormsModel::get_form_count();
     $active_count = $form_counts['active'];
     $inactive_count = $form_counts['inactive'];
     $fc = abs($active_count) + abs($inactive_count);
     $entry_count = GFFormsModel::get_lead_count_all_forms('active');
     $im = is_multisite() ? 'yes' : 'no';
     global $wpdb;
     $info = array('site: ' . $site_url, 'GF version' . GFCommon::$version, 'Gravity Flow version' . gravity_flow()->_version, 'WordPress version: ' . get_bloginfo('version'), 'php version' . phpversion(), 'mysql version: ' . $wpdb->db_version(), 'theme name:' . $theme_name, 'theme url' . $theme_uri, 'theme version:' . $theme_version, 'theme author: ' . $theme_author, 'theme author URL:' . $theme_author_uri, 'is multisite' . $im, 'form count: ' . $fc, 'entry count: ' . $entry_count, 'plugins: ' . $plugins);
     return join(PHP_EOL, $info);
 }