Answers.Body: <p>You can get the more granular CiviCRM version data with:</p>
  
  <pre><code>$version_file = CIVICRM_PLUGIN_DIR . 'civicrm/civicrm-version.php';
  if ( file_exists( $version_file ) ) {
      require_once $version_file;
      $civicrm_version = civicrmVersion();
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-05T14:03:55.770Z
Answers.Text: This does not fix the fact that WordPress is looking for the version information in the header when it displays it on the plugin page.
Answers.UserDisplayName: Codedogs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-06T14:41:58.407Z
Answers.Text: True, but what problem does that solve that the code above does not?
Answers.UserDisplayName: Christian Wach
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-07T17:28:12.160Z
Answers.Text: Having the WordPress plugin page display the entire version number is the problem I would like solved. Then I can give CiviCRM code that can be adapted to allow WordPress to update CiviCRM via the plugin page. No more coping and extracting of zip files. Wouldn't that be an improvement.
Answers.UserDisplayName: Codedogs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-09T23:26:46.470Z
Answers.Text: It would. I'd be very interested to hear your strategy for doing this.
Answers.UserDisplayName: Christian Wach
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-10T23:27:22.273Z
Answers.Text: My strategy is based on the following article: [article link](https://helpstring.wordpress.com/2012/04/18/a-guide-to-the-wordpress-http-api-automatic-plugin-updates/). It consists of one class that needs to be added to the plugin and a web page to respond to the WordPress requests. The code involves implementing 2 filters **pre_set_site_transient_update_plugins** and **plugins_api**. I'd be happy to answer any questions you have.
Answers.UserDisplayName: Codedogs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-11T17:47:01.287Z
Answers.Text: Are you planning to host these auto-updates and provide the associated API responses? I'd imagine people might be reluctant to trust an unknown third-party for this kind of thing.
Answers.UserDisplayName: Christian Wach
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-12T18:41:16.633Z
Answers.Text: No. I have enough on my plate with 4 of my own software projects to host. I was kind of hoping that CiviCRM.org might be interested.I have a further restriction on my client's site that I don't have SSH access. Imagine doing backups and moving zip files via your ISP's user interface.
Answers.UserDisplayName: Codedogs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-12T18:42:44.390Z
Answers.Text: Back to the original post. The version data is in the header of the main plugin file, so that even if the plugin is deactivated, one can still see the information.
Answers.UserDisplayName: Codedogs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-13T12:04:39.307Z
Answers.Text: @Codedogs I actually agree with what you want - the version number of the plugin *should* match Civi's version number. Quite how to make that happen is beyond me however - you will need to get the committers to make sure that it is updated prior to every minor version bump. Perhaps open an issue on Jira to get their attention?
Answers.UserDisplayName: Christian Wach
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-14T19:20:08.443Z
Answers.Text: Do you have a URL for Jira?
Answers.UserDisplayName: Codedogs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-16T00:58:57.617Z
Answers.Text: https://issues.civicrm.org
Answers.UserDisplayName: Christian Wach
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-24T17:41:31.667Z
Answers.LastActivityDate: 2016-10-24T17:41:31.667Z
Answers.UserDisplayName: Christian Wach
Body: <p>By default, WordPress uses the version information provided in ../civicrm/civicrm.php. However, the batch number is missing here:</p>
  
  <pre><code>&lt;?php
  /*
  Plugin Name: CiviCRM
  Description: CiviCRM - Growing and Sustaining Relationships
  Version: 4.7
  Author: CiviCRM LLC
  Author URI: http://civicrm.org/
  Plugin URI: http://wiki.civicrm.org/confluence/display/CRMDOC/WordPress+Installation+Guide+for+CiviCRM+4.7
  License: AGPL3
  Text Domain: civicrm
  Domain Path: /languages
  */
  </code></pre>
  
  <p>WordPress uses the following code to extract the version information from a plugin:</p>
  
  <pre><code>$data = get_plugin_data("~/civicrm/civicrm.php");
  $version = $data['Version'];
  </code></pre>
  
  <p>I am using this functionality to automate keeping track of my fixes until CiviCRM and other plugins make the necessary corrections in the next release.</p>
  
  <blockquote>
    <p>Would it be possible to update civicrm.php to add the batch number?
    So, it will return 4.7.12 instead of 4.7.</p>
  </blockquote>
  
Tags: <wordpress><4.7>
Title: Batch number missing in version number in civicrm.php
ThreadText: # Batch number missing in version number in civicrm.php
  
  (Asked by: username_0 on 2016-10-23)
  
  By default, WordPress uses the version information provided in ../civicrm/civicrm.php. However, the batch number is missing here:
  
  ```
  <?php
  /*
  Plugin Name: CiviCRM
  Description: CiviCRM - Growing and Sustaining Relationships
  Version: 4.7
  Author: CiviCRM LLC
  Author URI: http://civicrm.org/
  Plugin URI: http://wiki.civicrm.org/confluence/display/CRMDOC/WordPress+Installation+Guide+for+CiviCRM+4.7
  License: AGPL3
  Text Domain: civicrm
  Domain Path: /languages
  */
  
  ```
  
  WordPress uses the following code to extract the version information from a plugin:
  
  ```
  $data = get_plugin_data("~/civicrm/civicrm.php");
  $version = $data['Version'];
  
  ```
  
  I am using this functionality to automate keeping track of my fixes until CiviCRM and other plugins make the necessary corrections in the next release.
  
  > Would it be possible to update civicrm.php to add the batch number?
  > So, it will return 4.7.12 instead of 4.7.
  
  **Tags:** wordpress, 4.7
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-10-24. Score: 1
  
  You can get the more granular CiviCRM version data with:
  
  ```
  $version_file = CIVICRM_PLUGIN_DIR . 'civicrm/civicrm-version.php';
  if ( file_exists( $version_file ) ) {
      require_once $version_file;
      $civicrm_version = civicrmVersion();
  }
  
  ```
  
  > **Comments:**
  > **username_0**: This does not fix the fact that WordPress is looking for the version information in the header when it displays it on the plugin page.  
  > **username_1**: True, but what problem does that solve that the code above does not?  
  > **username_0**: Having the WordPress plugin page display the entire version number is the problem I would like solved. Then I can give CiviCRM code that can be adapted to allow WordPress to update CiviCRM via the plugin page. No more coping and extracting of zip files. Wouldn't that be an improvement.  
  > **username_1**: It would. I'd be very interested to hear your strategy for doing this.  
  > **username_0**: My strategy is based on the following article: [article link](https://helpstring.wordpress.com/2012/04/18/a-guide-to-the-wordpress-http-api-automatic-plugin-updates/). It consists of one class that needs to be added to the plugin and a web page to respond to the WordPress requests. The code involves implementing 2 filters **pre_set_site_transient_update_plugins** and **plugins_api**. I'd be happy to answer any questions you have.  
  > **username_1**: Are you planning to host these auto-updates and provide the associated API responses? I'd imagine people might be reluctant to trust an unknown third-party for this kind of thing.  
  > **username_0**: No. I have enough on my plate with 4 of my own software projects to host. I was kind of hoping that CiviCRM.org might be interested.I have a further restriction on my client's site that I don't have SSH access. Imagine doing backups and moving zip files via your ISP's user interface.  
  > **username_0**: Back to the original post. The version data is in the header of the main plugin file, so that even if the plugin is deactivated, one can still see the information.  
  > **username_1**: @username_0 I actually agree with what you want - the version number of the plugin *should* match Civi's version number. Quite how to make that happen is beyond me however - you will need to get the committers to make sure that it is updated prior to every minor version bump. Perhaps open an issue on Jira to get their attention?  
  > **username_0**: Do you have a URL for Jira?  
  > **username_1**: https://issues.civicrm.org  
  
  ---
  
  