[Plugin: User Meta Manager] Short evaluation warning to admins
-
Hi Jason.
First of all do not take my harsh words personally but your plugin in its current state ( version 1.2 ) is very dangerous! Just reading its code could cause me a heart attack. You’ve violated so many rules of plugin development that I don’t even know where to start. Before I begin explaining what’s wrong with this plugin:
WARNING: to all admins who installed and activated it. DO NOT try to edit your own meta data! The very moment you hit Update button you will not have access to your site ( both back and front end ). If you did it, don’t panic. To regain access you will have to edit the user_meta table of your database ( phpMyAdmin or whatever you normally use ). Find a record with your user id and a key: dbprefix_capabilities. You’ll have to modify its value part to be an array not a string. It should read
a:1:{s:13:"administrator";s:1:"1";}
. Save it and you’ll be ok. After that you’ll have to check other records with values which are supposed to be serialized arrays and modify them by removing surrounding string delimiters. I’m sure you’ll figure it out.Now back to the author:
- use hooks provided! Not everything can be loaded just at any place. Use init to load_plugin_textdomain and use its correct format. Right now you use deprecated format + you’re trying to load a .pot file rather than .mo file (???)
- do not make assumptions! The following line might not work:
define("UMM_PATH", ABSPATH . 'wp-content/plugins/user-meta-manager/');
as wp-content can be moved! - enqueue scripts in right places!
add_action( 'admin_enqueue_scripts', 'umm_enqueueScripts' );
after add_submenu_page. Within umm_enqueueScripts callback function check first that you’re on your own admin page then enqueue scripts. - avoid using $wpdb unless it is absolutely necessary. You can still get all user meta with get_user_meta function.
- when you serialize a form in AJAX jQuery do not forget to maybe_unserialize it on server side before updating database! Not doing it leads to the situation explained in my warning to admins
These are just some things I’ve discovered ( not all ). I did modify your code so it is working for me. For now I would suggest that you pull the plugin from repository until it is really ready and well tested.
Funny! 4 people said that it works. Good luck folks!
- The topic ‘[Plugin: User Meta Manager] Short evaluation warning to admins’ is closed to new replies.