• Resolved Fajar Tri

    (@fajarpagi)


    I want to ask, which is better for each function? is 1 function in 1 place, or is it better to make it one? example: this all scripts (PHP) combined is it better? maybe for performance?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @fajarpagi,

    From a performance perspective, there’s no real benefit in having them combined, as WPCode will preload all active snippets before execution so they are all executed as 1.

    There are many advantages to keeping them separated like you have, it’s going to be easier to maintain them and spot errors in case one of them throws an error.

    Let me know if you need any additional info.

    Thread Starter Fajar Tri

    (@fajarpagi)

    Thanks You!

    one more: if the context is location, is it better to Run Everywhere or adjust the function/context? for example: in the case image above, take the “Clipboard+Code” section which is actually intended for single post but I prefer run everywhere. so far no problem.

    How? any idea?

    Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @fajarpagi,

    It really depends on how the code is structured. For most things where you are using a WordPress hook like add_action or add_filter, it should be fine to use Run Everywhere.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.