1

I have an app server accessible via an API call. I have another website using WordPress Multisite installation.

On the Wordpress side, where is the proper place(s) to put the API calls and view logic for...

  1. security - not gaining access to the code (probably not any different than other PHP security concerns)
  2. updating - not having to reconfigure after WP version updates
  3. coding standards - proper place to put functionality & resulting views

Really don't want anyone to ever access nor disable the code. It should be persistent across the WPMU network. The code would submit values to the external API via form "view"s, display returned data via "views" and also be user/auth key specific.

I believe the choice is between a plugin and/or theme files but wanted to be sure.

csi
  • 9,018
  • 8
  • 61
  • 81
  • I'm not sure I understand the part about security, updating and coding standards. Putting code into a plugin often is very modular, you can make it a network-wide plugin as well. – hakre Aug 16 '12 at 18:30
  • so the proper location would be a plugin and not in theme files? That is the real question. Also check edits. – csi Aug 16 '12 at 18:34
  • You can not protect your code against wordpress update changes. If you do not maintain your add-on it *will* break. And no Wordpress does not have any LTS version so far. You might want to take a look into the MU Plugins. Normal users can not access it: [Must-Use Plugins and Drop-Ins](http://hakre.wordpress.com/2010/05/01/must-use-and-drop-ins-plugins/) – hakre Aug 16 '12 at 18:50
  • Thanks for the help so far. I am still struggling to understand where to place the code itself. If all I am trying to do is access APIs via form posts, would a custom theme be the best place to house this code? OR is it best to add a Must Use Plugin and then reference the plugin where needed within the site. Sorry but obviously new to the wp plugin arena. – csi Aug 17 '12 at 21:57
  • Thanks. If you want to post as an answer, I will approve. – csi Aug 21 '12 at 17:37
  • Done that, moved it into an answer. – hakre Aug 22 '12 at 10:34

1 Answers1

0

If you're new, start with what you think will do it for you. If you fail, take a look if the other variants are going better for you. Technically there is not much difference into which file(s) you place your code, because it can be loaded from many.

hakre
  • 193,403
  • 52
  • 435
  • 836