• I just wonder if there has been any body tested performance issues on following three options:

    1. Regular plugin
    2. Code snippet
    3. A php file in MU plugin folder

    Guess it really depends on an author writes his/her plugin, but just want to have any technical expertise view on this issue.

    Since all my tries with #3 were only a single PHP file, I feel that #3 affects the least in terms of performance. What about #2 vs. #3? As far as I remember, the initiative for Performant Translations – WordPress plugin | ww.wp.xz.cn this plugin was that PHP files perform the fastest on PHP. Does this mean #3 w/ a simple PHP is faster than #2?

    Regarding above matter, will it significantly improve website performance, if I convert most plugins to simple PHP files and run OPcache on the server?

    The difference should be marginal, but just want to know if there is any margin that I can improve my website’s performance.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    What do you mean by “code snippet”? If you mean adding some PHP code via a 3rd party code snippet plugin, I would expect that to be the least performant. For the exact same code as a plugin or MU plugin, I don’t think there’d be any difference at all.

    Disclaimer: I’ve done no objective testing, this is only opinion based solely on my own understanding of how core WP works.

    I’m not sure what you have in mind for “converting” plugins to PHP files. Isn’t that what plugins are to start with? Caching can have positive impact on performance when properly implemented. Poorly conceived caching schemes can have a negative impact. OPcache requires good memory resources to be effective, so may not be the best solution in some situations.

Viewing 1 replies (of 1 total)

The topic ‘Performance: A php file in MU plugin folder vs. code snippet vs. actuall plugin’ is closed to new replies.