Completed
Push — master ( ab397f...7c7246 )
by Stephanie
03:59
created
classes/models/FrmAddon.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -38,15 +38,15 @@  discard block
 block discarded – undo
38 38
 	}
39 39
 
40 40
 	public function insert_installed_addon( $plugins ) {
41
-		$plugins[ $this->plugin_slug ] = $this;
41
+		$plugins[$this->plugin_slug] = $this;
42 42
 		return $plugins;
43 43
 	}
44 44
 
45 45
 	public static function get_addon( $plugin_slug ) {
46 46
 		$plugins = apply_filters( 'frm_installed_addons', array() );
47 47
 		$plugin = false;
48
-		if ( isset( $plugins[ $plugin_slug ] ) ) {
49
-			$plugin = $plugins[ $plugin_slug ];
48
+		if ( isset( $plugins[$plugin_slug] ) ) {
49
+			$plugin = $plugins[$plugin_slug];
50 50
 		}
51 51
 		return $plugin;
52 52
 	}
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	public function show_license_message( $file, $plugin ) {
96 96
 		$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
97 97
 		echo '<tr class="plugin-update-tr active"><td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange"><div class="update-message">';
98
-		echo sprintf( __( 'Your %1$s license key is missing. Please add it on the %2$slicenses page%3$s.', 'formidable' ), $this->plugin_name, '<a href="' . esc_url( admin_url('admin.php?page=formidable-settings&t=licenses_settings' ) ) . '">', '</a>' );
98
+		echo sprintf( __( 'Your %1$s license key is missing. Please add it on the %2$slicenses page%3$s.', 'formidable' ), $this->plugin_name, '<a href="' . esc_url( admin_url( 'admin.php?page=formidable-settings&t=licenses_settings' ) ) . '">', '</a>' );
99 99
 		$id = sanitize_title( $plugin['Name'] );
100 100
 		echo '<script type="text/javascript">var d = document.getElementById("' . esc_attr( $id ) . '");if ( d !== null ){ d.className = d.className + " update"; }</script>';
101 101
 		echo '</div></td></tr>';
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
 
109 109
 		if ( $this->is_current_version( $transient ) ) {
110 110
 			//make sure it doesn't show there is an update if plugin is up-to-date
111
-			if ( isset( $transient->response[ $this->plugin_folder ] ) ) {
112
-				unset( $transient->response[ $this->plugin_folder ] );
111
+			if ( isset( $transient->response[$this->plugin_folder] ) ) {
112
+				unset( $transient->response[$this->plugin_folder] );
113 113
 			}
114
-		} else if ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) {
114
+		} else if ( isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) ) {
115 115
 			$cache_key = 'edd_plugin_' . md5( sanitize_key( $this->license . $this->version ) . '_get_version' );
116 116
 			$version_info = get_transient( $cache_key );
117 117
 			if ( $version_info !== false ) {
118
-				$transient->response[ $this->plugin_folder ] = $version_info;
118
+				$transient->response[$this->plugin_folder] = $version_info;
119 119
 			} else {
120 120
 				if ( ! $this->has_been_cleared() ) {
121 121
 					// if the transient has expired, clear the update and trigger it again
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 					$this->manually_queue_update();
124 124
 				}
125 125
 
126
-				unset( $transient->response[ $this->plugin_folder ] );
126
+				unset( $transient->response[$this->plugin_folder] );
127 127
 			}
128 128
 		}
129 129
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	}
132 132
 
133 133
 	private function is_current_version( $transient ) {
134
-		if ( empty( $transient->checked ) || ! isset( $transient->checked[ $this->plugin_folder ] ) ) {
134
+		if ( empty( $transient->checked ) || ! isset( $transient->checked[$this->plugin_folder] ) ) {
135 135
 			return false;
136 136
 		}
137 137
 
@@ -140,16 +140,16 @@  discard block
 block discarded – undo
140 140
 			return true;
141 141
 		}
142 142
 
143
-		return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] == $transient->response[ $this->plugin_folder ]->new_version;
143
+		return isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) && $transient->checked[$this->plugin_folder] == $transient->response[$this->plugin_folder]->new_version;
144 144
 	}
145 145
 
146 146
 	private function has_been_cleared() {
147 147
 		$last_cleared = get_option( 'frm_last_cleared' );
148
-		return ( $last_cleared < date( 'Y-m-d H:i:s', strtotime('-5 minutes') ) );
148
+		return ( $last_cleared < date( 'Y-m-d H:i:s', strtotime( '-5 minutes' ) ) );
149 149
 	}
150 150
 
151 151
 	private function cleared_plugins() {
152
-		update_option( 'frm_last_cleared', date('Y-m-d H:i:s') );
152
+		update_option( 'frm_last_cleared', date( 'Y-m-d H:i:s' ) );
153 153
 	}
154 154
 
155 155
 	public static function activate() {
@@ -249,9 +249,9 @@  discard block
 block discarded – undo
249 249
 
250 250
 		$message = __( 'Your License Key was invalid', 'formidable' );
251 251
 		if ( is_wp_error( $resp ) ) {
252
-			$message = sprintf( __( 'You had an error communicating with Formidable Pro\'s API. %1$sClick here%2$s for more information.', 'formidable' ), '<a href="http://formidablepro.com/knowledgebase/why-cant-i-activate-formidable-pro/" target="_blank">', '</a>');
252
+			$message = sprintf( __( 'You had an error communicating with Formidable Pro\'s API. %1$sClick here%2$s for more information.', 'formidable' ), '<a href="http://formidablepro.com/knowledgebase/why-cant-i-activate-formidable-pro/" target="_blank">', '</a>' );
253 253
 			if ( is_wp_error( $resp ) ) {
254
-				$message .= ' '. $resp->get_error_message();
254
+				$message .= ' ' . $resp->get_error_message();
255 255
 			}
256 256
 		} else if ( $body == 'error' || is_wp_error( $body ) ) {
257 257
 			$message = __( 'You had an HTTP error connecting to Formidable Pro\'s API', 'formidable' );
@@ -264,14 +264,14 @@  discard block
 block discarded – undo
264 264
 					$message = $json_res;
265 265
 				}
266 266
 			} else if ( isset( $resp['response'] ) && isset( $resp['response']['code'] ) ) {
267
-				$message = sprintf( __( 'There was a %1$s error: %2$s', 'formidable' ), $resp['response']['code'], $resp['response']['message'] .' '. $resp['body'] );
267
+				$message = sprintf( __( 'There was a %1$s error: %2$s', 'formidable' ), $resp['response']['code'], $resp['response']['message'] . ' ' . $resp['body'] );
268 268
 			}
269 269
 		}
270 270
 
271 271
 		return $message;
272 272
 	}
273 273
 
274
-    public function manually_queue_update(){
274
+    public function manually_queue_update() {
275 275
         set_site_transient( 'update_plugins', null );
276 276
     }
277 277
 }
Please login to merge, or discard this patch.