Title: bug, debug,undefined variable
Last modified: November 26, 2018

---

# bug, debug,undefined variable

 *  Resolved [Brian Brown, Ph.D.](https://wordpress.org/support/users/brianbrown/)
 * (@brianbrown)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/bug-debugundefined-variable/)
 * Please add the line:
    `$settings_link = null;` at line 675 [inside the function
   MPT_add_settings_link() function], like so:
 *     ```
       function MPT_add_settings_link( $links, $file ) {
       $settings_link = null;
       ```
   
 * to avoid the “undefined variable” error with the debugger on.
    Thanks! -Brian

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Alexandre Gaboriau](https://wordpress.org/support/users/mcurly/)
 * (@mcurly)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/bug-debugundefined-variable/#post-10923321)
 * Hello,
 * OK I see the problem, there was
    `$settings_link .=` insteand of `$settings_link
   =`
 * Thanks for your contribution, the modification will be made in the next version,
   and will be pushed in the next days.
    -  This reply was modified 7 years, 6 months ago by [Alexandre Gaboriau](https://wordpress.org/support/users/mcurly/).
 *  Thread Starter [Brian Brown, Ph.D.](https://wordpress.org/support/users/brianbrown/)
 * (@brianbrown)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/bug-debugundefined-variable/#post-10923987)
 * Thanks, Alexandre!
    Can you also fix the hard-coded call to WP Ajax? `require_once('../../../../
   wp-blog-header.php');` in generate.php? I think you’re supposed to use `/wp-load.
   php` anyway. They way its hard-coded, you cannot use this plugin if you have 
   moved the plugins directory in the wp-config.php file. I would buy the Pro version
   if this worked correctly. Kindest Regards, -Brian Brown
    -  This reply was modified 7 years, 6 months ago by [Brian Brown, Ph.D.](https://wordpress.org/support/users/brianbrown/).
    -  This reply was modified 7 years, 6 months ago by [Brian Brown, Ph.D.](https://wordpress.org/support/users/brianbrown/).
 *  Plugin Author [Alexandre Gaboriau](https://wordpress.org/support/users/mcurly/)
 * (@mcurly)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/bug-debugundefined-variable/#post-10924694)
 * Hello, yes it’s fixed also. I will publish it today 🙂
    And it works the same
   way for free/pro version about this part.
 * Regards.
    -  This reply was modified 7 years, 6 months ago by [Alexandre Gaboriau](https://wordpress.org/support/users/mcurly/).
 *  Thread Starter [Brian Brown, Ph.D.](https://wordpress.org/support/users/brianbrown/)
 * (@brianbrown)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/bug-debugundefined-variable/#post-10927430)
 * Thank you soooo much Alexandre!
    Just some thoughts to help: In line 30 of generate.
   php, it should be “exists” not “exist” (just a minor English correction). Also,
   I am wondering if it woud be better to use the “raw” title, in line 486 of magic_post_thumbnail.
   php: `$search = get_the_title( $id );` to `$search = get_post_field( 'post_title',
   $id, 'raw' );` in case they’re using some kind of a filter. I have had better
   luck (more accurate match) doing it this way. Just thinking out loud! Thanks 
   again! Good work; you’re a good coder! -Brian Brown, Ph.D.
 *  Plugin Author [Alexandre Gaboriau](https://wordpress.org/support/users/mcurly/)
 * (@mcurly)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/bug-debugundefined-variable/#post-10935518)
 * Thanks, I applied your fix on v2.4.4

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘bug, debug,undefined variable’ is closed to new replies.

 * ![](https://ps.w.org/magic-post-thumbnail/assets/icon-256x256.png?rev=3183991)
 * [Generate Images (AI) - Magic Post Thumbnail](https://wordpress.org/plugins/magic-post-thumbnail/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/magic-post-thumbnail/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/magic-post-thumbnail/)
 * [Active Topics](https://wordpress.org/support/plugin/magic-post-thumbnail/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/magic-post-thumbnail/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/magic-post-thumbnail/reviews/)

## Tags

 * [undefined variable](https://wordpress.org/support/topic-tag/undefined-variable/)

 * 5 replies
 * 2 participants
 * Last reply from: [Alexandre Gaboriau](https://wordpress.org/support/users/mcurly/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/bug-debugundefined-variable/#post-10935518)
 * Status: resolved