PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.2.3
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.2.3
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 +4 -66 6.56.2.3 View file →
@@ -18,9 +18,9 @@
18 18 return;
19 19 }
20 20
21 21 $label = __( 'Add-Ons', 'formidable' );
22 - $label = '<span style="color:#1da867">' . $label . '</span>';
22 + $label = '<span style="color:#fe5a1d">' . $label . '</span>';
23 23
24 24 add_submenu_page( 'formidable', 'Formidable | ' . __( 'Add-Ons', 'formidable' ), $label, 'frm_view_forms', 'formidable-addons', 'FrmAddonsController::list_addons' );
25 25
26 26 if ( ! FrmAppHelper::pro_is_installed() ) {
@@ -1012,9 +1012,10 @@
1012 1012 * @return bool
1013 1013 */
1014 1014 public static function url_is_allowed( $download_url ) {
1015 1015 return (
1016 - FrmAppHelper::validate_url_is_in_s3_bucket( $download_url, 'zip' ) || in_array( $download_url, self::allowed_external_urls(), true )
1016 + FrmAppHelper::validate_url_is_in_s3_bucket( $download_url, 'zip' ) ||
1017 + ( strpos( $download_url, 'https://downloads.wordpress.org/plugin' ) === 0 && substr_compare( $download_url, '.zip', -4 ) === 0 )
1017 1018 );
1018 1019 }
1019 1020
1020 1021 /**
@@ -1023,10 +1024,8 @@
1023 1024 *
1024 1025 * @since 3.04.02
1025 1026 */
1026 1027 protected static function install_addon() {
1027 - FrmAppHelper::permission_check( 'install_plugins' );
1028 -
1029 1028 require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
1030 1029
1031 1030 $download_url = self::get_current_plugin();
1032 1031
@@ -1077,12 +1076,10 @@
1077 1076 */
1078 1077 private static function get_addon_activation_response() {
1079 1078 $activating_page = self::get_activating_page();
1080 1079
1081 - $message = $activating_page ? __( 'Your plugin has been activated. Would you like to save and reload the page now?', 'formidable' ) : __( 'Your plugin has been activated.', 'formidable' );
1082 -
1083 1080 $response = array(
1084 - 'message' => $message,
1081 + 'message' => __( 'Your plugin has been activated. Would you like to save and reload the page now?', 'formidable' ),
1085 1082 'saveAndReload' => $activating_page,
1086 1083 );
1087 1084
1088 1085 return $response;
@@ -1179,12 +1176,8 @@
1179 1176 *
1180 1177 * @return bool
1181 1178 */
1182 1179 public static function can_install_addon_api() {
1183 - if ( ! current_user_can( 'activate_plugins' ) ) {
1184 - return false;
1185 - }
1186 -
1187 1180 // Verify params present (auth & download link).
1188 1181 $post_auth = FrmAppHelper::get_param( 'token', '', 'request', 'sanitize_text_field' );
1189 1182 $post_url = FrmAppHelper::get_param( 'file_url', '', 'request', 'sanitize_text_field' );
1190 1183
@@ -1320,63 +1313,8 @@
1320 1313 }
1321 1314
1322 1315 echo json_encode( self::get_addon_activation_response() );
1323 1316 wp_die();
1324 - }
1325 -
1326 - /**
1327 - * Allowed URLs used for internal source of plugins installation.
1328 - *
1329 - * @since 6.3.1
1330 - *
1331 - * @return array
1332 - */
1333 - private static function allowed_external_urls() {
1334 - $allowed_url_list = array(
1335 - 'https://downloads.wordpress.org/plugin/formidable-gravity-forms-importer.zip',
1336 - 'https://downloads.wordpress.org/plugin/formidable-import-pirate-forms.zip',
1337 - 'https://downloads.wordpress.org/plugin/wp-mail-smtp.zip',
1338 - );
1339 -
1340 - /**
1341 - * List of URLs used in plugin formidable internal installation.
1342 - *
1343 - * @since 6.3.1
1344 - *
1345 - * @param array $allowed_url_list List of URLs.
1346 - */
1347 - $allowed_url_list = apply_filters( 'frm_allowed_external_urls', $allowed_url_list );
1348 -
1349 - if ( ! is_array( $allowed_url_list ) ) {
1350 - _doing_it_wrong( __METHOD__, 'Only an array of URLs could be used within this filter.', '6.3.1' );
1351 -
1352 - return array();
1353 - }
1354 -
1355 - return $allowed_url_list;
1356 - }
1357 -
1358 - /**
1359 - * Gets required plan for an addon.
1360 - *
1361 - * @since 6.4.2
1362 - *
1363 - * @return string Empty string if no plan is required for active license.
1364 - */
1365 - public static function get_addon_required_plan( $addon_id ) {
1366 - $api = new FrmFormApi();
1367 - $addons = $api->get_api_info();
1368 -
1369 - if ( is_array( $addons ) && array_key_exists( $addon_id, $addons ) ) {
1370 - $dates = $addons[ $addon_id ];
1371 - $requires = FrmFormsHelper::get_plan_required( $dates );
1372 - }
1373 -
1374 - if ( ! isset( $requires ) || ! is_string( $requires ) ) {
1375 - $requires = '';
1376 - }
1377 -
1378 - return $requires;
1379 1317 }
1380 1318
1381 1319 /**
1382 1320 * @since 4.06.02