1

When i install this plugin (oQey gallery) i report some errors like:

1) Notice: Undefined index: type in \wp-content\plugins\oqey-gallery\gallcore.php on line 252

On line 252:

if($_GET['type'] == "oqeygallery"){ include ("insert_in_post.php"); }

2) Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in C:\xampp\htdocs\website\wp-includes\functions.php on line 2723

on line 2723:

trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s'), $function, $version, $message ) );

3) Notice: Undefined index: page in \wp-content\plugins\oqey-gallery\oqeygallery.php on line 346

on line 346:

 if(is_admin() && ($_GET['page']=='oQeysettings' || $_GET['page']=='oQeyGalleries' || $_GET['page']=='oQeySkins' || $_GET['page']=='oQeyMusic' || $_GET['page']=='oQeyTrash' || $_GET['page']=='oQeyVideo' ) ){
1

Undefined Index

The first and third are the same problem:

if($_GET['type'] == "oqeygallery"){}

and

if(is_admin() && ($_GET['page']=='oQeysettings'...

Basically are:

if ( $_GET['foo'] == 'bar' )

The problme is that $_GET['foo'] is not set. That is, the $_GET array does not have a 'foo' key.

The solution is to wrap $_GET['foo'] in an isset() conditional:

if ( isset( $_GET['foo'] ) && 'bar' == $_GET['foo'] )

Deprecated cap

The second issue doesn't derive from the code you've quoted. Somewhere in the Plugin, a function is using an invalid cap as a parameter. You'll need to look through the plugin files, to find where the invalid cap - likely an integer instead of a capability - is being used as a parameter.

Edit

Found one: gallcore.php:

add_menu_page('oQey Gallery plugin', 'oQey Gallery', 8, $oqeym, 'oqey_top_page', $icon);    

That 8, is a user cap, but is invalid (as of several WordPress versions prior), and needs to be replaced with an actual capability, such as 'manage_options'

| improve this answer | |
  • you give me useful feedback, but i can't find the solution and solve my problem. Finally i use another plugin like lightbox, and this is enough for me. After that maybe is better to close this topic. Thanks again. – user24259 Feb 21 '13 at 0:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy