• Resolved budasy

    (@budasy)


    I’ve just updated to v4.0.0 and I’m excited by the ability to have custom JS and CSS for each form. I have been editing the CF7 plugin style sheet and child theme to provide the same functionality.

    Unfortunately, in my tests, neither the JS, nor the CSS file were generated.

    I am testing on WordPress 5.5 running Astra Child theme. This is running via Local.app on MacOSX 10.15.6. ( Local creates a web development environment, in my case it is Nginx, PHP 7.3.5 and MySQL 8.0.16 ).

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter budasy

    (@budasy)

    Digging in the logs I found this:

    [31-Aug-2020 21:23:35 UTC] PHP Warning: file_put_contents(/Users/malcolm/Local Sites/adelphi-local/app/public/wp-content/themes/astra-child/css/loan-enquiry.css): failed to open stream: No such file or directory in /Users/malcolm/Local Sites/adelphi-local/app/public/wp-content/plugins/cf7-grid-layout/admin/class-cf7-grid-layout-admin.php on line 839

    and this

    [31-Aug-2020 21:40:48 UTC] PHP Warning: file_put_contents(/Users/malcolm/Local Sites/adelphi-local/app/public/wp-content/themes/astra-child/js/loan-enquiry.js): failed to open stream: No such file or directory in /Users/malcolm/Local Sites/adelphi-local/app/public/wp-content/plugins/cf7-grid-layout/admin/class-cf7-grid-layout-admin.php on line 828

    I suspect that the space in the folder name “Local Sites” is causing problems.

    Thread Starter budasy

    (@budasy)

    After testing, it wasn’t the space in the path name.

    You aren’t creating the CSS and JS folders in the theme directory before trying to write the file.

    Once the directories exist everything works.

    Plugin Author Aurovrata Venet

    (@aurovrata)

    You aren’t creating the CSS and JS folders in the theme directory before trying to write the file.

    aha! Odd, I had checked that, but I guess not well enough. Let run this again on my server.

    PS: given you interest in providing constructive feedback, you may find the following useful. I have a number of debugging file logging lines of code that help in identifying where things are going wrong in the code.

    I use the following constants in my wp-config.php file,

    
    define('WP_DEBUG', true); //debug must be true...
    
    define('WP_GURUS_DEBUG', true); //...along with this will trigger the debugging lines of code
     if ( WP_DEBUG ) {
         define( 'WP_DEBUG_LOG', true ); //will print to log
         define( 'WP_DEBUG_DISPLAY', false ); //will not print to front-end.
         @ini_set( 'display_errors', 0 );
         define('AUTOSAVE_INTERVAL', 600 );  //seconds
     }
    Plugin Author Aurovrata Venet

    (@aurovrata)

    yes, you’re right, the wrong path was being checked…fixed in v4.0.1

    Thread Starter budasy

    (@budasy)

    Cool. It works for me too.

    Thanks for the suggestion for the debugging settings. I’ve just had a quick look at wordpress-gurus-debug-api.php. I’m going play around with it.

    I’m glad to be able to provide some help, as little as it was. I know how much effort there is to keep a piece of code running smoothly. You’ve done a great job with this plugin.

    Plugin Author Aurovrata Venet

    (@aurovrata)

    I’m excited by the ability to have custom JS and CSS for each form. I have been editing the CF7 plugin style sheet and child theme to provide the same functionality.

    good to see my efforts are not in vain ?? This functionality to have custom css/js has been there since v1.0 (see FAQ #8), but I had a feeling few people were using it. Furthermore, there are a number of client-side js functionality built-in that can be leveraged to further customise forms. This is now exposed through helper codes in the js editor. I am planning a tutorial video on this in the near future.

    You’ve done a great job with this plugin.

    thank you, please leave a review when you a moment to spare.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Saving Custom CSS/JS is not Working’ is closed to new replies.