Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions classes/controllers/FrmStylesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,15 @@ public static function custom_stylesheet() {
* @return void
*/
private static function get_url_to_custom_style( &$stylesheet_urls ) {
$file_name = '/css/' . self::get_file_name();
if ( is_readable( FrmAppHelper::plugin_path() . $file_name ) ) {
$url = FrmAppHelper::plugin_url() . $file_name;
} else {
$url = admin_url( 'admin-ajax.php?action=frmpro_css' );
$add_css_to_uploads_dir = FrmStyle::add_css_to_uploads_dir();
$file_path = FrmStyle::get_generated_css_file_path( $add_css_to_uploads_dir ) . '/' . self::get_file_name();
if ( ! is_readable( $file_path ) ) {
$stylesheet_urls['formidable'] = admin_url( 'admin-ajax.php?action=frmpro_css' );
return;
}
$stylesheet_urls['formidable'] = $url;
$base_url = $add_css_to_uploads_dir ? wp_upload_dir()['baseurl'] . '/formidable/css/' : FrmAppHelper::plugin_url() . '/css/';

$stylesheet_urls['formidable'] = $base_url . self::get_file_name();
}

/**
Expand Down
72 changes: 66 additions & 6 deletions classes/models/FrmStyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,18 +392,78 @@ public function save_settings() {
$this->clear_cache();

$css = $this->get_css_content( $filename );
$create_file = new FrmCreateFile(
array(
'file_name' => FrmStylesController::get_file_name(),
'new_file_path' => FrmAppHelper::plugin_path() . '/css',
)
);
$create_file = new FrmCreateFile( self::get_create_style_file_args() );
$create_file->create_file( $css );

update_option( 'frmpro_css', $css, 'no' );
set_transient( 'frmpro_css', $css, MONTH_IN_SECONDS );
}

/**
* @since x.x
Comment on lines +402 to +403
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Update version placeholders in PHPDoc comments.

All the new methods have a placeholder version x.x in their PHPDoc comments. These should be updated with the actual version number where these methods are being introduced.

-	 * @since x.x
+	 * @since 6.14.2

Also applies to: 425-426, 438-439, 454-455, 463-464


🌐 Web query:

What is the latest version of Formidable Forms?

💡 Result:

The latest version of Formidable Forms is 6.20, as indicated by the plugin's listing on WordPress.org, which was updated 6 hours ago[4]. This version includes ongoing optimizations and fixes, such as recent updates to form styling and database query improvements seen in earlier releases[1][5].

For Pro users, updates can be downloaded directly from the Formidable Forms account page or via the WordPress plugins interface, ensuring compatibility with the latest features and security patches[8]. Developers should note that version 6.20 requires Formidable Forms Lite (the free version) to be installed alongside Pro for full functionality[8].

Citations:


Action Required: Update PHPDoc Version Placeholders

The PHPDoc comments in classes/models/FrmStyle.php still show the placeholder x.x for the @since annotations. Based on the latest version of Formidable Forms (6.20), please update these comments accordingly. For example:

-	 * @since x.x
+	 * @since 6.20

This change is required at the following locations:

  • Lines 402-403
  • Lines 425-426
  • Lines 438-439
  • Lines 454-455
  • Lines 463-464

Please ensure that all new methods’ PHPDoc comments reflect version 6.20 to maintain consistency with the current release.

*
* @return array
*/
private static function get_create_style_file_args() {
$add_css_to_uploads_dir = self::add_css_to_uploads_dir();
$create_file_args = array(
'file_name' => FrmStylesController::get_file_name(),
'new_file_path' => self::get_generated_css_file_path( $add_css_to_uploads_dir ),
);

if ( $add_css_to_uploads_dir ) {
$create_file_args['folder_name'] = 'formidable/css';
}
return $create_file_args;
}

/**
* @since x.x
*
* @param bool $add_css_to_uploads_dir
* @return string
*/
public static function get_generated_css_file_path( $add_css_to_uploads_dir ) {
if ( $add_css_to_uploads_dir ) {
return self::target_css_uploads_dir();
}
return self::target_css_plugin_dir();
}

/**
* Returns true if generated css file should be saved in the uploads directory.
*
* @since x.x
*
* @return bool
*/
public static function add_css_to_uploads_dir() {
/**
* @since x.x
*
* @param bool $add_css_to_uploads_dir
*/
return apply_filters( 'frm_add_css_to_uploads_dir', ! wp_is_file_mod_allowed( 'frm_save_css_to_plugin_folder' ) );
}

/**
* @since x.x
*
* @return string
*/
private static function target_css_uploads_dir() {
return wp_upload_dir()['basedir'] . '/formidable/css';
}

/**
* @since x.x
*
* @return string
*/
private static function target_css_plugin_dir() {
return FrmAppHelper::plugin_path() . '/css';
}

/**
* @param string $filename
* @return string
Expand Down
Loading