|
@@ -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,32 +95,32 @@ 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>'; |
|
102
|
102
|
} |
|
103
|
103
|
|
|
104
|
104
|
public function clear_expired_download( $transient ) { |
|
105
|
|
- if ( ! is_object($transient) ) { |
|
|
105
|
+ if ( ! is_object( $transient ) ) { |
|
106
|
106
|
return $transient; |
|
107
|
107
|
} |
|
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 if ( ! $this->has_been_cleared() ) { |
|
120
|
120
|
// if the transient has expired, clear the update and trigger it again |
|
121
|
121
|
$this->cleared_plugins(); |
|
122
|
122
|
$this->manually_queue_update(); |
|
123
|
|
- unset( $transient->response[ $this->plugin_folder ] ); |
|
|
123
|
+ unset( $transient->response[$this->plugin_folder] ); |
|
124
|
124
|
} |
|
125
|
125
|
} |
|
126
|
126
|
|
|
@@ -128,7 +128,7 @@ discard block |
|
|
block discarded – undo |
|
128
|
128
|
} |
|
129
|
129
|
|
|
130
|
130
|
private function is_current_version( $transient ) { |
|
131
|
|
- if ( empty( $transient->checked ) || ! isset( $transient->checked[ $this->plugin_folder ] ) ) { |
|
|
131
|
+ if ( empty( $transient->checked ) || ! isset( $transient->checked[$this->plugin_folder] ) ) { |
|
132
|
132
|
return false; |
|
133
|
133
|
} |
|
134
|
134
|
|
|
@@ -137,7 +137,7 @@ discard block |
|
|
block discarded – undo |
|
137
|
137
|
return true; |
|
138
|
138
|
} |
|
139
|
139
|
|
|
140
|
|
- return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] == $transient->response[ $this->plugin_folder ]->new_version; |
|
|
140
|
+ return isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) && $transient->checked[$this->plugin_folder] == $transient->response[$this->plugin_folder]->new_version; |
|
141
|
141
|
} |
|
142
|
142
|
|
|
143
|
143
|
private function has_been_cleared() { |
|
@@ -247,9 +247,9 @@ discard block |
|
|
block discarded – undo |
|
247
|
247
|
|
|
248
|
248
|
$message = __( 'Your License Key was invalid', 'formidable' ); |
|
249
|
249
|
if ( is_wp_error( $resp ) ) { |
|
250
|
|
- $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>'); |
|
|
250
|
+ $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>' ); |
|
251
|
251
|
if ( is_wp_error( $resp ) ) { |
|
252
|
|
- $message .= ' '. $resp->get_error_message(); |
|
|
252
|
+ $message .= ' ' . $resp->get_error_message(); |
|
253
|
253
|
} |
|
254
|
254
|
} else if ( $body == 'error' || is_wp_error( $body ) ) { |
|
255
|
255
|
$message = __( 'You had an HTTP error connecting to Formidable Pro\'s API', 'formidable' ); |
|
@@ -262,14 +262,14 @@ discard block |
|
|
block discarded – undo |
|
262
|
262
|
$message = $json_res; |
|
263
|
263
|
} |
|
264
|
264
|
} else if ( isset( $resp['response'] ) && isset( $resp['response']['code'] ) ) { |
|
265
|
|
- $message = sprintf( __( 'There was a %1$s error: %2$s', 'formidable' ), $resp['response']['code'], $resp['response']['message'] .' '. $resp['body'] ); |
|
|
265
|
+ $message = sprintf( __( 'There was a %1$s error: %2$s', 'formidable' ), $resp['response']['code'], $resp['response']['message'] . ' ' . $resp['body'] ); |
|
266
|
266
|
} |
|
267
|
267
|
} |
|
268
|
268
|
|
|
269
|
269
|
return $message; |
|
270
|
270
|
} |
|
271
|
271
|
|
|
272
|
|
- public function manually_queue_update(){ |
|
|
272
|
+ public function manually_queue_update() { |
|
273
|
273
|
set_site_transient( 'update_plugins', null ); |
|
274
|
274
|
} |
|
275
|
275
|
} |