PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.7.2
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.7.2
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 +44 -25 6.5.36.7.2 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,20 +352,21 @@
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
366 - }
368 + }//end foreach
367 369
368 370 return $transient;
369 371 }
370 372
@@ -387,9 +389,9 @@
387 389 * Check if a plugin is installed before showing an update for it
388 390 *
389 391 * @since 3.05
390 392 *
391 - * @param string $plugin - the folder/filename.php for a plugin
393 + * @param string $plugin The folder/filename.php for a plugin.
392 394 *
393 395 * @return bool - True if installed
394 396 */
395 397 protected static function is_installed( $plugin ) {
@@ -444,9 +446,9 @@
444 446 'code' => $addon_info['error']['code'],
445 447 );
446 448 }
447 449 }
448 - }
450 + }//end foreach
449 451
450 452 return $version_info;
451 453 }
452 454
@@ -453,9 +455,9 @@
453 455 /**
454 456 * Get the action link for an addon that isn't active.
455 457 *
456 458 * @since 3.06.03
457 - * @param string $plugin The plugin slug
459 + * @param string $plugin The plugin slug.
458 460 * @return array
459 461 */
460 462 public static function install_link( $plugin ) {
461 463 $link = array();
@@ -485,9 +487,9 @@
485 487 $link = array(
486 488 'url' => 'formidable-' . $plugin . '/formidable-' . $plugin . '.php',
487 489 'class' => 'frm-activate-addon',
488 490 );
489 - }
491 + }//end if
490 492
491 493 return $link;
492 494 }
493 495
@@ -492,9 +494,9 @@
492 494 }
493 495
494 496 /**
495 497 * @since 4.09
496 - * @param string $plugin The plugin slug
498 + * @param string $plugin The plugin slug.
497 499 * @return array|false
498 500 */
499 501 protected static function get_addon( $plugin ) {
500 502 $addons = self::get_api_addons();
@@ -523,10 +525,10 @@
523 525
524 526 /**
525 527 * @since 3.04.03
526 528 *
527 - * @param array $addons
528 - * @param object $license The FrmAddon object
529 + * @param array $addons
530 + * @param object $license The FrmAddon object.
529 531 *
530 532 * @return array
531 533 */
532 534 public static function get_addon_for_license( $addons, $license ) {
@@ -603,9 +605,9 @@
603 605 self::prepare_addon_link( $addon['link'] );
604 606
605 607 self::set_addon_status( $addon );
606 608 $addons[ $id ] = $addon;
607 - }
609 + }//end foreach
608 610 }
609 611
610 612 /**
611 613 * @return bool
@@ -937,9 +939,9 @@
937 939 *
938 940 * @return string
939 941 */
940 942 protected static function get_current_plugin() {
941 - if ( ! isset( self::$plugin ) ) {
943 + if ( empty( self::$plugin ) ) {
942 944 self::$plugin = FrmAppHelper::get_param( 'plugin', '', 'post', 'esc_url_raw' );
943 945 }
944 946 return self::$plugin;
945 947 }
@@ -1107,9 +1109,9 @@
1107 1109
1108 1110 /**
1109 1111 * @since 3.04.02
1110 1112 *
1111 - * @param string $installed The plugin folder name with file name
1113 + * @param string $installed The plugin folder name with file name.
1112 1114 */
1113 1115 protected static function maybe_activate_addon( $installed ) {
1114 1116 if ( ! $installed ) {
1115 1117 return;
@@ -1243,21 +1245,32 @@
1243 1245
1244 1246 /**
1245 1247 * Render a conditional action button for a specified plugin
1246 1248 *
1247 - * @param string $plugin
1249 + * @since 4.09
1250 + *
1251 + * @param string $plugin
1248 1252 * @param array|string $upgrade_link_args
1249 - * @since 4.09
1253 + * @return void
1250 1254 */
1251 1255 public static function conditional_action_button( $plugin, $upgrade_link_args ) {
1252 1256 if ( is_callable( 'FrmProAddonsController::conditional_action_button' ) ) {
1253 - return FrmProAddonsController::conditional_action_button( $plugin, $upgrade_link_args );
1257 + FrmProAddonsController::conditional_action_button( $plugin, $upgrade_link_args );
1258 + return;
1254 1259 }
1255 1260
1256 1261 $addon = self::get_addon( $plugin );
1257 1262 $upgrade_link = FrmAppHelper::admin_upgrade_link( $upgrade_link_args );
1258 1263
1264 + if ( ! is_array( $upgrade_link_args ) ) {
1265 + // A string $upgrade_link_args is used for the utm-medium value when calling
1266 + // FrmAppHelper::admin_upgrade_link above.
1267 + // For self::addon_upgrade_link, we'll pass just an empty array with the link key (set below).
1268 + $upgrade_link_args = array();
1269 + }
1270 +
1259 1271 $upgrade_link_args['link'] = $upgrade_link;
1272 +
1260 1273 self::addon_upgrade_link( $addon, $upgrade_link_args );
1261 1274 }
1262 1275
1263 1276 /**
@@ -1264,16 +1277,22 @@
1264 1277 * Render a conditional action button for an add on
1265 1278 *
1266 1279 * @since 4.09.01
1267 1280 *
1268 - * @param array $addon
1269 - * @param string|false $license_type
1270 - * @param string $plan_required
1271 - * @param string $upgrade_link
1281 + * @param array $atts {
1282 + * Button attributes.
1283 + *
1284 + * @type array $addon
1285 + * @type string|false $license_type
1286 + * @type string $plan_required
1287 + * @type string $upgrade_link
1288 + * }
1289 + * @return void
1272 1290 */
1273 1291 public static function show_conditional_action_button( $atts ) {
1274 1292 if ( is_callable( 'FrmProAddonsController::show_conditional_action_button' ) ) {
1275 - return FrmProAddonsController::show_conditional_action_button( $atts );
1293 + FrmProAddonsController::show_conditional_action_button( $atts );
1294 + return;
1276 1295 }
1277 1296
1278 1297 self::addon_upgrade_link( $atts['addon'], $atts['upgrade_link'] );
1279 1298 }
@@ -1453,9 +1472,9 @@
1453 1472 * @deprecated 3.04.03
1454 1473 * @codeCoverageIgnore
1455 1474 *
1456 1475 * @param boolean $return
1457 - * @param string $package
1476 + * @param string $package
1458 1477 *
1459 1478 * @return boolean
1460 1479 */
1461 1480 public static function add_shorten_edd_filename_filter( $return, $package ) {