• Dear all, I’m facing an issue. Every code I create, the software creates a “clone”, codified with a sequential number. This means a double code per each one in uploads/custom-css-js folder. When I delete or modify the code, the “clone” remains unchanged and creates troubles. To solve, I often go via ftp / Mozilla and cancel such doubled codes. F.e. I modified a jQuery ready <p> function (a typo error in the published wording), but the result was “two different scripts”, one modified and the old “clone” unchanged, both creating a popup. I took time to check which was the “clone” and erase it manually. HOW TO AVOID THIS ANNOYING DUPLICATION PLEASE ?? (thank you a lot). Mauro (IT)

Viewing 15 replies - 1 through 15 (of 23 total)
  • Plugin Author Diana Burduja

    (@diana_burduja)

    Hello Mauro,

    could you give me a concrete example with screenshots, just to make sure I don’t misunderstand the issue? You can use a Dropbox or Imgur to upload and link the screenshots.

    Thread Starter Mauro Vicariotto

    (@mrosfy)

    Thank You Diana. This is a dropbox link with folder “Diana”: 1) Mozilla screenshot showing the folder “uploads/custom-css-js”: the scripts with name are mine (f.e. “WP-contacts-EN-MRO.js”), the ones with number (f.e. “241.js”) are the doubled ones (what I jokingly call the “clones”) ; 2) a jQuery file and its “clone”. (NOTE: I know that in WP the jQuery functions must be called “jQuery” instead of “$”, and this could create some issue, but this is not the case) All js scripts and css styles are cloned, as you see in screenshot … probably they’re cache for integration with WP framework, but for me they don’t work accurately: in case of any my amendment (f.e. in the jQuery I made a typo error “Chaptcha” instead of “Captcha” and had to amend it) the old copy remains, creating troubles (I can delete only via ftp). I don’t think they are necessary (in my HTML the path is to my original name) … might I avoid those copies? THE DROPBOX LINK IS: https://www.dropbox.com/sh/bw56j44oicgwhjr/AAAxmU853_J6lklaBZ6WhIlia?dl=0 Thx. Mauro (the website is https://www.biomotive.com.hk

    Plugin Author Diana Burduja

    (@diana_burduja)

    The plugin handles the linking of the custom codes. Once a custom code it added, then it will automatically be linked with its /wp-content/uploads/custom-css-js/123.js form.

    You can choose to customize the custom code’s permalink from 123.js form to some-example.js, in case you want to link the custom code from another website. But the some-example.js form of the custom code should definitely not be linked from within your own website. The plugin already takes care of the linking.

    Plugin Author Diana Burduja

    (@diana_burduja)

    As a side node, in your code the $ is a variable inside the function’s scope, while the actual jQuery object is called jQuery, as it should be used in WordPress.

    Your function:

    jQuery(document).ready(function( $ ) {
    // here the $ is a variable inside the function's scope
    });

    Thread Starter Mauro Vicariotto

    (@mrosfy)

    Thank you Diana.

    1. for many reasons, I always edit the permalink before publishing the script, changing it to “my script name” … f.e.: <span style=”text-decoration: underline;”>Permalink: https://www.biomotive.com.hk/wp-content/uploads/custom-css-js/WP-contacts-IT-MRO.js</span> . This because I don’t use standard WP system, but manually call the scripts links in my HTML pages. I don’t want that WP manages the scripts link because I have a whole, different, customized framework (even inside WP).
    2. yes, normally the jQuery object can be called either $ or jQuery (it works properly in both ways), but I learnt long time ago that WP doesn’t accept that object is called $.
    3. Due to the above (since I want/need to manage my code links manually, manually compiling every HTML, js, php, css …) :
      • is there a way to avoid the creation of “123.js” ? (I repeat that I everytime change the permalink to …/[scriptname]/js to then copy and paste the permalink in more HTML’s)
      • do I create a problem to the framework if periodically I cancel via ftp all the double codes (123.js, 456.css, etc) ? (I see that I periodically delete such doubled codes and nothing bad happens)

    Thank again for your patience. Kind rgds. Mauro

    Plugin Author Diana Burduja

    (@diana_burduja)

    The plugin works by automatically linking the custom codes in the 123.js form. The creation of the 123.js files are an essential part of the plugin’s functionality. That cannot be turned off.

    The easy solution is to simply use the plugin’s functionality as it is implemented without additionally linking the custom codes from within the customized framework.

    The more complicated solution would be customize the plugin for your needs. It is an open-source plugin, you are free to do that. Open the plugin’s files and have a go at modifying it so it works with your customized framework.

    Thread Starter Mauro Vicariotto

    (@mrosfy)

    Thank yoy Diana. sorry: I see that manually cancelling the 123.js nothing bad happens. Of course only if I call the links manually in my HTML pages. In this case (deleting manually) do I create issues or not?

    I will see to change the plugin rules.

    It is really too complex to explain why my framework is in WP but fully customized.

    Thx and ciao.

    Mauro

    Thread Starter Mauro Vicariotto

    (@mrosfy)

    Fiana, sorry, kindly reply to my last question to close the thread: since I always and only call manually my script and style links in each appropriate HTML, it is useless in my case any automatic link. If I delete all the “123.js” and “456.css” and keep only my names and permalinks >>> is it a problem or not?

    (since each script is dedicated to specific HTML pages, it is my duty to call the appropriate links, and cannot use the numbers instead of names: I have up to 50 custom scripts and need my real code name to find them …)

    Furthermore, using my method, the doubled custom codes create a mess, because each one of them goes automaticall to every page: this is not a real issue (because then they are not used in the DOM) … but this way creates a considerable waste of time to load all the useless (!!)

    Please find here a (DropBox) screenshot of a souce view of a page:

    https://www.dropbox.com/s/tzsjg3gck4qvvin/230209_view-source_%28BM%29.png?dl=0

    So, once again: is it a problem if I manually delete them? Thank you for your collaboration.

    Mauro

    Plugin Author Diana Burduja

    (@diana_burduja)

    You are free to manually delete the 123.js files. But note that they will be automatically regenerated every time the custom code will be edited.

    Thread Starter Mauro Vicariotto

    (@mrosfy)

    Thank you very much Diana for your clear reply.

    Yes, I’m obviously aware that the custom codes will be regenerated everytime I will edit any of them … important for me is to be sure that deleting manually the doubled will not create mess (my worry was that your software writes in admin php to register the new codes (such as wp-config.php or …) , and deleting them manually could cause any mismatch.

    Thanks again, I will backup and delete. Diana, you have been helpful and very kind: I hope I can be as helpful to you in the future.

    Mauro

    Thread Starter Mauro Vicariotto

    (@mrosfy)

    Diana, thanks again for your support. I understand that in my case for the codes which are valid for all pages it’s better to use the WP customize area, and for the codes which must be separated (linked only manually in some specific page) I can use your plugin and delete the created codes. In fact my wrong way to use your plugin makes that all “doubled” codes are linked to all pages, and this is no good.

    I have another question: in your opinion does it cause any problem if I modify directly WP sources (in my case WP global.js) .. (of course making ahead a backup of original scripts) ?? Thank you again.

    Plugin Author Diana Burduja

    (@diana_burduja)

    I don’t know what is global.js.

    “Modifying directly WP sources” has nothing to do with the Simple Custom CSS & JS plugin. Why is my opinion necessary or relevant in the matter?

    Thread Starter Mauro Vicariotto

    (@mrosfy)

    Nothing Diana,

    nothing to do with you. … simply I was wondering this and I wanted to share my question with you. That’s all. Answering is always courtesy, not obligation. Anyhow, FYI, global.js is the WP TwentySeventeen javascript global sheet (such as per WP style.css).

    Plugin Author Diana Burduja

    (@diana_burduja)

    Would you ask the question on the Twenty Seventeen’s support forum? There you should find a more informed answer.

    Thread Starter Mauro Vicariotto

    (@mrosfy)

    yes, correct, it was just to share an opinion: I never made tweaks directly in WP sources, apart for some .php. Ciao. Mauro

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘codes cached create issues’ is closed to new replies.