PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.7
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.7
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/controllers/FrmAddonsController.php +16 -12 6.5.26.7 View file →
@@ -297,12 +297,13 @@
297 297 }
298 298
299 299 /**
300 300 * @since 4.08
301 + * @since 6.7 This is public.
301 302 *
302 303 * @return array|false
303 304 */
304 - protected static function get_primary_license_info() {
305 + public static function get_primary_license_info() {
305 306 $installed_addons = apply_filters( 'frm_installed_addons', array() );
306 307 if ( empty( $installed_addons ) || ! isset( $installed_addons['formidable_pro'] ) ) {
307 308 return false;
308 309 }
@@ -351,15 +352,16 @@
351 352 // don't show an update if the plugin isn't installed
352 353 continue;
353 354 }
354 355
355 - $wp_plugin = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array();
356 - $wp_version = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0';
356 + $wp_plugin = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array();
357 + $wp_version = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0';
358 + $plugin->slug = explode( '/', $folder )[0];
357 359
358 360 if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) {
359 - $slug = explode( '/', $folder );
360 - $plugin->slug = $slug[0];
361 361 $transient->response[ $folder ] = $plugin;
362 + } else {
363 + $transient->no_update[ $folder ] = $plugin;
362 364 }
363 365
364 366 $transient->checked[ $folder ] = $wp_version;
365 367
@@ -1023,10 +1025,8 @@
1023 1025 *
1024 1026 * @since 3.04.02
1025 1027 */
1026 1028 protected static function install_addon() {
1027 - FrmAppHelper::permission_check( 'install_plugins' );
1028 -
1029 1029 require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
1030 1030
1031 1031 $download_url = self::get_current_plugin();
1032 1032
@@ -1179,17 +1179,13 @@
1179 1179 *
1180 1180 * @return bool
1181 1181 */
1182 1182 public static function can_install_addon_api() {
1183 - if ( ! current_user_can( 'activate_plugins' ) ) {
1184 - return false;
1185 - }
1186 -
1187 1183 // Verify params present (auth & download link).
1188 1184 $post_auth = FrmAppHelper::get_param( 'token', '', 'request', 'sanitize_text_field' );
1189 1185 $post_url = FrmAppHelper::get_param( 'file_url', '', 'request', 'sanitize_text_field' );
1190 1186
1191 - if ( empty( $post_auth ) || empty( $post_url ) ) {
1187 + if ( ! $post_auth || ! $post_url ) {
1192 1188 return false;
1193 1189 }
1194 1190
1195 1191 // Verify auth.
@@ -1261,9 +1257,17 @@
1261 1257
1262 1258 $addon = self::get_addon( $plugin );
1263 1259 $upgrade_link = FrmAppHelper::admin_upgrade_link( $upgrade_link_args );
1264 1260
1261 + if ( ! is_array( $upgrade_link_args ) ) {
1262 + // A string $upgrade_link_args is used for the utm-medium value when calling
1263 + // FrmAppHelper::admin_upgrade_link above.
1264 + // For self::addon_upgrade_link, we'll pass just an empty array with the link key (set below).
1265 + $upgrade_link_args = array();
1266 + }
1267 +
1265 1268 $upgrade_link_args['link'] = $upgrade_link;
1269 +
1266 1270 self::addon_upgrade_link( $addon, $upgrade_link_args );
1267 1271 }
1268 1272
1269 1273 /**