Changeset 1866628
- Timestamp:
- 04/30/2018 08:21:05 PM (8 years ago)
- Location:
- divvyhq/trunk
- Files:
-
- 6 edited
-
README.txt (modified) (2 diffs)
-
admin/class-divvyhq-admin.php (modified) (1 diff)
-
divvyhq.php (modified) (3 diffs)
-
includes/class-divvyhq-activator.php (modified) (1 diff)
-
includes/class-divvyhq-deactivator.php (modified) (1 diff)
-
includes/class-divvyhq.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
divvyhq/trunk/README.txt
r1860162 r1866628 5 5 Tested up to: 4.9.5 6 6 Requires PHP: 5.2.4 7 Stable tag: 1.0. 17 Stable tag: 1.0.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 40 40 == Changelog == 41 41 42 = 1.0.2 = 43 Set JWT Secret Key to WP constant and configure .htaccess. 44 42 45 = 1.0.1 = 43 46 Update to webhook URL. -
divvyhq/trunk/admin/class-divvyhq-admin.php
r1860159 r1866628 111 111 . __('Settings', $this->plugin_name) . '</a>', 112 112 ); 113 113 114 return array_merge($settings_link, $links); 115 } 116 117 /** 118 * Update the .htaccess to add the appropriate JWT rewrite rules 119 * so that the DivvyHQ user won't have to implement them. 120 * 121 * @param $rules 122 * @return string 123 */ 124 public function update_rewrite_rules($rules) 125 { 126 // This only works if this constant is available. 127 if (defined('ABSPATH')) { 128 // Check to see if we've already appended to the .htaccess file, 129 // If not, write our rules. 130 $file = file_get_contents(ABSPATH . '.htaccess'); 131 132 if (!stripos($file, '# Begin DivvyHQ Settings')) { 133 $divvyhqAddition = <<<DIVVYHQ 134 \n# Begin DivvyHQ Settings 135 <IfModule mod_rewrite.c> 136 RewriteCond %{HTTP:Authorization} ^(.*) 137 RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1] 138 SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 139 </IfModule> 140 # End DivvyHQ Settings\n 141 DIVVYHQ; 142 143 $result = file_put_contents(ABSPATH . '.htaccess', $divvyhqAddition, FILE_APPEND); 144 unset($result); 145 } 146 } 147 148 return $rules; 149 } 150 151 /** 152 * Force the .htaccess changes to be written to the file. 153 */ 154 public function flush_rewrite_rules() 155 { 156 global $wp_rewrite; 157 $wp_rewrite->flush_rules(); 114 158 } 115 159 -
divvyhq/trunk/divvyhq.php
r1860159 r1866628 16 16 * Plugin URI: https://www.wordpress.com/ 17 17 * Description: This plugin allows users to sync their content from their WordPress instance back to DivvyHQ. 18 * Version: 1.0. 118 * Version: 1.0.2 19 19 * Author: Alluresoft, LLC 20 20 * Author URI: https://www.divvyhq.com/ … … 36 36 37 37 /** 38 * Current plugin version. 39 */ 40 define('DIVVYHQ_VERSION', '1.0.2'); 41 42 43 /** 44 * Set the JWT Secret Key 45 */ 46 if (!defined('JWT_AUTH_SECRET_KEY') && defined('SECURE_AUTH_SALT')) { 47 define('JWT_AUTH_SECRET_KEY', SECURE_AUTH_SALT); 48 } 49 50 /** 38 51 * Set timeout for JWT Auth Token 39 52 */ … … 41 54 define('JWT_AUTH_EXPIRE', time() + (DAY_IN_SECONDS * 90)); 42 55 } 43 44 /**45 * Current plugin version.46 */47 define('DIVVYHQ_VERSION', '1.0.1');48 56 49 57 /** -
divvyhq/trunk/includes/class-divvyhq-activator.php
r1859822 r1866628 16 16 * On activate, redirect the user to the settings page. 17 17 * 18 * @since 1.0.018 * @since 1.0.0 19 19 */ 20 20 public static function activate() -
divvyhq/trunk/includes/class-divvyhq-deactivator.php
r1859822 r1866628 14 14 { 15 15 /** 16 * Short Description. (use period) 17 * 18 * Long Description. 16 * Remove the DivvyHQ settings from WordPress. 19 17 * 20 18 * @since 1.0.0 -
divvyhq/trunk/includes/class-divvyhq.php
r1860159 r1866628 59 59 $this->version = DIVVYHQ_VERSION; 60 60 } else { 61 $this->version = '1.0. 1';61 $this->version = '1.0.2'; 62 62 } 63 63 … … 147 147 'add_action_links'); 148 148 149 // Used to update .htaccess with necessary rewrite rules. 150 $this->loader->add_filter('mod_rewrite_rules', $plugin_admin, 'update_rewrite_rules'); 151 $this->loader->add_action('admin_init', $plugin_admin, 'flush_rewrite_rules'); 152 149 153 // Redirect the user to the settings page. 150 154 $this->loader->add_action('admin_init', $plugin_admin, 'settings_redirect_after_activation');
Note: See TracChangeset
for help on using the changeset viewer.